From bfe17e0470772a9e8aa4777576a749c67a3fb1a6 Mon Sep 17 00:00:00 2001 From: Gwenhael Le Moine Date: Sun, 25 Aug 2024 17:57:17 +0200 Subject: [PATCH] only get needed ROM, add saturn40g --- .gitignore | 2 +- Makefile | 3 +++ dist/ROMs/Makefile | 22 ++++++++++++++++++++-- dist/saturn40g | 25 +++++++++++++++++++++++++ dist/saturn40g.desktop | 9 +++++++++ dist/saturn48gx | 2 +- dist/saturn49g | 2 +- 7 files changed, 60 insertions(+), 5 deletions(-) create mode 100755 dist/saturn40g create mode 100644 dist/saturn40g.desktop diff --git a/.gitignore b/.gitignore index f9b930a..de7e508 100644 --- a/.gitignore +++ b/.gitignore @@ -18,5 +18,5 @@ dist/saturn dist/saturn.cat dist/stateDir.* -dist/ROMs/*rom-* +dist/ROMs/*rom* /manual/saturn.log diff --git a/Makefile b/Makefile index ca10d3c..dec6997 100644 --- a/Makefile +++ b/Makefile @@ -148,6 +148,8 @@ install: dist/saturn dist/pack dist/saturn.cat dist/Saturn.ad manual chmod 755 $(DESTDIR)$(PREFIX)/bin/saturn48gx sed "s|@PREFIX@|$(PREFIX)|g" dist/saturn49g > $(DESTDIR)$(PREFIX)/bin/saturn49g chmod 755 $(DESTDIR)$(PREFIX)/bin/saturn49g + sed "s|@PREFIX@|$(PREFIX)|g" dist/saturn40g > $(DESTDIR)$(PREFIX)/bin/saturn40g + chmod 755 $(DESTDIR)$(PREFIX)/bin/saturn40g install -c -m 644 dist/saturn.cat $(DESTDIR)$(PREFIX)/bin/saturn.cat #FIXME # install -m 755 -d -- $(DESTDIR)$(PREFIX)/share/locale/C/LC_MESSAGES @@ -167,3 +169,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 + sed "s|@PREFIX@|$(PREFIX)|g" dist/saturn40g.desktop > $(DESTDIR)$(PREFIX)/share/applications/saturn40g.desktop diff --git a/dist/ROMs/Makefile b/dist/ROMs/Makefile index 3fdeffe..4929cc3 100644 --- a/dist/ROMs/Makefile +++ b/dist/ROMs/Makefile @@ -1,9 +1,23 @@ .PHONY: get-roms mrproper -get-roms: gxrom-l gxrom-m gxrom-p gxrom-r rom.49g +get-roms: sxrom-a sxrom-b sxrom-c sxrom-d sxrom-e sxrom-j gxrom-l gxrom-m gxrom-p gxrom-r rom.49g mrproper: - rm -f gxrom-l gxrom-m gxrom-p gxrom-r rom.49g + rm -f ./sxrom-a ./sxrom-b ./sxrom-c ./sxrom-d ./sxrom-e ./sxrom-j ./gxrom-l ./gxrom-m ./gxrom-p ./gxrom-r ./rom.49g + +# HP 48Sx +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: @@ -20,3 +34,7 @@ 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 + +# HP 39g/40g +rom.40g: + curl "https://www.hpcalc.org/hp40/pc/rom3940.zip" --output - | funzip > "rom.40g" diff --git a/dist/saturn40g b/dist/saturn40g new file mode 100755 index 0000000..e3735bc --- /dev/null +++ b/dist/saturn40g @@ -0,0 +1,25 @@ +#!/bin/bash -eu + +STATE_HOME=${XDG_STATE_HOME:-$HOME/.local/state} + +STATEDIR=$STATE_HOME/saturn/40g +mkdir -p "$STATEDIR" + +if [ ! -e "$STATEDIR"/rom.40g ]; then + if [ ! -d @PREFIX@/share/saturn/ROMs/ ]; then + echo "Error: No ROMs/ dir found" + exit 1 + fi + if [ ! -d "$STATEDIR"/../ROMs ]; then + cp -R @PREFIX@/share/saturn/ROMs/ "$STATEDIR"/../ROMs + fi + make -C "$STATEDIR"/../ROMs rom.40g + cp "$STATEDIR"/../ROMs/rom.40g "$STATEDIR"/rom.40g +fi + +RAM='' +if [ ! -e "$STATEDIR"/ram ]; then + RAM=-reset +fi + +@PREFIX@/bin/saturn -face hp40 -hw hp40 -stateDir "$STATEDIR" -rom rom.40g $RAM "$@" diff --git a/dist/saturn40g.desktop b/dist/saturn40g.desktop new file mode 100644 index 0000000..2ed527e --- /dev/null +++ b/dist/saturn40g.desktop @@ -0,0 +1,9 @@ +[Desktop Entry] +Encoding=UTF-8 +Version=1.0 +Type=Application +Terminal=false +Exec=@PREFIX@/bin/saturn40g +Name=saturn40g +Icon=@PREFIX@/share/saturn/hplogo.png +Categories=Utility; diff --git a/dist/saturn48gx b/dist/saturn48gx index d3887d2..e38263c 100755 --- a/dist/saturn48gx +++ b/dist/saturn48gx @@ -13,7 +13,7 @@ if [ ! -e "$STATEDIR"/gxrom-r ]; then if [ ! -d "$STATEDIR"/../ROMs ]; then cp -R @PREFIX@/share/saturn/ROMs/ "$STATEDIR"/../ROMs fi - make -C "$STATEDIR"/../ROMs get-roms + make -C "$STATEDIR"/../ROMs gxrom-r cp "$STATEDIR"/../ROMs/gxrom-r "$STATEDIR"/gxrom-r fi diff --git a/dist/saturn49g b/dist/saturn49g index 05be49a..5aba05b 100755 --- a/dist/saturn49g +++ b/dist/saturn49g @@ -13,7 +13,7 @@ if [ ! -e "$STATEDIR"/rom.49g ]; then if [ ! -d "$STATEDIR"/../ROMs ]; then cp -R @PREFIX@/share/saturn/ROMs/ "$STATEDIR"/../ROMs fi - make -C "$STATEDIR"/../ROMs get-roms + make -C "$STATEDIR"/../ROMs rom.49g cp "$STATEDIR"/../ROMs/rom.49g "$STATEDIR"/rom.49g fi