From: Lukas Krickl Date: Mon, 17 Nov 2025 09:47:58 +0000 (+0100) Subject: defs: Added type for tile adjacent struct X-Git-Url: https://git.krickl.dev/?a=commitdiff_plain;h=7e1acc303c041889a6be93966cf0c9b476b4846c;p=gbrg%2F.git defs: Added type for tile adjacent struct --- diff --git a/src/debug.s b/src/debug.s index 1096eef..c3703ce 100644 --- a/src/debug.s +++ b/src/debug.s @@ -1,6 +1,7 @@ ; checks debug flags and decides if ; update should be suspended + ; calls debug_update ; inputs: ; debug_flags ; returns: @@ -13,8 +14,9 @@ debug_should_suspend_update: 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 @@ -36,6 +38,9 @@ debug_update: ; 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 diff --git a/src/defs.s b/src/defs.s index 78aa15b..89f88c3 100644 --- a/src/defs.s +++ b/src/defs.s @@ -118,6 +118,11 @@ ; graphical tile .de t_tile, 1 .de t_size, 0 + + ; tile adjacent struct +.se 0 +.de ta_ptr, 2 +.de ta_size, 0 diff --git a/src/update.s b/src/update.s index f0c59b1..3bab360 100644 --- a/src/update.s +++ b/src/update.s @@ -5,19 +5,21 @@ update_game: ; 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 diff --git a/src/wram.s b/src/wram.s index 56e7588..4b66ea8 100644 --- a/src/wram.s +++ b/src/wram.s @@ -89,7 +89,7 @@ tiles_end: .adv 0 ; 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