From: Lukas Krickl Date: Sun, 16 Nov 2025 08:20:00 +0000 (+0100) Subject: debug: Added suspend resume code X-Git-Url: https://git.krickl.dev/?a=commitdiff_plain;h=30db795339f8823119a12c131b00a3e8692a58ec;p=gbrg%2F.git debug: Added suspend resume code --- 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