attack: Added direction UI setup.
authorLukas Krickl <lukas@krickl.dev>
Sat, 16 Aug 2025 06:20:58 +0000 (08:20 +0200)
committerLukas Krickl <lukas@krickl.dev>
Sat, 16 Aug 2025 06:20:58 +0000 (08:20 +0200)
src/action.s
src/defs.s
src/strings.s
tiles/bank8C00.inc

index 0b8929ac534433d6517fb4255f1a3622d9512585..196d5d316aa981c71d322128df8774e2df953418 100644 (file)
@@ -6,15 +6,15 @@ actions_new_game_init:
        ld hl, action_btna  
        
        ; default A button action
-       ld a, st_action_attack HI 
+       ld a, st_action_attack_init HI 
        ld [hl+], a
-       ld a, st_action_attack LO 
+       ld a, st_action_attack_init LO 
        ld [hl+], a
 
        ; default B button action
-       ld a, st_action_attack HI
+       ld a, st_action_attack_init HI
        ld [hl+], a
-       ld a, st_action_attack LO 
+       ld a, st_action_attack_init LO 
        ld [hl+], a
 
        ret
@@ -38,10 +38,28 @@ unit_handle_assigned_action:
        ;               de: unit
        ;       returns:
        ;               bc: next action
+unit_action_attack_pick_direction_init:
+       ; draw question to status line
+       ld hl, STR_ATTACK_DIRECTION
+       ld de, UI_STATUS_LINE
+       call puts
+
+       call ui_request_redraw
+       
+       ldnull bc
+       ret
+       
+       ; reads player direction inputs to pick a direction
+       ; inputs:
+       ;               de: unit
+       ;       returns:
+       ;               bc: next action
 unit_action_attack_pick_direction:
        ldnull bc
        ret
 
        ; default attack state
-st_action_attack:
-       st_def 0x00, unit_action_attack_pick_direction, st_action_attack 
+st_action_attack_init:
+       st_def 0x00, unit_action_attack_pick_direction_init, st_action_attack_pick_direction 
+st_action_attack_pick_direction:
+       st_def 0x00, unit_action_attack_pick_direction, st_action_attack_pick_direction
index 85579ed95ca9a7b989771c8957a3b82d9959abe5..6ea6df3c86d292575eefcbd76989d01f20a3d83c 100644 (file)
@@ -5,6 +5,8 @@
 
 #define FLOOR_MAP_COUNT 9
 
+#define UI_STATUS_LINE shadow_ui+1
+
 .def int OAMDMAFN = 0xFF80 
 #define WRAM 0xC000
 #define WRAMLEN 0xFFF
index 24b7c1a091953da40c77ab3b7f7cfb58dd6f5cc1..830996d251190e242956e9fbb961fc36d37c7011 100644 (file)
@@ -12,6 +12,9 @@
 ; one tile after Z
 .scc 0x20 = 26+11 
 
+; map ?
+.scc '?' = 26+13 
+
 STR_TITLE:
 .str "gbrg"
 .db 0
@@ -47,6 +50,10 @@ STR_FILE3:
 
 STR_DELETE:
 .str "DELETE"
+.db 0
+
+STR_ATTACK_DIRECTION:
+.str "attack direction?"
 .db 0
 
   ; print a 0-terminated string to the screen 
index cb99a4b60b9b8b9ae29e3453acb25baa6e5d5f8a..527a34e14446dbbdf114257571e572934beb7909 100644 (file)
 .chr 22333222
 .chr 22332222
 ; tile 54
-.chr 00000000
-.chr 00000000
-.chr 00000000
-.chr 00000000
-.chr 00000000
-.chr 00000000
-.chr 00000000
-.chr 00000000
+.chr 22333322
+.chr 22333332
+.chr 22222332
+.chr 22233332
+.chr 22233222
+.chr 22222222
+.chr 22233222
+.chr 22233222
 ; tile 55
 .chr 00000000
 .chr 00000000