From 30db795339f8823119a12c131b00a3e8692a58ec Mon Sep 17 00:00:00 2001 From: Lukas Krickl Date: Sun, 16 Nov 2025 09:20:00 +0100 Subject: [PATCH] debug: Added suspend resume code --- src/debug.s | 15 +++++++++++++-- src/update.s | 3 ++- 2 files changed, 15 insertions(+), 3 deletions(-) diff --git a/src/debug.s b/src/debug.s index 0c13475..1096eef 100644 --- a/src/debug.s +++ b/src/debug.s @@ -4,14 +4,25 @@ ; inputs: ; debug_flags ; returns: - ; flag z: 0 -> do not suspend - ; flag z: 1 -> do suspend + ; a: 0 -> do not suspend + ; a: 1 -> do suspend debug_should_suspend_update: call debug_update ld a, [debug_flags] and a, DEBUG_F_ENABLE + jr z, @do_not_suspend REL + + ld b, BTNSELECT + input_held + jr nz, @do_not_suspend REL +@do_suspend: + ld a, 0 ret +@do_not_suspend: + ld a, 1 + ret + ; updates debug code ; when in debug mode the diff --git a/src/update.s b/src/update.s index bc00a5a..f0c59b1 100644 --- a/src/update.s +++ b/src/update.s @@ -9,7 +9,8 @@ update_game: ; do we skip update this frame? call debug_should_suspend_update - ret nz + cp a, 0 + ret z ; tick rng every frame call rand -- 2.30.2