| |
Frantic
Registered: Mar 2003 Posts: 1648 |
Switch out C64 Kernal ROM when running code from RR Cart ROM
Hi!
I think I have actually asked this once before, but can't really find that thread (if I did). Furthermore, I can't accept what I think is the truth in this case, so I'll ask again. ;)
Is there really no way to switch out C64 Kernal ROM when executing code running from a Retro Replay ROM?
(I don't want to go into Ultimax mode, because that has all sorts of consequences, like hiding large amounts of the C64 RAM etc. Also, I am not thinking about tricks like temporarily disabling the cart as a whole, and such.)
What I want to achieve is basically to use code which (a) executes from retro replay rom, and (b) does not jump through the "indirect" IRQ/NMI vectors, but is rather handled directly through the vectors at $fffa/fffb etc.
//FTC |
|
| |
chatGPZ
Registered: Dec 2001 Posts: 11386 |
you can use the rom mirrors in i/o area for this, they are always visible (if enabled via cart regs) regardless of $01 |
| |
Frantic
Registered: Mar 2003 Posts: 1648 |
Uhm... How do you mean? What does the IO area have to do with the fact that the hardware NMI/IRQ vectors are covered by the Kernal ROM? I guess you may be saying something obvious, but I think I am precisely missing something obvious.
Or.. uh.. you mean.. only having one page of ROM code available at a time, and use $01 settings more freely? Not exactly desirable, but I suppose it is possible. Anyway, I would have preferred the "main loop" of the program to also be running from the cart ROM.
I must say that I haven't fully understood how that banking in the IO area works, although I think I've understood fairly well how to use RR ROM banking more generally, apart from the IO area trickery.. |
| |
chatGPZ
Registered: Dec 2001 Posts: 11386 |
"What does the IO area have to do with the fact that the hardware NMI/IRQ vectors are covered by the Kernal ROM?"
nothing :) but ....
"Or.. uh.. you mean.. only having one page of ROM code available at a time, and use $01 settings more freely?"
... if you want to have the hardware vectors in ram, ie have the kernal disabled, then the only place where cart rom is visible at the same time is (can be) the i/o area. typically in the i/o area there will be stub functions that bank in/out the cart rom and then call into them. |
| |
Frantic
Registered: Mar 2003 Posts: 1648 |
Yeah, thanks.. I get it! Then of course the banking stuff will waste a few cycles anyway, but.. yeah.. I see what you mean: that this is the only option under the conditions I specified. |
| |
Count Zero
Registered: Jan 2003 Posts: 1932 |
as groepaz said.
Though untested for details currently there seems to be a special situation when calling especially the BASIC ROM from banks 2 or 3 and above. Counting 0 to 7 as it should be I'd say it was bank 2. JMP/JSR to basic interpreter routines didn't properly work on RR - not sure about AR.
Someone may want to dig into it :) |
| |
Frantic
Registered: Mar 2003 Posts: 1648 |
Just a follow up question... does this limitation (my concern in the original question) apply to all carts on C64? That is, does it have anything to do with the way RR works specifically, or is this rather a limitation in the way C64 carts work in general? |
| |
chatGPZ
Registered: Dec 2001 Posts: 11386 |
its just how the mapping works, so yes it will be like that with every cartridge =) |
| |
Count Zero
Registered: Jan 2003 Posts: 1932 |
Followup thought/question: what is the code purpose here? Ultimax might be a bitter way indeed but there likely are other easy "memory hook" solutions I could think of. |