pokered/engine/overworld/is_player_just_outside_map.asm

17 lines
305 B
NASM
Raw Normal View History

; returns whether the player is one tile outside the map in Z
IsPlayerJustOutsideMap: ; 128d8 (4:68d8)
2015-08-31 02:38:41 +00:00
ld a, [wYCoord]
ld b, a
2015-08-31 02:38:41 +00:00
ld a, [wCurMapHeight]
call .compareCoordWithMapDimension
ret z
2015-08-31 02:38:41 +00:00
ld a, [wXCoord]
ld b, a
2015-08-31 02:38:41 +00:00
ld a, [wCurMapWidth]
.compareCoordWithMapDimension
add a
cp b
ret z
inc b
ret