blob: 2a462b5d68feb2a20fbdf4041d0a096531d2ef9a (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
|
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
|