diff -Nru xtrs-4.9c/ChangeLog xtrs-4.9c-new/ChangeLog --- xtrs-4.9c/ChangeLog 2006-05-14 18:55:28.000000000 -0600 +++ xtrs-4.9c-new/ChangeLog 2007-04-22 08:27:52.000000000 -0600 @@ -1,3 +1,16 @@ +4.9c-Gentoo -- Sat Apr 21 14:37:00 MDT 2007 Joe Peterson + +* Patched for Gentoo ebuild + - Changed default romtype to Model 4P OSS Freeware ROM Image + to avoid potential copyright infringement (same patch from + previous ebuild xtrs-4.9-r1) + - Change "int i" in the z80 delay loop to "volatile int" + (allows near-actual speed emulation with optimization) + - Added option to Makefile.local (SIGIO) to be used when compiled + on Cygwin to avoid hang after F10 (reset) + - Fixed keyboard wait issue that caused CPU spinning (i.e. max + CPU usage) after using F10 (reset), F7, F8, or F9. + 4.9c -- Sun May 14 17:54:25 PDT 2006 -- Tim Mann * Fixed the new -e flag on import/cmd and export/cmd to actually diff -Nru xtrs-4.9c/main.c xtrs-4.9c-new/main.c --- xtrs-4.9c/main.c 2002-04-14 01:03:43.000000000 -0600 +++ xtrs-4.9c-new/main.c 2007-02-13 10:44:49.000000000 -0700 @@ -26,7 +26,7 @@ #include "trs_disk.h" #include "load_cmd.h" -int trs_model = 1; +int trs_model = 5; int trs_paused = 1; int trs_autodelay = 0; char *program_name; diff -Nru xtrs-4.9c/Makefile xtrs-4.9c-new/Makefile --- xtrs-4.9c/Makefile 2006-05-13 15:10:25.000000000 -0600 +++ xtrs-4.9c-new/Makefile 2007-04-21 18:10:21.000000000 -0600 @@ -142,8 +142,8 @@ # Local customizations for make variables are done in Makefile.local: include Makefile.local -CFLAGS = $(DEBUG) $(ENDIAN) $(DEFAULT_ROM) $(READLINE) $(DISKDIR) $(IFLAGS) \ - $(APPDEFAULTS) -DKBWAIT -DHAVE_SIGIO +CFLAGS += $(DEBUG) $(ENDIAN) $(DEFAULT_ROM) $(READLINE) $(DISKDIR) $(IFLAGS) \ + $(APPDEFAULTS) -DKBWAIT $(SIGIO) LIBS = $(XLIB) $(READLINELIBS) $(EXTRALIBS) ZMACFLAGS = -h diff -Nru xtrs-4.9c/Makefile.local xtrs-4.9c-new/Makefile.local --- xtrs-4.9c/Makefile.local 2006-05-13 15:10:36.000000000 -0600 +++ xtrs-4.9c-new/Makefile.local 2007-04-22 08:29:16.000000000 -0600 @@ -25,25 +25,25 @@ # is included in this package. This ROM cannot boot a Model III mode # operating system. -# for -model I -BUILT_IN_ROM = fakerom.hex -# for -model III and -model 4 -BUILT_IN_ROM3 = fakerom.hex -# for -model 4P -BUILT_IN_ROM4P = xtrsrom4p.hex +## for -model I +#BUILT_IN_ROM = fakerom.hex +## for -model III and -model 4 +#BUILT_IN_ROM3 = fakerom.hex +## for -model 4P +#BUILT_IN_ROM4P = xtrsrom4p.hex # If you would like the application to load a default ROM file at startup # time, use these lines (with the appropriate file names). The default file # name is ignored and can be omitted if the ROM for that model is built in. -DEFAULT_ROM = -DDEFAULT_ROM='"/usr/local/lib/xtrs/level2rom.hex"' \ - -DDEFAULT_ROM3='"/usr/local/lib/xtrs/romimage.m3"' \ - -DDEFAULT_ROM4P='"/usr/local/lib/xtrs/romimage.m4p"' +DEFAULT_ROM = -DDEFAULT_ROM='"/usr/share/xtrs/fakerom.hex"' \ + -DDEFAULT_ROM3='"/usr/share/xtrs/fakerom.hex"' \ + -DDEFAULT_ROM4P='"/usr/share/xtrs/xtrsrom4p.hex"' # If you would like to change where xtrs looks for disk?-? files, edit # this line. "." of course means the current working directory. -DISKDIR = -DDISKDIR='"."' +DISKDIR = -DDISKDIR='"/usr/share/xtrs/"' # If you have the GNU readline package (the README file tells you where to # get it) and would like to use it with the built-in Z-80 debugger, use @@ -52,12 +52,20 @@ READLINE = -DREADLINE READLINELIBS = -lreadline -lncurses +# If you have SIGIO and it works for you, use this line. +# If you are using Cygwin (Windows), however, SIGIO does not seem to work, +# so comment this out. + +SIGIO = -DHAVE_SIGIO + # If you want to debug the emulator, use the -g flag instead: -DEBUG = -O2 -g +#DEBUG = -O2 -g #DEBUG = -g -DKBDEBUG -DXDEBUG #DEBUG = -g #DEBUG = -Wall +# Gentoo ebuild will set these flags +DEBUG = # If you have gcc, and you want to use it: @@ -89,7 +97,7 @@ # prefix directory -PREFIX=/usr/local +PREFIX=${D}/usr #If included in distribution: PREFIX=/usr # Set these to where you want installed stuff to go, if you install them. @@ -103,8 +111,6 @@ INSTALL = install # If you are building in a subdirectory: -#vpath %.c .. -#vpath %.h .. -#vpath %.man .. -#old way: -#VPATH = .. +vpath %.c $(PREFIX)/bin +vpath %.h $(PREFIX)/bin +vpath %.man $(PREFIX)/share/man diff -Nru xtrs-4.9c/trs.h xtrs-4.9c-new/trs.h --- xtrs-4.9c/trs.h 2006-05-13 15:05:59.000000000 -0600 +++ xtrs-4.9c-new/trs.h 2007-02-14 15:20:17.000000000 -0700 @@ -67,6 +67,7 @@ extern void queue_key(int key); extern int dequeue_key(void); extern void clear_key_queue(void); +extern void trs_start_kbwait(void); extern void trs_end_kbwait(void); extern int stretch_amount; diff -Nru xtrs-4.9c/trs_keyboard.c xtrs-4.9c-new/trs_keyboard.c --- xtrs-4.9c/trs_keyboard.c 2006-05-13 14:50:17.000000000 -0600 +++ xtrs-4.9c-new/trs_keyboard.c 2007-02-14 15:20:25.000000000 -0700 @@ -983,6 +983,12 @@ } void +trs_start_kbwait() +{ + key_immediate = 0; +} + +void trs_end_kbwait() { key_immediate = 1; @@ -1003,7 +1009,6 @@ } trs_paused = 1; pause(); /* Wait for SIGALRM or SIGIO */ - key_immediate = 0; trs_get_event(0); } return rval; diff -Nru xtrs-4.9c/trs_xinterface.c xtrs-4.9c-new/trs_xinterface.c --- xtrs-4.9c/trs_xinterface.c 2006-05-13 15:33:51.000000000 -0600 +++ xtrs-4.9c-new/trs_xinterface.c 2007-02-14 14:33:08.000000000 -0700 @@ -920,6 +920,7 @@ (void)trs_uart_check_avail(); } + trs_start_kbwait(); do { if (wait) { XNextEvent(display, &event); diff -Nru xtrs-4.9c/z80.c xtrs-4.9c-new/z80.c --- xtrs-4.9c/z80.c 2005-05-22 00:57:01.000000000 -0600 +++ xtrs-4.9c-new/z80.c 2007-04-22 08:28:08.000000000 -0600 @@ -2999,7 +2999,7 @@ Uchar instruction; Ushort address; /* generic temps */ int ret = 0; - int i; + volatile int i; trs_continuous = continuous; /* loop to do a z80 instruction */