zzarko
Registered: Feb 2003 Posts: 77 |
Starting a program after copying from cartridge
I am working on a 3.0 version of Magic Desk Cartridge Generator and I have come up with a problem with three programs (testing is done in VICE 3.3, and on a real C64):
Turbocopy V5.0
Turbo Nibbler V5.0
64 Tester
that simply would not start when copied from cartridge to $0801 (the other ~140 programs that I have tried worked just fine).
Anyhow, cold start is like this:
stx $d016
jsr $FDA3 // IOINIT, init CIA,IRQ
jsr $FD50 // RAMTAS, init memory
jsr $FD15 // RESTOR, init I/O
jsr $FF5B // SCINIT, init video
cli
jsr $E453 // load BASIC vectors
jsr $E3BF // init BASIC RAM
jsr $E422 // print BASIC start up messages
ldx #$FB // init BASIC stack
txs
Then I setup IRQ, VIC and CIA registers to my liking. After a program is selected from cartridge menu, I restore original IRQ and call these:
jsr $FDA3 // IOINIT, init CIA,IRQ
jsr $FD15 // RESTOR, init I/O
jsr $FF5B // SCINIT, init video
cli
jsr $E453 // load BASIC vectors
jsr $E3BF // init BASIC RAM
jsr $A68E // set current character pointer to start of basic - 1
ldx #$FB
txs
then I copy the program to its address ($0801), set $2d/2e to end of program, and then:
jsr $A871 // clr
jsr $A533 // re-link
jmp $A7AE // run
Does someone knows what initialization am I missing here (or have too much of it)? Complete source code will be available soon, but I would like to fix this before the release, if possible. |