act: Added new rt value for previous inputs
authorLukas Krickl <lukas@krickl.dev>
Mon, 8 Sep 2025 03:57:29 +0000 (05:57 +0200)
committerLukas Krickl <lukas@krickl.dev>
Mon, 8 Sep 2025 03:57:29 +0000 (05:57 +0200)
src/defs.s
src/macros.inc
src/unit.s

index 8a63c0bb1c6eb46c346c9224dc64518686cba26b..3116db1d3bd6ed6e5020b850b302d50a9151df31 100644 (file)
   ; last collision with actor
   ; set during unit_collision_woth_any_other
 .de act_rt_collided_with, 2
+
        ; temporary buffer for any action picked
 .de act_rt_action_dat1, 1
 .de act_rt_action_dat2, 1
 
+       ; last direction this actor moved in
+       ; button press mirror
+       ; can be used to decide which sprite to display
+.de act_rt_prev_inputs, 1
+       ; generic timer
+       ; can be used for animations or other relevant timers
+       ; state switching may change this value.
+.de act_rt_timer, 1
+
   ; sub-tile drawing vars
   ; during this animation the actor is already technically in its new 
   ; location. the real location offset can be calculated with 
   ; 00c00000: c: sub tile enabled
 .de act_rt_sub_tile, 1
 
-  ; inventory/equipment
-  ; if type player use the file-specific inventory/equipment
-  ; for players.
-  ; for any other actor this contains information about the loot table
-  ; that can be generated by the map generator
-  ; loot tables are based on the current floor.
-.de act_rt_loot_table_dat, 2
-
   ; stats1
 .de act_level, 1
 .de act_hp, stat_size
index 29ed3815662130d52c70be2c445b70a5f0c13780..b3d149433bc6f4b186f8dd1085f7b9bca1c44027 100644 (file)
   ; act_rt_collided_with
   dw 0 
   .db 0  ; act_rt_sub_tile 
-  ; act_rt_loot_table_dat
-  dw 0
        ; act_rt_action_dat1/2
        .db 0, 0
+       
+       ; rt last inputs 
+       .db 0
+
+       ; rt timer
+       .db 0
 #endmacro
   
   ; defines an actor's stats (1/2)
index 9e315b80ca4cd4a10baf0012e2242d7befa4a984..a7f1bda51099d92a924832cfbbf6a6afb495156f 100644 (file)
@@ -294,6 +294,14 @@ unit_handle_inputs:
   ld bc, NULL
   push bc
 
+       
+       ; write inputs to unit input mirror 
+       ld hl, act_rt_prev_inputs
+       add hl, de
+       ld a, [curr_inputs]
+       ld [hl], a
+
+
        ld b, BTNA
        input_just
        ld hl, action_btna