From 35ca35294a08dff39c3f4cca9eb0e8c31436b6a3 Mon Sep 17 00:00:00 2001 From: Miquel Sabaté Solà Date: Fri, 20 Mar 2026 15:29:15 +0100 Subject: Don't rely on the 'y' register in Over::handle() MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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à --- src/over.s | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'src/over.s') diff --git a/src/over.s b/src/over.s index cca59ae..6fb1db1 100644 --- a/src/over.s +++ b/src/over.s @@ -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 -- cgit v1.2.3