aboutsummaryrefslogtreecommitdiff
path: root/src/driver.s
diff options
context:
space:
mode:
authorMiquel Sabaté Solà <mssola@mssola.com>2026-03-07 23:11:09 +0100
committerMiquel Sabaté Solà <mssola@mssola.com>2026-03-07 23:11:09 +0100
commite8f39dc4a7cc19fb97e24ec0819ccd964cbd325f (patch)
tree2392d04e46abe4c1e112a027b81f63b6b3c05ffd /src/driver.s
parent60f21153e18ccf45cb120d50f6d5f5c860de78f2 (diff)
downloadjetpac.nes-e8f39dc4a7cc19fb97e24ec0819ccd964cbd325f.tar.gz
jetpac.nes-e8f39dc4a7cc19fb97e24ec0819ccd964cbd325f.zip
Initialize 'zp_pause_toggle' before NMI enablement
Otherwise we might randomly get weird scenarios like the title screen not showing up properly. Fixes: bc99212539f6 ("Toggle a "Paused" message on top of the screen") Signed-off-by: Miquel Sabaté Solà <mssola@mssola.com>
Diffstat (limited to 'src/driver.s')
-rw-r--r--src/driver.s10
1 files changed, 9 insertions, 1 deletions
diff --git a/src/driver.s b/src/driver.s
index 1449de5..1ac5718 100644
--- a/src/driver.s
+++ b/src/driver.s
@@ -49,6 +49,15 @@
;; this, but we have plenty of RAM left.
zp_pause_toggle = $39
+ ;; Initialization routine that is to be called before enabling NMIs back for
+ ;; the first time.
+ .proc init_before_nmi
+ lda #0
+ sta Driver::zp_pause_toggle
+
+ rts
+ .endproc
+
;; Switch from the title screen to the main screen. Note that this function
;; is to be called with the PPU disabled. If that's not the case, then it
;; will set the proper values to disable it on the next `nmi` call and set
@@ -157,7 +166,6 @@
lda #0
sta zp_pause_timer
sta Driver::zp_moved_out
- sta Driver::zp_pause_toggle
;; Initialize variables for sprite cycling.
sta zp_next_bullet_cycle