summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorluckytyphlosion <alan.rj.huang@gmail.com>2015-05-17 18:24:52 -0400
committerluckytyphlosion <alan.rj.huang@gmail.com>2015-05-17 18:24:52 -0400
commit361f600d6d0864a3af8323383b99a806005f8f90 (patch)
treeca05ed613c127aafefca6c9643037408a3a63189
parentb5f5a16f43ef62680f09666073f07911306e1561 (diff)
Add IsTilePassable Function
-rw-r--r--engine/overworld/oam.asm16
1 files changed, 16 insertions, 0 deletions
diff --git a/engine/overworld/oam.asm b/engine/overworld/oam.asm
index b4247257..71eb297c 100644
--- a/engine/overworld/oam.asm
+++ b/engine/overworld/oam.asm
@@ -176,3 +176,19 @@ Func_4bd1: ; 4bd1 (1:4bd1)
and $f0
ld [de], a ; c1xb (x)
ret
+
+_IsTilePassable:: ; 4aaa (1:4aaa)
+ ld hl,W_TILESETCOLLISIONPTR ; pointer to list of passable tiles
+ ld a,[hli]
+ ld h,[hl]
+ ld l,a ; hl now points to passable tiles
+.loop
+ ld a,[hli]
+ cp a,$ff
+ jr z,.tileNotPassable
+ cp c
+ ret z
+ jr .loop
+.tileNotPassable
+ scf
+ ret \ No newline at end of file