From: Lukas Krickl Date: Tue, 13 May 2025 03:41:35 +0000 (+0200) Subject: unit: wip unit switching X-Git-Url: https://git.krickl.dev/?a=commitdiff_plain;h=5de43509e6be2916c9c1c065927137897362c423;p=gbrg%2F.git unit: wip unit switching --- diff --git a/src/ui.s b/src/ui.s index 3970196..ab6b7e1 100644 --- 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: diff --git a/src/unit.s b/src/unit.s index 72dbf82..d4cb195 100644 --- a/src/unit.s +++ b/src/unit.s @@ -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 diff --git a/tiles/bank8800.inc b/tiles/bank8800.inc index c744cc3..03388e1 100644 --- a/tiles/bank8800.inc +++ b/tiles/bank8800.inc @@ -576,13 +576,13 @@ .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