defs: Added type for tile adjacent struct
authorLukas Krickl <lukas@krickl.dev>
Mon, 17 Nov 2025 09:47:58 +0000 (10:47 +0100)
committerLukas Krickl <lukas@krickl.dev>
Mon, 17 Nov 2025 09:47:58 +0000 (10:47 +0100)
src/debug.s
src/defs.s
src/update.s
src/wram.s

index 1096eefba930c8c3be9d38df381dced023933a0c..c3703cee4e39d4838f3863102d2e624764609a6e 100644 (file)
@@ -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
index 78aa15b69e60daa7f5a16e43e6eae723a8d8f77e..89f88c34801f4db3e101f917aee7a381dcd68f6b 100644 (file)
        ; graphical tile
 .de t_tile, 1
 .de t_size, 0
+       
+       ; tile adjacent struct
+.se 0
+.de ta_ptr, 2
+.de ta_size, 0
 
 
        
index f0c59b17002e56cb0553d9f67bb30843ab520018..3bab360a41907d45c40710781bf48ef5a7fbacfd 100644 (file)
@@ -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
index 56e7588b6f3c16d2e6b87da921e635fa656dea75..4b66ea8629bbe5a85245c2b6ca24aff8e5da420f 100644 (file)
@@ -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