************************************** * ZX81 EMULATOR FOR THE SPECTRUM 128 * * Version 3.12 * * * * Worarounds for * * Incompatible Programs * * * * By Paul Farrow * * www.fruitcake.plus.com * ************************************** KNOWN ISSUES ============ An IN A,($FE) instruction is used on the ZX81 to read the five keyboard columns but at the same time will also read in the EAR port and the 50Hz/60Hz setting. The Spectrum also maps its EAR socket to I/O port $FE but on a different bit, but does not have a bit selecting 50Hz/60Hz. Any game that does not mask off these non-keyboard bits and simply expects them to have fixed values will not work properly with the emulator. Such games will also not work properly with machines that do not match the expected 50Hz/60Hz setting, e.g. games designed in the UK would not work in the USA. Any game that uses interrupt mode 2 will not work on the emulator since this cannot be trapped. Any program that changes the I register to a value between $40 and $7F will cause the Spectrum 128 to crash. Z-Xtricator (Software Farm) =========================== This game is technically incompatible since it uses interrupt mode 2 and sets the I register to $40. However, I really wanted this game to be supported by the emulator and so the emulator will automatically detect the game and will modify the program so that the game will run. This is the only program that the emulator deliberates modifies. Note that the Transfer menu option does not apply the modification and so can still be used to accurately transfer Z-Xtricator between PC and cassette. Address Actual Changed to --------------------------- $4393 $40 $50 Address $40AA to $4050 $4394 $ED $40 $4050 $00 $3E LD A,$20 $4051 $00 $20 $4052 $00 $ED LD I,A $4053 $00 $47 $4054 $00 $76 HALT $4055 $00 $C9 RET The original game code at $40AA loads the I register with a value of $40 and enables interrupt mode 2. ZX Asteroids ============ An IN A,($FE) is used to read the keyboard and match the value against key code stored at location $4F63-$4F67. The program does not mask off the non-keyboard bits (bit 7 is the EAR bit and assumed to be 0; bit 6 indicates 50Hz/60Hz and is assumed to be 50Hz). To make the game to work with the emulator, make the following changes: Address Actual Change to -------------------------- $4F63 $6F $AF $4F64 $77 $B7 $4F65 $7B $BB $4F66 $7D $BD $4F67 $7E $BE This does not cause the non-keyboard bits to be masked off but simply replaces the expected key values with those that would be returned from the Spectrum 128. As a result, the modified game would no longer run on a real ZX81. QS Invaders (Quicksilva) ======================== HL points to the display file but bit 7 of H is set at $42F7. On a real ZX81, this would point at the ghost image of the display file above the 32K boundary. However, the emulator uses this area for the various patches and variables and so gets corrupted. To make the game to work with the emulator, make the following changes: Address Actual Change to -------------------------- $42F7 $CB $00 SET 7,H -> NOP; NOP $42F8 $FC $00 Note that the Quicksilva character board enabled version of the emulator automatically detects QS Invaders and applies the above patches. QS Scramble (Quicksilva) ======================== When the game is over, a check is made for the Newline key being pressed to restart it. When running, the game routinely checks the Space key to allow a return to BASIC. This two key presses are checked for using an IN A,($FE), but the non-keyboard bits are not masked off. To make the game to work with the emulator, make the following changes: Address Actual Change to -------------------------- $4BD6 $7E $BE $41E9 $7E $BE This does not cause the non-keyboard bits to be masked off but simply replaces the expected key values with those that would be returned from the Spectrum 128. As a result, the modified game would no longer run on a real ZX81. Note that the Quicksilva character board enabled version of the emulator automatically detects QS Scramble and applies the above patches.