debug: made debug menu interactive
authorLukas Krickl <lukas@krickl.dev>
Sun, 14 Sep 2025 15:59:11 +0000 (17:59 +0200)
committerLukas Krickl <lukas@krickl.dev>
Sun, 14 Sep 2025 15:59:11 +0000 (17:59 +0200)
src/debug.s
src/wram.s

index 408e8b604dbf89a4e6274b29d58767980b1c92c2..cb60f7e03a08aec7162a03571553bb4e98cd36f6 100644 (file)
@@ -13,7 +13,7 @@ debug_menu_str_table:
        dw str_dbg_clear_actors
 debug_menu_str_table_end:
 
-#define DEBUG_MENU_STR_TABLE_LEN (debug_menu_str_table_end - debug_menu_str_table)
+#define DEBUG_MENU_STR_TABLE_LEN (debug_menu_str_table_end - debug_menu_str_table) / 2
 
 debug_menu_action_table:
 debug_menu_action_table_end:
@@ -32,6 +32,13 @@ update_debug_menu:
                ret
 @notb:
 
+       ; update menu
+       ld a, [debug_menu_cursor]
+       ld hl, debug_menu_str_table
+       ld b, DEBUG_MENU_STR_TABLE_LEN
+       call select_menu_update
+       ld [debug_menu_cursor], a
+
        ldnull bc
        ret
 
@@ -46,7 +53,7 @@ debug_menu_init:
        ld [hl], a
 
        ; draw initial status line
-       ld a, [action_menu_cursor]
+       ld a, [debug_menu_cursor]
        ld b, DEBUG_MENU_STR_TABLE_LEN 
        ld hl, debug_menu_str_table
        call select_menu_draw_status
index ec5fac1e5297ada8095296af8e0e298767a243c1..82691c4db1664195e7e8d709c58ba6dc5c84bbfd 100644 (file)
@@ -74,6 +74,7 @@ redraw_shadow: .adv 2
 redraw_steps: .adv 1
 
 action_menu_cursor: .adv 1
+debug_menu_cursor: .adv 1
        
        ; simple menu delay timer
 select_menu_delay: .adv 1