Dragon 32 (and 64) Enhanced ROMs v3.1 released

Use this forum to submit new files for the download section of the archive. I will check each submission and upload it to the archive on a regular basis.
Post Reply
zephyr
Posts: 1474
Joined: Mon Jul 21, 2008 1:18 am

Dragon 32 (and 64) Enhanced ROMs v3.1 released

Post by zephyr »

Attached below is a copy of Steve Woolham's latest Dragon 32/64 enhanced ROMs.
Dragon 32 (and 64) Enhanced ROMs v3.1
By Stephen J Woolham.
18th December, 2013.


List of changes since version 3.0:


(1) The 6306 secondary error trap vector ($95:96) is now set by default to point to an RTI instruction at $FFEF
(Return from 6309 error trapping is now more reliable because it works even in 64K all RAM mode).

(2) Improved the automatic padded/unpadded USR support (Now also supports the use of DEF USR=x).

(3) Improved the keyboard auto-repeat routine (Uses considerably less CPU time).

(4) Relocated the Dragon 32 keyboard auto-repeat routine to the same address as the Dragon 64 routine.

(5) Improved the "disable any DOS or game cartridge at power-on" routine.

(6) Replaced the DLOAD command with RKEYS command for toggling the keyboard auto-repeat on/off.

(7) Added the RKEYS command to 64K mode BASIC.

(8) Fixed the ASCII save/load bug mentioned at "The DRAGON Archive" forums (Follow the links below to the forums
for more information).

viewtopic.php?f=5&t=4383&start=40#p9878

viewtopic.php?f=7&t=4532
Attachments
D32_&_D64_ENHANCED_ROMs_v31.zip
(130.12 KiB) Downloaded 250 times
zephyr
Posts: 1474
Joined: Mon Jul 21, 2008 1:18 am

Re: Dragon 32 (and 64) Enhanced ROMs v3.1 released

Post by zephyr »

Attached below is a small program (only 188 bytes long) that is designed to copy ROM to RAM, and restore the DLOAD/M command on a Dragon 64 that has been upgraded with Steve Woolham's enhanced ROMs. The program can be loaded very quickly from cassette or disk on a real Dragon 64 for temporarily restoring the DLOAD command if/when you need it. Once the ROM has been patched by the program, you can toggle between the RKEYS and DLOAD commands by simply entering EXEC (or EXEC&h7000 if you later use another EXEC address). An alternative way of switching between the RKEYS and DLOAD commands would be to use pokes as follows.

POKE65502,0 = RKEYS command active (ROM mode)

POKE65503,0 = DLOAD command active (RAM mode)

EDIT: Attachment replaced. The following changes were made:
(1) Position independent code
(2) Fixed a bug
(3) Displays which command (DLOAD or RKEYS) is active
Attachments
DLOAD32_v2.zip
(1.04 KiB) Downloaded 223 times
zephyr
Posts: 1474
Joined: Mon Jul 21, 2008 1:18 am

Re: Dragon 32 (and 64) Enhanced ROMs v3.1 released

Post by zephyr »

The attached program is for temporarily restoring the DLOAD/M command in 64 mode. You can't use the above mentioned pokes to switch between the RKEYS and DLOAD commands when the computer is in 64K RAM (MAP1) mode.
Attachments
DLOAD64.zip
(1.19 KiB) Downloaded 221 times
zephyr
Posts: 1474
Joined: Mon Jul 21, 2008 1:18 am

Re: Dragon 32 (and 64) Enhanced ROMs v3.1 released

Post by zephyr »

Steve Woolham has sent me some experimental ROMs. They are basically the same as the version 3.1 ROMs, but with an experimental keyboard auto-repeat routine. The new routine is not interrupt driven (IRQ) like all previous routines (including the original Dragon 64 routine) have been. The RKEYS command has also been updated. The correct usage is now "RKEYS ON" or "RKEYS OFF" to enable or disable the keyboard auto-repeat.

Byte $011F (Decimal 287) is still used to regulate both the wait, and inter-repeat delays. Because the new routine is not interrupt driven by the 50/60 Hz IRQ interrupt, you will need to alter this to something like 20 - 30 (decimal) for machine code programs which call the keyboard frequently. The current default behaviour of the routine is to automatically turn off auto-repeat when it detects that a BASIC program is running.

The original Dragon 64 interrupt driven keyboard auto-repeat routine is useless when a machine code game is running. Most games disable the interrupts or change the IRQ secondary vector to drive an internal timer routine.

I briefly tested the new routine with a few machine code adventure games. It worked perfectly once I found a good wait/inter-repeat delay setting by poking 287 with a few different values. I found 20 to be the best setting (for me) for the few games that I tried with it.

EDIT: Attachment (D32_&_D64_ENHANCED_ROMs_v31exp1.zip) removed.
Last edited by zephyr on Sat Jan 11, 2014 12:41 pm, edited 1 time in total.
zephyr
Posts: 1474
Joined: Mon Jul 21, 2008 1:18 am

Re: Dragon 32 (and 64) Enhanced ROMs v3.1 released

Post by zephyr »

An update was sent to me today. It is now possible to use the auto-repeat from within BASIC programs.

Poking 151 with any value other than zero bypasses the test that would normally disable key auto-repeat when a BASIC program is running. The same byte value multiplied by whatever value is at 287 is then also used for the wait delay. The routine normally uses a fixed value of 20 multiplied by whatever value is at 287 (default 20*5) when 151 is set to zero.

Example

Code: Select all

10 POKE151,30:P=PEEK(287):POKE287,20
20 A$=INKEY$:IF A$="" THEN 20
30 PRINT A$;
40 IF A$<>"?" THEN 20
50 POKE151,0:POKE287,P
NOTE: It is possible to use the enhanced keyboard without auto-repeating keys. Poking 152 with any value from 1 to 127 will enable the enhanced keyboard. Poking 152 with any value from 128 to 255 will enable the enhanced keyboard and auto-repeating keys (same as RKEYS ON).

EDIT: Attachment (D32_&_D64_ENHANCED_ROMs_v31exp2.zip) removed.
Last edited by zephyr on Sat Jan 11, 2014 2:14 am, edited 2 times in total.
zephyr
Posts: 1474
Joined: Mon Jul 21, 2008 1:18 am

Re: Dragon 32 (and 64) Enhanced ROMs v3.1 released

Post by zephyr »

Steve has released another update. You can forget everything that I said in my previous posts because the routine has been almost completely rewritten.

This far superior routine uses two sets of variables. One set at $0095 to $0097 for normal use, and another set at $011D to $011F when a BASIC program is running.

Memory Map

Code: Select all

$0095:0096   Wait delay (0x0064)
$0097	     Inter-repeat delay (0x05)

$0098	     Keyboard mode control byte (0x00)
	          (0x01-0x7F Enables enhanced keyboard response)
	          (0x80-0xFF Enables enhanced keyboard response and auto-repeating keys)

$00E6:00E7   Wait and inter-repeat delay countdown

$011D:011E   Wait delay used when BASIC programs are running (0x0258)
$011F        Inter-repeat delay used when BASIC programs are running (0x1E)
EDIT: Attachment (D32_&_D64_ENHANCED_ROMs_v31exp3.zip) removed.
Last edited by zephyr on Mon Jan 20, 2014 1:28 am, edited 7 times in total.
zephyr
Posts: 1474
Joined: Mon Jul 21, 2008 1:18 am

Re: Dragon 32 (and 64) Enhanced ROMs v3.1 released

Post by zephyr »

This update has an improved RKEYS routine. Everything else is exactly the same as the previous release.

EDIT: Attachment (D32_&_D64_ENHANCED_ROMs_v31exp4.zip) removed.
Last edited by zephyr on Sun Jan 12, 2014 1:59 am, edited 1 time in total.
zephyr
Posts: 1474
Joined: Mon Jul 21, 2008 1:18 am

Re: Dragon 32 (and 64) Enhanced ROMs v3.1 released

Post by zephyr »

This update is the same, but has the DLOAD/M command fully restored. You can still enable or disable the enhanced keyboard response and auto-repeating keys by poking the keyboard control byte at $0098 (Decimal 152) with the correct values.

Example

Code: Select all

POKE152,1       Enable enhanced keyboard response
POKE152,128     Enable enhanced keyboard response and auto-repeating keys
POKE152,0       Disable enhanced keyboard response and auto-repeating keys
Now we can choose whether to use the ROMs with RKEYS or DLOAD command.


EDIT: Attachment (D32_&_D64_ENHANCED_ROMs_v31exp4+DLOAD.zip) removed.
Last edited by zephyr on Sun Jan 12, 2014 1:08 pm, edited 4 times in total.
zephyr
Posts: 1474
Joined: Mon Jul 21, 2008 1:18 am

Re: Dragon 32 (and 64) Enhanced ROMs v3.1 released

Post by zephyr »

This update has a slightly tweaked auto-repeat routine.

TIP: If you enter POKE152,128:POKE104,0:CLOADM (or POKE152,128:CLOADM:POKE104,0:EXEC for games that don't auto-run) it will force the auto-repeat routine to use the second set of variables (the ones that are normally used only when a BASIC program is running) when the machine code program (or game) is running. The default second (BASIC) set of variables are perfect for machine code adventure games such as the graphical versions of Calixto Island, Sea Quest, Shenanigans, Trekboar etc. The non-graphical versions of these games work perfectly after entering only POKE152,128 before loading. This tip saves you the job of having to fine tune the normal variables (if you want to use auto-repeating keys) before running some machine code programs (or games).

Code: Select all

POKE152,128   Enables enhanced keyboard response and auto-repeating keys
POKE104,0     Temporarily forces the auto-repeat routine to use the second set of variables
You can, of course, simply enter POKE152,1 to enable only the enhanced keyboard response before loading your machine code program (or game). :)
Attachments
D32_&_D64_ENHANCED_ROMs_v31exp5.zip
RKEYS option
(40.68 KiB) Downloaded 243 times
D32_&_D64_ENHANCED_ROMs_v31exp5+DLOAD.zip
DLOAD option
(40.75 KiB) Downloaded 227 times
Post Reply