mirror of
https://gitlab.com/xCrystal/pokecrystal-board.git
synced 2024-09-09 09:51:34 -07:00
30 lines
381 B
NASM
Executable File
30 lines
381 B
NASM
Executable File
StepTowardsNextSpace::
|
|
ld a, [wCurSpaceNextSpace]
|
|
call LoadTempSpaceData
|
|
ld a, [wTempSpaceXCoord]
|
|
ld c, a
|
|
ld a, [wXCoord]
|
|
cp c
|
|
jr z, .check_y
|
|
ld a, D_RIGHT
|
|
jr c, .done
|
|
ld a, D_LEFT
|
|
jr .done
|
|
|
|
.check_y
|
|
ld a, [wTempSpaceYCoord]
|
|
ld c, a
|
|
ld a, [wYCoord]
|
|
cp c
|
|
jr z, .arrived
|
|
ld a, D_DOWN
|
|
jr c, .done
|
|
ld a, D_UP
|
|
jr .done
|
|
|
|
.arrived
|
|
xor a
|
|
.done
|
|
ld [wCurInput], a
|
|
ret
|