What is the correct order of the things that are done when the NMI interrupt hits?
Let's take these things:
- Reading the controller
- Saving the current sprite data to the CPU RAM address for DMA
- Making the address for sprite DMA known to the PPU
- Saving the current background and attribute data somewhere in the CPU RAM
- Drawing the background and attributes to the PPU
- Saving the current palette data somewhere in the CPU RAM
- Drawing the palettes to the PPU
- Setting the PPU parameters (intensify red, gren, blue etc., enabling sprites)
- Saving the current scrolling value somewhere in the CPU RAM
- Setting the scrolling value (+ nametable swap if necessary)
- Game logic (setting the game status according to the current input and the general variables)
In what order in the NMI do these steps have to be processed, so that everything works correcly?
And which ones of them only need to be done once at startup? (I assume "Making the address for sprite DMA known to the PPU" is only necessary once, right?)
Let's take these things:
- Reading the controller
- Saving the current sprite data to the CPU RAM address for DMA
- Making the address for sprite DMA known to the PPU
- Saving the current background and attribute data somewhere in the CPU RAM
- Drawing the background and attributes to the PPU
- Saving the current palette data somewhere in the CPU RAM
- Drawing the palettes to the PPU
- Setting the PPU parameters (intensify red, gren, blue etc., enabling sprites)
- Saving the current scrolling value somewhere in the CPU RAM
- Setting the scrolling value (+ nametable swap if necessary)
- Game logic (setting the game status according to the current input and the general variables)
In what order in the NMI do these steps have to be processed, so that everything works correcly?
And which ones of them only need to be done once at startup? (I assume "Making the address for sprite DMA known to the PPU" is only necessary once, right?)