--- /dev/null
+ ; game state for action menu selector
+ ; the action menu allows the player to select
+ ; any action the character can perform
+ ; it also allows binding an action to the B button
+ ; by pressing select
+ ; inputs:
+ ; de: state
+ ; returns:
+ ; bc: next state
+update_action_menu:
+ ldnull bc
+ ret
+
+ ; transitions from the current state
+ ; to action menu
+action_menu_init:
+ ld hl, game_mode
+ ld de, st_next
+ add hl, de
+ ; write st_update_action_menu to st_next
+ ld a, st_update_action_menu LO
+ ld [hl+], a
+ ld a, st_update_action_menu HI
+ ld [hl], a
+
+ ret
#include "objanim.s"
#include "battle.s"
#include "action.s"
+#include "action_menu.s"
+#include "select_menu.s"
; fill bank
.fill 0xFF, 0x4000 - $
--- /dev/null
+ ; a select menu is any menu that allows the player to select
+ ; a range of values
+ ; writes current string to status line and requests an update
+ ; if the direction keys are pressed
+ ; inputs:
+ ; hl: string ptr table
+ ; b: table length
+ ; a: current slection value
+ ; returns:
+ ; a: selection value
+ ; b: button pressed
+select_menu_update:
+ ret
call unit_handle_assigned_action
push bc ; bc = next state
@nota:
+
+ ld b, BTNSELECT
+ input_just
+ jr z, @notselect REL
+ pop bc
+ call action_menu_init
+ push bc ; bc = next state
+@notselect:
ld b, BTNUP
input_held
st_def 0x00, update_pause, st_update_pause
st_update_game_over:
st_def 0x00, update_game_over, st_update_game_over
+
+st_update_action_menu:
+ st_def 0x00, update_action_menu, st_update_action_menu