diff --git a/Makefile b/Makefile index 39bcc2f..ac35076 100644 --- a/Makefile +++ b/Makefile @@ -163,6 +163,7 @@ install: dist/saturn dist/saturn.cat dist/Saturn.ad doc install -m 755 -d -- $(DESTDIR)$(PREFIX)/bin install -c -m 755 dist/saturn $(DESTDIR)$(PREFIX)/bin/saturn install -c -m 755 dist/saturn48gx $(DESTDIR)$(PREFIX)/bin/saturn48gx + install -c -m 755 dist/saturn48gx $(DESTDIR)$(PREFIX)/bin/saturn48sx install -c -m 755 dist/saturn40g $(DESTDIR)$(PREFIX)/bin/saturn40g install -c -m 755 dist/saturn49g $(DESTDIR)$(PREFIX)/bin/saturn49g @@ -183,12 +184,14 @@ install: dist/saturn dist/saturn.cat dist/Saturn.ad doc 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/saturn48gx.desktop > $(DESTDIR)$(PREFIX)/share/applications/saturn48sx.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 uninstall: rm -f $(DESTDIR)$(PREFIX)/bin/saturn rm -f $(DESTDIR)$(PREFIX)/bin/saturn48gx + rm -f $(DESTDIR)$(PREFIX)/bin/saturn48sx rm -f $(DESTDIR)$(PREFIX)/bin/saturn40g rm -f $(DESTDIR)$(PREFIX)/bin/saturn49g rm -f $(DESTDIR)$(PREFIX)/bin/saturn.cat @@ -197,5 +200,6 @@ uninstall: rm -f $(DESTDIR)/etc/X11/app-defaults/Saturn rm -fr $(DESTDIR)$(DOCDIR) rm -f $(DESTDIR)$(PREFIX)/share/applications/saturn48gx.desktop + rm -f $(DESTDIR)$(PREFIX)/share/applications/saturn48sx.desktop rm -f $(DESTDIR)$(PREFIX)/share/applications/saturn49g.desktop rm -f $(DESTDIR)$(PREFIX)/share/applications/saturn40g.desktop diff --git a/dist/saturn48sx b/dist/saturn48sx new file mode 100755 index 0000000..f27ddeb --- /dev/null +++ b/dist/saturn48sx @@ -0,0 +1,31 @@ +#!/bin/bash -eu + +cd "$(dirname "$0")" || exit 1 +#CWD=$(pwd) + +STATE_HOME=${XDG_STATE_HOME:-$HOME/.local/state} + +STATEDIR=${STATEDIR:-$STATE_HOME/saturn/48sx} +mkdir -p "$STATEDIR" + +if [ ! -e "$STATEDIR"/rom ]; then + if [ ! -d ../share/saturn/ROMs/ ]; then + echo "Error: No ROMs/ dir found" + exit 1 + fi + if [ ! -d "$STATEDIR"/../ROMs ]; then + cp -R ../share/saturn/ROMs/ "$STATEDIR"/../ROMs + fi + make -C "$STATEDIR"/../ROMs sxrom-j + cp "$STATEDIR"/../ROMs/sxrom-j "$STATEDIR"/rom +fi + +[ ! -e "$STATEDIR"/port1 ] && dd if=/dev/zero of="$STATEDIR"/port1 bs=1k count=128 +[ ! -e "$STATEDIR"/port2 ] && dd if=/dev/zero of="$STATEDIR"/port2 bs=1k count=128 + +RESET='' +if [ ! -e "$STATEDIR"/ram ]; then + RESET=--reset +fi + +./saturn --48sx --state-dir "$STATEDIR" "$RESET" "$@" diff --git a/dist/saturn48sx.desktop b/dist/saturn48sx.desktop new file mode 100644 index 0000000..f3dd8e9 --- /dev/null +++ b/dist/saturn48sx.desktop @@ -0,0 +1,9 @@ +[Desktop Entry] +Encoding=UTF-8 +Version=1.0 +Type=Application +Terminal=false +Exec=@PREFIX@/bin/saturn48sx +Name=saturn48sx +Icon=@PREFIX@/share/saturn/hplogo.png +Categories=Utility; diff --git a/src/romram.c b/src/romram.c index fcc1748..e23e46d 100644 --- a/src/romram.c +++ b/src/romram.c @@ -150,8 +150,13 @@ void RomInit( void ) } if ( ReadNibblesFromFile( config.rom_file_name, N_ROM_SIZE, mod_status_rom ) ) { - ChfCondition MOD_F_ROM_INIT, CHF_FATAL ChfEnd; - ChfSignal(); + /* ChfCondition MOD_F_ROM_INIT, CHF_FATAL ChfEnd; */ + /* ChfSignal(); */ + // HACK: To load 48SX ROM, try again with half the size this time. + if ( ReadNibblesFromFile( config.rom_file_name, N_ROM_SIZE / 2, mod_status_rom ) ) { + ChfCondition MOD_F_ROM_INIT, CHF_FATAL ChfEnd; + ChfSignal(); + } } }