unit: wip unit switching
authorLukas Krickl <lukas@krickl.dev>
Tue, 13 May 2025 03:41:35 +0000 (05:41 +0200)
committerLukas Krickl <lukas@krickl.dev>
Tue, 13 May 2025 03:41:35 +0000 (05:41 +0200)
src/ui.s
src/unit.s
tiles/bank8800.inc

index 3970196cdf55dfd6391266284ff722ba5f513442..ab6b7e116e5f1176ae135de5c75cb95e16af6e46 100644 (file)
--- a/src/ui.s
+++ b/src/ui.s
@@ -1,4 +1,6 @@
-
+; draw one TILE_MOVE tile
+; in top row for each move remaining
+#define UI_TILE_MOVE 0xC0  
 
   ; inits UI
 ui_init:
index 72dbf8271c8beecbf0fbdb9369e3eb392b3897ba..d4cb1959020608628f3a0bea6719daf7031a66c3 100644 (file)
@@ -287,6 +287,23 @@ unit_switch_to_active:
   ; bc = next active state
 
   ret
+  
+  ; switches the current unit to idle
+  ; sets moves to 0 
+  ; inputs:
+  ;   de: unit
+unit_switch_to_idle:
+  ret
+
+  ; finds a unit with a higher initiative value 
+  ; than the current one that has moves > 0 set
+  ; if all unts have have 0 moves, set moves to 
+  ; initial value and try again
+  ; skips any ACT_T_NULL types
+  ; inputs:
+  ;   de: unit
+unit_next:
+  ret
 
 unit_demo_1:
   st_def 0x00, unit_demo_1_init, st_unit_demo_1_update
index c744cc3369ace7f26732421eb378ee52ac84c82e..03388e1e01da1b101136b47bbe5586bf6870999b 100644 (file)
 .chr 00000000
 ; tile 64
 .chr 00000000
-.chr 00000000
-.chr 00000000
-.chr 00000000
-.chr 00000000
-.chr 00000000
-.chr 00000000
-.chr 00000000
+.chr 00333000
+.chr 03232300
+.chr 32212230
+.chr 33111330
+.chr 32212230
+.chr 03232300
+.chr 00333000
 ; tile 65
 .chr 00000000
 .chr 00000000