aboutsummaryrefslogtreecommitdiffstats
path: root/home
diff options
context:
space:
mode:
authorSylvie <35663410+Rangi42@users.noreply.github.com>2024-08-04 10:05:33 -0400
committerGitHub <noreply@github.com>2024-08-04 10:05:33 -0400
commit77d051479bd0ed96cc2efdba52f837afd1e119c3 (patch)
tree72a22aeb8dd6edc10323f0ee72fe9dbf73e5481a /home
parentIdentify wcd6d as wNameBuffer and others (#455) (diff)
downloadpokeyellow-77d051479bd0ed96cc2efdba52f837afd1e119c3.tar.gz
pokeyellow-77d051479bd0ed96cc2efdba52f837afd1e119c3.tar.xz
pokeyellow-77d051479bd0ed96cc2efdba52f837afd1e119c3.zip
Identify wcf91 as wCurPartySpecies, wCurItem, and wCurListMenuItem (#457)
Diffstat (limited to 'home')
-rw-r--r--home/give.asm4
-rw-r--r--home/inventory.asm2
-rw-r--r--home/item.asm6
-rw-r--r--home/item_price.asm4
-rw-r--r--home/list_menu.asm14
-rw-r--r--home/pics.asm2
-rw-r--r--home/pokemon.asm8
7 files changed, 21 insertions, 19 deletions
diff --git a/home/give.asm b/home/give.asm
index 128367ec..8ede4ea4 100644
--- a/home/give.asm
+++ b/home/give.asm
@@ -4,7 +4,7 @@ GiveItem::
; Return carry on success.
ld a, b
ld [wd11e], a
- ld [wcf91], a
+ ld [wCurItem], a
ld a, c
ld [wItemQuantity], a
ld hl, wNumBagItems
@@ -18,7 +18,7 @@ GiveItem::
GivePokemon::
; Give the player monster b at level c.
ld a, b
- ld [wcf91], a
+ ld [wCurPartySpecies], a
ld a, c
ld [wCurEnemyLevel], a
xor a ; PLAYER_PARTY_DATA
diff --git a/home/inventory.asm b/home/inventory.asm
index 1100666f..e4f9a261 100644
--- a/home/inventory.asm
+++ b/home/inventory.asm
@@ -28,7 +28,7 @@ RemoveItemFromInventory::
; function to add an item (in varying quantities) to the player's bag or PC box
; INPUT:
; HL = address of inventory (either wNumBagItems or wNumBoxItems)
-; [wcf91] = item ID
+; [wCurItem] = item ID
; [wItemQuantity] = item quantity
; sets carry flag if successful, unsets carry flag if unsuccessful
AddItemToInventory::
diff --git a/home/item.asm b/home/item.asm
index f27d46f4..9e7f02f9 100644
--- a/home/item.asm
+++ b/home/item.asm
@@ -1,7 +1,7 @@
; uses an item
; UseItem is used with dummy items to perform certain other functions as well
; INPUT:
-; [wcf91] = item ID
+; [wCurItem] = item ID
; OUTPUT:
; [wActionResultOrTookBattleTurn] = success
; 00: unsuccessful
@@ -13,7 +13,7 @@ UseItem::
; confirms the item toss and then tosses the item
; INPUT:
; hl = address of inventory (either wNumBagItems or wNumBoxItems)
-; [wcf91] = item ID
+; [wCurItem] = item ID
; [wWhichPokemon] = index of item within inventory
; [wItemQuantity] = quantity to toss
; OUTPUT:
@@ -33,7 +33,7 @@ TossItem::
; checks if an item is a key item
; INPUT:
-; [wcf91] = item ID
+; [wCurItem] = item ID
; OUTPUT:
; [wIsKeyItem] = result
; 00: item is not key item
diff --git a/home/item_price.asm b/home/item_price.asm
index 98eb31b1..a71f655f 100644
--- a/home/item_price.asm
+++ b/home/item_price.asm
@@ -1,6 +1,6 @@
GetItemPrice::
; Stores item's price as BCD at hItemPrice (3 bytes)
-; Input: [wcf91] = item id
+; Input: [wCurItem] = item id
ldh a, [hLoadedROMBank]
push af
ld a, [wListMenuID]
@@ -15,7 +15,7 @@ GetItemPrice::
ld a, [hli]
ld h, [hl]
ld l, a
- ld a, [wcf91] ; a contains item id
+ ld a, [wCurItem]
cp HM01
jr nc, .getTMPrice
ld bc, $3
diff --git a/home/list_menu.asm b/home/list_menu.asm
index 3d864222..ca369a82 100644
--- a/home/list_menu.asm
+++ b/home/list_menu.asm
@@ -124,28 +124,30 @@ DisplayListMenuIDLoop::
ld b, 0
add hl, bc
ld a, [hl]
- ld [wcf91], a
+ ld [wCurListMenuItem], a
ld a, [wListMenuID]
and a ; PCPOKEMONLISTMENU?
jr z, .pokemonList
+; if it's an item menu
+ assert wCurListMenuItem == wCurItem
push hl
call GetItemPrice
pop hl
ld a, [wListMenuID]
cp ITEMLISTMENU
jr nz, .skipGettingQuantity
-; if it's an item menu
inc hl
ld a, [hl] ; a = item quantity
ld [wMaxItemQuantity], a
.skipGettingQuantity
- ld a, [wcf91]
+ ld a, [wCurItem]
ld [wd0b5], a
ld a, BANK(ItemNames)
ld [wPredefBank], a
call GetName
jr .storeChosenEntry
.pokemonList
+ assert wCurListMenuItem == wCurPartySpecies
ld hl, wPartyCount
ld a, [wListPointer]
cp l ; is it a list of party pokemon or box pokemon?
@@ -413,8 +415,8 @@ PrintListMenuEntries::
push hl
ld a, [de]
ld de, ItemPrices
- ld [wcf91], a
- call GetItemPrice ; get price
+ ld [wCurItem], a
+ call GetItemPrice
pop hl
ld bc, SCREEN_WIDTH + 5 ; 1 row down and 5 columns right
add hl, bc
@@ -468,7 +470,7 @@ PrintListMenuEntries::
jr nz, .nextListEntry
.printItemQuantity
ld a, [wd11e]
- ld [wcf91], a
+ ld [wCurItem], a
call IsKeyItem ; check if item is unsellable
ld a, [wIsKeyItem]
and a ; is the item unsellable?
diff --git a/home/pics.asm b/home/pics.asm
index 3bce1532..73ee35d7 100644
--- a/home/pics.asm
+++ b/home/pics.asm
@@ -16,7 +16,7 @@ UncompressMonSprite::
; $4A ≤ index < $74: bank $B ("Pics 3")
; $74 ≤ index < $99: bank $C ("Pics 4")
; $99 ≤ index: bank $D ("Pics 5")
- ld a, [wcf91]
+ ld a, [wCurPartySpecies]
ld b, a
cp MEW
ld a, BANK(MewPicFront)
diff --git a/home/pokemon.asm b/home/pokemon.asm
index b228f086..9fcf5622 100644
--- a/home/pokemon.asm
+++ b/home/pokemon.asm
@@ -77,7 +77,7 @@ DrawHPBar::
; 02: current box
; 03: daycare
; OUTPUT:
-; [wcf91] = pokemon ID
+; [wCurPartySpecies] = pokemon ID
; wLoadedMon = base address of pokemon data
; wMonHeader = base address of base stats
LoadMonData::
@@ -101,7 +101,7 @@ LoadFrontSpriteByMonIndex::
push hl
ld a, [wd11e]
push af
- ld a, [wcf91]
+ ld a, [wCurPartySpecies]
ld [wd11e], a
predef IndexToPokedex
ld hl, wd11e
@@ -115,7 +115,7 @@ LoadFrontSpriteByMonIndex::
jr c, .validDexNumber ; dex >#151 invalid
.invalidDexNumber
ld a, RHYDON ; $1
- ld [wcf91], a
+ ld [wCurPartySpecies], a
ret
.validDexNumber
push hl
@@ -264,7 +264,7 @@ HandlePartyMenuInput::
ld c, a
add hl, bc
ld a, [hl]
- ld [wcf91], a
+ ld [wCurPartySpecies], a
ld [wBattleMonSpecies2], a
call BankswitchBack
and a