| |
mhindsbo
Registered: Dec 2014 Posts: 51 |
Memory managment w. cartridge
I am setting up my game on a cartridge and loading levels etc. from the cart.
When looking at all the permutations for banking in RAM & ROM it looks like you always have the kernal in when cart rom is in. Is that the case or am i missing a setting?
http://www.c64-wiki.com/index.php/Bank_Switching
That is annoying since, especially since the kernal's IRQ vectors are then also in which I would like to avoid. |
|
| |
AlexC
Registered: Jan 2008 Posts: 299 |
I believe you misinterpreted table from that page. Here is an excerpt from it: "A cartridge may configure the system to one of the modes 0-23 as one or both of the expansion port latch bits will be logically low (cleared to 0) by grounding the EXROM/GAME lines." |
| |
Frantic
Registered: Mar 2003 Posts: 1648 |
mhindsbo: Don't take my word for it, but yes.. I think you're right. I have a vague memory that I came to that conclusion too a few years ago when I was thinking about some cartridge related project. I also seem to remember that I had to re-think things quite a lot precisely because of that thing. Bah..
(Well, there is the ultimax mode as well, but then you have very little RAM available to play with and then the IRQ/NMI vectors have to be fixed in cartridge ROM although they may point elsewhere than the kernal thing...)
One possibility is to have the cartridge switched out, and then switch it in only while the interrupt is executing, and switch cart out again before leaving the interrupt code. |
| |
mhindsbo
Registered: Dec 2014 Posts: 51 |
Thanks. Yes I unfortunately think the solution is to switch the cart ROM in and out. I will probably just have the irq vector both in $FFFE as well as in $314 (without the stack push) - that way it will jump to the same place with or without Kernal.
BTW follow up question. It seems cart ROM is different than Basic and Kernal in that you dont write to the RAM below it when it is banked in. Is that correct? |
| |
chatGPZ
Registered: Dec 2001 Posts: 11386 |
no, thats only true in ultimax mode (where there is no ram under the rom in the first place) |