3 ms·
I love stuff like this. Seeing the disassembly somehow adds to the nostalgia for a childhood pastime. What's this endlessloop for: https://gist.github.com/1wEr
by webXL 9y ago
I love stuff like this. Seeing the disassembly somehow adds to the nostalgia for a childhood pastime.
What's this endlessloop for: https://gist.github.com/1wErt3r/4048722#file-smbdis-asm-L712 https://gist.github.com/1wErt3r/4048722#file-smbdis-asm-L712
(Yes, please ;)
- jepler 9y agoYou can see that just above the endless loop, the code will "enable NMIs". I'm not sure about the nomenclature here (because normally NMI stands for non-maskable interrupts, meaning you can't disable them) but basically the game at this point becomes event (interrupt) driven, probably from the vertical retrace interrupt or another kind of timer interrupt. When no event is being handled, the CPU idles within this endless loop.
- jepler 9y agohttps://wiki.nesdev.com/w/index.php/PPU_registers#Controller_.28.242000.29_.3E_write https://wiki.nesdev.com/w/index.php/PPU_registers#Controller... states that bit 7 of the register at $2000 (which they call PPUCTRL, and this disassembly calls PPU_CTRL_REG1) will "generate an NMI at the start of the vertical blanking interval"