kep-hack/engine/overworld/doors.asm
Rangi 0a62d48df2 Move more tables from engine/ to data/
This also splits the end of engine/battle/core.asm into engine/battle/effects.asm.
2020-06-23 17:50:50 -04:00

29 lines
481 B
NASM
Executable file

; returns whether the player is standing on a door tile in carry
IsPlayerStandingOnDoorTile:
push de
ld hl, DoorTileIDPointers
ld a, [wCurMapTileset]
ld de, $3
call IsInArray
pop de
jr nc, .notStandingOnDoor
inc hl
ld a, [hli]
ld h, [hl]
ld l, a
aCoord 8, 9 ; a = lower left background tile under player's sprite
ld b, a
.loop
ld a, [hli]
and a
jr z, .notStandingOnDoor
cp b
jr nz, .loop
scf
ret
.notStandingOnDoor
and a
ret
INCLUDE "data/door_tile_ids.asm"