I almost titled this post "Schrodinger's Breakpoints". Anyway:
In my current project, once the player loses, they need to press start to go back to the main menu and reset everything. The code for this is just a copy of the reset vector (sans waiting for 2 vblanks, and overwiting the stack.). Here's where things get odd. Whenever this code is supposed to run, it never does, but when I set breakpoints in places where the code SHOULD write were it to run, it works perfectly. I thought that it might be an issue with the outdated fceuxdsp 1.07 that I was using, but running it on newer emulators also fails to reset things properly.
heres the code I run:
In my current project, once the player loses, they need to press start to go back to the main menu and reset everything. The code for this is just a copy of the reset vector (sans waiting for 2 vblanks, and overwiting the stack.). Here's where things get odd. Whenever this code is supposed to run, it never does, but when I set breakpoints in places where the code SHOULD write were it to run, it works perfectly. I thought that it might be an issue with the outdated fceuxdsp 1.07 that I was using, but running it on newer emulators also fails to reset things properly.
heres the code I run:
Code:
...stuff here to check to see if I am pressing start
;/ Clear the RAM
lda #$00
ldx #$00
@ramloop:
sta $0000 , x
sta $0200 , x
sta $0300 , x
sta $0400 , x
sta $0500 , x
sta $0600 , x
sta $0700 , x
inx
bne @ramloop
;\
lda #$00 ;. Disable Rendering
sta $2000
sta $2001
jsr initialize_sound
jsr initialize_vars
jsr initialize_graphics
lda #%10000001
sta $2000
lda #%00011110 ;. Show the background & the sprites
sta $2001
jmp endInput
;/ Clear the RAM
lda #$00
ldx #$00
@ramloop:
sta $0000 , x
sta $0200 , x
sta $0300 , x
sta $0400 , x
sta $0500 , x
sta $0600 , x
sta $0700 , x
inx
bne @ramloop
;\
lda #$00 ;. Disable Rendering
sta $2000
sta $2001
jsr initialize_sound
jsr initialize_vars
jsr initialize_graphics
lda #%10000001
sta $2000
lda #%00011110 ;. Show the background & the sprites
sta $2001
jmp endInput