.ResetToStartScreen LDX #$FF ; Set the stack pointer to $01FF, which is the standard TXS ; location for the 6502 stack, so this instruction ; effectively resets the stack JSR ResetVariables ; Reset all the RAM (in both the NES and cartridge), as ; it is in an undefined state when the NES is switched ; on, initialise all the game's variables, and switch to ; ROM bank 0 JMP ShowStartScreen ; Jump to ShowStartScreen in bank 0 to show the start ; screen and start the gameName: ResetToStartScreen [Show more] Type: Subroutine Category: Start and end Summary: Reset the stack and the game's variables and show the Start screenContext: See this subroutine in context in the source code References: This subroutine is called as follows: * DrawTitleScreen calls ResetToStartScreen
[X]
Subroutine ResetVariables (category: Start and end)
Reset all the RAM (in both the NES and cartridge), initialise all the game's variables, and switch to ROM bank 0
[X]
Subroutine ShowStartScreen (category: Start and end)
Show the start screen and start the game