diff --git a/.gitignore b/.gitignore index 1ae936f..e2eaa36 100644 --- a/.gitignore +++ b/.gitignore @@ -17,3 +17,5 @@ dist/pack dist/saturn dist/saturn.cat dist/stateDir.* + +dist/ROMs/*rom-* diff --git a/Makefile b/Makefile index 66fa89c..8395b97 100644 --- a/Makefile +++ b/Makefile @@ -6,6 +6,10 @@ # The governing license can be found in the LICENSE file or at # https://opensource.org/license/MIT. +PREFIX = /usr +DOCDIR = $(PREFIX)/doc/x48ng +MANDIR = $(PREFIX)/man + OPTIM ?= 2 CFLAGS ?= -g -O$(OPTIM) -I./src/ -D_GNU_SOURCE=1 -I./libChf -L./libChf/st_build -lutil @@ -94,7 +98,7 @@ override CPPFLAGS := -I./src/ -D_GNU_SOURCE=1 \ -DPATCHLEVEL=$(PATCHLEVEL) \ $(CPPFLAGS) -.PHONY: all clean clean-all pretty-code install mrproper get-roms +.PHONY: all clean clean-all pretty-code install mrproper get-roms install all: libChf/st_build/libChf.a dist/saturn dist/pack dist/saturn.cat manual @@ -124,6 +128,7 @@ clean: mrproper: clean rm -f dist/pack dist/saturn dist/saturn.cat + make -C dist/ROMs mrproper clean-all: mrproper @@ -133,4 +138,37 @@ pretty-code: # Dependencies get-roms: - make -C ROMs get-roms + make -C dist/ROMs get-roms + +# Installation +install: dist/saturn dist/pack dist/saturn.cat dist/Saturn.ad + 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 -m 755 -d -- $(DESTDIR)$(PREFIX)/share/saturn + install -c -m 755 dist/pack $(DESTDIR)$(PREFIX)/share/saturn/pack + cp -R dist/ROMs/ $(DESTDIR)$(PREFIX)/share/saturn/ + + install -m 755 -d -- $(DESTDIR)$(PREFIX)/share/locale/C/LC_MESSAGES + install -c -m 644 dist/saturn.cat $(DESTDIR)$(PREFIX)/share/locale/C/LC_MESSAGES + + install -m 755 -d -- $(DESTDIR)$(PREFIX)/etc/X11/app-defaults + install -c -m 644 dist/Saturn.ad $(DESTDIR)$(PREFIX)/etc/X11/app-defaults/Saturn + + # install -c -m 755 dist/mkcard $(DESTDIR)$(PREFIX)/share/x48ng/mkcard + # install -c -m 755 dist/dump2rom $(DESTDIR)$(PREFIX)/share/x48ng/dump2rom + # install -c -m 755 dist/checkrom $(DESTDIR)$(PREFIX)/share/x48ng/checkrom + # install -c -m 644 dist/hplogo.png $(DESTDIR)$(PREFIX)/share/x48ng/hplogo.png + # cp -R dist/ROMs/ $(DESTDIR)$(PREFIX)/share/x48ng/ + # sed "s|@PREFIX@|$(PREFIX)|g" dist/setup-x48ng-home.sh > $(DESTDIR)$(PREFIX)/share/x48ng/setup-x48ng-home.sh + # chmod 755 $(DESTDIR)$(PREFIX)/share/x48ng/setup-x48ng-home.sh + + # install -m 755 -d -- $(DESTDIR)$(MANDIR)/man1 + # sed "s|@VERSION@|$(VERSION_MAJOR).$(VERSION_MINOR).$(PATCHLEVEL)|g" dist/x48ng.man.1 > $(DESTDIR)$(MANDIR)/man1/x48ng.1 + + install -m 755 -d -- $(DESTDIR)$(DOCDIR) + cp -R COPYING LICENSE README* docs* manual/ $(DESTDIR)$(DOCDIR) + + # install -m 755 -d -- $(DESTDIR)$(PREFIX)/share/applications + # sed "s|@PREFIX@|$(PREFIX)|g" dist/x48ng.desktop > $(DESTDIR)$(PREFIX)/share/applications/x48ng.desktop diff --git a/ROMs/gxrom-l b/ROMs/gxrom-l deleted file mode 100644 index fce2032..0000000 Binary files a/ROMs/gxrom-l and /dev/null differ diff --git a/ROMs/gxrom-m b/ROMs/gxrom-m deleted file mode 100644 index 6d4939e..0000000 Binary files a/ROMs/gxrom-m and /dev/null differ diff --git a/ROMs/gxrom-p b/ROMs/gxrom-p deleted file mode 100644 index 9bbe597..0000000 Binary files a/ROMs/gxrom-p and /dev/null differ diff --git a/ROMs/gxrom-r b/ROMs/gxrom-r deleted file mode 100644 index 5e21f69..0000000 Binary files a/ROMs/gxrom-r and /dev/null differ diff --git a/ROMs/sxrom-a b/ROMs/sxrom-a deleted file mode 100644 index eb68057..0000000 Binary files a/ROMs/sxrom-a and /dev/null differ diff --git a/ROMs/sxrom-b b/ROMs/sxrom-b deleted file mode 100644 index fbd6538..0000000 Binary files a/ROMs/sxrom-b and /dev/null differ diff --git a/ROMs/sxrom-c b/ROMs/sxrom-c deleted file mode 100644 index 500c4fe..0000000 Binary files a/ROMs/sxrom-c and /dev/null differ diff --git a/ROMs/sxrom-d b/ROMs/sxrom-d deleted file mode 100644 index 1cc53a7..0000000 Binary files a/ROMs/sxrom-d and /dev/null differ diff --git a/ROMs/sxrom-e b/ROMs/sxrom-e deleted file mode 100644 index 0b30ce3..0000000 Binary files a/ROMs/sxrom-e and /dev/null differ diff --git a/ROMs/sxrom-j b/ROMs/sxrom-j deleted file mode 100644 index c44521c..0000000 Binary files a/ROMs/sxrom-j and /dev/null differ diff --git a/ROMs/Makefile b/dist/ROMs/Makefile similarity index 100% rename from ROMs/Makefile rename to dist/ROMs/Makefile diff --git a/dist/Saturn.ad b/dist/Saturn.ad index adaa8da..76ecc75 100644 --- a/dist/Saturn.ad +++ b/dist/Saturn.ad @@ -3,9 +3,9 @@ ! .identifier : $Id: Saturn.ad,v 4.1.1.1 2002/11/11 16:13:56 cibrario Exp $ ! .context : SATURN, Saturn CPU / HP48 emulator ! .title : $RCSfile: Saturn.ad,v $ -! .kind : Application's resource file +! .kind : Application's resource file ! .author : Ivan Cibrario B. -! .site : CSTV-CNR +! .site : CSTV-CNR ! .creation : 7-Sep-2000 ! .keywords : * ! .description : @@ -99,7 +99,7 @@ ! Error Dialog resources *error_popup*deleteResponse: XmDO_NOTHING -*error*fontList: *helvetica-medium-r-*-*-8-*,*symbol-*-*-*-*-8-*=S +*error*fontList: *helvetica-medium-r-*-*-12-*,*symbol-*-*-*-*-8-*=S *error*dialogTitle: Attention, please... *error*okLabelString: Continue @@ -107,7 +107,7 @@ *msg*foreground: red *msg*cursorPositionVisible: False -*msg*fontList: *helvetica-medium-r-*-*-8-*,*symbol-*-*-*-*-8-*=S +*msg*fontList: *helvetica-medium-r-*-*-12-*,*symbol-*-*-*-*-8-*=S ! Destroy application when 'Close' is selected from mwm menu. @@ -151,8 +151,8 @@ *hp48.nKeys: 49 *hp48.kbd.fractionBase: 1440 -*hp48.kbd*fontList: *helvetica-*-r-*-*-10-*,*symbol-*-*-*-*-10-*=S -*hp48.kbd*btn.fontList: *helvetica-*-r-*-*-12-*,*symbol-*-*-*-*-12-*=S +*hp48.kbd*fontList: *helvetica-*-r-*-*-16-*,*symbol-*-*-*-*-10-*=S +*hp48.kbd*btn.fontList: *helvetica-*-r-*-*-18-*,*symbol-*-*-*-*-12-*=S *hp48.kbd*ul.foreground: dark violet *hp48.kbd*ur.foreground: dark green *hp48.kbd*ll.foreground: gray90 @@ -899,8 +899,8 @@ *hp49.nKeys: 51 *hp49.kbd.fractionBase: 1124 -*hp49.kbd*fontList: *helvetica-medium-r-*-*-8-*,*symbol-*-*-*-*-8-*=S -*hp49.kbd*btn.fontList: *helvetica-medium-r-*-*-8-*,*symbol-*-*-*-*-8-*=S +*hp49.kbd*fontList: *helvetica-medium-r-*-*-12-*,*symbol-*-*-*-*-8-*=S +*hp49.kbd*btn.fontList: *helvetica-medium-r-*-*-12-*,*symbol-*-*-*-*-8-*=S *hp49.kbd*ul.foreground: midnight blue *hp49.kbd*ur.foreground: red *hp49.kbd*lr.foreground: sea green @@ -1680,8 +1680,8 @@ *hp40.nKeys: 51 *hp40.kbd.fractionBase: 1440 -*hp40.kbd*fontList: *helvetica-*-r-*-*-12-*,*symbol-*-*-*-*-12-*=S -*hp40.kbd*btn.fontList: *helvetica-*-r-*-*-14-*,*symbol-*-*-*-*-14-*=S +*hp40.kbd*fontList: *helvetica-*-r-*-*-16-*,*symbol-*-*-*-*-12-*=S +*hp40.kbd*btn.fontList: *helvetica-*-r-*-*-18-*,*symbol-*-*-*-*-14-*=S *hp40.kbd*ul.foreground: light sky blue *hp40.kbd*ur.foreground: red *hp40.kbd*lr.foreground: orange diff --git a/dist/run48.sh b/dist/run48.sh index 21fb3c7..8e81278 100755 --- a/dist/run48.sh +++ b/dist/run48.sh @@ -7,7 +7,7 @@ mkdir -p "$STATEDIR" if [ ! -e "$STATEDIR"/gxrom-r ]; then make -C .. get-roms - cp ../ROMs/gxrom-r "$STATEDIR"/gxrom-r + cp ROMs/gxrom-r "$STATEDIR"/gxrom-r fi RAM='' diff --git a/dist/saturn48gx b/dist/saturn48gx new file mode 100755 index 0000000..0d5a2dc --- /dev/null +++ b/dist/saturn48gx @@ -0,0 +1,21 @@ +#!/bin/bash -eu + +STATE_HOME=${XDG_STATE_HOME:-$HOME/.local/state} + +STATEDIR=$STATE_HOME/saturn/48gx +mkdir -p "$STATEDIR" + +if [ ! -e "$STATEDIR"/gxrom-r ]; then + make -C /usr/share/saturn/ROMs get-roms + cp /usr/share/saturn/ROMs/gxrom-r "$STATEDIR"/gxrom-r +fi + +RAM='' +if [ ! -e "$STATEDIR"/ram ]; then + RAM=-reset +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=4096 + +/usr/bin/saturn -face hp48 -hw hp48 -stateDir "$STATEDIR" -rom gxrom-r $RAM -port1 port1 -port2 port2 diff --git a/src/MSFs/serial.msf b/src/MSFs/serial.msf index b402cea..6eac359 100644 --- a/src/MSFs/serial.msf +++ b/src/MSFs/serial.msf @@ -2,9 +2,9 @@ $ .+ $ .identifier : $Id: serial.msf,v 4.1 2000/12/11 09:54:19 cibrario Rel $ $ .context : SATURN, Saturn CPU / HP48 emulator $ .title : $RCSfile: serial.msf,v $ -$ .kind : Message catalog source +$ .kind : Message catalog source $ .author : Ivan Cibrario B. -$ .site : CSTV-CNR +$ .site : CSTV-CNR $ .creation : 13-Sep-2000 $ .keywords : * $ .description : @@ -44,7 +44,7 @@ $set 15 104 Write [%s]; value [%01X](old) -> [%01X](new) 105 Read RBR; value [%02X] 106 Write TBR; value [%02X] -107 Slave pseudo-terminal name is [%s] +107 Pseudo-terminal name is [%s] 201 Read from empty receiver buffer, rcs [%01X] 202 Write into full transmitter buffer, tcs [%01X] 203 Pseudo-terminals not supported diff --git a/src/hw_config.c b/src/hw_config.c index 5e8d363..89333e4 100644 --- a/src/hw_config.c +++ b/src/hw_config.c @@ -166,11 +166,11 @@ table[] = {"hp48", { /* name, id, access_prio, - init, save, - read, write, - r_config, r_abs_base_addr, r_size, - map_flags - */ + init, save, + read, write, + r_config, r_abs_base_addr, r_size, + map_flags + */ { "ROM (ROM)", @@ -257,11 +257,11 @@ table[] = {"hp49", { /* name, id, access_prio, - init, save, - read, write, - r_config, r_abs_base_addr, r_size, - map_flags - */ + init, save, + read, write, + r_config, r_abs_base_addr, r_size, + map_flags + */ { "ROM (ROM)", diff --git a/src/serial.h b/src/serial.h index df4a609..8c24554 100644 --- a/src/serial.h +++ b/src/serial.h @@ -96,7 +96,7 @@ #define SERIAL_I_WRITE 104 /* Write %s %x -> %x */ #define SERIAL_I_RBR 105 /* Read RBR -> %x */ #define SERIAL_I_TBR 106 /* Write TBR <- %x */ -#define SERIAL_I_PTY_NAME 107 /* Slave pty name is %s */ +#define SERIAL_I_PTY_NAME 107 /* pty name is %s */ #define SERIAL_W_EMPTY_RRB 201 /* Read from empty RX buffer, rcs=%x */ #define SERIAL_W_FULL_TRB 202 /* Write into full TX buffer, tcs=%x */ #define SERIAL_W_NOPTY 203 /* 3.16: Pty support not available */