Dragon 32 (and 64) Enhanced ROMs v3.0 By Stephen J Woolham. 10th January, 2012. These enhanced Dragon 32/64 BASIC ROMs have the following enhancements: * Applied all known documented and undocumented Dragon 32/64 bug fixes * Support for both padded (X=USR01(X)) and unpadded (X=USR1(X)) USR calls * Improved keyboard auto-repeat routine for D64 ROMs * Added improved D64 keyboard auto-repeat routine to D32 ROM * Added the ability to toggle keyboard auto-repeat on/off with DLOAD command on D32 and D64 in 32K Mode * Improved keyboard routine with user selectable 'Enhanced Mode' for faster typing without missing keys * Added the ability to easily disable any DOS or game cartridge at power-on or after a hardware reset * Improved PCLEAR command (PCLEAR 0 -> maximum free memory limit) * Patched joystick routine to help prevent background noise (clicking) when playing some m/c games (Only effective when games call the joystick routine via $8012 or indirectly via $A00A) * Support for 63x09e error trapping The improved keyboard routine ----------------------------- The keyboard routine has been mostly rewritten and now features a user selectable enhanced mode. The enhanced mode is designed to allow for faster typing without missing keys. The default mode is 100% compatible with the original D32/64 keyboard routine. (1) The enhanced mode on its own or with the keyboard auto-repeat is ideal for software development and other projects where a lot of typing is required. It can also be used with games and other software that use the keyboard routine located within the Dragon BASIC ROM. No more missed keys!!! (2) POKE152,255 to enable the enhanced keyboard mode. POKE152,0 to disable (default). (3) Enhanced keyboard mode is automatically enabled when keyboard auto-repeat is turned on. The improved keyboard auto-repeat routine ----------------------------------------- The new keyboard auto-repeat routine is DOS compatible when turned on/off using the DLOAD command. (1) DLOAD command can be used to toggle the keyboard auto-repeat on/off on D32 and D64 in 32K mode. (Normal DLOAD command function is retained on D64 in 64K mode) (2) Although the keyboard auto-repeat can still be turned on by the very same pokes listed in the Dragon 64 supplement it is best to set up the IRQ vector to point to the routine at $9FF0 ($DFF0 in 64K mode) if you prefer to use your own program rather than the DLOAD command. The extra code at $9FF0 bypasses the keyboard auto-repeat code whenever a PLAY or SOUND command is in use to prevent sound distortion. Here are a few examples of how to safely turn on/off the keyboard auto-repeat from within your own program: [Dragon 32 and Dragon 64 in 32K mode] 10 'ENABLE KEYBOARD AUTO-REPEAT 20 ' 30 IF PEEK(&H10D)+PEEK(&H10E)=399 THEN80 40 POKE&HFF03,PEEK(&HFF03)AND&HFE 50 POKE&H11D,PEEK(&H10D):POKE&H11E,PEEK(&H10E) 60 POKE&H10D,&H9F:POKE&H10E,&HF0 70 POKE&HFF03,PEEK(&HFF03)OR1 80 CLS:PRINT"KEYBOARD AUTO-REPEAT ENABLED..." 10 'DISABLE KEYBOARD AUTO-REPEAT 20 ' 30 IF PEEK(&H10D)+PEEK(&H10E)<>399 THEN80 40 POKE&HFF03,PEEK(&HFF03)AND&HFE 50 POKE&H10D,PEEK(&H11D):POKE&H10E,PEEK(&H11E) 60 POKE&HFF03,PEEK(&HFF03)OR1 70 POKE152,0 80 CLS:PRINT"KEYBOARD AUTO-REPEAT DISABLED..."; [Dragon 64 in 64K mode] 10 'ENABLE KEYBOARD AUTO-REPEAT 20 '64K MODE 30 ' 40 IF PEEK(&H10D)+PEEK(&H10E)=463 THEN90 50 POKE&HFF03,PEEK(&HFF03)AND&HFE 60 POKE&H11D,PEEK(&H10D):POKE&H11E,PEEK(&H10E) 70 POKE&H10D,&HDF:POKE&H10E,&HF0 80 POKE&HFF03,PEEK(&HFF03)OR1 90 CLS:PRINT"KEYBOARD AUTO-REPEAT ENABLED..." 10 'DISABLE KEYBOARD AUTO-REPEAT 20 '64K MODE 30 ' 40 IF PEEK(&H10D)+PEEK(&H10E)<>463 THEN90 50 POKE&HFF03,PEEK(&HFF03)AND&HFE 60 POKE&H10D,PEEK(&H11D):POKE&H10E,PEEK(&H11E) 70 POKE&HFF03,PEEK(&HFF03)OR1 80 POKE152,0 90 CLS:PRINT"KEYBOARD AUTO-REPEAT DISABLED..."; All of the above example programs are included as .CAS files. Disable DOS or game cartridge at power-on or reset -------------------------------------------------- Holding down the SHIFT key at power-on or after a hardware reset will disable any attached DOS or game cartridge. (1) This feature is ideal for bypassing DOS without having to keep unplugging the controller cartridge. (2) Can also be used to disable auto-starting game, assembler, or other cartridges. Support for 63x09e error trapping --------------------------------- Support for 63x09e error trapping has been added to the ROMs in case you decide at some point to replace your Dragon's Motorola MC6809EP CPU with the superior Hitachi HD63B09EP or HD63C09EP. The Hitachi HD63B09EP or HD63C09EP is a direct pin-for-pin replacement for the 6809E found in all Dragon Computers. Besides being a CMOS chip, which runs much cooler than the Motorola 6809E, the Hitachi 63x09E also contains an enhanced instruction set and additiona CPU registers that bring significant performance beyond what a 6809 can provide. Bytes $0095:0096 are now used as a secondary vector for 63x09e error trapping. The default address simply points to an RTI instruction to prevent any running software that includes illegal op-codes from crashing the machine. (1) Hitachi 63B09E/63C09E processors can be purchased from http://www.cloud9tech.com/ for $22 + shipping. Changes to BASIC memory map --------------------------- These enhanced ROMs also include some changes to the BASIC memory map: $0095:0096 63x09e secondary error trap vector (0xb46e) $0097 %CNTDWN% Keyboard auto-repeat countdown byte $0098 Keyboard mode control byte (0x00-0x7f = Default mode, 0x80-0xff = Enhanced mode) $011d:011e Keyboard auto-repeat IRQ interrupt service routine jump vector (Dragon 32 and Dragon 64 in 32K mode = 0x9d3d, Dragon 64 in 64K mode = 0xdd3d) $011f %REPDLY% Keyboard auto-repeat inter-repeat delay value (0x05) $befd:befe ROM ID bytes: Dragon 32 (0x3332 "32"), Dragon 64 (0x3634 "64") $fe02:fe03 ROM ID bytes: Dragon 64 in 64K mode (0x3634 "64") $fff0:fff1 63x09e error trap vector (0xffec) Notes ----- This is intended to be the final release version of my enhanced Dragon ROMs. Although I can't guarantee that these ROMs are now totally bug free I have taken a great deal of care to make sure to the best of my ability that no bugs exist in this final v3.0 release. I strongly recommend that you delete all previous versions and distribute/use only these. Please inform me via Steve Evans (Zephyr) at "The DRAGON Archive" forums if you do happen to find any bugs. The DRAGON Archive http://archive.worldofdragon.org/ The DRAGON Archive forums http://archive.worldofdragon.org/phpBB3/ Please feel free to distribute my enhanced Dragon 32/64 ROMs free of charge to all Dragon users. Regards, Stephen J Woolham