Hi there,
Bit of a techie question here. I'm just wondering how the cartridges work - or to be specific, I'll give a theoretical example:
If I had a cartridge which offers nothing more than a few extra BASIC commands, how would this work? Would the cart identify itself as a disk controller and then in the $C002 initialisation routine extend the reserved word table etc? Or would you have an auto-starting (non-disk) cartridge that does the same thing then RTI/Reset?
Cheers.
Dragon Cartridges + BASIC...
Re: Dragon Cartridges + BASIC...
If the Dragon (or CoCo) finds $444B ("DK") at $C000-$C001, it then jumps to the next location at $C002. If "DK" is not found, and the cartridge is wired to auto start, the interrupts are enabled and the FIRQ handler does a hardware init, clears the reset flag at $71, and jumps to $C000.
Re: Dragon Cartridges + BASIC...
Cheers Zephyr, I think I'm slowly piecing this all together now.
Re: Dragon Cartridges + BASIC...
Here are a couple of quick examples for you:
"DK" auto-start:
FIRQ auto-start:
"DK" auto-start:
Code: Select all
ORG $C000
FCB $44,$4B
CLRA
L1 LDX #$0400
L2 STA ,X+
CMPX #$05FF
BLS L2
INCA
BNE L1
JMP $B43E
Code: Select all
ORG $C000
CLRA
L1 LDX #$0400
L2 STA ,X+
CMPX #$05FF
BLS L2
INCA
BNE L1
RTI
Re: Dragon Cartridges + BASIC...
That's fantastic!!! Cheers mate - you are an absolute diamond.
Re: Dragon Cartridges + BASIC...
Take a look at pages 238 to 242 of "Inside The Dragon" for a good example of adding new commands to BASIC.
Regards,
Steve
Regards,
Steve
Re: Dragon Cartridges + BASIC...
Unhelpfully, the Inside The Dragon book seems to have a typo - STUB2 hasn't been defined. I haven't had a chance to try and guess where it's supposed to go yet. Lol.
Cheers Steve.
Cheers Steve.
Re: Dragon Cartridges + BASIC...
If anyone is curious - I think
STUB2 EQU $0134
is the missing line.
Seemed to work... kinda. One of the two commands added in that example worked anyway.
STUB2 EQU $0134
is the missing line.
Seemed to work... kinda. One of the two commands added in that example worked anyway.
Re: Dragon Cartridges + BASIC...
That is correct!Rink wrote:If anyone is curious - I think
STUB2 EQU $0134
is the missing line.
You must have made a mistake somewhere because I typed in that example during the 80's and I clearly remember that both commands worked perfectly.Rink wrote: Seemed to work... kinda. One of the two commands added in that example worked anyway.
Re: Dragon Cartridges + BASIC...
Cheers fella. I'll take another look shortly.