A question for Sarah...

A place to discuss everything Dragon related that doesn't fall into the other categories.
zephyr
Posts: 1474
Joined: Mon Jul 21, 2008 1:18 am

A question for Sarah...

Post by zephyr »

Hi Sarah,

PC-Dragon 2.06 has an irritating bug which prevents it from working properly with CoCo ROMs. If I were to explain the bug in some detail and suggest a fix for it, would you be willing to fix the bug?

Regards,
Steve
Sarah
Posts: 177
Joined: Wed Apr 13, 2011 3:36 pm
Contact:

Re: A question for Sarah...

Post by Sarah »

Is it definitely a bug and not a feature? ;)

I can't make any promises but if you let me know some details then I could at least evaluate whether to undertake some PC-Dragon work. The source code is also already available for anyone else wishing to investigate!
zephyr
Posts: 1474
Joined: Mon Jul 21, 2008 1:18 am

Re: A question for Sarah...

Post by zephyr »

OK, Thanks! :) The quickest way to explain the problem is by pasting a dissasembly of the first few bytes of the CoCo's keyboard routines and the indirect jump address at $A000.

All standard CoCo 1 keyboard routines (Color BASIC 1.0 and 1.1) have an entry point of $A1C1 for both internal BASIC routines and third party machine code routines.

Code: Select all

A000 A1C1     CMPA  ,U++

Code: Select all

A1C1 3414     PSHS  B,X
A1C3 8D03     BSR   $A1C8
A1C5 4D       TSTA
A1C6 3594     PULS  B,X,PC
A1C8 327D     LEAS  -3,S
A1CA 8E0152   LDX   #$0152
A1CD 6F60     CLR   ,S
A1CF C6FE     LDB   #$FE
A1D1 F7FF02   STB   $FF02
All standard CoCo 2 keyboard routines (Color BASIC 1.2, 1.3 and 1.4) have an entry point of $A1C1 for internal BASIC routines, and a recommended entry point of $A1CB for third party machine code routines.

Code: Select all

A000 A1CB     CMPA  D,U

Code: Select all

A1C1 7FFF02   CLR   $FF02
A1C4 B6FF00   LDA   $FF00
A1C7 43       COMA
A1C8 48       LSLA
A1C9 2779     BEQ   $A244
A1CB 3454     PSHS  B,X,U
A1CD CEFF00   LDU   #$FF00
A1D0 8E0152   LDX   #$0152
PC-Dragon always breakpoints the CoCo keyboard routine at $A1CB. As you can clearly see from the dissasembly of the CoCo 1 keyboard routine, this results in disaster when using CoCo 1 ROM images. Also, running a BASIC program under PC-dragon with a CoCo 2 ROM image results in failure of the break key because of the code at $A1C1 to $A1CA which is intended to quickly check for a keypress and return if no key is pressed. The routine was added by Tandy in an attempt to speed up BASIC when none of the keys were being pressed.

My suggestion is to have PC-Dragon check the indirect jump address at $A000 (COCO 1's = $A1C1, COCO 2's = $A1CB) to determine where to add breakpoints to the CoCo keyboard routine. Because of the code at $A1C1 to $A1CA, the CoCo 2 keyboard routine needs to have breakpoints at both $A1C1 and $A1CB in order to work correctly with BASIC.

I would also like you to consider the following requests:

(1) Put Shift+@ on Shift+# like you did with T3.
(2) Make it possible to have 64K of RAM available under Dragon 32 emulation.
(3) PC-Dragon runs at a ridiculously fast speed on modern harware, and I would like some way of slowing it down via the command line or configuration file. I don't expect the emulated Dragon speed to be accurate like T3, but it would be nice to be able to slow it down to a reasonable level.

Regards,
Steve
Sarah
Posts: 177
Joined: Wed Apr 13, 2011 3:36 pm
Contact:

Re: A question for Sarah...

Post by Sarah »

Thanks for the info; think I understand what you're describing. Actually, I've probably never considered CoCo 1 emulation to be in-scope, however if that's the only issue then it seems pretty straightforward to accommodate and the extra breakpoint for the CoCo 2 is likely to be a simple addition too.

The other requests will need a little investigation. I don't remember some of the applicable details such as whether or not limitations exist for possible keyboard mappings. I wouldn't originally have considered including a slowdown feature in PC-Dragon since it'd always introduce at least a small amount of overhead, that couldn't be afforded on the early x86 hardware of the time, but it seems reasonable to include it now. Perhaps you've also noticed that the % speed calculation on the info screen (Ctrl-F10) now often overflows on modern PCs, lol!
zephyr
Posts: 1474
Joined: Mon Jul 21, 2008 1:18 am

Re: A question for Sarah...

Post by zephyr »

Thanks! 8-) I have attached the original COCO 1 (Color BASIC 1.0 + Extended Color BASIC 1.0) and COCO 2 (Color BASIC 1.2 + Extended Color BASIC 1.1) ROMs that you will need for testing the modified PC-Dragon code.
Attachments
ORIGINAL_COCO_ROMS_FOR_PC-DRAGON.zip
(27.58 KiB) Downloaded 238 times
zephyr
Posts: 1474
Joined: Mon Jul 21, 2008 1:18 am

Re: A question for Sarah...

Post by zephyr »

Sarah,

Have you abandoned the PC-Dragon fix?

Regards,
Steve
Sarah
Posts: 177
Joined: Wed Apr 13, 2011 3:36 pm
Contact:

Re: A question for Sarah...

Post by Sarah »

zephyr wrote:Sarah,

Have you abandoned the PC-Dragon fix?

Regards,
Steve
Don't worry, I haven't forgotten about you! ;)

My dev/build environment for PC-Dragon is an elderly real machine. I'll need to spend some time discovering whether it's still working and comprehensible..!
zephyr
Posts: 1474
Joined: Mon Jul 21, 2008 1:18 am

Re: A question for Sarah...

Post by zephyr »

Thank You! :D
Sarah
Posts: 177
Joined: Wed Apr 13, 2011 3:36 pm
Contact:

Re: A question for Sarah...

Post by Sarah »

Okay... think I've got the PC-Dragon development environment working. Looks like it was last built in January 2000, a few months before everything was migrated to the current PC from an even older one. Having spent awhile obstructed by TC complaining that it was unable to find standard include files (despite the INCLUDE environment variable being set) and hunting around for a further option to reconfigure the paths, it now seems to be up and running again!

I'll see how things go with your requests when time allows... hmm... tried the keyboard breakpoint change, it's now possible to successfully BREAK into a BASIC program on the CoCo 2 with 'PC Mode' keyboard selected, however the CoCo 1 still has problems. It's happy if you select 'Real Mode' keyboard and start the emulator without breakpoints (as before, use DRAGON /T /K /SB /NB) but looks like more than just the DOIO $00 was problematic for compatibility with the CoCo 1 ROM.

I've attached an update so that you can see for yourself and perhaps diagnose the next issue... you might like to try out Shift+# too! Have fun!
Attachments
pcd207ta.zip
PC-Dragon v2.07a (test)
(92.44 KiB) Downloaded 235 times
zephyr
Posts: 1474
Joined: Mon Jul 21, 2008 1:18 am

Re: A question for Sarah...

Post by zephyr »

Yes, the Shift+# is working OK but its only working in 'Real Mode' rather than 'PC Mode' like T3 and XROAR. Also, the breapoint at $A1C1 causes the emulated CoCo to crash when using the Color Basic 1.4 ROM in Real Mode. I have attached all of the CoCo 1 and 2 Color Basic ROMs for your test purposes.
Attachments
COCO_1_COLOR_BASIC.zip
(14.71 KiB) Downloaded 244 times
COCO_2_COLOR_BASIC.zip
(22 KiB) Downloaded 251 times
Post Reply