; checks debug flags and decides if
; update should be suspended
+ ; calls debug_update
; inputs:
; debug_flags
; returns:
and a, DEBUG_F_ENABLE
jr z, @do_not_suspend REL
+ ; select button influences suspend
ld b, BTNSELECT
- input_held
+ input_just
jr nz, @do_not_suspend REL
@do_suspend:
ld a, 0
; debug mode is anebled here
; TODO: implement debug code
+ ; draw current update tile
+ ; using a cursor
+
@poll_toggle_debug:
; debug mode can be enabled by pressing select 4 times in a
; row as the only input
; clear oam
; TODO: only clear used OAM
call shadow_oam_clear
-
+ ; player should update even in debug mode
+ call player_update
+ call player_draw
+
+#ifdef DEBUG
; do we skip update this frame?
call debug_should_suspend_update
cp a, 0
ret z
+#endif
; tick rng every frame
call rand
- call player_update
- call player_draw
-
call enemy_update
call tile_update_selected
; to all adjacent tiles
; set to NULL if no tile is adjacent
; byte 0: h, byte 1: l
-tiles_adjacent: .adv 2 * TILES_ADJACENT_MAX
+tiles_adjacent: .adv ta_size * TILES_ADJACENT_MAX
ui_draw_routine: .adv 2