Posted By
Stinaris on 2020-12-01 09:49:40
| Re: Cartridge and raster interrupts
Thanks Mad,
I spent sometime just seeing what was causing the issue. Now I suspect, although not being an expert I am probably wrong.
So I have a bit of code in the cartridge that writes a little message. This works fine. As well as that I try to set up a raster interrupt. Part of setting the vectors is doing an sta $ff3f Which I think will tell the system not to look at the ROM version of the interrupt and look in RAM. What I suspect is when I do this it's switching to the RAM under $8000 (which doesn't exist on the C16). However if I remove this line the program runs senza raster.
I'll try moving the raster code into ram and trying again. But for now I have to work.
------------------------------------------------------------------------------------------------------------------------------------------
Ok so during my lunch break I had a quick play.
I copied the raster interrupt code to colourmap at $0800. Set the raster interrupt to point to this. Kept the cartridge code simple the following was observed.
With the "sta $ff3f" included, the raster interrupt to change the border colour works but the Cartridge code is never started. Removing the "sta $ff3f" the cartridge code is run but the raster interrupt is never run.
It seems moving between RAM and ROM code is quite tricky. So I got my cartridge code to run then at the end of the cartridge code I placed a "STA $ff3f" and the interrupt started albeit not consistently.It takes a few resets for it to settle. However the cartridge code no longer executes, because I presume there is no code where the PC currently references. More investigation this evening.
|