diff options
| author | Miquel Sabaté Solà <mssola@mssola.com> | 2026-03-20 15:29:15 +0100 |
|---|---|---|
| committer | Miquel Sabaté Solà <mssola@mssola.com> | 2026-03-20 15:29:15 +0100 |
| commit | 35ca35294a08dff39c3f4cca9eb0e8c31436b6a3 (patch) | |
| tree | eebfc62e11d5657e9b736bf660102c1ea68cb20f /src | |
| parent | f0ad3efa6969f121538e946719eb7c3704339f35 (diff) | |
| download | jetpac.nes-35ca35294a08dff39c3f4cca9eb0e8c31436b6a3.tar.gz jetpac.nes-35ca35294a08dff39c3f4cca9eb0e8c31436b6a3.zip | |
Don't rely on the 'y' register in Over::handle()
Some of the functions being called from within will in fact tamper with
this value. Hence, use the free 'Globals::zp_arg3' variable.
Signed-off-by: Miquel Sabaté Solà <mssola@mssola.com>
Diffstat (limited to 'src')
| -rw-r--r-- | src/over.s | 7 |
1 files changed, 4 insertions, 3 deletions
@@ -27,7 +27,8 @@ ;; It will set 1 to the 'a' register if the timer has run out, signaling ;; that the game can start over. Otherwise it sets 0 to the 'a' register. .proc handle - ldy #0 + lda #0 + sta Globals::zp_arg3 ;; Has the "Game over" screen been displayed? If not do it now. lda Over::zp_displayed @@ -38,13 +39,13 @@ @do_handle: lda Over::zp_timer bne @dec_timer - iny + inc Globals::zp_arg3 beq @end @dec_timer: dec Over::zp_timer @end: - tya + lda Globals::zp_arg3 rts .endproc |
