debug: Added suspend resume code
authorLukas Krickl <lukas@krickl.dev>
Sun, 16 Nov 2025 08:20:00 +0000 (09:20 +0100)
committerLukas Krickl <lukas@krickl.dev>
Sun, 16 Nov 2025 08:20:00 +0000 (09:20 +0100)
src/debug.s
src/update.s

index 0c13475e646ae7a9e2c25c4f78d604dd8b83536c..1096eefba930c8c3be9d38df381dced023933a0c 100644 (file)
@@ -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 
index bc00a5afc6a03728484fac846731b1175afbead6..f0c59b17002e56cb0553d9f67bb30843ab520018 100644 (file)
@@ -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