diff options
author | Rangi <remy.oukaour+rangi42@gmail.com> | 2020-07-07 18:50:58 -0400 |
---|---|---|
committer | Rangi <remy.oukaour+rangi42@gmail.com> | 2020-07-07 19:43:11 -0400 |
commit | bbf2f51a02b2544f1bef32a5868503b474ae2fef (patch) | |
tree | d73507228a57e4f3cece2fb93fe7df3a9439553f /home/item.asm | |
parent | 51ac538c25f8c0a6d88101569a17f02d09855d31 (diff) |
Move all code out of home.asm into home/
This results in 64 home/*.asm files, comparable to pokecrystal's 57.
Diffstat (limited to 'home/item.asm')
-rw-r--r-- | home/item.asm | 49 |
1 files changed, 49 insertions, 0 deletions
diff --git a/home/item.asm b/home/item.asm new file mode 100644 index 00000000..f27d46f4 --- /dev/null +++ b/home/item.asm @@ -0,0 +1,49 @@ +; uses an item +; UseItem is used with dummy items to perform certain other functions as well +; INPUT: +; [wcf91] = item ID +; OUTPUT: +; [wActionResultOrTookBattleTurn] = success +; 00: unsuccessful +; 01: successful +; 02: not able to be used right now, no extra menu displayed (only certain items use this) +UseItem:: + farjp UseItem_ + +; confirms the item toss and then tosses the item +; INPUT: +; hl = address of inventory (either wNumBagItems or wNumBoxItems) +; [wcf91] = item ID +; [wWhichPokemon] = index of item within inventory +; [wItemQuantity] = quantity to toss +; OUTPUT: +; clears carry flag if the item is tossed, sets carry flag if not +TossItem:: + ldh a, [hLoadedROMBank] + push af + ld a, BANK(TossItem_) + ldh [hLoadedROMBank], a + ld [MBC1RomBank], a + call TossItem_ + pop de + ld a, d + ldh [hLoadedROMBank], a + ld [MBC1RomBank], a + ret + +; checks if an item is a key item +; INPUT: +; [wcf91] = item ID +; OUTPUT: +; [wIsKeyItem] = result +; 00: item is not key item +; 01: item is key item +IsKeyItem:: + push hl + push de + push bc + farcall IsKeyItem_ + pop bc + pop de + pop hl + ret |