It is currently Fri Dec 15, 2017 8:47 pm

All times are UTC - 7 hours





Post new topic Reply to topic  [ 4 posts ] 
Author Message
 Post subject: Programflow
PostPosted: Mon Feb 20, 2006 8:56 am 
Offline
User avatar

Joined: Sun Feb 12, 2006 4:00 pm
Posts: 3
Location: Linkoping / Sweden
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.

_________________
/opius


Top
 Profile  
 
 Post subject:
PostPosted: Mon Feb 20, 2006 9:20 am 
Offline

Joined: Sun Sep 19, 2004 11:12 pm
Posts: 19348
Location: NE Indiana, USA (NTSC)
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


Top
 Profile  
 
 Post subject: -
PostPosted: Mon Feb 20, 2006 12:48 pm 
Offline
User avatar

Joined: Sun Feb 12, 2006 4:00 pm
Posts: 3
Location: Linkoping / Sweden
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.

_________________
/opius


Top
 Profile  
 
 Post subject:
PostPosted: Mon Feb 20, 2006 1:09 pm 
Offline

Joined: Sun Sep 19, 2004 11:12 pm
Posts: 19348
Location: NE Indiana, USA (NTSC)
In general, in an NES NMI handler, you do video updates first and audio updates last.


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 4 posts ] 

All times are UTC - 7 hours


Who is online

Users browsing this forum: No registered users and 7 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group