summaryrefslogtreecommitdiff
path: root/home.asm
diff options
context:
space:
mode:
authorYamaArashi <shadow962@live.com>2015-07-12 23:00:48 -0700
committerYamaArashi <shadow962@live.com>2015-07-12 23:00:48 -0700
commit4a8c9993ad182296131ef87111e1b6d6e2af4201 (patch)
treecd8044bd5b8e4b88501c2ccf7b006ef296a735ca /home.asm
parent99df5f0fd79f063ee4c7ec364eadd175a3d83c42 (diff)
named wram variables
Diffstat (limited to 'home.asm')
-rw-r--r--home.asm69
1 files changed, 36 insertions, 33 deletions
diff --git a/home.asm b/home.asm
index 06a0aec3..b9041fef 100644
--- a/home.asm
+++ b/home.asm
@@ -1201,8 +1201,8 @@ DisplayPokemartDialogue:: ; 2a2e (0:2a2e)
pop hl
inc hl
call LoadItemList
- ld a,$02
- ld [wListMenuID],a ; selects between subtypes of menus
+ ld a,PRICEDITEMLISTMENU
+ ld [wListMenuID],a
ld a,[H_LOADEDROMBANK]
push af
ld a,Bank(DisplayPokemartDialogue_)
@@ -1219,12 +1219,12 @@ PokemartGreetingText:: ; 2a55 (0:2a55)
db "@"
LoadItemList:: ; 2a5a (0:2a5a)
- ld a,$01
+ ld a,1
ld [wUpdateSpritesEnabled],a
ld a,h
- ld [wd128],a
+ ld [wItemListPointer],a
ld a,l
- ld [wd129],a
+ ld [wItemListPointer + 1],a
ld de,wStringBuffer2 + 11
.loop
ld a,[hli]
@@ -1336,7 +1336,7 @@ AddAmountSoldToMoney:: ; 2b9e (0:2b9e)
; INPUT:
; HL = address of inventory (either wNumBagItems or wNumBoxItems)
; [wWhichPokemon] = index (within the inventory) of the item to remove
-; [wcf96] = quantity to remove
+; [wItemQuantity] = quantity to remove
RemoveItemFromInventory:: ; 2bbb (0:2bbb)
ld a,[H_LOADEDROMBANK]
push af
@@ -1353,7 +1353,7 @@ RemoveItemFromInventory:: ; 2bbb (0:2bbb)
; INPUT:
; HL = address of inventory (either wNumBagItems or wNumBoxItems)
; [wcf91] = item ID
-; [wcf96] = item quantity
+; [wItemQuantity] = item quantity
; sets carry flag if successful, unsets carry flag if unsuccessful
AddItemToInventory:: ; 2bcf (0:2bcf)
push bc
@@ -1461,9 +1461,12 @@ DisplayListMenuIDLoop:: ; 2c53 (0:2c53)
.buttonAPressed
ld a,[wCurrentMenuItem]
call PlaceUnfilledArrowMenuCursor
+
+; pointless because both values are overwritten before they are read
ld a,$01
- ld [wd12e],a
- ld [wd12d],a
+ ld [wMenuExitMethod],a
+ ld [wChosenMenuItem],a
+
xor a
ld [wcc37],a
ld a,[wCurrentMenuItem]
@@ -1506,7 +1509,7 @@ DisplayListMenuIDLoop:: ; 2c53 (0:2c53)
; if it's an item menu
inc hl
ld a,[hl] ; a = item quantity
- ld [wcf97],a
+ ld [wMaxItemQuantity],a
.skipGettingQuantity
ld a,[wcf91]
ld [wd0b5],a
@@ -1527,10 +1530,10 @@ DisplayListMenuIDLoop:: ; 2c53 (0:2c53)
.storeChosenEntry ; store the menu entry that the player chose and return
ld de,wcd6d
call CopyStringToCF4B ; copy name to wcf4b
- ld a,$01
- ld [wd12e],a
+ ld a,CHOSE_MENU_ITEM
+ ld [wMenuExitMethod],a
ld a,[wCurrentMenuItem]
- ld [wd12d],a
+ ld [wChosenMenuItem],a
xor a
ld [hJoy7],a ; joypad state update flag
ld hl,wd730
@@ -1584,7 +1587,7 @@ DisplayChooseQuantityMenu:: ; 2d57 (0:2d57)
ld de,InitialQuantityText
call PlaceString
xor a
- ld [wcf96],a ; initialize current quantity to 0
+ ld [wItemQuantity],a ; initialize current quantity to 0
jp .incrementQuantity
.waitForKeyPressLoop
call JoypadLowSensitivity
@@ -1599,10 +1602,10 @@ DisplayChooseQuantityMenu:: ; 2d57 (0:2d57)
jr nz,.decrementQuantity
jr .waitForKeyPressLoop
.incrementQuantity
- ld a,[wcf97] ; max quantity
+ ld a,[wMaxItemQuantity]
inc a
ld b,a
- ld hl,wcf96 ; current quantity
+ ld hl,wItemQuantity ; current quantity
inc [hl]
ld a,[hl]
cp b
@@ -1612,11 +1615,11 @@ DisplayChooseQuantityMenu:: ; 2d57 (0:2d57)
ld [hl],a
jr .handleNewQuantity
.decrementQuantity
- ld hl,wcf96 ; current quantity
+ ld hl,wItemQuantity ; current quantity
dec [hl]
jr nz,.handleNewQuantity
; wrap to the max quantity if the player goes below 1
- ld a,[wcf97] ; max quantity
+ ld a,[wMaxItemQuantity]
ld [hl],a
.handleNewQuantity
hlCoord 17, 10
@@ -1625,7 +1628,7 @@ DisplayChooseQuantityMenu:: ; 2d57 (0:2d57)
jr nz,.printQuantity
.printPrice
ld c,$03
- ld a,[wcf96]
+ ld a,[wItemQuantity]
ld b,a
ld hl,$ff9f ; total price
; initialize total price to 0
@@ -1641,7 +1644,7 @@ DisplayChooseQuantityMenu:: ; 2d57 (0:2d57)
pop bc
dec b
jr nz,.addLoop
- ld a,[$ff8e]
+ ld a,[hHalveItemPrices]
and a ; should the price be halved (for selling items)?
jr z,.skipHalvingPrice
xor a
@@ -1666,7 +1669,7 @@ DisplayChooseQuantityMenu:: ; 2d57 (0:2d57)
call PrintBCDNumber
hlCoord 9, 10
.printQuantity
- ld de,wcf96 ; current quantity
+ ld de,wItemQuantity ; current quantity
ld bc,$8102 ; print leading zeroes, 1 byte, 2 digits
call PrintNumber
jp .waitForKeyPressLoop
@@ -1688,9 +1691,9 @@ SpacesBetweenQuantityAndPriceText:: ; 2e34 (0:2e34)
ExitListMenu:: ; 2e3b (0:2e3b)
ld a,[wCurrentMenuItem]
- ld [wd12d],a
- ld a,$02
- ld [wd12e],a
+ ld [wChosenMenuItem],a
+ ld a,CANCELLED_MENU
+ ld [wMenuExitMethod],a
ld [wcc37],a
xor a
ld [hJoy7],a
@@ -1775,7 +1778,7 @@ PrintListMenuEntries:: ; 2e5a (0:2e5a)
call PlaceString
pop de
pop hl
- ld a,[wcf93]
+ ld a,[wPrintItemPrices]
and a ; should prices be printed?
jr z,.skipPrintingItemPrice
.printItemPrice
@@ -1839,7 +1842,7 @@ PrintListMenuEntries:: ; 2e5a (0:2e5a)
ld a,[wd11e]
ld [wcf91],a
call IsKeyItem ; check if item is unsellable
- ld a,[wd124]
+ ld a,[wIsKeyItem]
and a ; is the item unsellable?
jr nz,.skipPrintingItemQuantity ; if so, don't print the quantity
push hl
@@ -1850,7 +1853,7 @@ PrintListMenuEntries:: ; 2e5a (0:2e5a)
ld a,[wd11e]
push af
ld a,[de]
- ld [wcf97],a
+ ld [wMaxItemQuantity],a
push de
ld de,wd11e
ld [de],a
@@ -2101,7 +2104,7 @@ UseItem:: ; 30bc (0:30bc)
; hl = address of inventory (either wNumBagItems or wNumBoxItems)
; [wcf91] = item ID
; [wWhichPokemon] = index of item within inventory
-; [wcf96] = quantity to toss
+; [wItemQuantity] = quantity to toss
; OUTPUT:
; clears carry flag if the item is tossed, sets carry flag if not
TossItem:: ; 30c4 (0:30c4)
@@ -2121,7 +2124,7 @@ TossItem:: ; 30c4 (0:30c4)
; INPUT:
; [wcf91] = item ID
; OUTPUT:
-; [wd124] = result
+; [wIsKeyItem] = result
; 00: item is not key item
; 01: item is key item
IsKeyItem:: ; 30d9 (0:30d9)
@@ -3826,13 +3829,13 @@ AddEnemyMonToPlayerParty:: ; 3a53 (0:3a53)
ld [MBC1RomBank], a
ret
-Func_3a68:: ; 3a68 (0:3a68)
+MoveMon:: ; 3a68 (0:3a68)
ld a, [H_LOADEDROMBANK]
push af
- ld a, BANK(MoveMon)
+ ld a, BANK(_MoveMon)
ld [H_LOADEDROMBANK], a
ld [MBC1RomBank], a
- call MoveMon
+ call _MoveMon
pop bc
ld a, b
ld [H_LOADEDROMBANK], a
@@ -4568,7 +4571,7 @@ GiveItem::
ld [wd11e], a
ld [wcf91], a
ld a, c
- ld [wcf96], a
+ ld [wItemQuantity], a
ld hl,wNumBagItems
call AddItemToInventory
ret nc