From: Lukas Krickl Date: Sun, 10 Aug 2025 06:47:07 +0000 (+0200) Subject: objanim: the animation now overwrites player rt special flags X-Git-Url: https://git.krickl.dev/?a=commitdiff_plain;h=d0cc6b478d32ebd7ef18df7af6138bfd7b477c9a;p=gbrg%2F.git objanim: the animation now overwrites player rt special flags This makes it so the room is only uncovered when the animation finishes. --- diff --git a/src/objanim.s b/src/objanim.s index eaa0f00..ffd3b80 100644 --- a/src/objanim.s +++ b/src/objanim.s @@ -16,6 +16,7 @@ objanim_init: ; inputs: ; a: tile flags ; b: tile index + ; c: previous player rt special flags ; de: actor objanim_door_open: push de @@ -29,9 +30,10 @@ objanim_door_open: pop de ld hl, act_pos_y add hl, de ; hl = act y pos - - - xor a, a + + ; save palyer rt flags in flags + ; but invert CF_COVERED + ld a, c ld de, objanim+obja_flags ld [de], a inc de ; de = y pos @@ -66,6 +68,7 @@ objanim_door_open: objanim_door_open_fn: #define TMP_Y, scratch #define TMP_X, scratch+1 + call load_unit_obj ld de, objanim+st_size @@ -75,6 +78,9 @@ objanim_door_open_fn: ; de = anim flags ; set first object + ; reload rt flags from backup while the animation is playing + ld a, [de] + ld [player_rt_special_flags], a inc de ; skip flags ld a, [de] ; a = y position inc de ; de = x postion diff --git a/src/player.s b/src/player.s index 555d7ba..101244f 100644 --- a/src/player.s +++ b/src/player.s @@ -38,6 +38,7 @@ unit_player_update: and a, CF_COVERED ld b, a ld a, [player_rt_special_flags] + ld c, a ; remove door might needs this in c and a, (~CF_COVERED) & 0xFF or a, b ld [player_rt_special_flags], a