ui: added stub for UI state
authorLukas Krickl <lukas@krickl.dev>
Sat, 29 Mar 2025 05:22:26 +0000 (06:22 +0100)
committerLukas Krickl <lukas@krickl.dev>
Sat, 29 Mar 2025 05:22:26 +0000 (06:22 +0100)
src/defs.s
src/state.s
src/ui.s

index ea8282205360ea3c94c0a501c19fdbba10c4e521..27c528616470e86b996b728ea405f75fe6e77701 100644 (file)
 .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
index 2b3c13618bb56b8202be94e2fc17d3b21a22f01f..a1446b3e8de3733b090cfeaba645226c6c5f157f 100644 (file)
@@ -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
 
index 95910a5d6064ee754a05543cf90d8c89449f381e..86811f77edd567e95d349f2d73674e48efe367d1 100644 (file)
--- 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