From: Lukas Krickl Date: Sun, 16 Nov 2025 07:16:27 +0000 (+0100) Subject: debug: added suspend update call X-Git-Url: https://git.krickl.dev/?a=commitdiff_plain;h=a7a3c83bd2f67032f5e0ad67a0069268cfc576dc;p=gbrg%2F.git debug: added suspend update call --- 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