Not sure if I can explain this well, and maybe it's already been explored by someone, but this is my idea:
Background:
Most (all?) games try to do everything for the game logic during video rendering and get screen updates ready etc and try to beat the render time. If the game doesn't finish processing whatever it needs to do and the next screen is to be drawn then normally we see slowdown. I was thinking that there may be a way to have more complex (I may not have a good example here.) logic running in a way that slowdown shouldn't be a noticeable issue.
Idea:
Suppose the game is setup with a separate NMI thread structure. http://wiki.nesdev.com/w/index.php/NMI_thread
Most of the game logic would still operate normally during render time, but if the normal game logic was complete, rather than wait for NMI, the game could switch context to another thread (which if implemented simply is not too hard to do on 6502) that is allowed to calculate something over multiple frames. If this thread is interrupted for NMI, save it's state and switch context back to the main logic after the NMI thread is processed.
My thought was that this could help with a more complex enemy AI response, or other things I haven't thought of yet.
Of course you would need flags to hold the state of various things and it would a be a bit tricky to setup as there may be race conditions. Is this a valid idea?
Background:
Most (all?) games try to do everything for the game logic during video rendering and get screen updates ready etc and try to beat the render time. If the game doesn't finish processing whatever it needs to do and the next screen is to be drawn then normally we see slowdown. I was thinking that there may be a way to have more complex (I may not have a good example here.) logic running in a way that slowdown shouldn't be a noticeable issue.
Idea:
Suppose the game is setup with a separate NMI thread structure. http://wiki.nesdev.com/w/index.php/NMI_thread
Most of the game logic would still operate normally during render time, but if the normal game logic was complete, rather than wait for NMI, the game could switch context to another thread (which if implemented simply is not too hard to do on 6502) that is allowed to calculate something over multiple frames. If this thread is interrupted for NMI, save it's state and switch context back to the main logic after the NMI thread is processed.
My thought was that this could help with a more complex enemy AI response, or other things I haven't thought of yet.
Of course you would need flags to hold the state of various things and it would a be a bit tricky to setup as there may be race conditions. Is this a valid idea?