Every time a NMI occurs, The Processor starts from the top of my NMI routine, and works it's way down. Is it somehow possible to save the state of the processor, so next time the NMI occurs, it continues from my previous state? (let's say i had finished half my code in the NMI Interrupt). Hope you get what i mean.
Assuming that you want your NMI to be able to interrupt other code, the standard method is as follows:
Code:
nmivector:
pha
txa
pha
tya
pha
; do stuff here
pla
tay
pla
tax
pla
rti
But let's say i at first do nsf-playback (not sure of how much of the vblank time that uses).
And then after that i want to do my other code.. wich takes up alot of my vblank time (so there isn't enough time for both nsf and my code)
How can i prioritise my nsf, so that after the nsf-code has updated it's registers and loaded new values etc. I want the other code to be executed and stop if it's half-finished at the end of vblank.
Then in the next vblank period, nsf goes first then i want to continue with my other code where it stopped.
I hope im not asking dumb questions,or the answer to it is obvious in some doc.
In general, in an NES NMI handler, you do video updates first and audio updates last.