Page 1 of 1

Help running Basic programs from Rom

Posted: Sun Mar 21, 2021 7:14 pm
by robcfg
Hi folks!

I'm trying to get a Basic program running from cartridge because, why not?

So, I'm trying to replicate what the rom of the spanish driving test does, which is to copy the program to 0x1E00 and then jump to the basic RUN command at 0x85A5.

The loader code is this:

Code: Select all

CLRA
LDA   #$5B
STA   >$001B
STA   >$001F
LDX   #$C020
LDY   #$1E00
BSR   $C016
JMP   $85A5
RTS
LDA   ,X+
STA   ,Y+
CMPX  #$FEFF
BNE   $C016
RTS
I copied that code, loaded a basic program on XRoar and CSAVEMed it starting at 0x1E00, appended it to the loader and put it into one of my trusty Dragon Multicartridges. And it doesn't work, of course :mrgreen:

So I'm not exactly sure what did I miss. Any ideas?

Cheers,
Rob

Re: Help running Basic programs from Rom

Posted: Sun Mar 21, 2021 7:27 pm
by sixxie
Never done it myself, but I reckon there are more things to tweak before you RUN...

And I know a man who has! John Linville wrote this in 2017 - about the CoCo, but should translate readily enough:

https://retrotinker.blogspot.com/2017/0 ... ridge.html

Re: Help running Basic programs from Rom

Posted: Mon Mar 22, 2021 12:14 am
by robcfg
I've tried following John's tutorial but makes no difference whatsoever.

Also if it were the case, why is it that the driving test rom works with that minimal loader?

Re: Help running Basic programs from Rom

Posted: Mon Mar 22, 2021 11:06 pm
by robcfg
Ok, analysing the code in the rom I mentioned, it turns out that the first line does the following:

Code: Select all

1 POKE28,239:POKE32760,123:GP=0:RET=4:POKE32736,4:POKE32739,0:FER=2:POKE&H120,20:DEFUSR0=32720:CLEAR600,32720:P=PEEK(32761):IFP=1THENGOTO992:ELSEGOTO1450
So I guess I can have that on the asm loader like John does.