summaryrefslogtreecommitdiff
path: root/emulators/x48
diff options
context:
space:
mode:
Diffstat (limited to 'emulators/x48')
-rw-r--r--emulators/x48/Makefile27
-rw-r--r--emulators/x48/distinfo10
-rw-r--r--emulators/x48/patches/patch-aa22
-rw-r--r--emulators/x48/patches/patch-ab51
-rw-r--r--emulators/x48/patches/patch-ac56
-rw-r--r--emulators/x48/patches/patch-ad43
-rw-r--r--emulators/x48/patches/patch-ae193
-rw-r--r--emulators/x48/patches/patch-af13
-rw-r--r--emulators/x48/pkg/DESCR10
-rw-r--r--emulators/x48/pkg/PLIST14
10 files changed, 439 insertions, 0 deletions
diff --git a/emulators/x48/Makefile b/emulators/x48/Makefile
new file mode 100644
index 00000000000..c57ec23fd7c
--- /dev/null
+++ b/emulators/x48/Makefile
@@ -0,0 +1,27 @@
+# $NetBSD: Makefile,v 1.1.1.1 2001/04/27 14:56:27 agc Exp $
+#
+
+DISTNAME= x48_041
+PKGNAME= x48-0.4.1
+CATEGORIES= emulators
+MASTER_SITES= http://home.earthlink.net/~rmmlgetz/
+
+MAINTAINER= packages@netbsd.org
+COMMENT= HP48 emulator
+
+USE_IMAKE= YES
+
+WRKSRC= ${WRKDIR}/${PKGNAME}
+
+post-install:
+ ${INSTALL_DATA_DIR} ${PREFIX}/share/doc/x48 \
+ ${PREFIX}/share/doc/x48/romdump
+ cd ${WRKSRC}/doc && \
+ ${INSTALL_MAN} CARDS.doc INSTALLING ROMDump.doc \
+ ${PREFIX}/share/doc/x48
+ cd ${WRKSRC}/romdump && \
+ ${INSTALL_MAN} README ${PREFIX}/share/doc/x48/romdump && \
+ ${INSTALL_DATA} ROMDump ROMDump.s \
+ ${PREFIX}/share/doc/x48/romdump
+
+.include "../../mk/bsd.pkg.mk"
diff --git a/emulators/x48/distinfo b/emulators/x48/distinfo
new file mode 100644
index 00000000000..994692d7cca
--- /dev/null
+++ b/emulators/x48/distinfo
@@ -0,0 +1,10 @@
+$NetBSD: distinfo,v 1.1.1.1 2001/04/27 14:56:27 agc Exp $
+
+SHA1 (x48_041.tar.gz) = 7b166ab4a7570b0617a0d8d01d0938b6ae372ab6
+Size (x48_041.tar.gz) = 193864 bytes
+SHA1 (patch-aa) = 75af6f30b4e43d09212a50972957655f5bb4c837
+SHA1 (patch-ab) = 8053d3173be2b68f7ddb18b4bdebfe384f0336e2
+SHA1 (patch-ac) = ee5784614db4bf00c047e819aaa0f272d3bf9bce
+SHA1 (patch-ad) = c1f98b7672fe96ab8e203081dfedd6cf96075cfa
+SHA1 (patch-ae) = ba5a6be04dc16182fadd19977cdc359891c5138c
+SHA1 (patch-af) = 60adc15ae8c20528892cbcaa029a3dd206a7edca
diff --git a/emulators/x48/patches/patch-aa b/emulators/x48/patches/patch-aa
new file mode 100644
index 00000000000..729ba0830f9
--- /dev/null
+++ b/emulators/x48/patches/patch-aa
@@ -0,0 +1,22 @@
+$NetBSD: patch-aa,v 1.1.1.1 2001/04/27 14:56:27 agc Exp $
+
+--- config.h.orig Sun Feb 4 18:30:34 2001
++++ config.h
+@@ -29,7 +29,7 @@
+ /*
+ * Which OS are you on?
+ */
+-#define UNIX_DEF -DLINUX
++/* #define UNIX_DEF -DLINUX */
+ /* #define UNIX_DEF -DSOLARIS */
+ /* #define UNIX_DEF -DSUNOS */
+ /* #define UNIX_DEF -DIRIX */
+@@ -56,7 +56,7 @@
+ /*
+ * Which Compiler to use:
+ */
+-#define CC_DEF gcc
++/* #define CC_DEF gcc */
+
+ /*
+ * Which Optimization Flags:
diff --git a/emulators/x48/patches/patch-ab b/emulators/x48/patches/patch-ab
new file mode 100644
index 00000000000..d6a1fe01a70
--- /dev/null
+++ b/emulators/x48/patches/patch-ab
@@ -0,0 +1,51 @@
+$NetBSD: patch-ab,v 1.1.1.1 2001/04/27 14:56:27 agc Exp $
+
+--- src/Imakefile.orig Sun Feb 4 18:31:52 2001
++++ src/Imakefile
+@@ -60,7 +60,7 @@
+ LDOPTIONS = LDOPTIONS_DEF
+ #endif
+
+- DEFINES = -I/usr/openwin/include UNIX_DEF XSHM_DEF READLINE_DEF
++ DEFINES = UNIX_DEF XSHM_DEF READLINE_DEF
+ HDRS = annunc.h append.h buttons.h constants.h debugger.h \
+ device.h disasm.h errors.h global.h hp.h hp48.h \
+ hp48_emu.h hp48char.h icon.h mmu.h options.h resources.h \
+@@ -87,9 +87,9 @@
+ CO = co -l
+ TARFILES = Imakefile X48.ad $(TARS1) $(SRCS2) $(SRCS3) $(SRCS4) $(HDRS)
+
+-all:: $(BIN)/x48 $(BIN)/dump2rom $(BIN)/checkrom $(BIN)/mkcard
++all:: x48 dump2rom checkrom mkcard
+
+- PROGRAMS = $(BIN)/x48 $(BIN)/dump2rom $(BIN)/checkrom $(BIN)/mkcard
++ PROGRAMS = x48 dump2rom checkrom mkcard
+
+ depend:: version.c X48.ad.h
+
+@@ -102,16 +102,20 @@
+ RemoveTargetProgram($@) @@\
+ $(CC) -o $@ $(LDOPTIONS) $(OBJS4) locallib $(LDLIBS) syslib $(EXTRA_LOAD_FLAGS) @@\
+ @@\
+-SaberProgramTarget(program,$(SRCS4),$(OBJS4),locallib,syslib) @@\
+ @@\
+ InstallProgram(program,$(BINDIR)) @@\
+ InstallManPage(program,$(MANDIR))
+ #endif /* ComplexProgramTarget_4 */
+
+-ComplexProgramTarget_1($(BIN)/x48, $(X48LIBS),)
+-ComplexProgramTarget_2($(BIN)/dump2rom,,)
+-ComplexProgramTarget_3($(BIN)/checkrom,,)
+-ComplexProgramTarget_4($(BIN)/mkcard,,)
++NormalProgramTarget(x48, $(OBJS1),, $(X48LIBS),)
++NormalProgramTarget(dump2rom, $(OBJS2),,,)
++NormalProgramTarget(checkrom, $(OBJS3),,,)
++NormalProgramTarget(mkcard, $(OBJS4),,,)
++
++InstallProgram(x48, $(BINDIR))
++InstallProgram(dump2rom, $(BINDIR))
++InstallProgram(checkrom, $(BINDIR))
++InstallProgram(mkcard, $(BINDIR))
+
+ InstallAppDefaults(X48)
+
diff --git a/emulators/x48/patches/patch-ac b/emulators/x48/patches/patch-ac
new file mode 100644
index 00000000000..af6129bfa72
--- /dev/null
+++ b/emulators/x48/patches/patch-ac
@@ -0,0 +1,56 @@
+$NetBSD: patch-ac,v 1.1.1.1 2001/04/27 14:56:27 agc Exp $
+
+--- src/init.c.orig Sun Feb 4 18:32:22 2001
++++ src/init.c
+@@ -1204,13 +1204,15 @@
+ struct stat st;
+ FILE *fp;
+
+- fprintf(stderr, "testing: Getting home dir\n");
++ if (!quiet)
++ fprintf(stderr, "testing: Getting home dir\n");
+ get_home_directory(path);
+ strcat(path, "/");
+
+ saturn.rom = (word_4 *)NULL;
+
+- fprintf(stderr, "testing: Reading ROM files\n");
++ if (!quiet)
++ fprintf(stderr, "testing: Reading ROM files\n");
+ strcpy(fnam, path);
+ strcat(fnam, "rom");
+ if (!read_rom_file(fnam, &saturn.rom, &rom_size))
+@@ -1367,7 +1369,8 @@
+ exit (1);
+ }
+
+- fprintf(stderr, "testing: Reading RAM file\n");
++ if (!quiet)
++ fprintf(stderr, "testing: Reading RAM file\n");
+
+ strcpy(fnam, path);
+ strcat(fnam, "ram");
+@@ -1466,11 +1469,13 @@
+ saturn.card_status |= port2_is_ram ? 8 : 0;
+ }
+
++#ifdef notyet
+ fprintf(stderr, "testing: Reading Enteries file\n");
+ strcpy(fnam, path);
+ strcat(fnam, "entries.o");
+ if (!read_entries_file(fnam, &saturn.entries))
+ return 0;
++#endif
+
+
+ return 1;
+@@ -1841,7 +1846,8 @@
+ {
+ if (!initialize)
+ {
+- fprintf(stderr, "testing: Read Files\n");
++ if (!quiet)
++ fprintf(stderr, "testing: Read Files\n");
+ if (read_files())
+ {
+ if (resetOnStartup)
diff --git a/emulators/x48/patches/patch-ad b/emulators/x48/patches/patch-ad
new file mode 100644
index 00000000000..5e2431dd25f
--- /dev/null
+++ b/emulators/x48/patches/patch-ad
@@ -0,0 +1,43 @@
+$NetBSD: patch-ad,v 1.1.1.1 2001/04/27 14:56:27 agc Exp $
+
+--- src/main.c.orig Sun Feb 4 18:32:37 2001
++++ src/main.c
+@@ -70,6 +70,7 @@
+ #include "x48_x11.h"
+ #include "hp48.h"
+ #include "debugger.h"
++#include "resources.h"
+
+ char *progname;
+ char *res_name;
+@@ -169,7 +170,15 @@
+ /*
+ * Open up the display
+ */
+- fprintf(stderr, "testing1\n");
++#ifdef noyet
++ /*
++ * XXX options are not parsed yet so quiet is still 0. The
++ * parsing of options is done by the X11 specific code in
++ * InitDisplay.
++ */
++ if (!quiet)
++ fprintf(stderr, "testing: InitDisplay\n");
++#endif
+ if (InitDisplay(argc, argv) < 0) {
+ exit (1);
+ }
+@@ -177,9 +186,11 @@
+ /*
+ * initialize emulator stuff
+ */
+- fprintf(stderr, "testing1\n");
++ if (!quiet)
++ fprintf(stderr, "testing: init_emulator\n");
+ init_emulator();
+- fprintf(stderr, "testing2\n");
++ if (!quiet)
++ fprintf(stderr, "testing: init_emulator done\n");
+
+
+ /*
diff --git a/emulators/x48/patches/patch-ae b/emulators/x48/patches/patch-ae
new file mode 100644
index 00000000000..eda2f9c257d
--- /dev/null
+++ b/emulators/x48/patches/patch-ae
@@ -0,0 +1,193 @@
+$NetBSD: patch-ae,v 1.1.1.1 2001/04/27 14:56:27 agc Exp $
+
+--- src/serial.c.orig Sun Feb 4 18:32:56 2001
++++ src/serial.c
+@@ -69,7 +69,7 @@
+ #include <fcntl.h>
+ #include <errno.h>
+ #include <sys/time.h>
+-#if defined(LINUX) || defined(HPUX)
++#if defined(LINUX) || defined(HPUX) || defined(CSRG_BASED)
+ #include <sys/ioctl.h>
+ #endif
+ #include <unistd.h>
+@@ -77,6 +77,8 @@
+ #ifdef SOLARIS
+ #include <sys/stream.h>
+ #include <sys/stropts.h>
++#endif
++#if defined(SOLARIS) || defined(CSRG_BASED)
+ #include <sys/termios.h>
+ #endif
+
+@@ -129,6 +131,9 @@
+ #else
+ int c;
+ #endif
++#if defined(CSRG_BASED)
++ char *ptr1, *ptr2;
++#endif
+ int n;
+ char tty_dev_name[128];
+ struct termios ttybuf;
+@@ -200,6 +205,51 @@
+ }
+ while ((wire_fd < 0) && (errno != ENOENT));
+ #else /* LINUX */
++#if defined(CSRG_BASED)
++ c = c; /* XXX gcc */
++/* This is how Stevens does it in:
++ * Advanced programming in the UNIX environment
++ */
++ strcpy(tty_dev_name, "/dev/ptyXY");
++ /* array index: 0123456789 (for references in following code) */
++ for (ptr1 = "pqrstuvwxyzPQRST"; *ptr1 != 0; ptr1++)
++ {
++ tty_dev_name[8] = *ptr1;
++ for (ptr2 = "0123456789abcdef"; *ptr2 != 0; ptr2++)
++ {
++ tty_dev_name[9] = *ptr2;
++
++ /* try open the master */
++ if ((wire_fd = open(tty_dev_name, O_RDWR, 0666)) < 0)
++ {
++ if (errno == ENOENT)
++ {
++ wire_fd = -1; /* out of pty devices */
++ ttyp = -1;
++ goto break_for_pty;
++ }
++ else
++ continue; /* try next pty device */
++ }
++
++ tty_dev_name[5] = 't'; /* change pty to tty */
++ if ((ttyp = open(tty_dev_name, O_RDWR, 0666)) < 0)
++ {
++ printf("open tty: %s failed: %s, trying with another\n",
++ tty_dev_name, strerror(errno));
++ close(wire_fd);
++ wire_fd = -1;
++ ttyp = -1;
++ continue;
++ }
++ if (verbose)
++ printf("%s: wire connection on %s\n", progname, tty_dev_name);
++ wire_name = strdup(tty_dev_name);
++ goto break_for_pty;
++ }
++ }
++break_for_pty:
++#else
+ /*
+ * Here we go for SUNOS, HPUX
+ */
+@@ -231,6 +281,7 @@
+ c++;
+ }
+ while ((wire_fd < 0) && (errno != ENOENT));
++#endif /* CSRG_BASED */
+ #endif /* LINUX */
+ #endif /* SOLARIS */
+ #endif /* IRIX */
+@@ -238,7 +289,7 @@
+
+ if (ttyp >= 0)
+ {
+-#if defined(SUNOS) || defined(HPUX)
++#if defined(SUNOS) || defined(HPUX) || defined(CSRG_BASED)
+ if (tcgetattr(ttyp, &ttybuf) < 0)
+ #else
+ if (ioctl(ttyp, TCGETS, (char *)&ttybuf) < 0)
+@@ -263,7 +314,7 @@
+
+ if (ttyp >= 0)
+ {
+-#if defined(SUNOS) || defined (HPUX)
++#if defined(SUNOS) || defined (HPUX) || defined(CSRG_BASED)
+ if (tcsetattr(ttyp, TCSANOW, &ttybuf) < 0)
+ #else
+ if (ioctl(ttyp, TCSETS, (char *)&ttybuf) < 0)
+@@ -291,7 +342,7 @@
+
+ if (ir_fd >= 0)
+ {
+-#if defined(SUNOS) || defined (HPUX)
++#if defined(SUNOS) || defined (HPUX) || defined(CSRG_BASED)
+ if (tcgetattr(ir_fd, &ttybuf) < 0)
+ #else
+ if (ioctl(ir_fd, TCGETS, (char *)&ttybuf) < 0)
+@@ -315,7 +366,7 @@
+
+ if (ir_fd >= 0)
+ {
+-#if defined(SUNOS) || defined(HPUX)
++#if defined(SUNOS) || defined(HPUX) || defined(CSRG_BASED)
+ if (tcsetattr(ir_fd, TCSANOW, &ttybuf) < 0)
+ #else
+ if (ioctl(ir_fd, TCSETS, (char *)&ttybuf) < 0)
+@@ -344,7 +395,7 @@
+
+ if (ir_fd >= 0)
+ {
+-#if defined(SUNOS) || defined (HPUX)
++#if defined(SUNOS) || defined (HPUX) || defined(CSRG_BASED)
+ if (tcgetattr(ir_fd, &ttybuf) < 0)
+ #else
+ if (ioctl(ir_fd, TCGETS, (char *)&ttybuf) < 0)
+@@ -358,6 +409,10 @@
+ }
+ }
+
++#if defined(CSRG_BASED)
++ cfsetspeed(&ttybuf, baud);
++#else
++
+ ttybuf.c_cflag &= ~CBAUD;
+
+ baud &= 0x7;
+@@ -404,9 +459,11 @@
+ ttybuf.c_cflag |= B9600;
+ }
+
++#endif /* CSRG_BASED */
++
+ if (ir_fd >= 0)
+ {
+-#if defined(SUNOS) || defined(HPUX)
++#if defined(SUNOS) || defined(HPUX) || defined(CSRG_BASED)
+ if (tcsetattr(ir_fd, TCSANOW, &ttybuf) < 0)
+ #else
+ if (ioctl(ir_fd, TCSETS, (char *)&ttybuf) < 0)
+@@ -422,7 +479,7 @@
+
+ if (ttyp >= 0)
+ {
+-#if defined(SUNOS) || defined(HPUX)
++#if defined(SUNOS) || defined(HPUX) || defined(CSRG_BASED)
+ if (tcgetattr(ttyp, &ttybuf) < 0)
+ #else
+ if (ioctl(ttyp, TCGETS, (char *)&ttybuf) < 0)
+@@ -437,6 +494,9 @@
+ }
+ }
+
++#if defined(CSRG_BASED)
++ cfsetspeed(&ttybuf, baud);
++#else
+ ttybuf.c_cflag &= ~CBAUD;
+
+ baud &= 0x7;
+@@ -482,10 +542,11 @@
+ fprintf(stderr, "%s: can\'t set baud rate, using 9600\n", progname);
+ ttybuf.c_cflag |= B9600;
+ }
++#endif
+
+ if (ttyp >= 0)
+ {
+-#if defined(SUNOS) || defined(HPUX)
++#if defined(SUNOS) || defined(HPUX) || defined(CSRG_BASED)
+ if (tcsetattr(ttyp, TCSANOW, &ttybuf) < 0)
+ #else
+ if (ioctl(ttyp, TCSETS, (char *)&ttybuf) < 0)
diff --git a/emulators/x48/patches/patch-af b/emulators/x48/patches/patch-af
new file mode 100644
index 00000000000..b28d105db26
--- /dev/null
+++ b/emulators/x48/patches/patch-af
@@ -0,0 +1,13 @@
+$NetBSD: patch-af,v 1.1.1.1 2001/04/27 14:56:27 agc Exp $
+
+--- src/x48_x11.c.orig Sun Feb 4 18:33:36 2001
++++ src/x48_x11.c
+@@ -3605,6 +3605,8 @@
+ break;
+ case XK_Alt_L:
+ case XK_Alt_R:
++ case XK_Meta_L:
++ case XK_Meta_R:
+ key_event(BUTTON_ALPHA, xev);
+ wake = 1;
+ break;
diff --git a/emulators/x48/pkg/DESCR b/emulators/x48/pkg/DESCR
new file mode 100644
index 00000000000..2a0f4f8aeea
--- /dev/null
+++ b/emulators/x48/pkg/DESCR
@@ -0,0 +1,10 @@
+This emulator is capable of providing a faithful replication of the
+HP48. In order to do so, it requires a copy of the ROM software
+from YOUR calculator. In order to avoid breaking copyright laws,
+and upsetting HP, you MUST BE THE PROUD OWNER OF AN HP48 before
+running this program. Of course you can run this program without a
+copy of the ROM software in order to write trivial machine code
+programs but you will not be able to access any of the calculator
+functionality.
+
+WWW: http://home.earthlink.net/~rmmlgetz/
diff --git a/emulators/x48/pkg/PLIST b/emulators/x48/pkg/PLIST
new file mode 100644
index 00000000000..67466c996d6
--- /dev/null
+++ b/emulators/x48/pkg/PLIST
@@ -0,0 +1,14 @@
+@comment $NetBSD: PLIST,v 1.1.1.1 2001/04/27 14:56:27 agc Exp $
+bin/x48
+bin/dump2rom
+bin/checkrom
+bin/mkcard
+lib/X11/app-defaults/X48
+share/doc/x48/CARDS.doc
+share/doc/x48/INSTALLING
+share/doc/x48/ROMDump.doc
+share/doc/x48/romdump/README
+share/doc/x48/romdump/ROMDump
+share/doc/x48/romdump/ROMDump.s
+@dirrm share/doc/x48/romdump
+@dirrm share/doc/x48