From a7a3c83bd2f67032f5e0ad67a0069268cfc576dc Mon Sep 17 00:00:00 2001 From: Lukas Krickl Date: Sun, 16 Nov 2025 08:16:27 +0100 Subject: [PATCH] debug: added suspend update call --- src/debug.s | 14 ++++++++++++++ src/update.s | 11 +++++++---- 2 files changed, 21 insertions(+), 4 deletions(-) diff --git a/src/debug.s b/src/debug.s index 91d194a..0c13475 100644 --- a/src/debug.s +++ b/src/debug.s @@ -1,3 +1,17 @@ + + ; checks debug flags and decides if + ; update should be suspended + ; inputs: + ; debug_flags + ; returns: + ; flag z: 0 -> do not suspend + ; flag z: 1 -> do suspend +debug_should_suspend_update: + call debug_update + + ld a, [debug_flags] + and a, DEBUG_F_ENABLE + ret ; updates debug code ; when in debug mode the diff --git a/src/update.s b/src/update.s index 6252ae2..bc00a5a 100644 --- a/src/update.s +++ b/src/update.s @@ -2,13 +2,17 @@ update_game_over: ret update_game: - ; tick rng every frame - call rand - ; clear oam ; TODO: only clear used OAM call shadow_oam_clear + + ; do we skip update this frame? + call debug_should_suspend_update + ret nz + + ; tick rng every frame + call rand call player_update call player_draw @@ -19,7 +23,6 @@ update_game: call ui_update - call debug_update ; TODO: update map routine -- 2.30.2