Dragon 32 USR0x incompatible with Dragon 64

Hardware Hacking, Programming and Game Solutions/Cheats
Post Reply
zephyr
Posts: 1474
Joined: Mon Jul 21, 2008 1:18 am

Dragon 32 USR0x incompatible with Dragon 64

Post by zephyr »

The Dragon 32 has a bug in the USR routine which causes USR1 to USR9 to be always read as USR0. The work-around is to use USR01-USR09 instead. This bug was fixed for the Dragon 64, but unfortunately USR0x now returns a Syntax Error causing a BASIC incompatiblity. As a result of this, games such as Tim Love's Cricket, and Kriegspiel are not compatible with the Dragon 64.

Here's a routine which allows you to get round this problem, and play games like Tim Love's Cricket, and Kriegspiel on a Dragon 64. You can save the machine code to cassette or disk, and load it before loading the game you want to play, or add lines 20 and 30 to your own BASIC program. EXECing the start address connects/disconnects the routine from the BASIC operating system. The machine code routine is position independent.

Cassette compatible version:

Code: Select all

0 'USR32 V1.0
1 'FOR THE DRAGON 64
2 'BY STEPHEN J WOOLHAM
3 '
10 CLS:PRINT"WRITING MACHINE CODE..."
20 MC$="CE00EA1193A9270BDFA9308D000BC60F7EB7CC8EBB269FA9398C82922606813026020E9F7EBB26"
30 X=1:FOR I=20480 TO 20518:POKE I,VAL("&H"+MID$(MC$,X,2)):X=X+2:NEXT
40 POKE144,2:POKE145,0:CLS
50 PRINT"START ADDRESS = 20480"
60 PRINT"END ADDRESS = 20518"
70 PRINT"EXEC ADDRESS = 20480"
DOS compatible version:

Code: Select all

0 'USR32DOS V1.0
1 'FOR THE DRAGON 64
2 'BY STEPHEN J WOOLHAM
3 '
10 CLS:PRINT"WRITING MACHINE CODE..."
20 MC$="CE03EB1193A9270BDFA9308D000BC60F7EB7CC8EBB269FA9398C82922606813026020E9F7EBB26"
30 X=1:FOR I=20480 TO 20518:POKE I,VAL("&H"+MID$(MC$,X,2)):X=X+2:NEXT
40 POKE144,2:POKE145,0:CLS
50 PRINT"START ADDRESS = 20480"
60 PRINT"END ADDRESS = 20518"
70 PRINT"EXEC ADDRESS = 20480"
Attachments
USR32_USR32DOS.zip
(4.71 KiB) Downloaded 328 times
User avatar
robcfg
Posts: 1529
Joined: Sat Apr 04, 2009 10:16 pm
Location: Stockholm, Sweden
Contact:

Re: Dragon 32 USR0x incompatible with Dragon 64

Post by robcfg »

Hey, great work!

I'm learning a lot on the Dragon just by reading your posts.

Keep up the good work!
zephyr
Posts: 1474
Joined: Mon Jul 21, 2008 1:18 am

Re: Dragon 32 USR0x incompatible with Dragon 64

Post by zephyr »

NOTE: This routine is not needed if you are using Steve Woolham's Enhanced Dragon ROMs.
zephyr
Posts: 1474
Joined: Mon Jul 21, 2008 1:18 am

Re: Dragon 32 USR0x incompatible with Dragon 64

Post by zephyr »

Dragon 32/64 compatible versions of Kriegspiel and Tim Love's Cricket are now available from the Uploads section.

viewtopic.php?f=7&t=4861

viewtopic.php?f=7&t=4825
Post Reply