summaryrefslogtreecommitdiff
path: root/engine/items
diff options
context:
space:
mode:
Diffstat (limited to 'engine/items')
-rw-r--r--engine/items/buy_sell_toss.asm24
-rw-r--r--engine/items/item_effects.asm12
-rw-r--r--engine/items/items.asm48
-rw-r--r--engine/items/mart.asm18
-rw-r--r--engine/items/pack.asm40
-rw-r--r--engine/items/tmhm.asm4
6 files changed, 73 insertions, 73 deletions
diff --git a/engine/items/buy_sell_toss.asm b/engine/items/buy_sell_toss.asm
index 310deaeb8..16dce8353 100644
--- a/engine/items/buy_sell_toss.asm
+++ b/engine/items/buy_sell_toss.asm
@@ -29,7 +29,7 @@ SelectQuantityToSell:
Toss_Sell_Loop:
ld a, 1
- ld [wItemQuantityChangeBuffer], a
+ ld [wItemQuantityChange], a
.loop
call BuySellToss_UpdateQuantityDisplay ; update display
call BuySellToss_InterpretJoypad ; joy action
@@ -71,10 +71,10 @@ BuySellToss_InterpretJoypad:
ret
.down
- ld hl, wItemQuantityChangeBuffer
+ ld hl, wItemQuantityChange
dec [hl]
jr nz, .finish_down
- ld a, [wItemQuantityBuffer]
+ ld a, [wItemQuantity]
ld [hl], a
.finish_down
@@ -82,9 +82,9 @@ BuySellToss_InterpretJoypad:
ret
.up
- ld hl, wItemQuantityChangeBuffer
+ ld hl, wItemQuantityChange
inc [hl]
- ld a, [wItemQuantityBuffer]
+ ld a, [wItemQuantity]
cp [hl]
jr nc, .finish_up
ld [hl], 1
@@ -94,7 +94,7 @@ BuySellToss_InterpretJoypad:
ret
.left
- ld a, [wItemQuantityChangeBuffer]
+ ld a, [wItemQuantityChange]
sub 10
jr c, .load_1
jr z, .load_1
@@ -104,22 +104,22 @@ BuySellToss_InterpretJoypad:
ld a, 1
.finish_left
- ld [wItemQuantityChangeBuffer], a
+ ld [wItemQuantityChange], a
and a
ret
.right
- ld a, [wItemQuantityChangeBuffer]
+ ld a, [wItemQuantityChange]
add 10
ld b, a
- ld a, [wItemQuantityBuffer]
+ ld a, [wItemQuantity]
cp b
jr nc, .finish_right
ld b, a
.finish_right
ld a, b
- ld [wItemQuantityChangeBuffer], a
+ ld [wItemQuantityChange], a
and a
ret
@@ -130,7 +130,7 @@ BuySellToss_UpdateQuantityDisplay:
add hl, de
ld [hl], "×"
inc hl
- ld de, wItemQuantityChangeBuffer
+ ld de, wItemQuantityChange
lb bc, PRINTNUM_LEADINGZEROS | 1, 2
call PrintNum
ld a, [wMenuDataPointer]
@@ -163,7 +163,7 @@ BuySell_MultiplyPrice:
ldh [hMultiplicand + 1], a
ld a, [wBuySellItemPrice + 1]
ldh [hMultiplicand + 2], a
- ld a, [wItemQuantityChangeBuffer]
+ ld a, [wItemQuantityChange]
ldh [hMultiplier], a
push hl
call Multiply
diff --git a/engine/items/item_effects.asm b/engine/items/item_effects.asm
index 05cb7fbbd..eaff68fc2 100644
--- a/engine/items/item_effects.asm
+++ b/engine/items/item_effects.asm
@@ -1,6 +1,6 @@
_DoItemEffect::
ld a, [wCurItem]
- ld [wNamedObjectIndexBuffer], a
+ ld [wNamedObjectIndex], a
call GetItemName
call CopyName1
ld a, 1
@@ -566,7 +566,7 @@ PokeBallEffect:
call PrintText
ld a, [wCurPartySpecies]
- ld [wNamedObjectIndexBuffer], a
+ ld [wNamedObjectIndex], a
call GetPokemonName
call YesNoBox
@@ -626,7 +626,7 @@ PokeBallEffect:
call PrintText
ld a, [wCurPartySpecies]
- ld [wNamedObjectIndexBuffer], a
+ ld [wNamedObjectIndex], a
call GetPokemonName
call YesNoBox
@@ -702,7 +702,7 @@ PokeBallEffect:
.toss
ld hl, wNumItems
inc a
- ld [wItemQuantityChangeBuffer], a
+ ld [wItemQuantityChange], a
jp TossItem
.used_park_ball
@@ -2333,7 +2333,7 @@ RestorePPEffect:
push hl
ld a, [hl]
- ld [wNamedObjectIndexBuffer], a
+ ld [wNamedObjectIndex], a
call GetMoveName
call CopyName1
pop hl
@@ -2594,7 +2594,7 @@ UseItemText:
UseDisposableItem:
ld hl, wNumItems
ld a, 1
- ld [wItemQuantityChangeBuffer], a
+ ld [wItemQuantityChange], a
jp TossItem
UseBallInTrainerBattle:
diff --git a/engine/items/items.asm b/engine/items/items.asm
index cfdd4a4c5..1f9cb4437 100644
--- a/engine/items/items.asm
+++ b/engine/items/items.asm
@@ -4,7 +4,7 @@ _ReceiveItem::
push hl
call CheckItemPocket
pop de
- ld a, [wItemAttributeParamBuffer]
+ ld a, [wItemAttributeValue]
dec a
ld hl, .Pockets
rst JumpTable
@@ -45,7 +45,7 @@ _TossItem::
push hl
call CheckItemPocket
pop de
- ld a, [wItemAttributeParamBuffer]
+ ld a, [wItemAttributeValue]
dec a
ld hl, .Pockets
rst JumpTable
@@ -88,7 +88,7 @@ _CheckItem::
push hl
call CheckItemPocket
pop de
- ld a, [wItemAttributeParamBuffer]
+ ld a, [wItemAttributeValue]
dec a
ld hl, .Pockets
rst JumpTable
@@ -172,7 +172,7 @@ PutItemInPocket:
sub [hl]
add b
ld b, a
- ld a, [wItemQuantityChangeBuffer]
+ ld a, [wItemQuantityChange]
cp b
jr z, .ok
jr c, .ok
@@ -194,8 +194,8 @@ PutItemInPocket:
ld l, e
ld a, [wCurItem]
ld c, a
- ld a, [wItemQuantityChangeBuffer]
- ld [wItemQuantityBuffer], a
+ ld a, [wItemQuantityChange]
+ ld [wItemQuantity], a
.loop2
inc hl
ld a, [hli]
@@ -203,7 +203,7 @@ PutItemInPocket:
jr z, .terminator2
cp c
jr nz, .loop2
- ld a, [wItemQuantityBuffer]
+ ld a, [wItemQuantity]
add [hl]
cp MAX_ITEM_STACK + 1
jr nc, .newstack
@@ -213,14 +213,14 @@ PutItemInPocket:
.newstack
ld [hl], MAX_ITEM_STACK
sub MAX_ITEM_STACK
- ld [wItemQuantityBuffer], a
+ ld [wItemQuantity], a
jr .loop2
.terminator2
dec hl
ld a, [wCurItem]
ld [hli], a
- ld a, [wItemQuantityBuffer]
+ ld a, [wItemQuantity]
ld [hli], a
ld [hl], -1
ld h, d
@@ -264,13 +264,13 @@ RemoveItemFromPocket:
jr .loop
.skip
- ld a, [wItemQuantityChangeBuffer]
+ ld a, [wItemQuantityChange]
ld b, a
ld a, [hl]
sub b
jr c, .nope
ld [hl], a
- ld [wItemQuantityBuffer], a
+ ld [wItemQuantity], a
and a
jr nz, .yup
dec hl
@@ -406,7 +406,7 @@ ReceiveTMHM:
ld b, 0
ld hl, wTMsHMs
add hl, bc
- ld a, [wItemQuantityChangeBuffer]
+ ld a, [wItemQuantityChange]
add [hl]
cp MAX_ITEM_STACK + 1
jr nc, .toomany
@@ -423,13 +423,13 @@ TossTMHM:
ld b, 0
ld hl, wTMsHMs
add hl, bc
- ld a, [wItemQuantityChangeBuffer]
+ ld a, [wItemQuantityChange]
ld b, a
ld a, [hl]
sub b
jr c, .nope
ld [hl], a
- ld [wItemQuantityBuffer], a
+ ld [wItemQuantity], a
jr nz, .yup
ld a, [wTMHMPocketScrollPosition]
and a
@@ -492,7 +492,7 @@ GetNumberedTMHM:
ret
_CheckTossableItem::
-; Return 1 in wItemAttributeParamBuffer and carry if wCurItem can't be removed from the bag.
+; Return 1 in wItemAttributeValue and carry if wCurItem can't be removed from the bag.
ld a, ITEMATTR_PERMISSIONS
call GetItemAttr
bit CANT_TOSS_F, a
@@ -501,7 +501,7 @@ _CheckTossableItem::
ret
CheckSelectableItem:
-; Return 1 in wItemAttributeParamBuffer and carry if wCurItem can't be selected.
+; Return 1 in wItemAttributeValue and carry if wCurItem can't be selected.
ld a, ITEMATTR_PERMISSIONS
call GetItemAttr
bit CANT_SELECT_F, a
@@ -510,28 +510,28 @@ CheckSelectableItem:
ret
CheckItemPocket::
-; Return the pocket for wCurItem in wItemAttributeParamBuffer.
+; Return the pocket for wCurItem in wItemAttributeValue.
ld a, ITEMATTR_POCKET
call GetItemAttr
and $f
- ld [wItemAttributeParamBuffer], a
+ ld [wItemAttributeValue], a
ret
CheckItemContext:
-; Return the context for wCurItem in wItemAttributeParamBuffer.
+; Return the context for wCurItem in wItemAttributeValue.
ld a, ITEMATTR_HELP
call GetItemAttr
and $f
- ld [wItemAttributeParamBuffer], a
+ ld [wItemAttributeValue], a
ret
CheckItemMenu:
-; Return the menu for wCurItem in wItemAttributeParamBuffer.
+; Return the menu for wCurItem in wItemAttributeValue.
ld a, ITEMATTR_HELP
call GetItemAttr
swap a
and $f
- ld [wItemAttributeParamBuffer], a
+ ld [wItemAttributeValue], a
ret
GetItemAttr:
@@ -546,7 +546,7 @@ GetItemAttr:
add hl, bc
xor a
- ld [wItemAttributeParamBuffer], a
+ ld [wItemAttributeValue], a
ld a, [wCurItem]
dec a
@@ -562,7 +562,7 @@ GetItemAttr:
ItemAttr_ReturnCarry:
ld a, 1
- ld [wItemAttributeParamBuffer], a
+ ld [wItemAttributeValue], a
scf
ret
diff --git a/engine/items/mart.asm b/engine/items/mart.asm
index 875e6d5cc..6234cafbe 100644
--- a/engine/items/mart.asm
+++ b/engine/items/mart.asm
@@ -339,7 +339,7 @@ BuyMenu:
xor a
ld [wMenuScrollPositionBackup], a
ld a, 1
- ld [wMenuCursorBufferBackup], a
+ ld [wMenuCursorPositionBackup], a
.loop
call BuyMenuLoop ; menu loop
jr nc, .loop
@@ -431,15 +431,15 @@ BuyMenuLoop:
call UpdateSprites
ld hl, MenuHeader_Buy
call CopyMenuHeader
- ld a, [wMenuCursorBufferBackup]
- ld [wMenuCursorBuffer], a
+ ld a, [wMenuCursorPositionBackup]
+ ld [wMenuCursorPosition], a
ld a, [wMenuScrollPositionBackup]
ld [wMenuScrollPosition], a
call ScrollingMenu
ld a, [wMenuScrollPosition]
ld [wMenuScrollPositionBackup], a
ld a, [wMenuCursorY]
- ld [wMenuCursorBufferBackup], a
+ ld [wMenuCursorPositionBackup], a
call SpeechTextbox
ld a, [wMenuJoypad]
cp B_BUTTON
@@ -499,7 +499,7 @@ BuyMenuLoop:
StandardMartAskPurchaseQuantity:
ld a, MAX_ITEM_STACK
- ld [wItemQuantityBuffer], a
+ ld [wItemQuantity], a
ld a, MARTTEXT_HOW_MANY
call LoadBuyMenuText
farcall SelectQuantityToBuy
@@ -515,7 +515,7 @@ MartConfirmPurchase:
BargainShopAskPurchaseQuantity:
ld a, 1
- ld [wItemQuantityChangeBuffer], a
+ ld [wItemQuantityChange], a
ld a, [wMartItemID]
ld e, a
ld d, 0
@@ -558,7 +558,7 @@ RooftopSaleAskPurchaseQuantity:
call LoadBuyMenuText
call .GetSalePrice
ld a, MAX_ITEM_STACK
- ld [wItemQuantityBuffer], a
+ ld [wItemQuantity], a
farcall RooftopSale_SelectQuantityToBuy
call ExitMenu
ret
@@ -734,7 +734,7 @@ SellMenu:
.TryToSellItem:
farcall CheckItemMenu
- ld a, [wItemAttributeParamBuffer]
+ ld a, [wItemAttributeValue]
ld hl, .dw
rst JumpTable
ret
@@ -753,7 +753,7 @@ SellMenu:
.try_sell
farcall _CheckTossableItem
- ld a, [wItemAttributeParamBuffer]
+ ld a, [wItemAttributeValue]
and a
jr z, .okay_to_sell
ld hl, MartCantBuyText
diff --git a/engine/items/pack.asm b/engine/items/pack.asm
index 17662cf60..0a50bbb7c 100644
--- a/engine/items/pack.asm
+++ b/engine/items/pack.asm
@@ -74,7 +74,7 @@ Pack:
ld hl, ItemsPocketMenuHeader
call CopyMenuHeader
ld a, [wItemsPocketCursor]
- ld [wMenuCursorBuffer], a
+ ld [wMenuCursorPosition], a
ld a, [wItemsPocketScrollPosition]
ld [wMenuScrollPosition], a
call ScrollingMenu
@@ -102,7 +102,7 @@ Pack:
ld hl, KeyItemsPocketMenuHeader
call CopyMenuHeader
ld a, [wKeyItemsPocketCursor]
- ld [wMenuCursorBuffer], a
+ ld [wMenuCursorPosition], a
ld a, [wKeyItemsPocketScrollPosition]
ld [wMenuScrollPosition], a
call ScrollingMenu
@@ -135,7 +135,7 @@ Pack:
call Pack_InterpretJoypad
ret c
farcall _CheckTossableItem
- ld a, [wItemAttributeParamBuffer]
+ ld a, [wItemAttributeValue]
and a
jr nz, .use_quit
ld hl, .MenuHeader2
@@ -224,7 +224,7 @@ Pack:
ld hl, BallsPocketMenuHeader
call CopyMenuHeader
ld a, [wBallsPocketCursor]
- ld [wMenuCursorBuffer], a
+ ld [wMenuCursorPosition], a
ld a, [wBallsPocketScrollPosition]
ld [wMenuScrollPosition], a
call ScrollingMenu
@@ -241,29 +241,29 @@ Pack:
.ItemBallsKey_LoadSubmenu:
farcall _CheckTossableItem
- ld a, [wItemAttributeParamBuffer]
+ ld a, [wItemAttributeValue]
and a
jr nz, .tossable
farcall CheckSelectableItem
- ld a, [wItemAttributeParamBuffer]
+ ld a, [wItemAttributeValue]
and a
jr nz, .selectable
farcall CheckItemMenu
- ld a, [wItemAttributeParamBuffer]
+ ld a, [wItemAttributeValue]
and a
jr nz, .usable
jr .unusable
.selectable
farcall CheckItemMenu
- ld a, [wItemAttributeParamBuffer]
+ ld a, [wItemAttributeValue]
and a
jr nz, .selectable_usable
jr .selectable_unusable
.tossable
farcall CheckSelectableItem
- ld a, [wItemAttributeParamBuffer]
+ ld a, [wItemAttributeValue]
and a
jr nz, .tossable_selectable
jr .tossable_unselectable
@@ -424,7 +424,7 @@ Jumptable_GiveTossQuit:
UseItem:
farcall CheckItemMenu
- ld a, [wItemAttributeParamBuffer]
+ ld a, [wItemAttributeValue]
ld hl, .dw
rst JumpTable
ret
@@ -529,7 +529,7 @@ ResetPocketCursorPositions: ; unreferenced
RegisterItem:
farcall CheckSelectableItem
- ld a, [wItemAttributeParamBuffer]
+ ld a, [wItemAttributeValue]
and a
jr nz, .cant_register
ld a, [wCurPocket]
@@ -683,7 +683,7 @@ BattlePack:
ld hl, ItemsPocketMenuHeader
call CopyMenuHeader
ld a, [wItemsPocketCursor]
- ld [wMenuCursorBuffer], a
+ ld [wMenuCursorPosition], a
ld a, [wItemsPocketScrollPosition]
ld [wMenuScrollPosition], a
call ScrollingMenu
@@ -711,7 +711,7 @@ BattlePack:
ld hl, KeyItemsPocketMenuHeader
call CopyMenuHeader
ld a, [wKeyItemsPocketCursor]
- ld [wMenuCursorBuffer], a
+ ld [wMenuCursorPosition], a
ld a, [wKeyItemsPocketScrollPosition]
ld [wMenuScrollPosition], a
call ScrollingMenu
@@ -762,7 +762,7 @@ BattlePack:
ld hl, BallsPocketMenuHeader
call CopyMenuHeader
ld a, [wBallsPocketCursor]
- ld [wMenuCursorBuffer], a
+ ld [wMenuCursorPosition], a
ld a, [wBallsPocketScrollPosition]
ld [wMenuScrollPosition], a
call ScrollingMenu
@@ -779,7 +779,7 @@ BattlePack:
ItemSubmenu:
farcall CheckItemContext
- ld a, [wItemAttributeParamBuffer]
+ ld a, [wItemAttributeValue]
TMHMSubmenu:
and a
jr z, .NoUse
@@ -834,7 +834,7 @@ TMHMSubmenu:
.Use:
farcall CheckItemContext
- ld a, [wItemAttributeParamBuffer]
+ ld a, [wItemAttributeValue]
ld hl, .ItemFunctionJumptable
rst JumpTable
ret
@@ -951,7 +951,7 @@ DepositSellPack:
ld hl, PC_Mart_ItemsPocketMenuHeader
call CopyMenuHeader
ld a, [wItemsPocketCursor]
- ld [wMenuCursorBuffer], a
+ ld [wMenuCursorPosition], a
ld a, [wItemsPocketScrollPosition]
ld [wMenuScrollPosition], a
call ScrollingMenu
@@ -967,7 +967,7 @@ DepositSellPack:
ld hl, PC_Mart_KeyItemsPocketMenuHeader
call CopyMenuHeader
ld a, [wKeyItemsPocketCursor]
- ld [wMenuCursorBuffer], a
+ ld [wMenuCursorPosition], a
ld a, [wKeyItemsPocketScrollPosition]
ld [wMenuScrollPosition], a
call ScrollingMenu
@@ -992,7 +992,7 @@ DepositSellPack:
ld hl, PC_Mart_BallsPocketMenuHeader
call CopyMenuHeader
ld a, [wBallsPocketCursor]
- ld [wMenuCursorBuffer], a
+ ld [wMenuCursorPosition], a
ld a, [wBallsPocketScrollPosition]
ld [wMenuScrollPosition], a
call ScrollingMenu
@@ -1415,7 +1415,7 @@ INCBIN "gfx/pack/pack_menu.tilemap"
Pack_GetItemName:
ld a, [wCurItem]
- ld [wNamedObjectIndexBuffer], a
+ ld [wNamedObjectIndex], a
call GetItemName
call CopyName1
ret
diff --git a/engine/items/tmhm.asm b/engine/items/tmhm.asm
index 2e0cde341..9786b950f 100644
--- a/engine/items/tmhm.asm
+++ b/engine/items/tmhm.asm
@@ -15,7 +15,7 @@ TMHMPocket:
ld b, 0
add hl, bc
ld a, [hl]
- ld [wItemQuantityBuffer], a
+ ld [wItemQuantity], a
call .ConvertItemToTMHMNumber
scf
ret
@@ -377,7 +377,7 @@ TMHM_DisplayPocketItems:
ld [wTempTMHM], a
.okay
predef GetTMHMMove
- ld a, [wNamedObjectIndexBuffer]
+ ld a, [wNamedObjectIndex]
ld [wPutativeTMHMMove], a
call GetMoveName
pop hl