debug: added suspend update call
authorLukas Krickl <lukas@krickl.dev>
Sun, 16 Nov 2025 07:16:27 +0000 (08:16 +0100)
committerLukas Krickl <lukas@krickl.dev>
Sun, 16 Nov 2025 07:16:27 +0000 (08:16 +0100)
src/debug.s
src/update.s

index 91d194ae60b262812ce58122100f88f64b159862..0c13475e646ae7a9e2c25c4f78d604dd8b83536c 100644 (file)
@@ -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 
index 6252ae27010115a5b59a40076d64da5dbdb667a7..bc00a5afc6a03728484fac846731b1175afbead6 100644 (file)
@@ -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