Quote:
If you want the music to keep playing during pause, you'll have to jsr to your music routine even when paused. If you want music to stop... you'll have to silence all audio when the game is paused (otherwise you could be left with ugly hanging notes).
Heh, I forgot about that
Although I didn't take many things into account because that was just an example for him to go by.
Quote:
In fact... when paused, you still have to do EVERYTHING your game normally does. The only thing that's different is you don't allow the player to move/operate... and you stop the world (and enemies) from updating. So I'd say just keep a 'pause' value somewhere in RAM and in the NMI code (or wherever your typical frame code is)... branch over the routines that update the player and world if the game is paused.
I was gonna mention that he should just store a ram value and check it during certain routines to see if they can run or not, but then the example would've been too big, and I was going for something simple. And yeah thats a much better way to keep things paused, just set a value nd at certain routines just don't let them run if the value = $01 or something
Quote:
I guess the better, simpler, more structurated and more logistical thing is :
To have a NMI routine that upload PPU registers, SprRam, etc... from buffers, call the sound code, etc....
Your main programm can just does the actual gameplay things and upload buffer to be read in a NMI.
That would probably work much better for him. That way he could just go into an infinite loop, but all the "necessarry" things willl occure because the NMI keeps going.
Quote:
So you have to check the JoyPad in the main thing, if start if pressed you have to wait it to be released, then wait it to be pressed again, then continius gameplay (otherwise you game will pause and unpause 60 times per seconds, and I guess that's not the thing you want). All NMI thing will of couse be still enabled with and witout pausing.
Heh, I even left that out in my code example. Eh, it was late. Anyway, he'll defintly need to do that or the pausing will be horrible. He'll prolly need to do something like that for other keys as well (depending on the kind of game he's making).