Changes for May 26th 1999
-------------------------
The USR command has been modified to get round the problem of either USR0x
or USRx not being recognised correctly because of the difference between the
Dragon 32 and Dragon 64 BASIC ROMs. This version of the Dragon 32 BASIC ROM
now understands both USR0x (Dragon 32) and USRx (Dragon 64).

e.g.

A=USR01(A) (Dragon 32)
A=USR1(A)  (Dragon 64 and Tandy CoCo)

The other modification that has been made is to the "RAM FILL" routine at
$A06C which has been changed because the USR modification has taken away
some of the space where the original routine was located. Read the text
file ROMPATCH.TXT for more information.


Changes for February 19th 20001
-------------------------------
The T3 Dragon/CoCo emulator has a minor (but annoying) bug that causes a
number three to displayed every time the BREAK key is pressed when using
a speedkey or auto repeating keyboard routine. Both D32 and D64 keyboard
routines have now been modified to mask the bug.


Changes for February 24th 2001
------------------------------
Fixed several minor bugs in D64 ROM.

Modified D32 keyboard routine to include speedkey function.

Added pseudo multi-tasking to D32 ROM.


Setting $98 to #$50 (POKE &H98,&H50) enables the speedkey function.

If the speedkey function is enabled and locations $98 - $99 are set to point
at a routine that starts with a NOP instruction the multi-tasking will start
automatically. Reading the keyboard from within your routine is easy because
on entry the A register contains the value of the current keypress. 

Set $98 to any other value (default = #$5E) to disable multi-tasking.

I have included a small example program (MTASK.CAS) to demonstrate the new
multi-tasking capability.

CLOADM and EXEC MTASK.CAS (which will automatically set $109 - $10A & $98)
and type in the folloing BASIC program to see what's happening.

10 PMODE 3,1:SCREEN 1,0
20 GOTO 20

You should see a constantly changing pattern on the graphics screen.

Pressing the "[" key enables sound.

Pressing the "]" key disables sound.

When the speedkey/multi-tasking are disabled the keyboard functions normally
and will not cause any compatibility problems.


Changes for March 4th 2001
--------------------------
Doubled the execution speed of the PCLS routine in both D32 and D64 ROMs.

Fixed several minor bugs in both D32 and D64 ROMs.

Added two routines to help list BASIC programs in a more controlled manner.


The first routine pauses the listing and waits for a keypress after each line.

EXEC&HE0A9 to enable
POKE&H1A6,&H39 to disable
POKE&H1A6,&H7E or EXEC&HE0A9 to re-enable

Press SPACE to display each program line
Hold SHIFT and press SPACE for scrolling list (Release SHIFT to stop)
Press BREAK to end list


The second routine displays the listing at a more readable speed.

EXEC&HE0C6 to enable
POKE&H11D,Delay 1-8 (Default=1)
POKE&H11D,0 to disable

Press SPACE to pause or resume list
Press BREAK to end list

Try them both and use the one you prefer. Do not try to use both routines
together.


Try the supplied BASIC program (GSPEED.CAS) with old and new ROMs to see the
difference in the execution speed of the PCLS routine.


Changes for March 8th 2001
--------------------------
Modified the error handler to stop ?SN ERROR memory leak when the DragonDOS
cartridge is present.

Modified Hardware Initialisation routine and FIRQ handler to make Enhanced 
32K mode ROM compatible with Jeff Vavasour's CoCo Emulator.

Because Jeff Vavasour's CoCo emulator does not support the .dgn format there
is now a seperate file in .rom format supplied as well as the original .dgn
format version.

e.g.

These .dgn format files are for use with Paul Burgin's T3 and PC Dragon.

DRAGROM.DGN
D64ROM2.DGN 

This .rom format file is for use with Jeff Vavasour's CoCo emulator.

DRAGROM.ROM


*NOTE*
There are two different versions of the .rom format.  The .rom files used by
MESS are just a copy of the original binary file which have been renamed with
a .rom file extension. Jeff Vavasour's .rom format is almost identical except
for two extra bytes (The ROMs start address) at the start of the file.


Changes for April 8th 2001
--------------------------
Improved error handling.

Improved audio disable/enable routine.

Fixed a bug that caused the computer to freeze if the PLAY command was used
when the IRQ was disabled.

Improved SOUND command's handling of the above problem.

Improved IRQ handler.

Modified FIRQ handler to compensate for the different ways that the hardware
FIRQ is emulated by Dragon/CoCo emulators.

The cartridge support routine at $BECC now emulates the hardware FIRQ and the
FIRQ handler to give better support for cartridges.

Added on screen real time clock routine ($E1A2) to cartridge.

To enable on screen clock: EXEC&HE1A2
To set hours:              POKE&H100,&H HOURS
To set minutes:            POKE&H101,&H MINUTES
To set seconds:            POKE&H102,&H SECONDS

Or use the supplied BASIC program SETTIME.CAS to set time and enable clock.

*NOTES*
After activating Encoder09 with the new FIRQ emulation routine, the IRQ will
be left in a disabled state just as it would if it had been activated by the
real FIRQ handler. If you need to enable the IRQ, the quickest way is to use
the warm reset routine at $B44F (EXEC&HB44F).

If you want to use the on screen clock and keyboard auto-repeat together, you
must enable the keyboard auto-repeat first.

The new FIRQ emulation routine will also cause problems with the three in one
DASM/DEMON/ENCODER cartridge (File date: January 20th 1998) that is available
for download from my Dragon site.  The reason for this is that the DASM/DEMON
FIRQ handler had been modified to work with the old cartridge support routine.

An updated copy (DASM.ZIP) of the cartridge is supplied in this archive.


Changes for May 15th 2002
-------------------------
Modified power on reset routine to speed up system restarts.

Modified FIRQ handler to prevent system lockups occurring after a warm reset
when using the DragonDOS cartridge with certain emulators.

A new CoCo hardware compatible version of the ROM is now available with the
following features...


Added support for the CoCo's keyboard and serial printer port in a special
CoCo hardware compatible version of the Dragon 32 ROM.  The new ROM has been
designed for Dragon users who would like to use David Keil's excellent CoCo
emulator (v1.22) for Dragon 32 emulation.

The ROM has a number of new features added, such as a speed poke emulation
routine and a keyboard auto-repeat routine.

The speed poke routine emulates the Dragon/CoCo standard speed pokes (65495,
65494, 65497, 65494) and adds a new (65499, 65498) turbo speed poke.

The speed poke emulation uses the emulators speeds of 1.79Mhz for the 65495
poke and 3.58 Mhz for the 65497 poke. The new 65499 poke enables the turbo
speed of the emulator. While the emulated speeds may not be 100% accurate,
the emulated MPU rate select of the SAM chip is.

e.g.

If the A.D. rate (65495) has been selected and the fast rate (65497) is
then selected, the computer will reset to the A.D. rate when a fast rate
reset (65496) is selected.  The new turbo poke (65499) however does not
follow these rules and will always reset the computer to standard speed
when a turbo reset (65498) is selected.

The speed poke routine can also be called from machine code.

e.g.

        LDX     #$FFD7
        JSR     $BF14
        RTS

This would give the same result as using POKE65495,0 in BASIC.


The keyboard auto-repeat can be enabled or disabled by the use of a new
command "RKEYS" which can be used from the command prompt or as part of
a BASIC program.

The auto-repeat can be customised be pokeing into two locations that control
the inter-repeat delay ($11B) and the wait delay ($11C). The wait delay is
set to a default value of $30 which gives a delay of 0.8 of a second before
key repeat starts. The inter-repeat delay is set to a default value of 6
which gives a key repeat of 10 characters per second.

The serial printer port routine uses two previously unused bytes ($00E6:00E7)
for the serial baud rate constant.

There is also a small keyboard translation routine added to the ROM which
maps three of the keys so that the keyboard layout is exactly the same as
the PC's. Keyboard translation can be disabled by pokeing any value other
than zero into address $00EB.

The ROM also includes the CoCo's original hardware initialisation routine
to maintain full compatibility with CoCo hardware. A separate version of
the ROM is included (COCO.zip) without the keyboard translation routine.
This version of the ROM is supplied for use with a real CoCo or CoCo II
computer. Although it should work perfectly if used as the ROM of a real
CoCo, it has not been tested by myself or anyone alse at this time and
cannot be guaranteed to work correctly with your own CoCo. It is possible
to try the ROM in a real CoCo without making any modifications as long as
you have 64K memory fitted. You will find a file called D32ROM.CAS in the
same .zip file as the ROM files. When converted back to tape and loaded
into your CoCo the program will switch the computer to 64K mode and copy
the ROM to the correct memory address of $8000 and perform a cold start
on the Dragon ROM. You can then use this to give you some idea of what the
real ROM would be like if used with your CoCo. It should be noted that
although BASIC programs pose no problem for the ROM in RAM, machine code
programs are a different story. Some of them switch to 32K mode as part
ot their initialisation routine. These programs would of course always
fail unless they were modified by the user so that they do not swith to
32K mode.


The new CoCo compatible files can be found in the following archives:

COCO.ZIP  -  ROM files suitable for use with a real CoCo.

KEILS.ZIP -  ROM files suitable for use with David Keil's CoCo emulator.


*NOTES*
If you experience problems loading any .cas files while using David Keil's
CoCo emulator, use the supplied FIXCAS.EXE to add more sync information
to the file header.

Information on converting a CoCo 1 or 2 to a Dragon 32 can be found on the
following web page:

http://www.onastick.clara.net/cococnv.htm

For updates and information on David Keil's CoCo emulator:

http://discover-net.net/~dmkeil/


Changes for June 4th 2002
-------------------------
Improved keyboard routine in both Dragon 32 and Dragon 64 ROMs.

Modified multi-tasking routine.

Added multi-tasking capability to Dragon 64 ROM.

Added keyboard auto-repeat routine to both ROMs.

Fixed some bugs in the Dragon 32 ROM.


The keyboard routine is now much faster and will detect more than one key
pressed on the same matrix row. The only software that I have found not to
work with the modified keyboard routine is Sprite Magic. This is because
Sprite Magic does not call the keyboard routine at its official entry point
of $BBE5.  I have included a small BASIC program (SMKP.CAS) that will load
and apply a small three byte patch to Sprite Magic to allow it to work with
both modified and original Dragon keyboard routines.

If you find any other software that will not work with the modified keyboard
routine please let me know.


The keyboard auto-repeat routine is enabled and disabled by the use of EXEC
&H8030 (EXEC &HC030 for the Dragon 64 ROM). The auto-repeat routine is an
improved version of the one in the CoCo compatible ROM and can be customised
in exactly the same way.  The only difference is that the inter-repeat delay
is now stored at $011E and the start delay at $011F.

Because of a lack of space in the ROMs, the auto-repeat routine is now stored
at the memory address that was used by the serial port routines. I decided to
do this because it is unlikely that the old serial routines will ever be used
and the keyboard auto-repeat is very handy to have if you use the Dragon for
programming like myself.

I have moved the original serial port routines to the cartridge area so that
they can still be used as long as the cartridge is present.

The entry points are as follows:

$E245 - Reads a byte from serial port.

$E262 - Sends a byte to serial port.

$E270 - Select serial baud rate.


Because of a lack of space in the ROMs the multi-tasking routine has been
modified to use the software interrupt (SWI) instead of a dedicated JSR.

To use the new multi-tasking capability, set $0106 - $0108 to a JuMP to the
start address of your own routine and set $0098 to #$50. The multi-tasking
example program (MTASK.CAS) has been updated to work with the new routine.

The speedkey routine has been removed as it is no longer needed.


*NOTES*
The keyboard auto-repeat routine is driven by the 50Hz interrupt just like the
original Dragon 64 keyboard auto-repeat. If you are using Encoder 09 you will
notice that the keyboard auto-repeat does not work.  This is because Encoder
does not enable the interrupts as part of its initialisation. There are many
ways to re-enable the interrupts, but the simplest way is to use the Dragon's
SOUND or PLAY commands at any time from the command prompt.

The entry points to enable or disable the auto-repeating keys mentioned above
are part of the direct jump table and were originally used by the serial port
routines. The true entry points are as follows.

$BE7B - Entry point of the Dragon 32 auto-repeat enable/disable routine.

$BE92 - Entry point of the actual Dragon 32 keyboard auto-repeat code.

$802A
$802D - These addresses all point to the Dragon 32 enable/disable routine.
$8030 - Use the one you find easiest to remember.

$FD80 - Entry point of the Dragon 64 auto-repeat enable/disable routine.

$FD97 - Entry point of the actual Dragon 64 keyboard auto-repeat code.

$C02A
$C02D - These addresses all point to the Dragon 64 enable/disable routine.
$C030 - Use the one you find easiest to remember.


If you do happen to find a piece of software that does not work with the new
keyboard routine, one option is try using the routine at $E28F to temporarily
restore the original keyboard routine. The routine works by using MAP 1 mode
(all RAM like the Dragon 64), it then copies the ROM to RAM and restores the
original code to the keyboard routine.

There is also a copy of the original keyboard code at $E306 that jumps to the
new keyboard routine but restores the same functionality of the old keyboard
routine. This could be used as a temporary measure by patching your software
to use this entry point to read the keyboard instead of the official $BBE5
entry point.

If none of the above work you will have to use a previous version of the ROM
without the enhanced keyboard. I personally would much rather have a decent
keyboard routine than say one piece of software out of hundreds that does not
work properly. I have read many complaints over the years about the Dragon's
poor keyboard routine and how its not as good as the Tandy CoCo's routine.
The new keyboard routine is a dream to use and I for one am not prepared to
go back to using the old one for the sake of one or two pieces of software
that may not work correctly with the new one.

Please by all means let me know if you do have a favourite piece of software
that you find does not work with the new keyboard routine and I will modify
it and send you a working version.


Changes for June 24th 2002
-------------------------
Modified D32 RAM test routine to improve speed and compatibility.

Fixed a minor bug in the D32 ROM.



Stephen J Woolham

TheDragon32@Hotmail.com

