From 82ccd61a659e026e57a821bf0b387fd8eb14fe59 Mon Sep 17 00:00:00 2001 From: Lukas Krickl Date: Sat, 29 Mar 2025 06:22:26 +0100 Subject: [PATCH] ui: added stub for UI state --- src/defs.s | 4 +++- src/state.s | 7 ++++++- src/ui.s | 6 ++++++ 3 files changed, 15 insertions(+), 2 deletions(-) diff --git a/src/defs.s b/src/defs.s index ea82822..27c5286 100644 --- a/src/defs.s +++ b/src/defs.s @@ -65,10 +65,12 @@ .de st_time, 1 ; state routine (BE) ; it can return 0000 in hl - ; or a new state address in hl (LE) + ; or a new state address in hl (BE) ; if bc is not 0000 after ; the calling state's address ; will be set to bc immediatly + ; inputs for all state routines: + ; de: state pointer .de st_routine, 2 ; next state (BE) .de st_next, 2 diff --git a/src/state.s b/src/state.s index 2b3c136..a1446b3 100644 --- a/src/state.s +++ b/src/state.s @@ -26,7 +26,9 @@ st_update: pop de ret @update: - + ; de = actor ptr + pop de + push de call call_hl pop hl ; hl = original actor ptr = dst @@ -86,6 +88,9 @@ st_cursor_draw: st_cursor_delay: st_def CURSOR_MOVE_TIMER, st_null_fn, st_cursor +st_ui_building_selector: + st_def 0, ui_building_selector_update, st_ui_building_selector + st_update_game: st_def 0x00, update_game, st_update_game diff --git a/src/ui.s b/src/ui.s index 95910a5..86811f7 100644 --- a/src/ui.s +++ b/src/ui.s @@ -13,3 +13,9 @@ ui_draw: ld [hl], a ret + + ; ui building selector state +ui_building_selector_update: + + ldnull bc + ret -- 2.30.2