From 3302f760f1461bc4582c99ee2e4ed0ccc1d5b186 Mon Sep 17 00:00:00 2001 From: Miquel Sabaté Solà Date: Fri, 6 Mar 2026 16:14:17 +0100 Subject: Don't toggle pause from a holded button MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit If you just holded the Select or Start buttons, it would be forever toggling pause/unpause, which is an unexpected behavior. Fix this by saving which value from the joypad was previously read. With this, whenever the pause timer reaches zero, we can check whether either button is still pressed, and avoid toggling if that is the case. Signed-off-by: Miquel Sabaté Solà --- src/driver.s | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/driver.s b/src/driver.s index c4bd8e7..2b61e17 100644 --- a/src/driver.s +++ b/src/driver.s @@ -173,8 +173,13 @@ lda zp_pause_timer bne @skip_pause_handling - ;; The timer is zero and the player asked to pause, let's reset the - ;; timer. + ;; The timer reached zero, but is the player actually just holding the + ;; button? If so ignore it until it unholds it. + eor Joypad::zp_prev + and #(Joypad::BUTTON_START | Joypad::BUTTON_SELECT) + bne @skip_pause_handling + + ;; Let's reset the timer. lda #PAUSE_TIMER_VALUE sta zp_pause_timer -- cgit v1.2.3