ret
@notb:
+ ; on up enter debug mode
+ ld b, BTNUP
+ input_just
+ jr z, @notup REL
+ ; load debug menu
+ call debug_menu_init
+ ldnull bc
+ ret
+@notup:
+
; update menu
ld a, [action_menu_cursor]
ld hl, action_menu_str_table
--- /dev/null
+; this is a helper file for a debug menu
+
+str_dbg_new_game:
+.str "RELOAD"
+.db 0
+
+str_dbg_clear_actors:
+.str "CLEAR ACTORS"
+.db 0
+
+debug_menu_str_table:
+ dw str_dbg_new_game
+ 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)
+
+debug_menu_action_table:
+debug_menu_action_table_end:
+
+ ; updates the debug menu
+ ; inputs:
+ ; de: state
+ ; returns:
+ ; bc: next state
+update_debug_menu:
+ ; exit debug menu on b press
+ ld b, BTNB
+ input_just
+ jr z, @notb REL
+ ld bc, st_update_game
+ ret
+@notb:
+
+ ldnull bc
+ ret
+
+debug_menu_init:
+ ld hl, game_mode
+ ld de, st_next
+ add hl, de
+ ; write st_update_debug_menu to std_Next
+ ld a, st_update_debug_menu LO
+ ld [hl+], a
+ ld a, st_update_debug_menu HI
+ ld [hl], a
+
+ ; draw initial status line
+ ld a, [action_menu_cursor]
+ ld b, DEBUG_MENU_STR_TABLE_LEN
+ ld hl, debug_menu_str_table
+ call select_menu_draw_status
+ ret
st_update_action_menu:
st_def 0x00, update_action_menu, st_update_action_menu
+
+st_update_debug_menu:
+ st_def 0x00, update_debug_menu, st_update_debug_menu