Remove all address comments

This commit is contained in:
mid-kid
2018-06-24 16:09:41 +02:00
parent 131875d3e3
commit 1d9a68dbdd
616 changed files with 12133 additions and 20380 deletions

View File

@@ -1,13 +1,12 @@
SelectQuantityToToss: ; 24fbf
SelectQuantityToToss:
ld hl, TossItem_MenuHeader
call LoadMenuHeader
call Toss_Sell_Loop
ret
; 24fc9
SelectQuantityToBuy: ; 24fc9
SelectQuantityToBuy:
farcall GetItemPrice
RooftopSale_SelectQuantityToBuy: ; 24fcf
RooftopSale_SelectQuantityToBuy:
ld a, d
ld [wBuffer1], a
ld a, e
@@ -16,9 +15,8 @@ RooftopSale_SelectQuantityToBuy: ; 24fcf
call LoadMenuHeader
call Toss_Sell_Loop
ret
; 24fe1
SelectQuantityToSell: ; 24fe1
SelectQuantityToSell:
farcall GetItemPrice
ld a, d
ld [wBuffer1], a
@@ -28,9 +26,8 @@ SelectQuantityToSell: ; 24fe1
call LoadMenuHeader
call Toss_Sell_Loop
ret
; 24ff9
Toss_Sell_Loop: ; 24ff9
Toss_Sell_Loop:
ld a, 1
ld [wItemQuantityChangeBuffer], a
.loop
@@ -45,9 +42,8 @@ Toss_Sell_Loop: ; 24ff9
.nope
and a
ret
; 2500e
BuySellToss_InterpretJoypad: ; 2500e
BuySellToss_InterpretJoypad:
call JoyTextDelay_ForcehJoyDown ; get joypad
bit B_BUTTON_F, c
jr nz, .b
@@ -126,9 +122,8 @@ BuySellToss_InterpretJoypad: ; 2500e
ld [wItemQuantityChangeBuffer], a
and a
ret
; 25072
BuySellToss_UpdateQuantityDisplay: ; 25072
BuySellToss_UpdateQuantityDisplay:
call MenuBox
call MenuBoxCoord2Tile
ld de, SCREEN_WIDTH + 1
@@ -145,26 +140,22 @@ BuySellToss_UpdateQuantityDisplay: ; 25072
ld a, [wMenuDataBank]
call FarCall_de
ret
; 25097
ret_25097: ; 25097
ret_25097:
ret
; 25098
DisplayPurchasePrice: ; 25098
DisplayPurchasePrice:
call BuySell_MultiplyPrice
call BuySell_DisplaySubtotal
ret
; 2509f
DisplaySellingPrice: ; 2509f
DisplaySellingPrice:
call BuySell_MultiplyPrice
call Sell_HalvePrice
call BuySell_DisplaySubtotal
ret
; 250a9
BuySell_MultiplyPrice: ; 250a9
BuySell_MultiplyPrice:
xor a
ld [hMultiplicand + 0], a
ld a, [wBuffer1]
@@ -177,9 +168,8 @@ BuySell_MultiplyPrice: ; 250a9
call Multiply
pop hl
ret
; 250c1
Sell_HalvePrice: ; 250c1
Sell_HalvePrice:
push hl
ld hl, hProduct + 1
ld a, [hl]
@@ -193,9 +183,8 @@ Sell_HalvePrice: ; 250c1
ld [hl], a
pop hl
ret
; 250d1
BuySell_DisplaySubtotal: ; 250d1
BuySell_DisplaySubtotal:
push hl
ld hl, hMoneyTemp
ld a, [hProduct + 1]
@@ -211,7 +200,6 @@ BuySell_DisplaySubtotal: ; 250d1
call PrintNum
call WaitBGMap
ret
; 250ed
TossItem_MenuHeader: ; 0x250ed
db MENU_BACKUP_TILES ; flags

File diff suppressed because it is too large Load Diff

View File

@@ -1,4 +1,4 @@
_ReceiveItem:: ; d1d5
_ReceiveItem::
call DoesHLEqualNumItems
jp nz, PutItemInPocket
push hl
@@ -10,28 +10,28 @@ _ReceiveItem:: ; d1d5
rst JumpTable
ret
.Pockets: ; d1e9
.Pockets:
; entries correspond to item types
dw .Item
dw .KeyItem
dw .Ball
dw .TMHM
.Item: ; d1f1
.Item:
ld h, d
ld l, e
jp PutItemInPocket
.KeyItem: ; d1f6
.KeyItem:
ld h, d
ld l, e
jp ReceiveKeyItem
.Ball: ; d1fb
.Ball:
ld hl, wNumBalls
jp PutItemInPocket
.TMHM: ; d201
.TMHM:
ld h, d
ld l, e
ld a, [wCurItem]
@@ -39,7 +39,7 @@ _ReceiveItem:: ; d1d5
call GetTMHMNumber
jp ReceiveTMHM
_TossItem:: ; d20d
_TossItem::
call DoesHLEqualNumItems
jr nz, .remove
push hl
@@ -58,11 +58,11 @@ _TossItem:: ; d20d
dw .Ball
dw .TMHM
.Ball: ; d228
.Ball:
ld hl, wNumBalls
jp RemoveItemFromPocket
.TMHM: ; d22e
.TMHM:
ld h, d
ld l, e
ld a, [wCurItem]
@@ -70,19 +70,19 @@ _TossItem:: ; d20d
call GetTMHMNumber
jp TossTMHM
.KeyItem: ; d23a
.KeyItem:
ld h, d
ld l, e
jp TossKeyItem
.Item: ; d23f
.Item:
ld h, d
ld l, e
.remove
jp RemoveItemFromPocket
_CheckItem:: ; d244
_CheckItem::
call DoesHLEqualNumItems
jr nz, .nope
push hl
@@ -101,11 +101,11 @@ _CheckItem:: ; d244
dw .Ball
dw .TMHM
.Ball: ; d25f
.Ball:
ld hl, wNumBalls
jp CheckTheItem
.TMHM: ; d265
.TMHM:
ld h, d
ld l, e
ld a, [wCurItem]
@@ -113,19 +113,19 @@ _CheckItem:: ; d244
call GetTMHMNumber
jp CheckTMHM
.KeyItem: ; d271
.KeyItem:
ld h, d
ld l, e
jp CheckKeyItems
.Item: ; d276
.Item:
ld h, d
ld l, e
.nope
jp CheckTheItem
DoesHLEqualNumItems: ; d27b
DoesHLEqualNumItems:
ld a, l
cp LOW(wNumItems)
ret nz
@@ -133,7 +133,7 @@ DoesHLEqualNumItems: ; d27b
cp HIGH(wNumItems)
ret
GetPocketCapacity: ; d283
GetPocketCapacity:
ld c, MAX_ITEMS
ld a, e
cp LOW(wNumItems)
@@ -155,7 +155,7 @@ GetPocketCapacity: ; d283
ld c, MAX_BALLS
ret
PutItemInPocket: ; d29c
PutItemInPocket:
ld d, h
ld e, l
inc hl
@@ -231,7 +231,7 @@ PutItemInPocket: ; d29c
scf
ret
RemoveItemFromPocket: ; d2ff
RemoveItemFromPocket:
ld d, h
ld e, l
ld a, [hli]
@@ -296,7 +296,7 @@ RemoveItemFromPocket: ; d2ff
and a
ret
CheckTheItem: ; d349
CheckTheItem:
ld a, [wCurItem]
ld c, a
.loop
@@ -313,7 +313,7 @@ CheckTheItem: ; d349
and a
ret
ReceiveKeyItem: ; d35a
ReceiveKeyItem:
ld hl, wNumKeyItems
ld a, [hli]
cp MAX_KEY_ITEMS
@@ -333,7 +333,7 @@ ReceiveKeyItem: ; d35a
and a
ret
TossKeyItem: ; d374
TossKeyItem:
ld a, [wCurItemQuantity]
ld e, a
ld d, 0
@@ -363,7 +363,7 @@ TossKeyItem: ; d374
scf
ret
.Toss: ; d396
.Toss:
ld hl, wNumKeyItems
ld a, [wCurItem]
ld c, a
@@ -384,7 +384,7 @@ TossKeyItem: ; d374
scf
ret
CheckKeyItems: ; d3b1
CheckKeyItems:
ld a, [wCurItem]
ld c, a
ld hl, wKeyItems
@@ -401,7 +401,7 @@ CheckKeyItems: ; d3b1
scf
ret
ReceiveTMHM: ; d3c4
ReceiveTMHM:
dec c
ld b, 0
ld hl, wTMsHMs
@@ -418,7 +418,7 @@ ReceiveTMHM: ; d3c4
and a
ret
TossTMHM: ; d3d8
TossTMHM:
dec c
ld b, 0
ld hl, wTMsHMs
@@ -445,7 +445,7 @@ TossTMHM: ; d3d8
and a
ret
CheckTMHM: ; d3fb
CheckTMHM:
dec c
ld b, $0
ld hl, wTMsHMs
@@ -456,7 +456,7 @@ CheckTMHM: ; d3fb
scf
ret
GetTMHMNumber:: ; d407
GetTMHMNumber::
; Return the number of a TM/HM by item id c.
ld a, c
; Skip any dummy items.
@@ -473,7 +473,7 @@ GetTMHMNumber:: ; d407
ld c, a
ret
GetNumberedTMHM: ; d417
GetNumberedTMHM:
; Return the item id of a TM/HM by number c.
ld a, c
; Skip any gaps.
@@ -491,7 +491,7 @@ GetNumberedTMHM: ; d417
ld c, a
ret
_CheckTossableItem:: ; d427
_CheckTossableItem::
; Return 1 in wItemAttributeParamBuffer and carry if wCurItem can't be removed from the bag.
ld a, ITEMATTR_PERMISSIONS
call GetItemAttr
@@ -500,7 +500,7 @@ _CheckTossableItem:: ; d427
and a
ret
CheckSelectableItem: ; d432
CheckSelectableItem:
; Return 1 in wItemAttributeParamBuffer and carry if wCurItem can't be selected.
ld a, ITEMATTR_PERMISSIONS
call GetItemAttr
@@ -509,7 +509,7 @@ CheckSelectableItem: ; d432
and a
ret
CheckItemPocket:: ; d43d
CheckItemPocket::
; Return the pocket for wCurItem in wItemAttributeParamBuffer.
ld a, ITEMATTR_POCKET
call GetItemAttr
@@ -517,7 +517,7 @@ CheckItemPocket:: ; d43d
ld [wItemAttributeParamBuffer], a
ret
CheckItemContext: ; d448
CheckItemContext:
; Return the context for wCurItem in wItemAttributeParamBuffer.
ld a, ITEMATTR_HELP
call GetItemAttr
@@ -525,7 +525,7 @@ CheckItemContext: ; d448
ld [wItemAttributeParamBuffer], a
ret
CheckItemMenu: ; d453
CheckItemMenu:
; Return the menu for wCurItem in wItemAttributeParamBuffer.
ld a, ITEMATTR_HELP
call GetItemAttr
@@ -534,7 +534,7 @@ CheckItemMenu: ; d453
ld [wItemAttributeParamBuffer], a
ret
GetItemAttr: ; d460
GetItemAttr:
; Get attribute a of wCurItem.
push hl
@@ -560,13 +560,13 @@ GetItemAttr: ; d460
pop hl
ret
ItemAttr_ReturnCarry: ; d47f
ItemAttr_ReturnCarry:
ld a, 1
ld [wItemAttributeParamBuffer], a
scf
ret
GetItemPrice: ; d486
GetItemPrice:
; Return the price of wCurItem in de.
push hl
push bc

View File

@@ -6,7 +6,7 @@
const MARTTEXT_HERE_YOU_GO
const MARTTEXT_SOLD_OUT
OpenMartDialog:: ; 15a45
OpenMartDialog::
call GetMart
ld a, c
ld [wEngineBuffer1], a
@@ -15,7 +15,6 @@ OpenMartDialog:: ; 15a45
ld hl, .dialogs
rst JumpTable
ret
; 15a57
.dialogs
dw MartDialog
@@ -23,18 +22,16 @@ OpenMartDialog:: ; 15a45
dw BargainShop
dw Pharmacist
dw RooftopSale
; 15a61
MartDialog: ; 15a61
MartDialog:
ld a, 0
ld [wEngineBuffer1], a
xor a
ld [wEngineBuffer5], a
call StandardMart
ret
; 15a6e
HerbShop: ; 15a6e
HerbShop:
call FarReadMart
call LoadStandardMenuHeader
ld hl, Text_HerbShop_Intro
@@ -43,9 +40,8 @@ HerbShop: ; 15a6e
ld hl, Text_HerbShop_ComeAgain
call MartTextBox
ret
; 15a84
BargainShop: ; 15a84
BargainShop:
ld b, BANK(BargainShopData)
ld de, BargainShopData
call LoadMartPointer
@@ -65,9 +61,8 @@ BargainShop: ; 15a84
ld hl, Text_BargainShop_ComeAgain
call MartTextBox
ret
; 15aae
Pharmacist: ; 15aae
Pharmacist:
call FarReadMart
call LoadStandardMenuHeader
ld hl, Text_Pharmacist_Intro
@@ -76,9 +71,8 @@ Pharmacist: ; 15aae
ld hl, Text_Pharmacist_ComeAgain
call MartTextBox
ret
; 15ac4
RooftopSale: ; 15ac4
RooftopSale:
ld b, BANK(RooftopSaleMart1)
ld de, RooftopSaleMart1
ld hl, wStatusFlags
@@ -97,11 +91,10 @@ RooftopSale: ; 15ac4
ld hl, Text_Mart_ComeAgain
call MartTextBox
ret
; 15aee
INCLUDE "data/items/rooftop_sale.asm"
LoadMartPointer: ; 15b10
LoadMartPointer:
ld a, b
ld [wMartPointerBank], a
ld a, e
@@ -117,9 +110,8 @@ LoadMartPointer: ; 15b10
ld [wBargainShopFlags], a
ld [wFacingDirection], a
ret
; 15b31
GetMart: ; 15b31
GetMart:
ld a, e
cp (Marts.End - Marts) / 2
jr c, .IsAMart
@@ -136,9 +128,8 @@ GetMart: ; 15b31
ld d, [hl]
ld b, BANK(Marts)
ret
; 15b47
StandardMart: ; 15b47
StandardMart:
.loop
ld a, [wEngineBuffer5]
ld hl, .MartFunctions
@@ -155,17 +146,15 @@ StandardMart: ; 15b47
dw .Sell
dw .Quit
dw .AnythingElse
; 15b62
.HowMayIHelpYou: ; 15b62
.HowMayIHelpYou:
call LoadStandardMenuHeader
ld hl, Text_Mart_HowMayIHelpYou
call PrintText
ld a, $1 ; top menu
ret
; 15b6e
.TopMenu: ; 15b6e
.TopMenu:
ld hl, MenuHeader_BuySell
call CopyMenuHeader
call VerticalMenu
@@ -184,41 +173,36 @@ StandardMart: ; 15b47
.sell
ld a, $3 ; sell
ret
; 15b8d
.Buy: ; 15b8d
.Buy:
call ExitMenu
call FarReadMart
call BuyMenu
and a
ld a, $5 ; Anything else?
ret
; 15b9a
.Sell: ; 15b9a
.Sell:
call ExitMenu
call SellMenu
ld a, $5 ; Anything else?
ret
; 15ba3
.Quit: ; 15ba3
.Quit:
call ExitMenu
ld hl, Text_Mart_ComeAgain
call MartTextBox
ld a, $ff ; exit
ret
; 15baf
.AnythingElse: ; 15baf
.AnythingElse:
call LoadStandardMenuHeader
ld hl, Text_Mart_AnythingElse
call PrintText
ld a, $1 ; top menu
ret
; 15bbb
FarReadMart: ; 15bbb
FarReadMart:
ld hl, wMartPointer
ld a, [hli]
ld h, [hl]
@@ -246,16 +230,15 @@ FarReadMart: ; 15bbb
.done
ret
; 15be5
GetMartItemPrice: ; 15be5
GetMartItemPrice:
; Return the price of item a in BCD at hl and in tiles at wStringBuffer1.
push hl
ld [wCurItem], a
farcall GetItemPrice
pop hl
GetMartPrice: ; 15bf0
GetMartPrice:
; Return price de in BCD at hl and in tiles at wStringBuffer1.
push hl
ld a, d
@@ -280,9 +263,8 @@ GetMartPrice: ; 15bf0
dec c
jr nz, .loop
ret
; 15c1a
.CharToNybble: ; 15c1a
.CharToNybble:
ld a, [de]
inc de
cp " "
@@ -292,9 +274,8 @@ GetMartPrice: ; 15bf0
.not_space
sub "0"
ret
; 15c25
ReadMart: ; 15c25
ReadMart:
; Load the mart pointer. Mart data is local (no need for bank).
ld hl, wMartPointer
ld a, [hli]
@@ -337,12 +318,11 @@ ReadMart: ; 15c25
ld a, [hl]
ld [wCurMart], a
ret
; 15c51
INCLUDE "data/items/bargain_shop.asm"
BuyMenu: ; 15c62
BuyMenu:
call FadeToMenu
farcall BlankScreen
xor a
@@ -354,9 +334,8 @@ BuyMenu: ; 15c62
jr nc, .loop
call CloseSubmenu
ret
; 15c7d
LoadBuyMenuText: ; 15c7d
LoadBuyMenuText:
; load text from a nested table
; which table is in wEngineBuffer1
; which entry is in register a
@@ -375,9 +354,8 @@ LoadBuyMenuText: ; 15c7d
ld l, a
call PrintText
ret
; 15c91
MartAskPurchaseQuantity: ; 15c91
MartAskPurchaseQuantity:
call GetMartDialogGroup ; gets a pointer from GetMartDialogGroup.MartTextFunctionPointers
inc hl
inc hl
@@ -387,9 +365,8 @@ MartAskPurchaseQuantity: ; 15c91
cp 1
jp z, BargainShopAskPurchaseQuantity
jp RooftopSaleAskPurchaseQuantity
; 15ca3
GetMartDialogGroup: ; 15ca3
GetMartDialogGroup:
ld a, [wEngineBuffer1]
ld e, a
ld d, 0
@@ -398,17 +375,15 @@ GetMartDialogGroup: ; 15ca3
add hl, de
add hl, de
ret
; 15cb0
.MartTextFunctionPointers: ; 15cb0
.MartTextFunctionPointers:
dwb .StandardMartPointers, 0
dwb .HerbShopPointers, 0
dwb .BargainShopPointers, 1
dwb .PharmacyPointers, 0
dwb .StandardMartPointers, 2
; 15cbf
.StandardMartPointers: ; 15cbf
.StandardMartPointers:
dw Text_Mart_HowMany
dw Text_Mart_CostsThisMuch
dw Text_Mart_InsufficientFunds
@@ -416,7 +391,7 @@ GetMartDialogGroup: ; 15ca3
dw Text_Mart_HereYouGo
dw BuyMenuLoop
.HerbShopPointers: ; 15ccb
.HerbShopPointers:
dw Text_HerbShop_HowMany
dw Text_HerbShop_CostsThisMuch
dw Text_HerbShop_InsufficientFunds
@@ -424,7 +399,7 @@ GetMartDialogGroup: ; 15ca3
dw Text_HerbShop_HereYouGo
dw BuyMenuLoop
.BargainShopPointers: ; 15cd7
.BargainShopPointers:
dw BuyMenuLoop
dw Text_BargainShop_CostsThisMuch
dw Text_BargainShop_InsufficientFunds
@@ -432,17 +407,16 @@ GetMartDialogGroup: ; 15ca3
dw Text_BargainShop_HereYouGo
dw Text_BargainShop_SoldOut
.PharmacyPointers: ; 15ce3
.PharmacyPointers:
dw Text_Pharmacy_HowMany
dw Text_Pharmacy_CostsThisMuch
dw Text_Pharmacy_InsufficientFunds
dw Text_Pharmacy_BagFull
dw Text_Pharmacy_HereYouGo
dw BuyMenuLoop
; 15cef
BuyMenuLoop: ; 15cef
BuyMenuLoop:
farcall PlaceMoneyTopRight
call UpdateSprites
ld hl, MenuHeader_Buy
@@ -512,7 +486,6 @@ BuyMenuLoop: ; 15cef
call JoyWaitAorB
and a
ret
; 15d83
StandardMartAskPurchaseQuantity:
ld a, 99
@@ -522,15 +495,13 @@ StandardMartAskPurchaseQuantity:
farcall SelectQuantityToBuy
call ExitMenu
ret
; 15d97
MartConfirmPurchase: ; 15d97
MartConfirmPurchase:
predef PartyMonItemName
ld a, MARTTEXT_COSTS_THIS_MUCH
call LoadBuyMenuText
call YesNoBox
ret
; 15da5
BargainShopAskPurchaseQuantity:
ld a, 1
@@ -571,7 +542,6 @@ BargainShopAskPurchaseQuantity:
call JoyWaitAorB
scf
ret
; 15de2
RooftopSaleAskPurchaseQuantity:
ld a, MARTTEXT_HOW_MANY
@@ -582,9 +552,8 @@ RooftopSaleAskPurchaseQuantity:
farcall RooftopSale_SelectQuantityToBuy
call ExitMenu
ret
; 15df9
.GetSalePrice: ; 15df9
.GetSalePrice:
ld a, [wMartItemID]
ld e, a
ld d, 0
@@ -601,7 +570,6 @@ RooftopSaleAskPurchaseQuantity:
inc hl
ld d, [hl]
ret
; 15e0e
Text_Mart_HowMany: ; 0x15e0e
@@ -631,9 +599,8 @@ MenuHeader_Buy: ; 0x15e18
dba PlaceMenuItemName
dba .PrintBCDPrices
dba UpdateItemDescription
; 15e30
.PrintBCDPrices: ; 15e30
.PrintBCDPrices:
ld a, [wScrollingMenuCursorPosition]
ld c, a
ld b, 0
@@ -650,7 +617,6 @@ MenuHeader_Buy: ; 0x15e18
ld c, PRINTNUM_LEADINGZEROS | PRINTNUM_MONEY | 3
call PrintBCDNumber
ret
; 15e4a (5:5e4a)
Text_HerbShop_Intro: ; 0x15e4a
; Hello, dear. I sell inexpensive herbal medicine. They're good, but a trifle bitter. Your #MON may not like them. Hehehehe…
@@ -779,7 +745,7 @@ Text_Pharmacist_ComeAgain: ; 0x15eae
; 0x15eb3
SellMenu: ; 15eb3
SellMenu:
call DisableSpriteUpdates
farcall DepositSellInitPackBuffers
.loop
@@ -794,14 +760,12 @@ SellMenu: ; 15eb3
call ReturnToMapWithSpeechTextbox
and a
ret
; 15ed3
.Unreferenced_NothingToSell:
ld hl, .NothingToSellText
call MenuTextBoxBackup
and a
ret
; 15edb
.NothingToSellText: ; 0x15edb
; You don't have anything to sell.
@@ -810,15 +774,14 @@ SellMenu: ; 15eb3
; 0x15ee0
.TryToSellItem: ; 15ee0
.TryToSellItem:
farcall CheckItemMenu
ld a, [wItemAttributeParamBuffer]
ld hl, .dw
rst JumpTable
ret
; 15eee
.dw ; 15eee
.dw
dw .try_sell
dw .cant_buy
dw .cant_buy
@@ -826,14 +789,12 @@ SellMenu: ; 15eb3
dw .try_sell
dw .try_sell
dw .try_sell
; 15efc
.cant_buy ; 15efc
.cant_buy
ret
; 15efd
.try_sell ; 15efd
.try_sell
farcall _CheckTossableItem
ld a, [wItemAttributeParamBuffer]
and a
@@ -877,7 +838,6 @@ SellMenu: ; 15eb3
call ExitMenu
and a
ret
; 15f73
Text_Mart_SellHowMany: ; 0x15f73
; How many?
@@ -891,7 +851,7 @@ Text_Mart_ICanPayThisMuch: ; 0x15f78
db "@"
; 0x15f7d
.UnusedString15f7d: ; 15f7d
.UnusedString15f7d:
db "!ダミー!@"
Text_Mart_HowMayIHelpYou: ; 0x15f83
@@ -955,16 +915,14 @@ Text_Mart_SoldForAmount: ; 0x15fbe
db "@"
; 0x15fc3
PlayTransactionSound: ; 15fc3
PlayTransactionSound:
call WaitSFX
ld de, SFX_TRANSACTION
call PlaySFX
ret
; 15fcd
MartTextBox: ; 15fcd
MartTextBox:
call MenuTextBox
call JoyWaitAorB
call ExitMenu
ret
; 15fd7

View File

@@ -12,7 +12,7 @@
const PACKSTATE_QUITNOSCRIPT ; 9
const PACKSTATE_QUITRUNSCRIPT ; 10
Pack: ; 10000
Pack:
ld hl, wOptions
set NO_TEXT_SCROLL, [hl]
call InitPackBuffers
@@ -31,17 +31,15 @@ Pack: ; 10000
ld hl, wOptions
res NO_TEXT_SCROLL, [hl]
ret
; 10026
.RunJumptable: ; 10026
.RunJumptable:
ld a, [wJumptableIndex]
ld hl, .Jumptable
call Pack_GetJumptablePointer
jp hl
; 10030
.Jumptable: ; 10030 (4:4030)
.Jumptable:
; entries correspond to PACKSTATE_* constants
dw .InitGFX ; 0
dw .InitItemsPocket ; 1
@@ -55,7 +53,7 @@ Pack: ; 10000
dw Pack_QuitNoScript ; 9
dw Pack_QuitRunScript ; 10
.InitGFX: ; 10046 (4:4046)
.InitGFX:
xor a
ld [hBGMapMode], a
call Pack_InitGFX
@@ -64,7 +62,7 @@ Pack: ; 10000
call Pack_InitColors
ret
.InitItemsPocket: ; 10056 (4:4056)
.InitItemsPocket:
xor a ; ITEM_POCKET
ld [wCurrPocket], a
call ClearPocketList
@@ -73,7 +71,7 @@ Pack: ; 10000
call Pack_JumptableNext
ret
.ItemsPocketMenu: ; 10067 (4:4067)
.ItemsPocketMenu:
ld hl, ItemsPocketMenuHeader
call CopyMenuHeader
ld a, [wItemsPocketCursor]
@@ -92,7 +90,7 @@ Pack: ; 10000
call .ItemBallsKey_LoadSubmenu
ret
.InitKeyItemsPocket: ; 10094 (4:4094)
.InitKeyItemsPocket:
ld a, KEY_ITEM_POCKET
ld [wCurrPocket], a
call ClearPocketList
@@ -101,7 +99,7 @@ Pack: ; 10000
call Pack_JumptableNext
ret
.KeyItemsPocketMenu: ; 100a6 (4:40a6)
.KeyItemsPocketMenu:
ld hl, KeyItemsPocketMenuHeader
call CopyMenuHeader
ld a, [wKeyItemsPocketCursor]
@@ -120,7 +118,7 @@ Pack: ; 10000
call .ItemBallsKey_LoadSubmenu
ret
.InitTMHMPocket: ; 100d3 (4:40d3)
.InitTMHMPocket:
ld a, TM_HM_POCKET
ld [wCurrPocket], a
call ClearPocketList
@@ -131,7 +129,7 @@ Pack: ; 10000
call Pack_JumptableNext
ret
.TMHMPocketMenu: ; 100e8 (4:40e8)
.TMHMPocketMenu:
farcall TMHMPocket
ld b, PACKSTATE_INITKEYITEMSPOCKET ; left
ld c, PACKSTATE_INITITEMSPOCKET ; right
@@ -160,7 +158,6 @@ Pack: ; 10000
call Pack_GetJumptablePointer
jp hl
; 10124 (4:4124)
.MenuHeader1: ; 0x10124
db MENU_BACKUP_TILES ; flags
menu_coords 13, 7, SCREEN_WIDTH - 1, TEXTBOX_Y - 1
@@ -175,11 +172,10 @@ Pack: ; 10000
db "QUIT@"
; 0x10137
.Jumptable1: ; 10137
.Jumptable1:
dw .UseItem
dw QuitItemSubmenu
; 1013b
.MenuHeader2: ; 0x1013b
db MENU_BACKUP_TILES ; flags
@@ -196,13 +192,12 @@ Pack: ; 10000
db "QUIT@"
; 0x10153
.Jumptable2: ; 10153
.Jumptable2:
dw .UseItem
dw GiveItem
dw QuitItemSubmenu
; 10159
.UseItem: ; 10159
.UseItem:
farcall AskTeachTMHM
ret c
farcall ChooseMonToLearnTMHM
@@ -222,7 +217,7 @@ Pack: ; 10000
call Pack_InitColors
ret
.InitBallsPocket: ; 10186 (4:4186)
.InitBallsPocket:
ld a, BALL_POCKET
ld [wCurrPocket], a
call ClearPocketList
@@ -231,7 +226,7 @@ Pack: ; 10000
call Pack_JumptableNext
ret
.BallsPocketMenu: ; 10198 (4:4198)
.BallsPocketMenu:
ld hl, BallsPocketMenuHeader
call CopyMenuHeader
ld a, [wBallsPocketCursor]
@@ -250,7 +245,7 @@ Pack: ; 10000
call .ItemBallsKey_LoadSubmenu
ret
.ItemBallsKey_LoadSubmenu: ; 101c5 (4:41c5)
.ItemBallsKey_LoadSubmenu:
farcall _CheckTossableItem
ld a, [wItemAttributeParamBuffer]
and a
@@ -319,7 +314,6 @@ Pack: ; 10000
call Pack_GetJumptablePointer
jp hl
; 10249 (4:4249)
MenuHeader_UsableKeyItem: ; 0x10249
db MENU_BACKUP_TILES ; flags
menu_coords 13, 1, SCREEN_WIDTH - 1, TEXTBOX_Y - 1
@@ -337,13 +331,12 @@ MenuHeader_UsableKeyItem: ; 0x10249
db "QUIT@"
; 0x1026a
Jumptable_UseGiveTossRegisterQuit: ; 1026a
Jumptable_UseGiveTossRegisterQuit:
dw UseItem
dw GiveItem
dw TossMenu
dw RegisterItem
dw QuitItemSubmenu
; 10274
MenuHeader_UsableItem: ; 0x10274
db MENU_BACKUP_TILES ; flags
@@ -361,12 +354,11 @@ MenuHeader_UsableItem: ; 0x10274
db "QUIT@"
; 0x10291
Jumptable_UseGiveTossQuit: ; 10291
Jumptable_UseGiveTossQuit:
dw UseItem
dw GiveItem
dw TossMenu
dw QuitItemSubmenu
; 10299
MenuHeader_UnusableItem: ; 0x10299
db MENU_BACKUP_TILES ; flags
@@ -382,10 +374,9 @@ MenuHeader_UnusableItem: ; 0x10299
db "QUIT@"
; 0x102ac
Jumptable_UseQuit: ; 102ac
Jumptable_UseQuit:
dw UseItem
dw QuitItemSubmenu
; 102b0
MenuHeader_UnusableKeyItem: ; 0x102b0
db MENU_BACKUP_TILES ; flags
@@ -402,11 +393,10 @@ MenuHeader_UnusableKeyItem: ; 0x102b0
db "QUIT@"
; 0x102c7
Jumptable_UseRegisterQuit: ; 102c7
Jumptable_UseRegisterQuit:
dw UseItem
dw RegisterItem
dw QuitItemSubmenu
; 102cd
MenuHeader_HoldableKeyItem: ; 0x102cd
db MENU_BACKUP_TILES ; flags
@@ -424,12 +414,11 @@ MenuHeader_HoldableKeyItem: ; 0x102cd
db "QUIT@"
; 0x102ea
Jumptable_GiveTossRegisterQuit: ; 102ea
Jumptable_GiveTossRegisterQuit:
dw GiveItem
dw TossMenu
dw RegisterItem
dw QuitItemSubmenu
; 102f2
MenuHeader_HoldableItem: ; 0x102f2
db MENU_BACKUP_TILES ; flags
@@ -446,22 +435,20 @@ MenuHeader_HoldableItem: ; 0x102f2
db "QUIT@"
; 0x1030b
Jumptable_GiveTossQuit: ; 1030b
Jumptable_GiveTossQuit:
dw GiveItem
dw TossMenu
dw QuitItemSubmenu
; 10311
UseItem: ; 10311
UseItem:
farcall CheckItemMenu
ld a, [wItemAttributeParamBuffer]
ld hl, .dw
rst JumpTable
ret
; 1031f
.dw ; 1031f (4:431f)
.dw
; entries correspond to ITEMMENU_* constants
dw .Oak ; ITEMMENU_NOUSE
dw .Oak
@@ -470,18 +457,17 @@ UseItem: ; 10311
dw .Current ; ITEMMENU_CURRENT
dw .Party ; ITEMMENU_PARTY
dw .Field ; ITEMMENU_CLOSE
; 1035c
.Oak: ; 1032d (4:432d)
.Oak:
ld hl, Text_ThisIsntTheTime
call Pack_PrintTextNoScroll
ret
.Current: ; 10334 (4:4334)
.Current:
call DoItemEffect
ret
.Party: ; 10338 (4:4338)
.Party:
ld a, [wPartyCount]
and a
jr z, .NoPokemon
@@ -498,7 +484,7 @@ UseItem: ; 10311
call Pack_PrintTextNoScroll
ret
.Field: ; 10355 (4:4355)
.Field:
call DoItemEffect
ld a, [wItemEffectSucceeded]
and a
@@ -506,9 +492,8 @@ UseItem: ; 10311
ld a, PACKSTATE_QUITRUNSCRIPT
ld [wJumptableIndex], a
ret
; 10364 (4:4364)
TossMenu: ; 10364
TossMenu:
ld hl, Text_ThrowAwayHowMany
call Pack_PrintTextNoScroll
farcall SelectQuantityToToss
@@ -532,9 +517,8 @@ TossMenu: ; 10364
call Pack_PrintTextNoScroll
.finish
ret
; 1039d
Unreferenced_ResetPocketCursorPositions: ; 1039d
Unreferenced_ResetPocketCursorPositions:
ld a, [wCurrPocket]
and a ; ITEM_POCKET
jr z, .items
@@ -561,9 +545,8 @@ Unreferenced_ResetPocketCursorPositions: ; 1039d
ld [wKeyItemsPocketCursor], a
ld [wKeyItemsPocketScrollPosition], a
ret
; 103c2
RegisterItem: ; 103c2
RegisterItem:
farcall CheckSelectableItem
ld a, [wItemAttributeParamBuffer]
and a
@@ -591,9 +574,8 @@ RegisterItem: ; 103c2
ld hl, Text_CantRegister
call Pack_PrintTextNoScroll
ret
; 103fd
GiveItem: ; 103fd
GiveItem:
ld a, [wPartyCount]
and a
jp z, .NoPokemon
@@ -647,22 +629,20 @@ GiveItem: ; 103fd
call Pack_InitColors
ret
.NoPokemon: ; 10486 (4:4486)
.NoPokemon:
ld hl, TextJump_YouDontHaveAMon
call Pack_PrintTextNoScroll
ret
; 1048d (4:448d)
.Egg: ; 0x1048d
; An EGG can't hold an item.
text_jump Text_AnEGGCantHoldAnItem
db "@"
; 0x10492
QuitItemSubmenu: ; 10492
QuitItemSubmenu:
ret
; 10493
BattlePack: ; 10493
BattlePack:
ld hl, wOptions
set NO_TEXT_SCROLL, [hl]
call InitPackBuffers
@@ -681,17 +661,15 @@ BattlePack: ; 10493
ld hl, wOptions
res NO_TEXT_SCROLL, [hl]
ret
; 104b9
.RunJumptable: ; 104b9
.RunJumptable:
ld a, [wJumptableIndex]
ld hl, .Jumptable
call Pack_GetJumptablePointer
jp hl
; 104c3
.Jumptable: ; 104c3 (4:44c3)
.Jumptable:
; entries correspond to PACKSTATE_* constants
dw .InitGFX ; 0
dw .InitItemsPocket ; 1
@@ -705,7 +683,7 @@ BattlePack: ; 10493
dw Pack_QuitNoScript ; 9
dw Pack_QuitRunScript ; 10
.InitGFX: ; 104d9 (4:44d9)
.InitGFX:
xor a
ld [hBGMapMode], a
call Pack_InitGFX
@@ -714,7 +692,7 @@ BattlePack: ; 10493
call Pack_InitColors
ret
.InitItemsPocket: ; 104e9 (4:44e9)
.InitItemsPocket:
xor a ; ITEM_POCKET
ld [wCurrPocket], a
call ClearPocketList
@@ -723,7 +701,7 @@ BattlePack: ; 10493
call Pack_JumptableNext
ret
.ItemsPocketMenu: ; 104fa (4:44fa)
.ItemsPocketMenu:
ld hl, ItemsPocketMenuHeader
call CopyMenuHeader
ld a, [wItemsPocketCursor]
@@ -742,7 +720,7 @@ BattlePack: ; 10493
call ItemSubmenu
ret
.InitKeyItemsPocket: ; 10527 (4:4527)
.InitKeyItemsPocket:
ld a, KEY_ITEM_POCKET
ld [wCurrPocket], a
call ClearPocketList
@@ -751,7 +729,7 @@ BattlePack: ; 10493
call Pack_JumptableNext
ret
.KeyItemsPocketMenu: ; 10539 (4:4539)
.KeyItemsPocketMenu:
ld hl, KeyItemsPocketMenuHeader
call CopyMenuHeader
ld a, [wKeyItemsPocketCursor]
@@ -770,7 +748,7 @@ BattlePack: ; 10493
call ItemSubmenu
ret
.InitTMHMPocket: ; 10566 (4:4566)
.InitTMHMPocket:
ld a, TM_HM_POCKET
ld [wCurrPocket], a
call ClearPocketList
@@ -783,7 +761,7 @@ BattlePack: ; 10493
call Pack_JumptableNext
ret
.TMHMPocketMenu: ; 10581 (4:4581)
.TMHMPocketMenu:
farcall TMHMPocket
ld b, PACKSTATE_INITKEYITEMSPOCKET ; left
ld c, PACKSTATE_INITITEMSPOCKET ; right
@@ -793,7 +771,7 @@ BattlePack: ; 10493
call TMHMSubmenu
ret
.InitBallsPocket: ; 10594 (4:4594)
.InitBallsPocket:
ld a, BALL_POCKET
ld [wCurrPocket], a
call ClearPocketList
@@ -802,7 +780,7 @@ BattlePack: ; 10493
call Pack_JumptableNext
ret
.BallsPocketMenu: ; 105a6 (4:45a6)
.BallsPocketMenu:
ld hl, BallsPocketMenuHeader
call CopyMenuHeader
ld a, [wBallsPocketCursor]
@@ -821,10 +799,10 @@ BattlePack: ; 10493
call ItemSubmenu
ret
ItemSubmenu: ; 105d3 (4:45d3)
ItemSubmenu:
farcall CheckItemContext
ld a, [wItemAttributeParamBuffer]
TMHMSubmenu: ; 105dc (4:45dc)
TMHMSubmenu:
and a
jr z, .NoUse
ld hl, .UsableMenuHeader
@@ -846,7 +824,6 @@ TMHMSubmenu: ; 105dc (4:45dc)
call Pack_GetJumptablePointer
jp hl
; 10601 (4:4601)
.UsableMenuHeader: ; 0x10601
db MENU_BACKUP_TILES ; flags
menu_coords 13, 7, SCREEN_WIDTH - 1, TEXTBOX_Y - 1
@@ -861,10 +838,9 @@ TMHMSubmenu: ; 105dc (4:45dc)
db "QUIT@"
; 0x10614
.UsableJumptable: ; 10614
.UsableJumptable:
dw .Use
dw .Quit
; 10618
.UnusableMenuHeader: ; 0x10618
db MENU_BACKUP_TILES ; flags
@@ -879,18 +855,17 @@ TMHMSubmenu: ; 105dc (4:45dc)
db "QUIT@"
; 0x10627
.UnusableJumptable: ; 10627
.UnusableJumptable:
dw .Quit
; 10629
.Use: ; 10629
.Use:
farcall CheckItemContext
ld a, [wItemAttributeParamBuffer]
ld hl, .ItemFunctionJumptable
rst JumpTable
ret
.ItemFunctionJumptable: ; 10637 (4:4637)
.ItemFunctionJumptable:
; entries correspond to ITEMMENU_* constants
dw .Oak ; ITEMMENU_NOUSE
dw .Oak
@@ -900,19 +875,19 @@ TMHMSubmenu: ; 105dc (4:45dc)
dw .BattleField ; ITEMMENU_PARTY
dw .BattleOnly ; ITEMMENU_CLOSE
.Oak: ; 10645 (4:4645)
.Oak:
ld hl, Text_ThisIsntTheTime
call Pack_PrintTextNoScroll
ret
.Unused: ; 1064c (4:464c)
.Unused:
call DoItemEffect
ld a, [wItemEffectSucceeded]
and a
jr nz, .ReturnToBattle
ret
.BattleField: ; 10656 (4:4656)
.BattleField:
call DoItemEffect
ld a, [wItemEffectSucceeded]
and a
@@ -924,32 +899,30 @@ TMHMSubmenu: ; 105dc (4:45dc)
call Pack_InitColors
ret
.ReturnToBattle: ; 1066c (4:466c)
.ReturnToBattle:
call ClearBGPalettes
jr .quit_run_script
.BattleOnly: ; 10671 (4:4671)
.BattleOnly:
call DoItemEffect
ld a, [wItemEffectSucceeded]
and a
jr z, .Oak
cp $2
jr z, .didnt_use_item
.quit_run_script ; 1067e (4:467e)
.quit_run_script
ld a, PACKSTATE_QUITRUNSCRIPT
ld [wJumptableIndex], a
ret
.didnt_use_item ; 10684 (4:4684)
.didnt_use_item
xor a
ld [wItemEffectSucceeded], a
ret
; 10689 (4:4689)
.Quit: ; 10689
.Quit:
ret
; 1068a
InitPackBuffers: ; 1068a
InitPackBuffers:
xor a
ld [wJumptableIndex], a
; pocket id -> jumptable index
@@ -965,9 +938,8 @@ InitPackBuffers: ; 1068a
xor a
ld [wSwitchItem], a
ret
; 106a5
DepositSellInitPackBuffers: ; 106a5
DepositSellInitPackBuffers:
xor a
ld [hBGMapMode], a
ld [wJumptableIndex], a ; PACKSTATE_INITGFX
@@ -978,32 +950,29 @@ DepositSellInitPackBuffers: ; 106a5
call Pack_InitGFX
call Pack_InitColors
ret
; 106be
DepositSellPack: ; 106be
DepositSellPack:
.loop
call .RunJumptable
call DepositSellTutorial_InterpretJoypad
jr c, .loop
ret
; 106c7
.RunJumptable: ; 106c7
.RunJumptable:
ld a, [wJumptableIndex]
ld hl, .Jumptable
call Pack_GetJumptablePointer
jp hl
; 106d1
.Jumptable: ; 106d1 (4:46d1)
.Jumptable:
; entries correspond to *_POCKET constants
dw .ItemsPocket
dw .BallsPocket
dw .KeyItemsPocket
dw .TMHMPocket
.ItemsPocket: ; 106d9 (4:46d9)
.ItemsPocket:
xor a ; ITEM_POCKET
call InitPocket
ld hl, PC_Mart_ItemsPocketMenuHeader
@@ -1019,7 +988,7 @@ DepositSellPack: ; 106be
ld [wItemsPocketCursor], a
ret
.KeyItemsPocket: ; 106ff (4:46ff)
.KeyItemsPocket:
ld a, KEY_ITEM_POCKET
call InitPocket
ld hl, PC_Mart_KeyItemsPocketMenuHeader
@@ -1035,7 +1004,7 @@ DepositSellPack: ; 106be
ld [wKeyItemsPocketCursor], a
ret
.TMHMPocket: ; 10726 (4:4726)
.TMHMPocket:
ld a, TM_HM_POCKET
call InitPocket
call WaitBGMap_DrawPackGFX
@@ -1044,7 +1013,7 @@ DepositSellPack: ; 106be
ld [wCurItem], a
ret
.BallsPocket: ; 1073b (4:473b)
.BallsPocket:
ld a, BALL_POCKET
call InitPocket
ld hl, PC_Mart_BallsPocketMenuHeader
@@ -1060,14 +1029,14 @@ DepositSellPack: ; 106be
ld [wBallsPocketCursor], a
ret
InitPocket: ; 10762 (4:4762)
InitPocket:
ld [wCurrPocket], a
call ClearPocketList
call DrawPocketName
call WaitBGMap_DrawPackGFX
ret
DepositSellTutorial_InterpretJoypad: ; 1076f
DepositSellTutorial_InterpretJoypad:
ld hl, wMenuJoypad
ld a, [hl]
and A_BUTTON
@@ -1119,9 +1088,8 @@ DepositSellTutorial_InterpretJoypad: ; 1076f
pop de
scf
ret
; 107bb
TutorialPack: ; 107bb
TutorialPack:
call DepositSellInitPackBuffers
ld a, [wInputType]
or a
@@ -1134,29 +1102,26 @@ TutorialPack: ; 107bb
xor a ; FALSE
ld [wPackUsedItem], a
ret
; 107d7
.RunJumptable: ; 107d7
.RunJumptable:
ld a, [wJumptableIndex]
ld hl, .dw
call Pack_GetJumptablePointer
jp hl
; 107e1
.dw ; 107e1 (4:47e1)
.dw
; entries correspond to *_POCKET constants
dw .Items
dw .Balls
dw .KeyItems
dw .TMHM
.Items: ; 107e9 (4:47e9)
.Items:
xor a ; ITEM_POCKET
ld hl, .ItemsMenuHeader
jr .DisplayPocket
; 107ef (4:47ef)
.ItemsMenuHeader: ; 0x107ef
db MENU_BACKUP_TILES ; flags
menu_coords 7, 1, SCREEN_WIDTH - 1, TEXTBOX_Y - 1
@@ -1172,14 +1137,12 @@ TutorialPack: ; 107bb
dba PlaceMenuItemName
dba PlaceMenuItemQuantity
dba UpdateItemDescription
; 10807
.KeyItems: ; 10807 (4:4807)
.KeyItems:
ld a, KEY_ITEM_POCKET
ld hl, .KeyItemsMenuHeader
jr .DisplayPocket
; 1080e (4:480e)
.KeyItemsMenuHeader: ; 0x1080e
db MENU_BACKUP_TILES ; flags
menu_coords 7, 1, SCREEN_WIDTH - 1, TEXTBOX_Y - 1
@@ -1195,9 +1158,8 @@ TutorialPack: ; 107bb
dba PlaceMenuItemName
dba PlaceMenuItemQuantity
dba UpdateItemDescription
; 10826
.TMHM: ; 10826 (4:4826)
.TMHM:
ld a, TM_HM_POCKET
call InitPocket
call WaitBGMap_DrawPackGFX
@@ -1206,12 +1168,11 @@ TutorialPack: ; 107bb
ld [wCurItem], a
ret
.Balls: ; 1083b (4:483b)
.Balls:
ld a, BALL_POCKET
ld hl, .BallsMenuHeader
jr .DisplayPocket
; 10842 (4:4842)
.BallsMenuHeader: ; 0x10842
db MENU_BACKUP_TILES ; flags
menu_coords 7, 1, SCREEN_WIDTH - 1, TEXTBOX_Y - 1
@@ -1227,9 +1188,8 @@ TutorialPack: ; 107bb
dba PlaceMenuItemName
dba PlaceMenuItemQuantity
dba UpdateItemDescription
; 1085a
.DisplayPocket: ; 1085a (4:485a)
.DisplayPocket:
push hl
call InitPocket
pop hl
@@ -1237,12 +1197,12 @@ TutorialPack: ; 107bb
call ScrollingMenu
ret
Pack_JumptableNext: ; 10866 (4:4866)
Pack_JumptableNext:
ld hl, wJumptableIndex
inc [hl]
ret
Pack_GetJumptablePointer: ; 1086b
Pack_GetJumptablePointer:
ld e, a
ld d, 0
add hl, de
@@ -1251,23 +1211,22 @@ Pack_GetJumptablePointer: ; 1086b
ld h, [hl]
ld l, a
ret
; 10874
Pack_QuitNoScript: ; 10874 (4:4874)
Pack_QuitNoScript:
ld hl, wJumptableIndex
set 7, [hl]
xor a ; FALSE
ld [wPackUsedItem], a
ret
Pack_QuitRunScript: ; 1087e (4:487e)
Pack_QuitRunScript:
ld hl, wJumptableIndex
set 7, [hl]
ld a, TRUE
ld [wPackUsedItem], a
ret
Pack_PrintTextNoScroll: ; 10889 (4:4889)
Pack_PrintTextNoScroll:
ld a, [wOptions]
push af
set NO_TEXT_SCROLL, a
@@ -1277,9 +1236,9 @@ Pack_PrintTextNoScroll: ; 10889 (4:4889)
ld [wOptions], a
ret
WaitBGMap_DrawPackGFX: ; 1089a (4:489a)
WaitBGMap_DrawPackGFX:
call WaitBGMap
DrawPackGFX: ; 1089d
DrawPackGFX:
ld a, [wCurrPocket]
maskbits NUM_POCKETS
ld e, a
@@ -1305,16 +1264,14 @@ DrawPackGFX: ; 1089d
.female
farcall DrawKrisPackGFX
ret
; 108cc
PackGFXPointers: ; 108cc
PackGFXPointers:
dw PackGFX + (15 tiles) * 1 ; ITEM_POCKET
dw PackGFX + (15 tiles) * 3 ; BALL_POCKET
dw PackGFX + (15 tiles) * 0 ; KEY_ITEM_POCKET
dw PackGFX + (15 tiles) * 2 ; TM_HM_POCKET
; 108d4
Pack_InterpretJoypad: ; 108d4 (4:48d4)
Pack_InterpretJoypad:
ld hl, wMenuJoypad
ld a, [wSwitchItem]
and a
@@ -1398,7 +1355,7 @@ Pack_InterpretJoypad: ; 108d4 (4:48d4)
scf
ret
Pack_InitGFX: ; 10955
Pack_InitGFX:
call ClearBGPalettes
call ClearTileMap
call ClearSprites
@@ -1435,9 +1392,8 @@ Pack_InitGFX: ; 10955
call EnableLCD
call DrawPackGFX
ret
; 109a5
PlacePackGFX: ; 109a5
PlacePackGFX:
hlcoord 0, 3
ld a, $50
ld de, SCREEN_WIDTH - 5
@@ -1453,9 +1409,8 @@ PlacePackGFX: ; 109a5
dec b
jr nz, .row
ret
; 109bb
DrawPocketName: ; 109bb
DrawPocketName:
ld a, [wCurrPocket]
; * 15
ld d, a
@@ -1484,9 +1439,8 @@ DrawPocketName: ; 109bb
dec c
jr nz, .row
ret
; 109e1
.tilemap ; 109e1
.tilemap
; ITEM_POCKET
db $00, $04, $04, $04, $01 ; top border
db $06, $07, $08, $09, $0a ; Items
@@ -1503,38 +1457,34 @@ DrawPocketName: ; 109bb
db $00, $04, $04, $04, $01 ; top border
db $10, $11, $12, $13, $14 ; TM/HM
db $02, $05, $05, $05, $03 ; bottom border
; 10a1d
Pack_GetItemName: ; 10a1d
Pack_GetItemName:
ld a, [wCurItem]
ld [wNamedObjectIndexBuffer], a
call GetItemName
call CopyName1
ret
; 10a2a
Unreferenced_Pack_ClearTilemap: ; 10a2a
Unreferenced_Pack_ClearTilemap:
hlcoord 0, 0
ld bc, SCREEN_WIDTH * SCREEN_HEIGHT
ld a, " "
call ByteFill
ret
; 10a36
ClearPocketList: ; 10a36 (4:4a36)
ClearPocketList:
hlcoord 5, 2
lb bc, 10, SCREEN_WIDTH - 5
call ClearBox
ret
Pack_InitColors: ; 10a40
Pack_InitColors:
call WaitBGMap
ld b, SCGB_PACKPALS
call GetSGBLayout
call SetPalettes
call DelayFrame
ret
; 10a4f
ItemsPocketMenuHeader: ; 0x10a4f
db MENU_BACKUP_TILES ; flags
@@ -1551,7 +1501,6 @@ ItemsPocketMenuHeader: ; 0x10a4f
dba PlaceMenuItemName
dba PlaceMenuItemQuantity
dba UpdateItemDescription
; 10a67
PC_Mart_ItemsPocketMenuHeader: ; 0x10a67
db MENU_BACKUP_TILES ; flags
@@ -1568,7 +1517,6 @@ PC_Mart_ItemsPocketMenuHeader: ; 0x10a67
dba PlaceMenuItemName
dba PlaceMenuItemQuantity
dba UpdateItemDescription
; 10a7f
KeyItemsPocketMenuHeader: ; 0x10a7f
db MENU_BACKUP_TILES ; flags
@@ -1585,7 +1533,6 @@ KeyItemsPocketMenuHeader: ; 0x10a7f
dba PlaceMenuItemName
dba PlaceMenuItemQuantity
dba UpdateItemDescription
; 10a97
PC_Mart_KeyItemsPocketMenuHeader: ; 0x10a97
db MENU_BACKUP_TILES ; flags
@@ -1602,7 +1549,6 @@ PC_Mart_KeyItemsPocketMenuHeader: ; 0x10a97
dba PlaceMenuItemName
dba PlaceMenuItemQuantity
dba UpdateItemDescription
; 10aaf
BallsPocketMenuHeader: ; 0x10aaf
db MENU_BACKUP_TILES ; flags
@@ -1619,7 +1565,6 @@ BallsPocketMenuHeader: ; 0x10aaf
dba PlaceMenuItemName
dba PlaceMenuItemQuantity
dba UpdateItemDescription
; 10ac7
PC_Mart_BallsPocketMenuHeader: ; 0x10ac7
db MENU_BACKUP_TILES ; flags
@@ -1636,7 +1581,6 @@ PC_Mart_BallsPocketMenuHeader: ; 0x10ac7
dba PlaceMenuItemName
dba PlaceMenuItemQuantity
dba UpdateItemDescription
; 10adf
Text_PackNoItems: ; 0x10adf
; No items.

View File

@@ -1,4 +1,4 @@
DrawKrisPackGFX: ; 48e81
DrawKrisPackGFX:
ld hl, PackFGFXPointers
add hl, de
add hl, de
@@ -10,11 +10,11 @@ DrawKrisPackGFX: ; 48e81
call Request2bpp
ret
PackFGFXPointers: ; 48e93
PackFGFXPointers:
dw PackFGFX + (15 tiles) * 1 ; ITEM_POCKET
dw PackFGFX + (15 tiles) * 3 ; BALL_POCKET
dw PackFGFX + (15 tiles) * 0 ; KEY_ITEM_POCKET
dw PackFGFX + (15 tiles) * 2 ; TM_HM_POCKET
PackFGFX: ; 48e9b
PackFGFX:
INCBIN "gfx/pack/pack_f.2bpp"

View File

@@ -1,4 +1,4 @@
SwitchItemsInBag: ; 2490c (9:490c)
SwitchItemsInBag:
ld a, [wSwitchItem]
and a
jr z, .init
@@ -84,7 +84,7 @@ SwitchItemsInBag: ; 2490c (9:490c)
ld [wSwitchItem], a
ret
Function249a7: ; 249a7 (9:49a7)
Function249a7:
ld a, [wSwitchItem]
call ItemSwitch_GetNthItem
ld d, h
@@ -110,7 +110,7 @@ Function249a7: ; 249a7 (9:49a7)
scf
ret
Function249d1: ; 249d1 (9:49d1)
Function249d1:
ld a, [wSwitchItem]
call ItemSwitch_GetNthItem
inc hl
@@ -180,14 +180,14 @@ Function249d1: ; 249d1 (9:49d1)
ld [wSwitchItem], a
ret
Function24a40: ; 24a40 (9:4a40)
Function24a40:
call ItemSwitch_GetNthItem
ld de, wd002
call ItemSwitch_ConvertSpacingToDW
call CopyBytes
ret
Function24a4d: ; 24a4d (9:4a4d)
Function24a4d:
call ItemSwitch_GetNthItem
ld d, h
ld e, l
@@ -196,7 +196,7 @@ Function24a4d: ; 24a4d (9:4a4d)
call CopyBytes
ret
ItemSwitch_GetNthItem: ; 24a5c (9:4a5c)
ItemSwitch_GetNthItem:
push af
call ItemSwitch_ConvertSpacingToDW
ld hl, wMenuData_ItemsPointerAddr
@@ -208,7 +208,7 @@ ItemSwitch_GetNthItem: ; 24a5c (9:4a5c)
call AddNTimes
ret
Function24a6c: ; 24a6c (9:4a6c)
Function24a6c:
push hl
call ItemSwitch_ConvertSpacingToDW
ld a, d
@@ -224,7 +224,7 @@ Function24a6c: ; 24a6c (9:4a6c)
pop hl
ret
ItemSwitch_ConvertSpacingToDW: ; 24a80 (9:4a80)
ItemSwitch_ConvertSpacingToDW:
; This function is absolutely idiotic.
push hl
ld a, [wMenuData_ScrollingMenuSpacing]
@@ -239,13 +239,11 @@ ItemSwitch_ConvertSpacingToDW: ; 24a80 (9:4a80)
pop hl
ret
; 24a91 (9:4a91)
.spacing_dws ; 24a91
.spacing_dws
dw 0, 1, 2
; 24a97
Function24a97: ; 24a97 (9:4a97)
Function24a97:
push af
call ItemSwitch_ConvertSpacingToDW
ld a, c
@@ -262,7 +260,7 @@ Function24a97: ; 24a97 (9:4a97)
ld a, $1
ret
Function24aab: ; 24aab (9:4aab)
Function24aab:
.loop
ld a, [hld]
ld [de], a

View File

@@ -1,4 +1,4 @@
TMHMPocket: ; 2c76f (b:476f)
TMHMPocket:
ld a, $1
ld [hInMenu], a
call TMHM_PocketLoop
@@ -20,7 +20,7 @@ TMHMPocket: ; 2c76f (b:476f)
scf
ret
.ConvertItemToTMHMNumber: ; 2c798 (b:4798)
.ConvertItemToTMHMNumber:
ld a, [wCurItem]
ld c, a
callfar GetNumberedTMHM
@@ -28,7 +28,7 @@ TMHMPocket: ; 2c76f (b:476f)
ld [wCurItem], a
ret
ConvertCurItemIntoCurTMHM: ; 2c7a7 (b:47a7)
ConvertCurItemIntoCurTMHM:
ld a, [wCurItem]
ld c, a
callfar GetTMHMNumber
@@ -36,12 +36,12 @@ ConvertCurItemIntoCurTMHM: ; 2c7a7 (b:47a7)
ld [wCurTMHM], a
ret
GetTMHMItemMove: ; 2c7b6 (b:47b6)
GetTMHMItemMove:
call ConvertCurItemIntoCurTMHM
predef GetTMHMMove
ret
AskTeachTMHM: ; 2c7bf (b:47bf)
AskTeachTMHM:
ld hl, wOptions
ld a, [hl]
push af
@@ -70,13 +70,13 @@ AskTeachTMHM: ; 2c7bf (b:47bf)
ld [wOptions], a
ret
ChooseMonToLearnTMHM: ; 2c7fb
ChooseMonToLearnTMHM:
ld hl, wStringBuffer2
ld de, wTMHMMoveNameBackup
ld bc, 12
call CopyBytes
call ClearBGPalettes
ChooseMonToLearnTMHM_NoRefresh: ; 2c80a
ChooseMonToLearnTMHM_NoRefresh:
farcall LoadPartyMenuGFX
farcall InitPartyMenuWithCancel
farcall InitPartyMenuGFX
@@ -115,9 +115,8 @@ ChooseMonToLearnTMHM_NoRefresh: ; 2c80a
pop de
pop hl
jr .loopback
; 2c867
TeachTMHM: ; 2c867
TeachTMHM:
predef CanLearnTMHMMove
push bc
@@ -166,7 +165,6 @@ TeachTMHM: ; 2c867
.learned_move
scf
ret
; 2c8bf (b:48bf)
Text_BootedTM: ; 0x2c8bf
; Booted up a TM.
@@ -192,7 +190,7 @@ Text_TMHMNotCompatible: ; 0x2c8ce
db "@"
; 0x2c8d3
TMHM_PocketLoop: ; 2c8d3 (b:48d3)
TMHM_PocketLoop:
xor a
ld [hBGMapMode], a
call TMHM_DisplayPocketItems
@@ -225,7 +223,7 @@ TMHM_PocketLoop: ; 2c8d3 (b:48d3)
ld [wMenuCursorX], a
jr TMHM_ShowTMMoveDescription
TMHM_JoypadLoop: ; 2c915 (b:4915)
TMHM_JoypadLoop:
call TMHM_DisplayPocketItems
call StaticMenuJoypad
ld b, a
@@ -247,7 +245,7 @@ TMHM_JoypadLoop: ; 2c915 (b:4915)
jp nz, TMHM_ExitPocket
bit D_LEFT_F, a
jp nz, TMHM_ExitPocket
TMHM_ShowTMMoveDescription: ; 2c946 (b:4946)
TMHM_ShowTMMoveDescription:
call TMHM_CheckHoveringOverCancel
jp nc, TMHM_ExitPocket
hlcoord 0, 12
@@ -265,7 +263,7 @@ TMHM_ShowTMMoveDescription: ; 2c946 (b:4946)
call PrintMoveDesc
jp TMHM_JoypadLoop
TMHM_ChooseTMorHM: ; 2c974 (b:4974)
TMHM_ChooseTMorHM:
call TMHM_PlaySFX_ReadText2
call CountTMsHMs ; This stores the count to wd265.
ld a, [wMenuCursorY]
@@ -277,7 +275,7 @@ TMHM_ChooseTMorHM: ; 2c974 (b:4974)
ld a, [wd265]
cp b
jr z, _TMHM_ExitPack ; our cursor was hovering over CANCEL
TMHM_CheckHoveringOverCancel: ; 2c98a (b:498a)
TMHM_CheckHoveringOverCancel:
call TMHM_GetCurrentPocketPosition
ld a, [wMenuCursorY]
ld b, a
@@ -297,19 +295,19 @@ TMHM_CheckHoveringOverCancel: ; 2c98a (b:498a)
cp -1
ret
TMHM_ExitPack: ; 2c9a5 (b:49a5)
TMHM_ExitPack:
call TMHM_PlaySFX_ReadText2
_TMHM_ExitPack: ; 2c9a8 (b:49a8)
_TMHM_ExitPack:
ld a, $2
ld [wMenuJoypad], a
and a
ret
TMHM_ExitPocket: ; 2c9af (b:49af)
TMHM_ExitPocket:
and a
ret
TMHM_ScrollPocket: ; 2c9b1 (b:49b1)
TMHM_ScrollPocket:
ld a, b
bit 7, a
jr nz, .skip
@@ -339,7 +337,7 @@ TMHM_ScrollPocket: ; 2c9b1 (b:49b1)
call TMHM_DisplayPocketItems
jp TMHM_ShowTMMoveDescription
TMHM_DisplayPocketItems: ; 2c9e2 (b:49e2)
TMHM_DisplayPocketItems:
ld a, [wBattleType]
cp BATTLETYPE_TUTORIAL
jp z, Tutorial_TMHMPocket
@@ -433,7 +431,7 @@ TMHM_DisplayPocketItems: ; 2c9e2 (b:49e2)
.done
ret
TMHMPocket_GetCurrentLineCoord: ; 2ca86 (b:4a86)
TMHMPocket_GetCurrentLineCoord:
hlcoord 5, 0
ld bc, 2 * SCREEN_WIDTH
ld a, 6
@@ -445,9 +443,8 @@ TMHMPocket_GetCurrentLineCoord: ; 2ca86 (b:4a86)
dec e
jr nz, .loop
ret
; 2ca95 (b:4a95)
Unreferenced_Function2ca95: ; 2ca95
Unreferenced_Function2ca95:
pop hl
ld bc, 3
add hl, bc
@@ -459,13 +456,11 @@ Unreferenced_Function2ca95: ; 2ca95
call PlaceString
pop hl
ret
; 2caae
TMHM_String_Cancel: ; 2caae
TMHM_String_Cancel:
db "CANCEL@"
; 2cab5
TMHM_GetCurrentPocketPosition: ; 2cab5 (b:4ab5)
TMHM_GetCurrentPocketPosition:
ld hl, wTMsHMs
ld a, [wTMHMPocketScrollPosition]
ld b, a
@@ -482,7 +477,7 @@ TMHM_GetCurrentPocketPosition: ; 2cab5 (b:4ab5)
dec c
ret
Tutorial_TMHMPocket: ; 2caca (b:4aca)
Tutorial_TMHMPocket:
hlcoord 9, 3
push de
ld de, TMHM_String_Cancel
@@ -490,15 +485,14 @@ Tutorial_TMHMPocket: ; 2caca (b:4aca)
pop de
ret
TMHM_PlaySFX_ReadText2: ; 2cad6 (b:4ad6)
TMHM_PlaySFX_ReadText2:
push de
ld de, SFX_READ_TEXT_2
call PlaySFX
pop de
ret
; 2cadf (b:4adf)
Unreferenced_Function2cadf: ; 2cadf
Unreferenced_Function2cadf:
call ConvertCurItemIntoCurTMHM
call .CheckHaveRoomForTMHM
ld hl, .NoRoomText
@@ -506,7 +500,6 @@ Unreferenced_Function2cadf: ; 2cadf
ld hl, .ReceivedText
.print
jp PrintText
; 2caf0
.NoRoomText: ; 0x2caf0
; You have no room for any more @ S.
@@ -520,7 +513,7 @@ Unreferenced_Function2cadf: ; 2cadf
db "@"
; 0x2cafa
.CheckHaveRoomForTMHM: ; 2cafa
.CheckHaveRoomForTMHM:
ld a, [wd265]
dec a
ld hl, wTMsHMs
@@ -533,9 +526,8 @@ Unreferenced_Function2cadf: ; 2cadf
ret nc
ld [hl], a
ret
; 2cb0c
ConsumeTM: ; 2cb0c (b:4b0c)
ConsumeTM:
call ConvertCurItemIntoCurTMHM
ld a, [wd265]
dec a
@@ -556,7 +548,7 @@ ConsumeTM: ; 2cb0c (b:4b0c)
ld [wTMHMPocketScrollPosition], a
ret
CountTMsHMs: ; 2cb2a (b:4b2a)
CountTMsHMs:
ld b, 0
ld c, NUM_TMS + NUM_HMS
ld hl, wTMsHMs
@@ -572,7 +564,7 @@ CountTMsHMs: ; 2cb2a (b:4b2a)
ld [wd265], a
ret
PrintMoveDesc: ; 2cb3e
PrintMoveDesc:
push hl
ld hl, MoveDescriptions
ld a, [wCurSpecies]
@@ -586,4 +578,3 @@ PrintMoveDesc: ; 2cb3e
ld d, [hl]
pop hl
jp PlaceString
; 2cb52

View File

@@ -1,4 +1,4 @@
CanLearnTMHMMove: ; 11639
CanLearnTMHMMove:
ld a, [wCurPartySpecies]
ld [wCurSpecies], a
call GetBaseData
@@ -31,9 +31,8 @@ CanLearnTMHMMove: ; 11639
pop hl
ld c, 0
ret
; 1166a
GetTMHMMove: ; 1166a
GetTMHMMove:
ld a, [wd265]
dec a
ld hl, TMHMMoves
@@ -43,7 +42,6 @@ GetTMHMMove: ; 1166a
ld a, [hl]
ld [wd265], a
ret
; 1167a
INCLUDE "data/moves/tmhm_moves.asm"