actor: added mask for tile postions
authorLukas Krickl <lukas@krickl.dev>
Wed, 15 Jan 2025 04:48:43 +0000 (05:48 +0100)
committerLukas Krickl <lukas@krickl.dev>
Wed, 15 Jan 2025 04:48:43 +0000 (05:48 +0100)
src/actor.s
src/wram.s

index a8b63ec221db32413989273ebf839a1c8ad3a12d..aa681205cb584e29838b2f3b362346039315e4d1 100644 (file)
@@ -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 
index 58e3e264148ca20127c88fac567bfc6a65f3a734..d259311c0d96445ecf36be539170d59594966f5e 100644 (file)
@@ -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