Talk:The frame and NMIs: Difference between revisions

From NESdev Wiki
Jump to navigationJump to search
No edit summary
(Pokémon does this)
Line 4: Line 4:
first instruction in the NMI would be 'inc nmi_nest_level', and last NMI instruction (before RTI) would be 'dec nmi_nest_level'
first instruction in the NMI would be 'inc nmi_nest_level', and last NMI instruction (before RTI) would be 'dec nmi_nest_level'
the NMI routine would check the nest_level variable, if it is higher than 1, then you could could the play music, then exit.  To avoid corrupting temporary variables in the music play routine, you would need to guarantee that the music routine can never be interrupted. [[User:Memblers|Memblers]] ([[User talk:Memblers|talk]]) 23:17, 6 October 2014 (MDT)
the NMI routine would check the nest_level variable, if it is higher than 1, then you could could the play music, then exit.  To avoid corrupting temporary variables in the music play routine, you would need to guarantee that the music routine can never be interrupted. [[User:Memblers|Memblers]] ([[User talk:Memblers|talk]]) 23:17, 6 October 2014 (MDT)
* ''Pokémon Red and Blue'' for Game Boy Color appear to do exactly this. You can hear the music lag and then catch up. If that effect is desirable, you could edit it into the article. (''Klax'' for NES and ''Tetris'' for Game Boy lag and don't catch up.) --[[User:Tepples|Tepples]] ([[User talk:Tepples|talk]]) 08:03, 8 October 2014 (MDT)

Revision as of 14:03, 8 October 2014

quote "You can't keep the music updated during slowdown, or during bulk drawing transitions, because NMIs will be disabled"

Sure you can (while keeping NMIs enabled, I mean). I'm not sure if I should edit it in, I don't want to turning a newbie-friendly article into a technical dorkfest, but I was thinking of this: first instruction in the NMI would be 'inc nmi_nest_level', and last NMI instruction (before RTI) would be 'dec nmi_nest_level' the NMI routine would check the nest_level variable, if it is higher than 1, then you could could the play music, then exit. To avoid corrupting temporary variables in the music play routine, you would need to guarantee that the music routine can never be interrupted. Memblers (talk) 23:17, 6 October 2014 (MDT)

  • Pokémon Red and Blue for Game Boy Color appear to do exactly this. You can hear the music lag and then catch up. If that effect is desirable, you could edit it into the article. (Klax for NES and Tetris for Game Boy lag and don't catch up.) --Tepples (talk) 08:03, 8 October 2014 (MDT)