From - Wed Aug 7 08:35:21 1996 Received: from pelleas.netcom.net.uk (pelleas.netcom.net.uk [194.42.224.145]) by horten.vingmed.no (8.6.9/8.6.9) with ESMTP id RAA26509 for ; Tue, 6 Aug 1996 17:26:29 +0200 Received: (from majordom@localhost) by pelleas.netcom.net.uk (8.7.4/8.7.3) id QAA24878 for xbeeb-outgoing; Tue, 6 Aug 1996 16:21:06 +0100 (BST) Received: from gatekeeper.corp.netcom.net.uk (firewall-user@gatekeeper.corp.netcom.net.uk [194.42.224.25]) by pelleas.netcom.net.uk (8.7.4/8.7.3) with SMTP id QAA24871 for ; Tue, 6 Aug 1996 16:21:05 +0100 (BST) Received: by gatekeeper.corp.netcom.net.uk; id QAA20701; Tue, 6 Aug 1996 16:21:03 +0100 Received: from Netcom by gatekeeper.corp.netcom.net.uk via smap (V3.1) id xma020685; Tue, 6 Aug 96 16:20:33 +0100 From: James Fidell Message-Id: <199608061520.QAA03231@corp.netcom.net.uk> Subject: [Xbeeb] patch-0.3.5 To: xbeeb@netcom.net.uk Date: Tue, 6 Aug 1996 16:20:32 +0100 (BST) X-Mailer: ELM [version 2.4 PL25] MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: owner-xbeeb@netcom.net.uk Precedence: bulk X-UIDL: 57b7b4f06b54ac1782e0b8e7fe5d88ae Status: RO X-Mozilla-Status: 0001 diff -N -r -c xbeeb-0.3.4/doc/Changes xbeeb-0.3.5/doc/Changes *** xbeeb-0.3.4/doc/Changes Fri Jul 26 21:54:35 1996 --- xbeeb-0.3.5/doc/Changes Fri Jul 26 21:56:36 1996 *************** *** 494,496 **** --- 494,503 ---- Pause key. Patch created for v0.3.4 + + + o Thu Mar 21 23:53:53 GMT 1996 + + Documentation corrections. + + Patch created for v0.3.5 diff -N -r -c xbeeb-0.3.4/doc/Installation xbeeb-0.3.5/doc/Installation *** xbeeb-0.3.4/doc/Installation Mon Mar 18 23:38:47 1996 --- xbeeb-0.3.5/doc/Installation Tue Mar 19 20:55:06 1996 *************** *** 28,33 **** --- 28,36 ---- That should work.) + It's possible that on HP-UX you may need to add -D_HPUX_SOURCE to the + CFLAGS variable. + To install the executable : $ make install diff -N -r -c xbeeb-0.3.4/doc/Keyboard xbeeb-0.3.5/doc/Keyboard *** xbeeb-0.3.4/doc/Keyboard Mon Mar 18 23:38:47 1996 --- xbeeb-0.3.5/doc/Keyboard Tue Mar 19 20:56:32 1996 *************** *** 48,53 **** --- 48,56 ---- "-" (on the keypad) turns off instruction disassembly "+" (on the keypad) turns on instruction disassembly + If there is no "Pause" key on your keyboard and X doesn't #define XK_Pause, + then F12 is used instead. + The code that implemented this is still available by #defining KEYMAP_LEGEND in src/Config.h, because it may be more useful to use when not playing games, or when playing games that involve lots of text *************** *** 91,96 **** --- 94,102 ---- relative positions of these keys to make playing game such as Arcadians more straightforward. To use this keymap, #define KEYMAP_STRICT in src/Config.h. + + Again, F12 is used as a replacement for "Pause" should you not have that + key. Note that the keyboard DIP switches can be set on the command line using the -s option. diff -N -r -c xbeeb-0.3.4/src/Beeb.h xbeeb-0.3.5/src/Beeb.h *** xbeeb-0.3.4/src/Beeb.h Mon Mar 18 23:38:47 1996 --- xbeeb-0.3.5/src/Beeb.h Sat Mar 23 18:14:22 1996 *************** *** 36,42 **** extern unsigned char DebugLevel; extern byteval MaskableInterruptRequest; ! #define SetProgramCounter(v) EmulatorPC = Mem + v #define GetProgramCounter ( EmulatorPC - Mem ) /* --- 36,42 ---- extern unsigned char DebugLevel; extern byteval MaskableInterruptRequest; ! #define SetProgramCounter(v) EmulatorPC = Mem + ( v ) #define GetProgramCounter ( EmulatorPC - Mem ) /* diff -N -r -c xbeeb-0.3.4/src/Bitmap.c xbeeb-0.3.5/src/Bitmap.c *** xbeeb-0.3.4/src/Bitmap.c Mon Mar 18 23:38:47 1996 --- xbeeb-0.3.5/src/Bitmap.c Sat Mar 23 19:08:15 1996 *************** *** 62,68 **** static void DrawCursor(); #endif ! #define MIN(x,y) (( x < y ) ? x : y ) static unsigned int Xmax = 0, Xmin = 639, Ymin = 511, Ymax = 0; --- 62,68 ---- static void DrawCursor(); #endif ! #define MIN(x,y) ((( x ) < ( y )) ? ( x ) : ( y )) static unsigned int Xmax = 0, Xmin = 639, Ymin = 511, Ymax = 0; *************** *** 73,78 **** --- 73,122 ---- if ( CurrentScreenMode != MODE_BITMAP ) { CurrentScreenMode = MODE_BITMAP; + + /* + * Need to recalculate the top of screen information here because + * it's not going to be right given that teletext screen start + * addresses are calculated differently to bitmap screen start + * addresses. The same applies to the cursor address. + */ + + TopOfScreen = ScreenStartHi << 8; + TopOfScreen |= ScreenStartLo; + TopOfScreen *= 8; + + /* + * FIX ME + * + * I'm sure there's going to be a problem here if the cursor + * drawing code doesn't realise that the cursor won't be on + * the screen when the window pops up. + */ + + CursorAddress = CursorPosHi << 8; + CursorAddress |= CursorPosLo; + CursorAddress *= 8; + + if ( CursorAddress < TopOfScreen ) + CursorOffset += ScreenLength; + + /* + * FIX ME + * + * This is not right, because it doesn't take + * account of the horizontal displayed value. + * + * It would be better to use + * HorizDisplayed / ( 6845 chars per real char ) + * rather than CharsPerLine. + * + * This code should be corrected at the same time as the code + * in Crtc.c (where I pinched it from). + */ + + NewCursorX = CursorOffset % CharsPerLine; + NewCursorY = CursorOffset / CharsPerLine; + XUnmapWindow ( dpy, TeletextScreen ); XMapRaised ( dpy, BitmapScreen ); XFlush ( dpy ); diff -N -r -c xbeeb-0.3.4/src/Crtc.c xbeeb-0.3.5/src/Crtc.c *** xbeeb-0.3.4/src/Crtc.c Mon Mar 18 23:38:47 1996 --- xbeeb-0.3.5/src/Crtc.c Sat Mar 23 19:08:51 1996 *************** *** 56,66 **** unsigned char NewCursorX = 255; unsigned char NewCursorY = 255; unsigned int CrtcMagicNumber; - static unsigned int CursorAddress, CursorOffset; ! ! #define MIN(a,b) a < b ? a : b; void --- 56,65 ---- unsigned char NewCursorX = 255; unsigned char NewCursorY = 255; unsigned int CrtcMagicNumber; + unsigned int CursorAddress, CursorOffset; ! #define MIN(x,y) ((( x ) < ( y )) ? ( x ) : ( y )) void diff -N -r -c xbeeb-0.3.4/src/Crtc.h xbeeb-0.3.5/src/Crtc.h *** xbeeb-0.3.4/src/Crtc.h Mon Mar 18 23:38:47 1996 --- xbeeb-0.3.5/src/Crtc.h Sat Mar 23 19:09:12 1996 *************** *** 35,40 **** --- 35,41 ---- extern unsigned char CursorMoved; extern unsigned char NewCursorX, NewCursorY; extern unsigned int CrtcMagicNumber; + extern unsigned int CursorAddress, CursorOffset; extern void ResetCrtc(); extern byteval ReadCrtc ( int ); diff -N -r -c xbeeb-0.3.4/src/EFS.c xbeeb-0.3.5/src/EFS.c *** xbeeb-0.3.4/src/EFS.c Mon Mar 18 23:54:03 1996 --- xbeeb-0.3.5/src/EFS.c Sat Mar 23 18:22:56 1996 *************** *** 88,94 **** * DFS */ ! #define DFS_PATH_MAX 16 #ifdef XDFS --- 88,94 ---- * DFS */ ! #define DFS_FILE_MAX 16 #ifdef XDFS *************** *** 141,147 **** int LoadAddress; unsigned int ExeAddress, StartAddress, EndAddress; unsigned int param_block, fname_address; ! char fname [ DFS_PATH_MAX ]; param_block = ( Y << 8 ) + X; fname_address = ReadWord ( param_block ); --- 141,147 ---- int LoadAddress; unsigned int ExeAddress, StartAddress, EndAddress; unsigned int param_block, fname_address; ! char fname [ DFS_FILE_MAX ]; param_block = ( Y << 8 ) + X; fname_address = ReadWord ( param_block ); *************** *** 425,431 **** case 0x09 : /* *RENAME */ { char fail; ! char fname [ DFS_PATH_MAX ], fname2 [ DFS_PATH_MAX ]; char thefile [ PATH_MAX ], thefile2 [ PATH_MAX ]; short idx; --- 425,431 ---- case 0x09 : /* *RENAME */ { char fail; ! char fname [ DFS_FILE_MAX ], fname2 [ DFS_FILE_MAX ]; char thefile [ PATH_MAX ], thefile2 [ PATH_MAX ]; short idx; *************** *** 642,648 **** case 3 : /* Unrecognised star command */ { unsigned int fname_address; ! char fname [ DFS_PATH_MAX ]; int idx; fname_address = ( Y << 8 ) + X; --- 642,648 ---- case 3 : /* Unrecognised star command */ { unsigned int fname_address; ! char fname [ DFS_FILE_MAX ]; int idx; fname_address = ( Y << 8 ) + X; *************** *** 778,794 **** /* Put new disc title in memory */ for ( i = 0; i < 8; i++ ) ! { ! if (!( byte = DiskName [ i ] )) ! break; ! WriteByte ( XDFS_CATWS1 + i, byte ); ! } for ( i = 8; i < 12; i++ ) ! { ! if (!( byte = DiskName [ i ] )) ! break; ! WriteByte ( XDFS_CATWS2 + i - 8, byte ); ! } WriteByte ( XDFS_CATWR, CatalogWrites ); /* times written */ WriteByte ( XDFS_NOFILES, CatalogSize * 8 ); /* no. of files */ --- 778,787 ---- /* Put new disc title in memory */ for ( i = 0; i < 8; i++ ) ! WriteByte ( XDFS_CATWS1 + i, DiskName [ i ] ); ! for ( i = 8; i < 12; i++ ) ! WriteByte ( XDFS_CATWS2 + i - 8, DiskName [ i ] ); WriteByte ( XDFS_CATWR, CatalogWrites ); /* times written */ WriteByte ( XDFS_NOFILES, CatalogSize * 8 ); /* no. of files */ *************** *** 1008,1014 **** i = 0; while ((( c = ReadByte ((( src + i ) & 0xffff ))) != 0x0d ) && c != ' ' && ( !quoted || c != '"' ) ! && (( fstart + i ) < DFS_PATH_MAX )) { tgt [ fstart + i ] = c; i++; --- 1001,1007 ---- i = 0; while ((( c = ReadByte ((( src + i ) & 0xffff ))) != 0x0d ) && c != ' ' && ( !quoted || c != '"' ) ! && (( fstart + i ) < DFS_FILE_MAX )) { tgt [ fstart + i ] = c; i++; *************** *** 1582,1588 **** i = 0; while ((( c = ReadByte ((( src + i ) & 0xffff ))) != 0x0d ) && c != ' ' && ( !quoted || c != '"' ) ! && (( fstart + i ) < DFS_PATH_MAX )) { tgt [ fstart + i ] = c; i++; --- 1575,1581 ---- i = 0; while ((( c = ReadByte ((( src + i ) & 0xffff ))) != 0x0d ) && c != ' ' && ( !quoted || c != '"' ) ! && (( fstart + i ) < DFS_FILE_MAX )) { tgt [ fstart + i ] = c; i++; *************** *** 1615,1621 **** i = 0; while ((( c = ReadByte ((( src + i ) & 0xffff ))) != 0x0d ) && c != ' ' && ( !quoted || c != '"' ) ! && (( fstart + i ) < DFS_PATH_MAX )) { tgt [ fstart + i ] = c; i++; --- 1608,1614 ---- i = 0; while ((( c = ReadByte ((( src + i ) & 0xffff ))) != 0x0d ) && c != ' ' && ( !quoted || c != '"' ) ! && (( fstart + i ) < PATH_MAX )) { tgt [ fstart + i ] = c; i++; diff -N -r -c xbeeb-0.3.4/src/Memory.h xbeeb-0.3.5/src/Memory.h *** xbeeb-0.3.4/src/Memory.h Mon Mar 18 23:38:47 1996 --- xbeeb-0.3.5/src/Memory.h Sat Mar 23 18:27:49 1996 *************** *** 39,44 **** --- 39,45 ---- extern unsigned char PagedRAMChanged; extern unsigned int MaxRAMAddress; + /* * FIX ME * *************** *** 67,81 **** #ifdef NO_FRED_JIM #define ReadByte(a) \ ! ((( a >> 8 ) != 0xfe ) ? Mem [ a ] : \ ReadSheila ( a )) #else #define ReadByte(a) \ ! (( a < 0xfc00 || a >= 0xff00 ) ? Mem [ a ] : \ ! (( a < 0xfd00 ) ? ReadFred ( a ) : \ ! (( a < 0xfe00 ) ? ReadJim ( a ) : \ ReadSheila ( a )))) #endif /* NO_FRED_JIM */ --- 68,82 ---- #ifdef NO_FRED_JIM #define ReadByte(a) \ ! (((( a ) >> 8 ) != 0xfe ) ? Mem [ a ] : \ ReadSheila ( a )) #else #define ReadByte(a) \ ! ((( a ) < 0xfc00 || ( a ) >= 0xff00 ) ? Mem [ a ] : \ ! ((( a ) < 0xfd00 ) ? ReadFred ( a ) : \ ! ((( a ) < 0xfe00 ) ? ReadJim ( a ) : \ ReadSheila ( a )))) #endif /* NO_FRED_JIM */ diff -N -r -c xbeeb-0.3.4/src/Ops.h xbeeb-0.3.5/src/Ops.h *** xbeeb-0.3.4/src/Ops.h Mon Mar 18 23:38:47 1996 --- xbeeb-0.3.5/src/Ops.h Thu Mar 21 23:56:06 1996 *************** *** 160,166 **** Anew = Aold - (v) + CarryFlag - 1; \ Accumulator = Anew & 0xff; \ \ - ResetCarryFlag ( Anew >= 0x0 ); \ NegativeFlag = Accumulator & 0x80; \ ResetOverflowFlag ((!(( Aold ^ (v) ) & 0x80 )) && \ (( Aold ^ Accumulator ) & 0x80 )); \ --- 160,165 ---- *************** *** 186,191 **** --- 185,191 ---- \ Accumulator = Alo + ( Ahi << 4 ); \ } \ + ResetCarryFlag ( Anew >= 0x0 ); \ } diff -N -r -c xbeeb-0.3.4/src/Patchlevel.h xbeeb-0.3.5/src/Patchlevel.h *** xbeeb-0.3.4/src/Patchlevel.h Tue Mar 19 00:03:11 1996 --- xbeeb-0.3.5/src/Patchlevel.h Thu Mar 21 23:53:00 1996 *************** *** 28,33 **** #define VERSION 0 #define RELEASE 3 ! #define PATCHLEVEL 4 #endif /* PATCHLEVEL_H */ --- 28,33 ---- #define VERSION 0 #define RELEASE 3 ! #define PATCHLEVEL 5 #endif /* PATCHLEVEL_H */ diff -N -r -c xbeeb-0.3.4/src/Teletext.c xbeeb-0.3.5/src/Teletext.c *** xbeeb-0.3.4/src/Teletext.c Mon Mar 18 23:38:47 1996 --- xbeeb-0.3.5/src/Teletext.c Sat Mar 23 19:06:55 1996 *************** *** 104,110 **** static void DrawCursor(); ! #define MIN(x,y) (( x < y ) ? x : y ) void InitialiseTeletext() --- 104,111 ---- static void DrawCursor(); ! #define MIN(x,y) ((( x ) < ( y )) ? ( x ) : ( y )) ! void InitialiseTeletext() *************** *** 115,120 **** --- 116,164 ---- XColor colour; CurrentScreenMode = MODE_TELETEXT; + + /* + * Need to recalculate the top of screen information here because + * it's not going to be right given that teletext screen start + * addresses are calculated differently to bitmap screen start + * addresses. The same applies to the cursor address where more + * calculations have to be done... + */ + + TopOfScreen = (( ScreenStartHi ^ 0x20 ) + 0x74 ) << 8; + TopOfScreen |= ScreenStartLo; + + /* + * FIX ME + * + * I'm sure there's going to be a problem here if the cursor + * drawing code doesn't realise that the cursor won't be on + * the screen when the window pops up. + */ + + CursorAddress = (( CursorPosHi ^ 0x20 ) + 0x74 ) << 8; + CursorAddress |= CursorPosLo; + CursorOffset = CursorAddress - TopOfScreen; + + if ( CursorAddress < TopOfScreen ) + CursorOffset += ScreenLength; + + /* + * FIX ME + * + * This is not right, because it doesn't take + * account of the horizontal displayed value. + * + * It would be better to use + * HorizDisplayed / ( 6845 chars per real char ) + * rather than CharsPerLine. + * + * This code should be corrected at the same time as the code + * in Crtc.c (where I pinched it from). + */ + + NewCursorX = CursorOffset % CharsPerLine; + NewCursorY = CursorOffset / CharsPerLine; /* * FIX ME