Log inRegister an accountBrowse CSDbHelp & documentationFacts & StatisticsThe forumsAvailable RSS-feeds on CSDbSupport CSDb Commodore 64 Scene Database
You are not logged in - nap
CSDb User Forums


Forums > C64 Coding > Starting a program after copying from cartridge
2019-06-23 12:48
zzarko

Registered: Feb 2003
Posts: 66
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.
 
... 20 posts hidden. Click here to view all posts....
 
2019-06-28 21:17
map

Registered: Feb 2002
Posts: 27
Ok, so you still would like to start the AR-snapshot from the crt.

Did you try if AR-snapshots from other programs can be started with your solution?

Some general ideas:

The adresses of some ROM calls used in these examples look a bit different compared to what you use but I did not check the details.

https://codebase64.org/doku.php?id=base:runbasicprg
https://codebase64.org/doku.php?id=base:kernalbasicinit

Also for debugging this tool is very nice:

C64 Debugger V0.64.56

Maybe you already knew these..
Previous - 1 | 2 | 3 - Next
RefreshSubscribe to this thread:

You need to be logged in to post in the forum.

Search the forum:
Search   for   in  
All times are CET.
Search CSDb
Advanced
Users Online
CA$H/TRiAD
juN3bula/N3U
B.A.
Clayboy
Mike
Matt
MuZZa/The Codeblasters
Nordischsound/Hokuto..
map/Plush
Viti/Hokuto Force
oziphantom
pcollins/Quantum
Guests online: 77
Top Demos
1 Next Level  (9.8)
2 Mojo  (9.7)
3 Coma Light 13  (9.7)
4 Edge of Disgrace  (9.6)
5 Comaland 100%  (9.6)
6 No Bounds  (9.6)
7 Uncensored  (9.6)
8 Wonderland XIV  (9.6)
9 Memento Mori  (9.6)
10 Bromance  (9.5)
Top onefile Demos
1 It's More Fun to Com..  (9.7)
2 Party Elk 2  (9.7)
3 Cubic Dream  (9.6)
4 Copper Booze  (9.5)
5 TRSAC, Gabber & Pebe..  (9.5)
6 Rainbow Connection  (9.5)
7 Wafer Demo  (9.5)
8 Dawnfall V1.1  (9.5)
9 Quadrants  (9.5)
10 Daah, Those Acid Pil..  (9.5)
Top Groups
1 Nostalgia  (9.3)
2 Oxyron  (9.3)
3 Booze Design  (9.3)
4 Censor Design  (9.3)
5 Crest  (9.3)
Top Logo Graphicians
1 Sander  (10)
2 Facet  (9.7)
3 Mermaid  (9.4)
4 Pal  (9.4)
5 Shine  (9.3)

Home - Disclaimer
Copyright © No Name 2001-2024
Page generated in: 0.046 sec.