mirror of
https://github.com/thornAvery/kep-hack.git
synced 2026-02-21 22:52:15 +13:00
Add subdirectories to engine/ similar to pokecrystal
This commit is contained in:
parent
5559d51c86
commit
f275790aec
124 changed files with 342 additions and 346 deletions
18
engine/items/get_bag_item_quantity.asm
Normal file
18
engine/items/get_bag_item_quantity.asm
Normal file
|
|
@ -0,0 +1,18 @@
|
|||
GetQuantityOfItemInBag:
|
||||
; 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
|
||||
Loading…
Add table
Add a link
Reference in a new issue