A small hack allows loading 48SX ROMs
This commit is contained in:
parent
a5f60a12bd
commit
6caf83e02c
4 changed files with 51 additions and 2 deletions
4
Makefile
4
Makefile
|
@ -163,6 +163,7 @@ install: dist/saturn dist/saturn.cat dist/Saturn.ad doc
|
||||||
install -m 755 -d -- $(DESTDIR)$(PREFIX)/bin
|
install -m 755 -d -- $(DESTDIR)$(PREFIX)/bin
|
||||||
install -c -m 755 dist/saturn $(DESTDIR)$(PREFIX)/bin/saturn
|
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/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/saturn40g $(DESTDIR)$(PREFIX)/bin/saturn40g
|
||||||
install -c -m 755 dist/saturn49g $(DESTDIR)$(PREFIX)/bin/saturn49g
|
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
|
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/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/saturn49g.desktop > $(DESTDIR)$(PREFIX)/share/applications/saturn49g.desktop
|
||||||
sed "s|@PREFIX@|$(PREFIX)|g" dist/saturn40g.desktop > $(DESTDIR)$(PREFIX)/share/applications/saturn40g.desktop
|
sed "s|@PREFIX@|$(PREFIX)|g" dist/saturn40g.desktop > $(DESTDIR)$(PREFIX)/share/applications/saturn40g.desktop
|
||||||
|
|
||||||
uninstall:
|
uninstall:
|
||||||
rm -f $(DESTDIR)$(PREFIX)/bin/saturn
|
rm -f $(DESTDIR)$(PREFIX)/bin/saturn
|
||||||
rm -f $(DESTDIR)$(PREFIX)/bin/saturn48gx
|
rm -f $(DESTDIR)$(PREFIX)/bin/saturn48gx
|
||||||
|
rm -f $(DESTDIR)$(PREFIX)/bin/saturn48sx
|
||||||
rm -f $(DESTDIR)$(PREFIX)/bin/saturn40g
|
rm -f $(DESTDIR)$(PREFIX)/bin/saturn40g
|
||||||
rm -f $(DESTDIR)$(PREFIX)/bin/saturn49g
|
rm -f $(DESTDIR)$(PREFIX)/bin/saturn49g
|
||||||
rm -f $(DESTDIR)$(PREFIX)/bin/saturn.cat
|
rm -f $(DESTDIR)$(PREFIX)/bin/saturn.cat
|
||||||
|
@ -197,5 +200,6 @@ uninstall:
|
||||||
rm -f $(DESTDIR)/etc/X11/app-defaults/Saturn
|
rm -f $(DESTDIR)/etc/X11/app-defaults/Saturn
|
||||||
rm -fr $(DESTDIR)$(DOCDIR)
|
rm -fr $(DESTDIR)$(DOCDIR)
|
||||||
rm -f $(DESTDIR)$(PREFIX)/share/applications/saturn48gx.desktop
|
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/saturn49g.desktop
|
||||||
rm -f $(DESTDIR)$(PREFIX)/share/applications/saturn40g.desktop
|
rm -f $(DESTDIR)$(PREFIX)/share/applications/saturn40g.desktop
|
||||||
|
|
31
dist/saturn48sx
vendored
Executable file
31
dist/saturn48sx
vendored
Executable file
|
@ -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" "$@"
|
9
dist/saturn48sx.desktop
vendored
Normal file
9
dist/saturn48sx.desktop
vendored
Normal file
|
@ -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;
|
|
@ -150,10 +150,15 @@ void RomInit( void )
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( ReadNibblesFromFile( config.rom_file_name, N_ROM_SIZE, mod_status_rom ) ) {
|
if ( ReadNibblesFromFile( config.rom_file_name, N_ROM_SIZE, mod_status_rom ) ) {
|
||||||
|
/* 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;
|
ChfCondition MOD_F_ROM_INIT, CHF_FATAL ChfEnd;
|
||||||
ChfSignal();
|
ChfSignal();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/* .+
|
/* .+
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue