Login
Back to forumSee the full topicGo to last reply

Posted By

siz
on 2011-02-09
03:22:57
 Re: cartridge programming

Your ROM image should start at $8000. There must be a signature in the beginning of the image to be autostarted by KERNAL. The initialization routine maps each ROM slot to the LOW ROM in decreasing order (from 3 to 0) and checks for a signature at $8007. If the characters 'CBM' is found there (bytes $43, $42, $4d) then it checks $8006. If the value found there is 1 then it makes a JSR to $8000. You can place a JMP to your real start there.
Most probably you have to initialize everything in because the ROM init is called before KERNAL RAMTEST and VIDEOINIT.

My code looks like this:
vidinit = $ff81
ioinit = $ff84
ramtest = $ff87
restorio = $ff8a

*= $8000

jmp cold
jmp warmstart

.byte 1
.text "cbm"

cold sei
lda #$bf
sta $fd30
sta $ff08
lda $ff08
and #$10
beq +
rts
+ jsr ioinit
lda $0508
cmp #$a5
beq *+5
jsr ramtest
jsr restorio
jsr vidinit

This one checks for Escape pressed during startup and starts my code only when it is pressed.



Back to top


Copyright © Plus/4 World Team, 2001-2024