Skip to content

Commit

Permalink
Merge pull request #115 from mike632t/unstable
Browse files Browse the repository at this point in the history
Merge changes from unstable
  • Loading branch information
mike632t authored Jul 23, 2024
2 parents 8f506c9 + eb7440d commit bce02c7
Show file tree
Hide file tree
Showing 8 changed files with 333 additions and 170 deletions.
47 changes: 29 additions & 18 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,8 @@ Tru64 Unix.

The simulator has been successfully compiled and tested on:

- Alpine 3.20, gcc 13.2.1, x64 + arm64

- Alpine 3.19, gcc 13.2.1, x64 + arm64

- Debian 12 (Bookworm), clang 14.0.6, x64 + arm64
Expand Down Expand Up @@ -158,11 +160,11 @@ If you install the simulator on most modern desktops it should create a new
menu entry that will start the launcher script by default. When invoked for
the first time this will prompt you to select the default simulator as well
as any additional command line options. These selections will be saved and
used in future.
the selected simulator will become the new default.

On some desktop environments it is also possible to right click on the menu
icon which will display a sub-menu that will allow you to select a specific
model directly as well as change the default model and options.
When using some desktop environments (like GNOME and KDE) it is possible to
access a sub-menu that will allow you to select a specific model as well as
change the default settings by right clicking on the menu icon.

#### Keyboard Shortcuts

Expand Down Expand Up @@ -218,6 +220,12 @@ For models with a 'sliding' On/Off switch clicking on the switch will turn
the simulator on or off, but if when switching off you hold down the switch
down for two seconds the program will exit.

#### Window Size

The size of the simulator window can be adjusted from the command line with
the `--zoom ZOOM` option, where the value for ZOOM can be in the range zero
to four (0-4).

#### Debugging

You can start the simulation in trace mode using '-t', or in single step
Expand Down Expand Up @@ -369,7 +377,12 @@ make DESTDIR=/tmp/staging install
### Using a pre-compiled package <sup>[Back to Top](#top)</sup>

If you don't want to download an compile the sources yourself you can use a
pre-compiled binary package from [Flathub](https://flathub.org/apps/io.github.mike632t.x11-calc) using Flatpak.
pre-compiled binary package compatible with most distros from [Flathub](https://flathub.org/apps/io.github.mike632t.x11-calc) using Flatpak.

A native binary package is also available on Alpine Linux 3.20 release.\
If x11 is not already installed, add it as standalone (`setup-xorg-base`) or together with a standard desktop (`setup-desktop`).\
Make sure `community` repo is enabled and then install with `apk add x11-calc`.\
To leverage GUI for setup, install `apk add zenity`. Optional program saves may be installed with `apk add x11-calc-prg`.

<a id="issues"></a>
### Known Issues <sup>[Back to Top](#top)</sup>
Expand All @@ -385,10 +398,6 @@ pre-compiled binary package from [Flathub](https://flathub.org/apps/io.github.mi

- Keyboard test is successful but these models do not pass the self-test.

##### HP 29C

- All 30 registers have continuous memory.

##### HP 37E

- Fails self-test.
Expand Down Expand Up @@ -426,21 +435,23 @@ on Xwayland the window manager does not handle this correctly.
### Acknowledgements <sup>[Back to Top](#top)</sup>

There are almost certainly some names I've missed off this list but without
the help and encouragement from a multiple it is unlikely that this project
would have happened at all or that it would got as far as it has.
the help and encouragement from several members of the calculator community
it is unlikely that this project would have happened at all or that I would
have managed to get as far as I have.

- `Teenix` for convincing me that it was possible in the first place and help
since (at least I think I glad he did).
- `Teenix` for convincing me that it was possible in the first place.

- `Teenix/Panamatik` for their excellent simulators from which I was able to
figure out most of what should happen when each instruction is executed.
- `Teenix` and `Panamatik` for their excellent simulators from which I was able
to figure out most of what should happen when each instruction is executed.

- `Agarza` for providing the details of the voyager displays.

- `Macmpi` for completely rewriting the makefiles creating a Flatpak package the simulator
for Flatpak and for packaging and testing the simulators on Alpine Linux.
- `Macmpi` for completely rewriting the makefiles and packaging the simulator
for Flatpak.

- `Macmpi` for packaging and testing the simulators on Alpine Linux

- `Agarza/Martin HEPPERLE` for translating the help text.
- `Agarza` and `Martin HEPPERLE` for translating the help text.

- `Brouhaha` for taking the time to explain the workings of various models.

Expand Down
3 changes: 2 additions & 1 deletion makefile
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,7 @@
# same common files. Make is still parallelizing
# submakes calls which do the real work. - macmpi
# 29 Apr 24 - Improve parallel make performance - macmpi
# 12 May 24 - Use a separate makefile for MacOS - MT
#

PROGRAM = x11-calc
Expand All @@ -115,7 +116,7 @@ IMG = img

# Files to be backed up (and the current date).

_files = `ls makefile makefile.*.[0-9] $(SRC)/makefile $(SRC)/makefile.all $(SRC)/makefile.linux $(SRC)/makefile.bsd $(SRC)/makefile.osf1 $(SRC)/makefile.*.[0-9] 2>/dev/null || true`
_files = `ls makefile makefile.*.[0-9] $(SRC)/makefile $(SRC)/makefile.all $(SRC)/makefile.linux $(SRC)/makefile.darwin $(SRC)/makefile.bsd $(SRC)/makefile.osf1 $(SRC)/makefile.*.[0-9] 2>/dev/null || true`
_source = `ls $(SRC)/*.c $(SRC)/*.c.[0-9] $(SRC)/*.h $(SRC)/*.h.[0-9] $(SRC)/*.in $(SRC)/*.in.[0-9] 2>/dev/null || true`
_data = `ls $(ROM)/$(PROGRAM)*.rom $(ROM)/$(PROGRAM)*.rom.[0-9] $(PRG)/$(PROGRAM)*.dat $(PRG)/$(PROGRAM)*.dat.[0-9] 2>/dev/null || true`
_images = `ls $(SRC)/*.ico $(SRC)/*.ico.[0-9] $(SRC)/*.png $(SRC)/*.png.[0-9] $(SRC)/*.svg $(SRC)/*.svg.[0-9] $(IMG)/*.png $(IMG)/*.png.[0-9] 2>/dev/null || true`
Expand Down
5 changes: 3 additions & 2 deletions src/makefile
Original file line number Diff line number Diff line change
Expand Up @@ -24,16 +24,17 @@
# Linux (now we can get rid of make.sh) - MT
# 24 Mar 24 - Pass model number - MT
# 29 Mar 24 - Use linux/bsd/osf1 makefiles -macmpi
# 12 May 24 - Use a separate makefile for MacOS - MT
#

MODEL = 21

all:
@_os="`uname -s | tr '[:upper:]' '[:lower:]'`"; \
echo "$$_os" | grep -qwE "freebsd|netbsd|darwin" && _os=bsd; \
echo "$$_os" | grep -qwE "freebsd|netbsd" && _os=bsd; \
$(MAKE) -s -f "makefile.$$_os" MODEL=$(MODEL) $@

.DEFAULT:
@_os="`uname -s | tr '[:upper:]' '[:lower:]'`"; \
echo "$$_os" | grep -qwE "freebsd|netbsd|darwin" && _os=bsd; \
echo "$$_os" | grep -qwE "freebsd|netbsd" && _os=bsd; \
$(MAKE) -s -f "makefile.$$_os" MODEL=$(MODEL) $@
7 changes: 1 addition & 6 deletions src/makefile.bsd
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
#
# 28 Mar 24 - Initial version - macmpi
# 06 May 24 - Fixed include path for Darwin - MT
# 12 May 24 - Use a separate makefile for MacOS - MT
#

CFLAGS ?=
Expand All @@ -51,10 +52,4 @@ CFLAGS += -I/usr/X11R7/include/
LDFLAGS += -L/usr/X11R7/lib/ -R /usr/X11R7/lib
.endif

.if ${OS} == "Darwin" # MacOS
LANG = LANG_en
CFLAGS += -I/opt/X11/include/
LDFLAGS += -L/opt/X11/lib/
.endif

include makefile.all
46 changes: 46 additions & 0 deletions src/makefile.darwin
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
#
# makefile - RPN (Reverse Polish) calculator simulator.
#
# Copyright(C) 2019 - MT
#
# makefile.darwin
#
# This program is free software: you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by the
# Free Software Foundation, either version 3 of the License, or (at your
# option) any later version.
#
# This program is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
# Public License for more details.
#
# You should have received a copy of the GNU General Public License along
# with this program. If not, see <http://www.gnu.org/licenses/>.
#
# Note seperator (tab) at the beginning of the line CANNOT be a space..!
#
# https://stackoverflow.com/questions/50941196/
#
# https://www.gnu.org/software/make/manual/html_node/Prerequisite-Types.html
#
# 12 May 24 - Initial version - MT
#

CFLAGS += -I/opt/X11/include/
LDFLAGS += -L/opt/X11/lib/
LDLIBS ?=

LANG = LANG_en

ifneq ($(COMMIT),)
CFLAGS += -DCOMMIT_ID='"[Commit Id : $(COMMIT)]"'
endif
ifneq ($(SCALE_WIDTH),)
CFLAGS += -DSCALE_WIDTH=$(SCALE_WIDTH)
endif
ifneq ($(SCALE_HEIGHT),)
CFLAGS += -DSCALE_HEIGHT=$(SCALE_HEIGHT)
endif

include makefile.all
Loading

0 comments on commit bce02c7

Please sign in to comment.