From 63ee568e9fc2f6b30a6fa7e995088a1ca4279b87 Mon Sep 17 00:00:00 2001 From: Gwenhael Le Moine Date: Sun, 25 Aug 2024 17:39:50 +0200 Subject: [PATCH] saturn49g --- Makefile | 3 +++ dist/ROMs/Makefile | 23 +++++++++-------------- dist/saturn48gx | 2 +- dist/saturn49g | 23 +++++++++++++++++++++++ dist/saturn49g.desktop | 9 +++++++++ 5 files changed, 45 insertions(+), 15 deletions(-) create mode 100755 dist/saturn49g create mode 100644 dist/saturn49g.desktop diff --git a/Makefile b/Makefile index 8e988cd..ca10d3c 100644 --- a/Makefile +++ b/Makefile @@ -146,6 +146,8 @@ install: dist/saturn dist/pack dist/saturn.cat dist/Saturn.ad manual install -c -m 755 dist/saturn $(DESTDIR)$(PREFIX)/bin/saturn sed "s|@PREFIX@|$(PREFIX)|g" dist/saturn48gx > $(DESTDIR)$(PREFIX)/bin/saturn48gx chmod 755 $(DESTDIR)$(PREFIX)/bin/saturn48gx + sed "s|@PREFIX@|$(PREFIX)|g" dist/saturn49g > $(DESTDIR)$(PREFIX)/bin/saturn49g + chmod 755 $(DESTDIR)$(PREFIX)/bin/saturn49g install -c -m 644 dist/saturn.cat $(DESTDIR)$(PREFIX)/bin/saturn.cat #FIXME # install -m 755 -d -- $(DESTDIR)$(PREFIX)/share/locale/C/LC_MESSAGES @@ -164,3 +166,4 @@ install: dist/saturn dist/pack dist/saturn.cat dist/Saturn.ad manual install -m 755 -d -- $(DESTDIR)$(PREFIX)/share/applications sed "s|@PREFIX@|$(PREFIX)|g" dist/saturn48gx.desktop > $(DESTDIR)$(PREFIX)/share/applications/saturn48gx.desktop + sed "s|@PREFIX@|$(PREFIX)|g" dist/saturn49g.desktop > $(DESTDIR)$(PREFIX)/share/applications/saturn49g.desktop diff --git a/dist/ROMs/Makefile b/dist/ROMs/Makefile index effc770..66f3d13 100644 --- a/dist/ROMs/Makefile +++ b/dist/ROMs/Makefile @@ -1,22 +1,11 @@ .PHONY: get-roms mrproper -get-roms: sxrom-a sxrom-b sxrom-c sxrom-d sxrom-e sxrom-j gxrom-l gxrom-m gxrom-p gxrom-r +get-roms: gxrom-l gxrom-m gxrom-p gxrom-r mrproper: - -rm sxrom-a sxrom-b sxrom-c sxrom-d sxrom-e sxrom-j gxrom-l gxrom-m gxrom-p gxrom-r + rm -f gxrom-l gxrom-m gxrom-p gxrom-r -sxrom-a: - curl "https://www.hpcalc.org/hp48/pc/emulators/sxrom-a.zip" --output - | funzip > "sxrom-a" -sxrom-b: - curl "https://www.hpcalc.org/hp48/pc/emulators/sxrom-b.zip" --output - | funzip > "sxrom-b" -sxrom-c: - curl "https://www.hpcalc.org/hp48/pc/emulators/sxrom-c.zip" --output - | funzip > "sxrom-c" -sxrom-d: - curl "https://www.hpcalc.org/hp48/pc/emulators/sxrom-d.zip" --output - | funzip > "sxrom-d" -sxrom-e: - curl "https://www.hpcalc.org/hp48/pc/emulators/sxrom-e.zip" --output - | funzip > "sxrom-e" -sxrom-j: - curl "https://www.hpcalc.org/hp48/pc/emulators/sxrom-j.zip" --output - | funzip > "sxrom-j" +# HP 48Gx gxrom-l: curl "https://www.hpcalc.org/hp48/pc/emulators/gxrom-l.zip" --output - | funzip > "gxrom-l" gxrom-m: @@ -25,3 +14,9 @@ gxrom-p: curl "https://www.hpcalc.org/hp48/pc/emulators/gxrom-p.zip" --output - | funzip > "gxrom-p" gxrom-r: curl "https://www.hpcalc.org/hp48/pc/emulators/gxrom-r.zip" --output - | funzip > "gxrom-r" + +# HP 49 +rom.49g: + curl "https://www.hpcalc.org/hp49/pc/rom/beta1196.zip" --output rom-49g.zip + unzip rom-49g.zip rom.49g + rm rom-49g.zip diff --git a/dist/saturn48gx b/dist/saturn48gx index eaabb4f..11c4b47 100755 --- a/dist/saturn48gx +++ b/dist/saturn48gx @@ -25,4 +25,4 @@ fi # export XAPPLRESDIR=/etc/X11/app-defaults/ # export NLSPATH=@PREFIX@/share/locale/C/LC_MESSAGES/ -@PREFIX@/bin/saturn -face hp48 -hw hp48 -stateDir "$STATEDIR" -rom gxrom-r $RAM -port1 port1 -port2 port2 +@PREFIX@/bin/saturn -face hp48 -hw hp48 -stateDir "$STATEDIR" -rom gxrom-r $RAM -port1 port1 -port2 port2 "$@" diff --git a/dist/saturn49g b/dist/saturn49g new file mode 100755 index 0000000..57bd370 --- /dev/null +++ b/dist/saturn49g @@ -0,0 +1,23 @@ +#!/bin/bash -eu + +STATE_HOME=${XDG_STATE_HOME:-$HOME/.local/state} + +STATEDIR=$STATE_HOME/saturn/49g +mkdir -p "$STATEDIR" + +if [ ! -e "$STATEDIR"/rom.49g ]; then + if [ ! -d @PREFIX@/share/saturn/ROMs/ ]; then + echo "Error: No ROMs/ dir found" + exit 1 + fi + cp -R @PREFIX@/share/saturn/ROMs/ "$STATEDIR"/ROMs + make -C "$STATEDIR"/ROMs get-roms + cp "$STATEDIR"/ROMs/rom.49g "$STATEDIR"/rom.49g +fi + +RAM='' +if [ ! -e "$STATEDIR"/ram ]; then + RAM=-reset +fi + +@PREFIX@/bin/saturn -face hp49 -hw hp49 -stateDir "$STATEDIR" -rom rom.49g $RAM "$@" diff --git a/dist/saturn49g.desktop b/dist/saturn49g.desktop new file mode 100644 index 0000000..2f938a7 --- /dev/null +++ b/dist/saturn49g.desktop @@ -0,0 +1,9 @@ +[Desktop Entry] +Encoding=UTF-8 +Version=1.0 +Type=Application +Terminal=false +Exec=@PREFIX@/bin/saturn49g +Name=saturn49g +Icon=@PREFIX@/share/saturn/hplogo.png +Categories=Utility;