Help running Basic programs from Rom

Hardware Hacking, Programming and Game Solutions/Cheats
Post Reply
User avatar
robcfg
Posts: 1529
Joined: Sat Apr 04, 2009 10:16 pm
Location: Stockholm, Sweden
Contact:

Help running Basic programs from Rom

Post 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
sixxie
Posts: 1346
Joined: Fri Jul 18, 2008 8:36 am
Location: Hertfordshire
Contact:

Re: Help running Basic programs from Rom

Post 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
User avatar
robcfg
Posts: 1529
Joined: Sat Apr 04, 2009 10:16 pm
Location: Stockholm, Sweden
Contact:

Re: Help running Basic programs from Rom

Post 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?
User avatar
robcfg
Posts: 1529
Joined: Sat Apr 04, 2009 10:16 pm
Location: Stockholm, Sweden
Contact:

Re: Help running Basic programs from Rom

Post 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.
Post Reply