update emulators/x48: enhancements to emulators/x48

PR:		53912
Submitted by:	Pedro F. Giffuni <giffunip@yahoo.com>
This commit is contained in:
Daichi GOTO 2003-07-09 07:40:20 +00:00
parent e375de5e4d
commit 8006b733b5
Notes: svn2git 2021-03-31 03:12:20 +00:00
svn path=/head/; revision=84508
13 changed files with 122 additions and 40 deletions

View file

@ -9,18 +9,28 @@ PORTNAME= x48
PORTVERSION= 0.4.1e
CATEGORIES= emulators
MASTER_SITES= http://www.hpcalc.org/hp48/pc/emulators/
DISTNAME= ${PORTNAME}-${PORTVERSION:S/.//g}
EXTRACT_SUFX= .tgz
DISTFILES= ${PORTNAME}-${PORTVERSION:S/.//g}.tgz \
gxrom-r.zip
EXTRACT_ONLY= ${PORTNAME}-${PORTVERSION:S/.//g}.tgz
MAINTAINER= ports@FreeBSD.org
COMMENT= An HP48sx emulator
COMMENT= A HP48 SX/GX calculator emulator
BUILD_DEPENDS= unzip:${PORTSDIR}/archivers/unzip
WRKSRC= ${WRKDIR}/${PORTNAME}-${PORTVERSION:S/e//}
USE_IMAKE= yes
NO_INSTALL_MANPAGES= yes
USE_REINPLACE= yes
ROMPATH= ${PREFIX}/share/x48
post-patch:
@${REINPLACE_CMD} -e 's+rom.dump+${ROMPATH}/gxrom-r+' \
${WRKSRC}/src/dump2rom.c ${WRKSRC}/src/X48.ad
post-install:
@${MKDIR} ${ROMPATH}
@unzip ${DISTDIR}/${DISTSUBDIR}/gxrom-r -d ${ROMPATH}
.if !defined(NOPORTDOCS)
@${MKDIR} ${DOCSDIR}
.for file in README doc/CARDS.doc doc/ROMDump.doc

View file

@ -1 +1,3 @@
MD5 (x48-041e.tgz) = 0f03da2cea0ca3fd690dcae00f088faa
MD5 (gxrom-r.zip) = e4ec80ac325313b006b8c94d9be8db5a
MD5 (sxrom-j.zip) = 8f61e9ee00562e94c485028eac311cf8

View file

@ -1,5 +1,5 @@
--- src/Imakefile.orig Thu Jun 17 00:32:19 1999
+++ src/Imakefile Sat Oct 14 13:22:30 2000
--- src/Imakefile.orig Sun Jul 4 17:04:21 1999
+++ src/Imakefile Sat Jun 28 19:01:04 2003
@@ -60,7 +60,7 @@
LDOPTIONS = LDOPTIONS_DEF
#endif

View file

@ -1,11 +0,0 @@
--- src/x48_x11.c.orig Tue Jun 29 07:12:29 1999
+++ src/x48_x11.c Tue Aug 15 22:30:17 2000
@@ -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;

View file

@ -1,5 +1,5 @@
--- config.h.orig Tue Jun 29 07:36:58 1999
+++ config.h Tue Aug 15 20:52:55 2000
--- config.h.orig Mon Jun 28 17:36:58 1999
+++ config.h Sat Jun 28 21:40:54 2003
@@ -56,12 +56,12 @@
/*
* Which Compiler to use:

View file

@ -0,0 +1,13 @@
--- src/X48.ad.orig Wed Jan 11 13:24:05 1995
+++ src/X48.ad Sun Jun 29 10:46:17 2003
@@ -49,8 +49,8 @@
! resources controlling the connections
!
*useTerminal: True
-*useSerial: False
-*serialLine: /dev/ttyS0
+*useSerial: True
+*serialLine: /dev/cuaa0
!
! stuff controlling initialization

View file

@ -0,0 +1,12 @@
--- src/dump2rom.c.orig Tue Sep 7 10:41:48 1999
+++ src/dump2rom.c Sun Jun 29 10:44:05 2003
@@ -130,8 +130,7 @@
{
FILE *dump;
long addr, size;
- char ch;
- int i, gx, error;
+ int ch, i, gx, error;
if (argc < 2) {
fprintf(stderr, "usage: %s hp48-dump-file\n", argv[0]);

View file

@ -0,0 +1,11 @@
--- src/hp48.h.orig Sat Jun 28 20:50:52 2003
+++ src/hp48.h Sat Jun 28 20:52:14 2003
@@ -246,7 +246,7 @@
word_8 unknown2;
- char timer1; /* may NOT be unsigned !!! */
+ signed char timer1; /* may NOT be unsigned !!! */
word_32 timer2;
long t1_instr;

View file

@ -1,11 +1,20 @@
--- src/serial.c.orig Tue Jun 29 07:12:29 1999
+++ src/serial.c Tue Aug 15 20:46:02 2000
--- src/serial.c.orig Tue Sep 7 10:41:48 1999
+++ src/serial.c Sat Jun 28 21:27:06 2003
@@ -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(__FreeBSD__) || defined (__bsdi__)
+#if defined(SOLARIS) || defined(CSRG_BASED)
#include <sys/termios.h>
#endif
@ -14,7 +23,7 @@
if (ttyp >= 0)
{
-#if defined(SUNOS) || defined(HPUX)
+#if defined(SUNOS) || defined(HPUX) || defined(__FreeBSD__) || defined (__bsdi__)
+#if defined(SUNOS) || defined(HPUX) || defined (CSRG_BASED)
if (tcgetattr(ttyp, &ttybuf) < 0)
#else
if (ioctl(ttyp, TCGETS, (char *)&ttybuf) < 0)
@ -23,7 +32,7 @@
if (ttyp >= 0)
{
-#if defined(SUNOS) || defined (HPUX)
+#if defined(SUNOS) || defined (HPUX) || defined(__FreeBSD__) || defined (__bsdi__)
+#if defined(SUNOS) || defined (HPUX) || defined(CSRG_BASED)
if (tcsetattr(ttyp, TCSANOW, &ttybuf) < 0)
#else
if (ioctl(ttyp, TCSETS, (char *)&ttybuf) < 0)
@ -32,7 +41,7 @@
if (ir_fd >= 0)
{
-#if defined(SUNOS) || defined (HPUX)
+#if defined(SUNOS) || defined (HPUX) || defined (__FreeBSD__) || defined (__bsdi__)
+#if defined(SUNOS) || defined (HPUX) || defined (CSRG_BASED)
if (tcgetattr(ir_fd, &ttybuf) < 0)
#else
if (ioctl(ir_fd, TCGETS, (char *)&ttybuf) < 0)
@ -41,7 +50,7 @@
if (ir_fd >= 0)
{
-#if defined(SUNOS) || defined(HPUX)
+#if defined(SUNOS) || defined(HPUX) || defined (__FreeBSD__) || defined (__bsdi__)
+#if defined(SUNOS) || defined(HPUX) || defined (CSRG_BASED)
if (tcsetattr(ir_fd, TCSANOW, &ttybuf) < 0)
#else
if (ioctl(ir_fd, TCSETS, (char *)&ttybuf) < 0)
@ -50,7 +59,7 @@
if (ir_fd >= 0)
{
-#if defined(SUNOS) || defined (HPUX)
+#if defined(SUNOS) || defined (HPUX) || defined (__FreeBSD__) || defined (__bsdi__)
+#if defined(SUNOS) || defined (HPUX) || defined (CSRG_BASED)
if (tcgetattr(ir_fd, &ttybuf) < 0)
#else
if (ioctl(ir_fd, TCGETS, (char *)&ttybuf) < 0)
@ -58,7 +67,7 @@
}
}
+#if defined(__FreeBSD__) || defined(__bsdi__)
+#if defined(CSRG_BASED)
+ cfsetspeed(&ttybuf, baud);
+#else
+
@ -69,12 +78,12 @@
ttybuf.c_cflag |= B9600;
}
+#endif /* FreeBSD */
+#endif /* CSRG_BASED */
+
if (ir_fd >= 0)
{
-#if defined(SUNOS) || defined(HPUX)
+#if defined(SUNOS) || defined(HPUX) || defined (__FreeBSD__) || defined(__bsdi__)
+#if defined(SUNOS) || defined(HPUX) || defined (CSRG_BASED)
if (tcsetattr(ir_fd, TCSANOW, &ttybuf) < 0)
#else
if (ioctl(ir_fd, TCSETS, (char *)&ttybuf) < 0)
@ -83,7 +92,7 @@
if (ttyp >= 0)
{
-#if defined(SUNOS) || defined(HPUX)
+#if defined(SUNOS) || defined(HPUX) || defined (__FreeBSD__) || defined(__bsdi__)
+#if defined(SUNOS) || defined(HPUX) || defined (CSRG_BASED)
if (tcgetattr(ttyp, &ttybuf) < 0)
#else
if (ioctl(ttyp, TCGETS, (char *)&ttybuf) < 0)
@ -91,7 +100,7 @@
}
}
+#if defined(__FreeBSD__) || defined(__bsdi__)
+#if defined(CSRG_BASED)
+ cfsetspeed(&ttybuf, baud);
+#else
ttybuf.c_cflag &= ~CBAUD;
@ -106,7 +115,7 @@
if (ttyp >= 0)
{
-#if defined(SUNOS) || defined(HPUX)
+#if defined(SUNOS) || defined(HPUX) || defined (__FreeBSD__) || defined(__bsdi__)
+#if defined(SUNOS) || defined(HPUX) || defined (CSRG_BASED)
if (tcsetattr(ttyp, TCSANOW, &ttybuf) < 0)
#else
if (ioctl(ttyp, TCSETS, (char *)&ttybuf) < 0)

View file

@ -0,0 +1,19 @@
--- src/x48_x11.c.orig Thu Sep 9 01:05:58 1999
+++ src/x48_x11.c Sat Jun 28 20:55:35 2003
@@ -4108,6 +4108,7 @@
break;
case XK_KP_Add:
case XK_plus:
+ case XK_equal:
key_event(BUTTON_PLUS, xev);
wake = 1;
break;
@@ -4168,6 +4169,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;

View file

@ -0,0 +1,19 @@
--- src/X48.ad.orig Sat Jun 28 22:22:06 2003
+++ src/X48.ad Sat Jun 28 22:26:22 2003
@@ -50,14 +50,14 @@
!
*useTerminal: True
*useSerial: False
-*serialLine: /dev/ttyS0
+*serialLine: /dev/cuaa0
!
! stuff controlling initialization
!
*completeInitialize: False
*resetOnStartup: False
-*romFileName: rom.dump
+*romFileName: gxrom-r
*homeDirectory: .hp48
!

View file

@ -1,10 +1,6 @@
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.
HP48.
Around mid 2000, Hewlett Packard has gratituoslys made available the
ROMs required to run package.
WWW: http://home.earthlink.net/~rmmlgetz/
WWW: http://www.hp.com/calculators

View file

@ -3,6 +3,8 @@ bin/dump2rom
bin/mkcard
bin/x48
lib/X11/app-defaults/X48
share/x48/gxrom-r
@dirrm share/x48
%%PORTDOCS%%share/doc/x48/CARDS.doc
%%PORTDOCS%%share/doc/x48/README
%%PORTDOCS%%share/doc/x48/ROMDump.doc