projects
/
gbrg
/
.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
a7a3c83
)
debug: Added suspend resume code
author
Lukas Krickl
<lukas@krickl.dev>
Sun, 16 Nov 2025 08:20:00 +0000
(09:20 +0100)
committer
Lukas Krickl
<lukas@krickl.dev>
Sun, 16 Nov 2025 08:20:00 +0000
(09:20 +0100)
src/debug.s
patch
|
blob
|
history
src/update.s
patch
|
blob
|
history
diff --git
a/src/debug.s
b/src/debug.s
index 0c13475e646ae7a9e2c25c4f78d604dd8b83536c..1096eefba930c8c3be9d38df381dced023933a0c 100644
(file)
--- 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 bc00a5afc6a03728484fac846731b1175afbead6..f0c59b17002e56cb0553d9f67bb30843ab520018 100644
(file)
--- 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