From: Lukas Krickl Date: Mon, 8 Sep 2025 03:57:29 +0000 (+0200) Subject: act: Added new rt value for previous inputs X-Git-Url: https://git.krickl.dev/?a=commitdiff_plain;h=17c79e718c3a675e8a257b531b193f27ef2d06a1;p=gbrg%2F.git act: Added new rt value for previous inputs --- diff --git a/src/defs.s b/src/defs.s index 8a63c0b..3116db1 100644 --- a/src/defs.s +++ b/src/defs.s @@ -180,10 +180,20 @@ ; 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 @@ -192,14 +202,6 @@ ; 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 diff --git a/src/macros.inc b/src/macros.inc index 29ed381..b3d1494 100644 --- a/src/macros.inc +++ b/src/macros.inc @@ -186,10 +186,14 @@ ; 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) diff --git a/src/unit.s b/src/unit.s index 9e315b8..a7f1bda 100644 --- a/src/unit.s +++ b/src/unit.s @@ -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