I have a loop which repeatedly finds the sprite0 hit and colors the screen green after it occurs:
When I test this in Nestopia and Nintendulator, it works for some frames, but other frames the screen is 100% green with rendering disabled. This seems to occur randomly.
What's going on?
I've tried setting breakpoints on PPUMASK, but I see absolutely no difference between frames. The split seems to occur at the same time each frame, but for some reason it doesn't display that way.
(If you're wondering, my NMI does nothing but set the PPU registers and returns)
Code:
loop:
; Wait until sprite0 is cleared
:
bit PPUSTATUS
bvs :-
; Wait until sprite0 is set
:
bit PPUSTATUS
bvc :-
; Color the screen
lda #PPUMASK_EMPHASIZE_G | PPUMASK_GREYSCALE
sta PPUMASK
jmp loop
; Wait until sprite0 is cleared
:
bit PPUSTATUS
bvs :-
; Wait until sprite0 is set
:
bit PPUSTATUS
bvc :-
; Color the screen
lda #PPUMASK_EMPHASIZE_G | PPUMASK_GREYSCALE
sta PPUMASK
jmp loop
When I test this in Nestopia and Nintendulator, it works for some frames, but other frames the screen is 100% green with rendering disabled. This seems to occur randomly.
What's going on?
I've tried setting breakpoints on PPUMASK, but I see absolutely no difference between frames. The split seems to occur at the same time each frame, but for some reason it doesn't display that way.
(If you're wondering, my NMI does nothing but set the PPU registers and returns)