mirror of
https://github.com/pret/pokeyellow.git
synced 2026-05-11 05:05:21 -05:00
18 lines
273 B
NASM
18 lines
273 B
NASM
GetQuantityOfItemInBag: ; f735 (3:7735)
|
|
; In: b = item ID
|
|
; Out: b = how many of that item are in the bag
|
|
call GetPredefRegisters
|
|
ld hl, wNumBagItems
|
|
.loop
|
|
inc hl
|
|
ld a, [hli]
|
|
cp $ff
|
|
jr z, .notInBag
|
|
cp b
|
|
jr nz, .loop
|
|
ld a, [hl]
|
|
ld b, a
|
|
ret
|
|
.notInBag
|
|
ld b, 0
|
|
ret |