mirror of
https://github.com/pret/pokered.git
synced 2024-10-24 15:27:10 +00:00
17 lines
309 B
NASM
17 lines
309 B
NASM
|
; returns whether the player is one tile outside the map in Z
|
||
|
IsPlayerJustOutsideMap: ; 128d8 (4:68d8)
|
||
|
ld a, [W_YCOORD]
|
||
|
ld b, a
|
||
|
ld a, [W_CURMAPHEIGHT]
|
||
|
call .compareCoordWithMapDimension
|
||
|
ret z
|
||
|
ld a, [W_XCOORD]
|
||
|
ld b, a
|
||
|
ld a, [W_CURMAPWIDTH]
|
||
|
.compareCoordWithMapDimension
|
||
|
add a
|
||
|
cp b
|
||
|
ret z
|
||
|
inc b
|
||
|
ret
|