mirror of
https://github.com/pret/pokegold-spaceworld.git
synced 2026-09-28 21:51:01 -04:00
f7e5260f01
This syncs the label with pokegold/pokecrystal.
24 lines
260 B
NASM
24 lines
260 B
NASM
IsInArray::
|
|
; Find value a for every de bytes in array hl.
|
|
; Return index in b and carry if found.
|
|
|
|
ld b, 0
|
|
ld c, a
|
|
.loop
|
|
ld a, [hl]
|
|
cp -1
|
|
jr z, .NotInArray
|
|
cp c
|
|
jr z, .InArray
|
|
inc b
|
|
add hl, de
|
|
jr .loop
|
|
|
|
.NotInArray:
|
|
and a
|
|
ret
|
|
|
|
.InArray:
|
|
scf
|
|
ret
|