mirror of
https://github.com/pret/pokered.git
synced 2024-10-24 15:27:10 +00:00
27 lines
465 B
NASM
27 lines
465 B
NASM
|
; checks if the mon in wWhichPokemon already knows the move in $d0e0
|
||
|
CheckIfMoveIsKnown: ; 2fe18 (b:7e18)
|
||
|
ld a, [wWhichPokemon]
|
||
|
ld hl, W_PARTYMON1_MOVE1
|
||
|
ld bc, $2c
|
||
|
call AddNTimes
|
||
|
ld a, [$d0e0]
|
||
|
ld b, a
|
||
|
ld c, $4 ; nubmer of moves
|
||
|
.loop
|
||
|
ld a, [hli]
|
||
|
cp b
|
||
|
jr z, .alreadyKnown ; found a match
|
||
|
dec c
|
||
|
jr nz, .loop
|
||
|
and a
|
||
|
ret
|
||
|
.alreadyKnown
|
||
|
ld hl, AlreadyKnowsText
|
||
|
call PrintText
|
||
|
scf
|
||
|
ret
|
||
|
|
||
|
AlreadyKnowsText: ; 2fe3b (b:7e3b)
|
||
|
TX_FAR _AlreadyKnowsText
|
||
|
db "@"
|