From 8874b41dbd3dd68043b3d193108bf4fea4017676 Mon Sep 17 00:00:00 2001 From: Lukas Krickl Date: Wed, 15 Jan 2025 05:48:43 +0100 Subject: [PATCH] actor: added mask for tile postions --- src/actor.s | 9 +++++++++ src/wram.s | 2 ++ 2 files changed, 11 insertions(+) diff --git a/src/actor.s b/src/actor.s index a8b63ec..aa68120 100644 --- a/src/actor.s +++ b/src/actor.s @@ -171,6 +171,15 @@ actor_anim_verify: call anim_clear ret + ; truncates the position + ; to only use the high nibble + ; inputs: + ; hl: ptr to y/x + ; returns: + ; hl: trunacted y/x +anim_truncate_pos: + ret + ; marks the current actor's tile ; as occupied by an actor ; also removes the flag from the actor's current tile diff --git a/src/wram.s b/src/wram.s index 58e3e26..d259311 100644 --- a/src/wram.s +++ b/src/wram.s @@ -113,6 +113,8 @@ damage_anim: .adv 1 .de room_exit_table, 2 ; list of ptrs to new rooms .de room_size, 0 +#define TILE_POS_MASK 0xF0 + ; room flags .se 1 ; set if a tile is a wall -- 2.30.2