mirror of
https://github.com/thornAvery/kep-hack.git
synced 2026-04-16 07:03:22 +12:00
named wram variables
This commit is contained in:
parent
99df5f0fd7
commit
4a8c9993ad
21 changed files with 253 additions and 173 deletions
|
|
@ -12,3 +12,9 @@ ITEM_NAME EQU 4
|
||||||
PLAYEROT_NAME EQU 5
|
PLAYEROT_NAME EQU 5
|
||||||
ENEMYOT_NAME EQU 6
|
ENEMYOT_NAME EQU 6
|
||||||
TRAINER_NAME EQU 7
|
TRAINER_NAME EQU 7
|
||||||
|
|
||||||
|
INIT_ENEMYOT_LIST EQU 1
|
||||||
|
INIT_BAG_ITEM_LIST EQU 2
|
||||||
|
INIT_OTHER_ITEM_LIST EQU 3
|
||||||
|
INIT_PLAYEROT_LIST EQU 4
|
||||||
|
INIT_MON_LIST EQU 5
|
||||||
|
|
@ -58,6 +58,14 @@ TRADE_CANCEL_MENU EQU 5
|
||||||
HEAL_CANCEL_MENU EQU 6
|
HEAL_CANCEL_MENU EQU 6
|
||||||
NO_YES_MENU EQU 7
|
NO_YES_MENU EQU 7
|
||||||
|
|
||||||
|
; menu exit method constants for list menus and the buy/sell/quit menu
|
||||||
|
CHOSE_MENU_ITEM EQU 1 ; pressed A
|
||||||
|
CANCELLED_MENU EQU 2 ; pressed B
|
||||||
|
|
||||||
|
; menu exit method constants for two-option menus
|
||||||
|
CHOSE_FIRST_ITEM EQU 1
|
||||||
|
CHOSE_SECOND_ITEM EQU 2
|
||||||
|
|
||||||
; serial
|
; serial
|
||||||
|
|
||||||
ESTABLISH_CONNECTION_WITH_INTERNAL_CLOCK EQU $01
|
ESTABLISH_CONNECTION_WITH_INTERNAL_CLOCK EQU $01
|
||||||
|
|
|
||||||
|
|
@ -53,29 +53,29 @@ FormatMovesString: ; 39b87 (e:5b87)
|
||||||
|
|
||||||
; XXX this is called in a few places, but it doesn't appear to do anything useful
|
; XXX this is called in a few places, but it doesn't appear to do anything useful
|
||||||
InitList: ; 39bd5 (e:5bd5)
|
InitList: ; 39bd5 (e:5bd5)
|
||||||
ld a, [wd11b]
|
ld a, [wInitListType]
|
||||||
cp $1
|
cp INIT_ENEMYOT_LIST
|
||||||
jr nz, .notEnemy
|
jr nz, .notEnemy
|
||||||
ld hl, wEnemyPartyCount
|
ld hl, wEnemyPartyCount
|
||||||
ld de, wEnemyMonOT
|
ld de, wEnemyMonOT
|
||||||
ld a, ENEMYOT_NAME
|
ld a, ENEMYOT_NAME
|
||||||
jr .done
|
jr .done
|
||||||
.notEnemy
|
.notEnemy
|
||||||
cp $4
|
cp INIT_PLAYEROT_LIST
|
||||||
jr nz, .notPlayer
|
jr nz, .notPlayer
|
||||||
ld hl, wPartyCount
|
ld hl, wPartyCount
|
||||||
ld de, wPartyMonOT
|
ld de, wPartyMonOT
|
||||||
ld a, PLAYEROT_NAME
|
ld a, PLAYEROT_NAME
|
||||||
jr .done
|
jr .done
|
||||||
.notPlayer
|
.notPlayer
|
||||||
cp $5
|
cp INIT_MON_LIST
|
||||||
jr nz, .notMonster
|
jr nz, .notMonster
|
||||||
ld hl, wStringBuffer2 + 11
|
ld hl, wStringBuffer2 + 11
|
||||||
ld de, MonsterNames
|
ld de, MonsterNames
|
||||||
ld a, MONSTER_NAME
|
ld a, MONSTER_NAME
|
||||||
jr .done
|
jr .done
|
||||||
.notMonster
|
.notMonster
|
||||||
cp $2
|
cp INIT_BAG_ITEM_LIST
|
||||||
jr nz, .notBag
|
jr nz, .notBag
|
||||||
ld hl, wNumBagItems
|
ld hl, wNumBagItems
|
||||||
ld de, ItemNames
|
ld de, ItemNames
|
||||||
|
|
|
||||||
|
|
@ -1142,8 +1142,8 @@ DoUseNextMonDialogue: ; 3c79b (f:479b)
|
||||||
ld a, TWO_OPTION_MENU
|
ld a, TWO_OPTION_MENU
|
||||||
ld [wTextBoxID], a
|
ld [wTextBoxID], a
|
||||||
call DisplayTextBoxID
|
call DisplayTextBoxID
|
||||||
ld a, [wd12e]
|
ld a, [wMenuExitMethod]
|
||||||
cp $2 ; did the player choose NO?
|
cp CHOSE_SECOND_ITEM ; did the player choose NO?
|
||||||
jr z, .tryRunning ; if the player chose NO, try running
|
jr z, .tryRunning ; if the player chose NO, try running
|
||||||
and a ; reset carry
|
and a ; reset carry
|
||||||
ret
|
ret
|
||||||
|
|
@ -2296,7 +2296,7 @@ DisplayPlayerBag:
|
||||||
|
|
||||||
DisplayBagMenu:
|
DisplayBagMenu:
|
||||||
xor a
|
xor a
|
||||||
ld [wcf93], a
|
ld [wPrintItemPrices], a
|
||||||
ld a, ITEMLISTMENU
|
ld a, ITEMLISTMENU
|
||||||
ld [wListMenuID], a
|
ld [wListMenuID], a
|
||||||
ld a, [wcc2c]
|
ld a, [wcc2c]
|
||||||
|
|
|
||||||
|
|
@ -357,9 +357,9 @@ TradeCenter_SelectMon:
|
||||||
dec a
|
dec a
|
||||||
ld [wCurrentMenuItem], a
|
ld [wCurrentMenuItem], a
|
||||||
.displayEnemyMonStats
|
.displayEnemyMonStats
|
||||||
ld a, $1
|
ld a, INIT_ENEMYOT_LIST
|
||||||
ld [wd11b], a
|
ld [wInitListType], a
|
||||||
callab InitList
|
callab InitList ; the list isn't used
|
||||||
ld hl, wEnemyMons
|
ld hl, wEnemyMons
|
||||||
call TradeCenter_DisplayStats
|
call TradeCenter_DisplayStats
|
||||||
jp .getNewInput
|
jp .getNewInput
|
||||||
|
|
@ -416,9 +416,9 @@ TradeCenter_SelectMon:
|
||||||
jr z, .playerMonMenu_ANotPressed
|
jr z, .playerMonMenu_ANotPressed
|
||||||
jp .chosePlayerMon ; jump if A button pressed
|
jp .chosePlayerMon ; jump if A button pressed
|
||||||
; unreachable code
|
; unreachable code
|
||||||
ld a, $4
|
ld a, INIT_PLAYEROT_LIST
|
||||||
ld [wd11b], a
|
ld [wInitListType], a
|
||||||
callab InitList
|
callab InitList ; the list isn't used
|
||||||
call TradeCenter_DisplayStats
|
call TradeCenter_DisplayStats
|
||||||
jp .getNewInput
|
jp .getNewInput
|
||||||
.playerMonMenu_ANotPressed
|
.playerMonMenu_ANotPressed
|
||||||
|
|
@ -511,9 +511,9 @@ TradeCenter_SelectMon:
|
||||||
.displayPlayerMonStats
|
.displayPlayerMonStats
|
||||||
pop af
|
pop af
|
||||||
ld [wCurrentMenuItem], a
|
ld [wCurrentMenuItem], a
|
||||||
ld a, $4
|
ld a, INIT_PLAYEROT_LIST
|
||||||
ld [wd11b], a
|
ld [wInitListType], a
|
||||||
callab InitList
|
callab InitList ; the list isn't used
|
||||||
call TradeCenter_DisplayStats
|
call TradeCenter_DisplayStats
|
||||||
call LoadScreenTilesFromBuffer1
|
call LoadScreenTilesFromBuffer1
|
||||||
jp .playerMonMenu
|
jp .playerMonMenu
|
||||||
|
|
|
||||||
|
|
@ -450,7 +450,7 @@ ItemUseBall: ; d687 (3:5687)
|
||||||
ret nz
|
ret nz
|
||||||
ld hl,wNumBagItems
|
ld hl,wNumBagItems
|
||||||
inc a
|
inc a
|
||||||
ld [wcf96],a
|
ld [wItemQuantity],a
|
||||||
jp RemoveItemFromInventory
|
jp RemoveItemFromInventory
|
||||||
ItemUseBallText00: ; d937 (3:5937)
|
ItemUseBallText00: ; d937 (3:5937)
|
||||||
;"It dodged the thrown ball!"
|
;"It dodged the thrown ball!"
|
||||||
|
|
@ -655,7 +655,7 @@ ItemUseEvoStone: ; da5b (3:5a5b)
|
||||||
ld [wWhichPokemon],a
|
ld [wWhichPokemon],a
|
||||||
ld hl,wNumBagItems
|
ld hl,wNumBagItems
|
||||||
ld a,1 ; remove 1 stone
|
ld a,1 ; remove 1 stone
|
||||||
ld [wcf96],a
|
ld [wItemQuantity],a
|
||||||
jp RemoveItemFromInventory
|
jp RemoveItemFromInventory
|
||||||
.noEffect
|
.noEffect
|
||||||
call ItemUseNoEffect
|
call ItemUseNoEffect
|
||||||
|
|
@ -2193,7 +2193,7 @@ PrintItemUseTextAndRemoveItem: ; e563 (3:6563)
|
||||||
RemoveUsedItem: ; e571 (3:6571)
|
RemoveUsedItem: ; e571 (3:6571)
|
||||||
ld hl,wNumBagItems
|
ld hl,wNumBagItems
|
||||||
ld a,1 ; one item
|
ld a,1 ; one item
|
||||||
ld [wcf96],a ; store quantity
|
ld [wItemQuantity],a
|
||||||
jp RemoveItemFromInventory
|
jp RemoveItemFromInventory
|
||||||
|
|
||||||
ItemUseNoEffect: ; e57c (3:657c)
|
ItemUseNoEffect: ; e57c (3:657c)
|
||||||
|
|
@ -2464,7 +2464,7 @@ GetSelectedMoveOffset2: ; e6e9 (3:66e9)
|
||||||
; hl = address of inventory (either wNumBagItems or wNumBoxItems)
|
; hl = address of inventory (either wNumBagItems or wNumBoxItems)
|
||||||
; [wcf91] = item ID
|
; [wcf91] = item ID
|
||||||
; [wWhichPokemon] = index of item within inventory
|
; [wWhichPokemon] = index of item within inventory
|
||||||
; [wcf96] = quantity to toss
|
; [wItemQuantity] = quantity to toss
|
||||||
; OUTPUT:
|
; OUTPUT:
|
||||||
; clears carry flag if the item is tossed, sets carry flag if not
|
; clears carry flag if the item is tossed, sets carry flag if not
|
||||||
TossItem_: ; e6f1 (3:66f1)
|
TossItem_: ; e6f1 (3:66f1)
|
||||||
|
|
@ -2475,7 +2475,7 @@ TossItem_: ; e6f1 (3:66f1)
|
||||||
jr c,.tooImportantToToss
|
jr c,.tooImportantToToss
|
||||||
push hl
|
push hl
|
||||||
call IsKeyItem_
|
call IsKeyItem_
|
||||||
ld a,[wd124]
|
ld a,[wIsKeyItem]
|
||||||
pop hl
|
pop hl
|
||||||
and a
|
and a
|
||||||
jr nz,.tooImportantToToss
|
jr nz,.tooImportantToToss
|
||||||
|
|
@ -2491,11 +2491,11 @@ TossItem_: ; e6f1 (3:66f1)
|
||||||
ld a,TWO_OPTION_MENU
|
ld a,TWO_OPTION_MENU
|
||||||
ld [wTextBoxID],a
|
ld [wTextBoxID],a
|
||||||
call DisplayTextBoxID ; yes/no menu
|
call DisplayTextBoxID ; yes/no menu
|
||||||
ld a,[wd12e]
|
ld a,[wMenuExitMethod]
|
||||||
cp a,2
|
cp a,CHOSE_SECOND_ITEM
|
||||||
pop hl
|
pop hl
|
||||||
scf
|
scf
|
||||||
ret z
|
ret z ; return if the player chose No
|
||||||
; if the player chose Yes
|
; if the player chose Yes
|
||||||
push hl
|
push hl
|
||||||
ld a,[wWhichPokemon]
|
ld a,[wWhichPokemon]
|
||||||
|
|
@ -2533,12 +2533,12 @@ TooImportantToTossText: ; e75f (3:675f)
|
||||||
; INPUT:
|
; INPUT:
|
||||||
; [wcf91] = item ID
|
; [wcf91] = item ID
|
||||||
; OUTPUT:
|
; OUTPUT:
|
||||||
; [wd124] = result
|
; [wIsKeyItem] = result
|
||||||
; 00: item is not key item
|
; 00: item is not key item
|
||||||
; 01: item is key item
|
; 01: item is key item
|
||||||
IsKeyItem_: ; e764 (3:6764)
|
IsKeyItem_: ; e764 (3:6764)
|
||||||
ld a,$01
|
ld a,$01
|
||||||
ld [wd124],a
|
ld [wIsKeyItem],a
|
||||||
ld a,[wcf91]
|
ld a,[wcf91]
|
||||||
cp a,HM_01 ; is the item an HM or TM?
|
cp a,HM_01 ; is the item an HM or TM?
|
||||||
jr nc,.checkIfItemIsHM
|
jr nc,.checkIfItemIsHM
|
||||||
|
|
@ -2562,7 +2562,7 @@ IsKeyItem_: ; e764 (3:6764)
|
||||||
call IsItemHM
|
call IsItemHM
|
||||||
ret c
|
ret c
|
||||||
xor a
|
xor a
|
||||||
ld [wd124],a
|
ld [wIsKeyItem],a
|
||||||
ret
|
ret
|
||||||
|
|
||||||
INCLUDE "data/key_items.asm"
|
INCLUDE "data/key_items.asm"
|
||||||
|
|
|
||||||
|
|
@ -231,7 +231,7 @@ BillsPCDeposit:
|
||||||
call PlaySoundWaitForCurrent
|
call PlaySoundWaitForCurrent
|
||||||
ld a, $1
|
ld a, $1
|
||||||
ld [wcf95], a
|
ld [wcf95], a
|
||||||
call Func_3a68
|
call MoveMon
|
||||||
xor a
|
xor a
|
||||||
ld [wcf95], a
|
ld [wcf95], a
|
||||||
call RemovePokemon
|
call RemovePokemon
|
||||||
|
|
@ -283,7 +283,7 @@ Func_21618: ; 21618 (8:5618)
|
||||||
call PlaySoundWaitForCurrent
|
call PlaySoundWaitForCurrent
|
||||||
xor a
|
xor a
|
||||||
ld [wcf95], a
|
ld [wcf95], a
|
||||||
call Func_3a68
|
call MoveMon
|
||||||
ld a, $1
|
ld a, $1
|
||||||
ld [wcf95], a
|
ld [wcf95], a
|
||||||
call RemovePokemon
|
call RemovePokemon
|
||||||
|
|
@ -329,7 +329,7 @@ Func_216be: ; 216be (8:56be)
|
||||||
ld a, h
|
ld a, h
|
||||||
ld [wList + 1], a
|
ld [wList + 1], a
|
||||||
xor a
|
xor a
|
||||||
ld [wcf93], a
|
ld [wPrintItemPrices], a
|
||||||
ld [wListMenuID], a
|
ld [wListMenuID], a
|
||||||
inc a ; MONSTER_NAME
|
inc a ; MONSTER_NAME
|
||||||
ld [wNameListType], a
|
ld [wNameListType], a
|
||||||
|
|
|
||||||
|
|
@ -135,7 +135,7 @@ RemoveItemByID: ; 17f37 (5:7f37)
|
||||||
jr .asm_17f40
|
jr .asm_17f40
|
||||||
.asm_17f4f
|
.asm_17f4f
|
||||||
ld a, $1
|
ld a, $1
|
||||||
ld [wcf96], a
|
ld [wItemQuantity], a
|
||||||
ld a, [$ffdc]
|
ld a, [$ffdc]
|
||||||
ld [wWhichPokemon], a
|
ld [wWhichPokemon], a
|
||||||
ld hl, wNumBagItems
|
ld hl, wNumBagItems
|
||||||
|
|
|
||||||
|
|
@ -101,15 +101,15 @@ Func_79ab: ; 79ab (1:79ab)
|
||||||
ld a, h
|
ld a, h
|
||||||
ld [wList + 1], a
|
ld [wList + 1], a
|
||||||
xor a
|
xor a
|
||||||
ld [wcf93], a
|
ld [wPrintItemPrices], a
|
||||||
ld a, $3
|
ld a, $3
|
||||||
ld [wListMenuID], a
|
ld [wListMenuID], a
|
||||||
call DisplayListMenuID
|
call DisplayListMenuID
|
||||||
jp c, Func_790c
|
jp c, Func_790c
|
||||||
call IsKeyItem
|
call IsKeyItem
|
||||||
ld a, $1
|
ld a, $1
|
||||||
ld [wcf96], a
|
ld [wItemQuantity], a
|
||||||
ld a, [wd124]
|
ld a, [wIsKeyItem]
|
||||||
and a
|
and a
|
||||||
jr nz, .asm_79e7
|
jr nz, .asm_79e7
|
||||||
ld hl, DepositHowManyText
|
ld hl, DepositHowManyText
|
||||||
|
|
@ -155,15 +155,15 @@ Func_7a28: ; 7a28 (1:7a28)
|
||||||
ld a, h
|
ld a, h
|
||||||
ld [wList + 1], a
|
ld [wList + 1], a
|
||||||
xor a
|
xor a
|
||||||
ld [wcf93], a
|
ld [wPrintItemPrices], a
|
||||||
ld a, $3
|
ld a, $3
|
||||||
ld [wListMenuID], a
|
ld [wListMenuID], a
|
||||||
call DisplayListMenuID
|
call DisplayListMenuID
|
||||||
jp c, Func_790c
|
jp c, Func_790c
|
||||||
call IsKeyItem
|
call IsKeyItem
|
||||||
ld a, $1
|
ld a, $1
|
||||||
ld [wcf96], a
|
ld [wItemQuantity], a
|
||||||
ld a, [wd124]
|
ld a, [wIsKeyItem]
|
||||||
and a
|
and a
|
||||||
jr nz, .asm_7a64
|
jr nz, .asm_7a64
|
||||||
ld hl, WithdrawHowManyText
|
ld hl, WithdrawHowManyText
|
||||||
|
|
@ -209,7 +209,7 @@ Func_7aa5: ; 7aa5 (1:7aa5)
|
||||||
ld a, h
|
ld a, h
|
||||||
ld [wList + 1], a
|
ld [wList + 1], a
|
||||||
xor a
|
xor a
|
||||||
ld [wcf93], a
|
ld [wPrintItemPrices], a
|
||||||
ld a, $3
|
ld a, $3
|
||||||
ld [wListMenuID], a
|
ld [wListMenuID], a
|
||||||
push hl
|
push hl
|
||||||
|
|
@ -220,8 +220,8 @@ Func_7aa5: ; 7aa5 (1:7aa5)
|
||||||
call IsKeyItem
|
call IsKeyItem
|
||||||
pop hl
|
pop hl
|
||||||
ld a, $1
|
ld a, $1
|
||||||
ld [wcf96], a
|
ld [wItemQuantity], a
|
||||||
ld a, [wd124]
|
ld a, [wIsKeyItem]
|
||||||
and a
|
and a
|
||||||
jr nz, .asm_7aef
|
jr nz, .asm_7aef
|
||||||
ld a, [wcf91]
|
ld a, [wcf91]
|
||||||
|
|
|
||||||
|
|
@ -313,7 +313,7 @@ StartMenu_Item: ; 13302 (4:7302)
|
||||||
ld [hli],a
|
ld [hli],a
|
||||||
ld [hl],b ; store item bag pointer at wList (for DisplayListMenuID)
|
ld [hl],b ; store item bag pointer at wList (for DisplayListMenuID)
|
||||||
xor a
|
xor a
|
||||||
ld [wcf93],a
|
ld [wPrintItemPrices],a
|
||||||
ld a,ITEMLISTMENU
|
ld a,ITEMLISTMENU
|
||||||
ld [wListMenuID],a
|
ld [wListMenuID],a
|
||||||
ld a,[wcc2c]
|
ld a,[wcc2c]
|
||||||
|
|
@ -423,7 +423,7 @@ StartMenu_Item: ; 13302 (4:7302)
|
||||||
jp ItemMenuLoop
|
jp ItemMenuLoop
|
||||||
.tossItem
|
.tossItem
|
||||||
call IsKeyItem
|
call IsKeyItem
|
||||||
ld a,[wd124]
|
ld a,[wIsKeyItem]
|
||||||
and a
|
and a
|
||||||
jr nz,.skipAskingQuantity
|
jr nz,.skipAskingQuantity
|
||||||
ld a,[wcf91]
|
ld a,[wcf91]
|
||||||
|
|
|
||||||
|
|
@ -46,7 +46,7 @@ OakSpeech: ; 6115 (1:6115)
|
||||||
ld a,POTION
|
ld a,POTION
|
||||||
ld [wcf91],a
|
ld [wcf91],a
|
||||||
ld a,1
|
ld a,1
|
||||||
ld [wcf96],a
|
ld [wItemQuantity],a
|
||||||
call AddItemToInventory ; give one potion
|
call AddItemToInventory ; give one potion
|
||||||
ld a,[W_ANIMATIONID]
|
ld a,[W_ANIMATIONID]
|
||||||
ld [wDestinationMap],a
|
ld [wDestinationMap],a
|
||||||
|
|
|
||||||
|
|
@ -1,30 +1,34 @@
|
||||||
DisplayPokemartDialogue_: ; 6c20 (1:6c20)
|
DisplayPokemartDialogue_: ; 6c20 (1:6c20)
|
||||||
ld a,[wListScrollOffset]
|
ld a,[wListScrollOffset]
|
||||||
ld [wd07e],a
|
ld [wSavedListScrollOffset],a
|
||||||
call UpdateSprites
|
call UpdateSprites
|
||||||
xor a
|
xor a
|
||||||
ld [wcf0a],a ; flag that is set if something is sold or bought
|
ld [wBoughtOrSoldItemInMart],a
|
||||||
.loop
|
.loop
|
||||||
xor a
|
xor a
|
||||||
ld [wListScrollOffset],a
|
ld [wListScrollOffset],a
|
||||||
ld [wCurrentMenuItem],a
|
ld [wCurrentMenuItem],a
|
||||||
ld [wPlayerMonNumber],a
|
ld [wPlayerMonNumber],a
|
||||||
inc a
|
inc a
|
||||||
ld [wcf93],a
|
ld [wPrintItemPrices],a
|
||||||
ld a,MONEY_BOX
|
ld a,MONEY_BOX
|
||||||
ld [wTextBoxID],a
|
ld [wTextBoxID],a
|
||||||
call DisplayTextBoxID ; draw money text box
|
call DisplayTextBoxID
|
||||||
ld a,BUY_SELL_QUIT_MENU
|
ld a,BUY_SELL_QUIT_MENU
|
||||||
ld [wTextBoxID],a
|
ld [wTextBoxID],a
|
||||||
call DisplayTextBoxID ; do buy/sell/quit menu
|
call DisplayTextBoxID
|
||||||
ld hl,wd128 ; pointer to this pokemart's inventory
|
|
||||||
|
; This code is useless. It copies the address of the pokemart's inventory to hl,
|
||||||
|
; but the address is never used.
|
||||||
|
ld hl,wItemListPointer
|
||||||
ld a,[hli]
|
ld a,[hli]
|
||||||
ld l,[hl]
|
ld l,[hl]
|
||||||
ld h,a ; hl = address of inventory
|
ld h,a
|
||||||
ld a,[wd12e]
|
|
||||||
cp a,$02
|
ld a,[wMenuExitMethod]
|
||||||
|
cp a,CANCELLED_MENU
|
||||||
jp z,.done
|
jp z,.done
|
||||||
ld a,[wd12d] ; ID of the chosen menu item
|
ld a,[wChosenMenuItem]
|
||||||
and a ; buying?
|
and a ; buying?
|
||||||
jp z,.buyMenu
|
jp z,.buyMenu
|
||||||
dec a ; selling?
|
dec a ; selling?
|
||||||
|
|
@ -32,11 +36,14 @@ DisplayPokemartDialogue_: ; 6c20 (1:6c20)
|
||||||
dec a ; quitting?
|
dec a ; quitting?
|
||||||
jp z,.done
|
jp z,.done
|
||||||
.sellMenu
|
.sellMenu
|
||||||
|
|
||||||
|
; the same variables are set again below, so this code has no effect
|
||||||
xor a
|
xor a
|
||||||
ld [wcf93],a
|
ld [wPrintItemPrices],a
|
||||||
ld a,$02
|
ld a,INIT_BAG_ITEM_LIST
|
||||||
ld [wd11b],a
|
ld [wInitListType],a
|
||||||
callab InitList
|
callab InitList
|
||||||
|
|
||||||
ld a,[wNumBagItems]
|
ld a,[wNumBagItems]
|
||||||
and a
|
and a
|
||||||
jp z,.bagEmpty
|
jp z,.bagEmpty
|
||||||
|
|
@ -54,15 +61,15 @@ DisplayPokemartDialogue_: ; 6c20 (1:6c20)
|
||||||
ld a,h
|
ld a,h
|
||||||
ld [wList + 1],a
|
ld [wList + 1],a
|
||||||
xor a
|
xor a
|
||||||
ld [wcf93],a
|
ld [wPrintItemPrices],a
|
||||||
ld [wCurrentMenuItem],a
|
ld [wCurrentMenuItem],a
|
||||||
ld a,ITEMLISTMENU
|
ld a,ITEMLISTMENU
|
||||||
ld [wListMenuID],a
|
ld [wListMenuID],a
|
||||||
call DisplayListMenuID
|
call DisplayListMenuID
|
||||||
jp c,.returnToMainPokemartMenu ; if the player closed the menu
|
jp c,.returnToMainPokemartMenu ; if the player closed the menu
|
||||||
.confirmItemSale ; if the player is trying to sell a specific item
|
.confirmItemSale ; if the player is trying to sell a specific item
|
||||||
call IsKeyItem ; check if item is unsellable
|
call IsKeyItem
|
||||||
ld a,[wd124]
|
ld a,[wIsKeyItem]
|
||||||
and a
|
and a
|
||||||
jr nz,.unsellableItem
|
jr nz,.unsellableItem
|
||||||
ld a,[wcf91]
|
ld a,[wcf91]
|
||||||
|
|
@ -70,7 +77,7 @@ DisplayPokemartDialogue_: ; 6c20 (1:6c20)
|
||||||
jr c,.unsellableItem
|
jr c,.unsellableItem
|
||||||
ld a,PRICEDITEMLISTMENU
|
ld a,PRICEDITEMLISTMENU
|
||||||
ld [wListMenuID],a
|
ld [wListMenuID],a
|
||||||
ld [$ff8e],a ; halve prices when selling
|
ld [hHalveItemPrices],a ; halve prices when selling
|
||||||
call DisplayChooseQuantityMenu
|
call DisplayChooseQuantityMenu
|
||||||
inc a
|
inc a
|
||||||
jr z,.sellMenuLoop ; if the player closed the choose quantity menu with the B button
|
jr z,.sellMenuLoop ; if the player closed the choose quantity menu with the B button
|
||||||
|
|
@ -82,18 +89,22 @@ DisplayPokemartDialogue_: ; 6c20 (1:6c20)
|
||||||
ld a,TWO_OPTION_MENU
|
ld a,TWO_OPTION_MENU
|
||||||
ld [wTextBoxID],a
|
ld [wTextBoxID],a
|
||||||
call DisplayTextBoxID ; yes/no menu
|
call DisplayTextBoxID ; yes/no menu
|
||||||
ld a,[wd12e]
|
ld a,[wMenuExitMethod]
|
||||||
cp a,$02
|
cp a,CHOSE_SECOND_ITEM
|
||||||
jr z,.sellMenuLoop ; if the player pressed the B button
|
jr z,.sellMenuLoop ; if the player chose No or pressed the B button
|
||||||
ld a,[wd12d] ; ID of the chosen menu item
|
|
||||||
|
; The following code is supposed to check if the player chose No, but the above
|
||||||
|
; check already catches it.
|
||||||
|
ld a,[wChosenMenuItem]
|
||||||
dec a
|
dec a
|
||||||
jr z,.sellMenuLoop ; if the player chose No
|
jr z,.sellMenuLoop
|
||||||
|
|
||||||
.sellItem
|
.sellItem
|
||||||
ld a,[wcf0a] ; flag that is set if something is sold or bought
|
ld a,[wBoughtOrSoldItemInMart]
|
||||||
and a
|
and a
|
||||||
jr nz,.skipSettingFlag1
|
jr nz,.skipSettingFlag1
|
||||||
inc a
|
inc a
|
||||||
ld [wcf0a],a
|
ld [wBoughtOrSoldItemInMart],a
|
||||||
.skipSettingFlag1
|
.skipSettingFlag1
|
||||||
call AddAmountSoldToMoney
|
call AddAmountSoldToMoney
|
||||||
ld hl,wNumBagItems
|
ld hl,wNumBagItems
|
||||||
|
|
@ -106,22 +117,25 @@ DisplayPokemartDialogue_: ; 6c20 (1:6c20)
|
||||||
.bagEmpty
|
.bagEmpty
|
||||||
ld hl,PokemartItemBagEmptyText
|
ld hl,PokemartItemBagEmptyText
|
||||||
call PrintText
|
call PrintText
|
||||||
call SaveScreenTilesToBuffer1 ; save screen
|
call SaveScreenTilesToBuffer1
|
||||||
jp .returnToMainPokemartMenu
|
jp .returnToMainPokemartMenu
|
||||||
.buyMenu
|
.buyMenu
|
||||||
ld a,$01
|
|
||||||
ld [wcf93],a
|
; the same variables are set again below, so this code has no effect
|
||||||
ld a,$03
|
ld a,1
|
||||||
ld [wd11b],a
|
ld [wPrintItemPrices],a
|
||||||
|
ld a,INIT_OTHER_ITEM_LIST
|
||||||
|
ld [wInitListType],a
|
||||||
callab InitList
|
callab InitList
|
||||||
|
|
||||||
ld hl,PokemartBuyingGreetingText
|
ld hl,PokemartBuyingGreetingText
|
||||||
call PrintText
|
call PrintText
|
||||||
call SaveScreenTilesToBuffer1 ; save screen
|
call SaveScreenTilesToBuffer1
|
||||||
.buyMenuLoop
|
.buyMenuLoop
|
||||||
call LoadScreenTilesFromBuffer1 ; restore saved screen
|
call LoadScreenTilesFromBuffer1
|
||||||
ld a,MONEY_BOX
|
ld a,MONEY_BOX
|
||||||
ld [wTextBoxID],a
|
ld [wTextBoxID],a
|
||||||
call DisplayTextBoxID ; draw money text box
|
call DisplayTextBoxID
|
||||||
ld hl,wStringBuffer2 + 11
|
ld hl,wStringBuffer2 + 11
|
||||||
ld a,l
|
ld a,l
|
||||||
ld [wList],a
|
ld [wList],a
|
||||||
|
|
@ -130,15 +144,15 @@ DisplayPokemartDialogue_: ; 6c20 (1:6c20)
|
||||||
xor a
|
xor a
|
||||||
ld [wCurrentMenuItem],a
|
ld [wCurrentMenuItem],a
|
||||||
inc a
|
inc a
|
||||||
ld [wcf93],a
|
ld [wPrintItemPrices],a
|
||||||
inc a ; a = 2 (PRICEDITEMLISTMENU)
|
inc a ; a = 2 (PRICEDITEMLISTMENU)
|
||||||
ld [wListMenuID],a
|
ld [wListMenuID],a
|
||||||
call DisplayListMenuID
|
call DisplayListMenuID
|
||||||
jr c,.returnToMainPokemartMenu ; if the player closed the menu
|
jr c,.returnToMainPokemartMenu ; if the player closed the menu
|
||||||
ld a,$63
|
ld a,99
|
||||||
ld [wcf97],a
|
ld [wMaxItemQuantity],a
|
||||||
xor a
|
xor a
|
||||||
ld [$ff8e],a
|
ld [hHalveItemPrices],a ; don't halve item prices when buying
|
||||||
call DisplayChooseQuantityMenu
|
call DisplayChooseQuantityMenu
|
||||||
inc a
|
inc a
|
||||||
jr z,.buyMenuLoop ; if the player closed the choose quantity menu with the B button
|
jr z,.buyMenuLoop ; if the player closed the choose quantity menu with the B button
|
||||||
|
|
@ -153,12 +167,16 @@ DisplayPokemartDialogue_: ; 6c20 (1:6c20)
|
||||||
ld a,TWO_OPTION_MENU
|
ld a,TWO_OPTION_MENU
|
||||||
ld [wTextBoxID],a
|
ld [wTextBoxID],a
|
||||||
call DisplayTextBoxID ; yes/no menu
|
call DisplayTextBoxID ; yes/no menu
|
||||||
ld a,[wd12e]
|
ld a,[wMenuExitMethod]
|
||||||
cp a,$02
|
cp a,CHOSE_SECOND_ITEM
|
||||||
jp z,.buyMenuLoop ; if the player pressed the B button
|
jp z,.buyMenuLoop ; if the player chose No or pressed the B button
|
||||||
ld a,[wd12d] ; ID of the chosen menu item
|
|
||||||
|
; The following code is supposed to check if the player chose No, but the above
|
||||||
|
; check already catches it.
|
||||||
|
ld a,[wChosenMenuItem]
|
||||||
dec a
|
dec a
|
||||||
jr z,.buyMenuLoop ; if the player chose No
|
jr z,.buyMenuLoop
|
||||||
|
|
||||||
.buyItem
|
.buyItem
|
||||||
call .isThereEnoughMoney
|
call .isThereEnoughMoney
|
||||||
jr c,.notEnoughMoney
|
jr c,.notEnoughMoney
|
||||||
|
|
@ -166,11 +184,11 @@ DisplayPokemartDialogue_: ; 6c20 (1:6c20)
|
||||||
call AddItemToInventory
|
call AddItemToInventory
|
||||||
jr nc,.bagFull
|
jr nc,.bagFull
|
||||||
call SubtractAmountPaidFromMoney
|
call SubtractAmountPaidFromMoney
|
||||||
ld a,[wcf0a] ; flag that is set if something is sold or bought
|
ld a,[wBoughtOrSoldItemInMart]
|
||||||
and a
|
and a
|
||||||
jr nz,.skipSettingFlag2
|
jr nz,.skipSettingFlag2
|
||||||
ld a,$01
|
ld a,1
|
||||||
ld [wcf0a],a
|
ld [wBoughtOrSoldItemInMart],a
|
||||||
.skipSettingFlag2
|
.skipSettingFlag2
|
||||||
ld a,(SFX_02_5a - SFX_Headers_02) / 3
|
ld a,(SFX_02_5a - SFX_Headers_02) / 3
|
||||||
call PlaySoundWaitForCurrent
|
call PlaySoundWaitForCurrent
|
||||||
|
|
@ -182,7 +200,7 @@ DisplayPokemartDialogue_: ; 6c20 (1:6c20)
|
||||||
call LoadScreenTilesFromBuffer1
|
call LoadScreenTilesFromBuffer1
|
||||||
ld a,MONEY_BOX
|
ld a,MONEY_BOX
|
||||||
ld [wTextBoxID],a
|
ld [wTextBoxID],a
|
||||||
call DisplayTextBoxID ; draw money text box
|
call DisplayTextBoxID
|
||||||
ld hl,PokemartAnythingElseText
|
ld hl,PokemartAnythingElseText
|
||||||
call PrintText
|
call PrintText
|
||||||
jp .loop
|
jp .loop
|
||||||
|
|
@ -202,10 +220,10 @@ DisplayPokemartDialogue_: ; 6c20 (1:6c20)
|
||||||
.done
|
.done
|
||||||
ld hl,PokemartThankYouText
|
ld hl,PokemartThankYouText
|
||||||
call PrintText
|
call PrintText
|
||||||
ld a,$01
|
ld a,1
|
||||||
ld [wUpdateSpritesEnabled],a
|
ld [wUpdateSpritesEnabled],a
|
||||||
call UpdateSprites
|
call UpdateSprites
|
||||||
ld a,[wd07e]
|
ld a,[wSavedListScrollOffset]
|
||||||
ld [wListScrollOffset],a
|
ld [wListScrollOffset],a
|
||||||
ret
|
ret
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -11,7 +11,7 @@ Func_1c9c6: ; 1c9c6 (7:49c6)
|
||||||
xor a
|
xor a
|
||||||
ld [wCurrentMenuItem], a
|
ld [wCurrentMenuItem], a
|
||||||
ld [wListScrollOffset], a
|
ld [wListScrollOffset], a
|
||||||
ld [wcf93], a
|
ld [wPrintItemPrices], a
|
||||||
ld a, $4
|
ld a, $4
|
||||||
ld [wListMenuID], a
|
ld [wListMenuID], a
|
||||||
call DisplayListMenuID
|
call DisplayListMenuID
|
||||||
|
|
|
||||||
69
home.asm
69
home.asm
|
|
@ -1201,8 +1201,8 @@ DisplayPokemartDialogue:: ; 2a2e (0:2a2e)
|
||||||
pop hl
|
pop hl
|
||||||
inc hl
|
inc hl
|
||||||
call LoadItemList
|
call LoadItemList
|
||||||
ld a,$02
|
ld a,PRICEDITEMLISTMENU
|
||||||
ld [wListMenuID],a ; selects between subtypes of menus
|
ld [wListMenuID],a
|
||||||
ld a,[H_LOADEDROMBANK]
|
ld a,[H_LOADEDROMBANK]
|
||||||
push af
|
push af
|
||||||
ld a,Bank(DisplayPokemartDialogue_)
|
ld a,Bank(DisplayPokemartDialogue_)
|
||||||
|
|
@ -1219,12 +1219,12 @@ PokemartGreetingText:: ; 2a55 (0:2a55)
|
||||||
db "@"
|
db "@"
|
||||||
|
|
||||||
LoadItemList:: ; 2a5a (0:2a5a)
|
LoadItemList:: ; 2a5a (0:2a5a)
|
||||||
ld a,$01
|
ld a,1
|
||||||
ld [wUpdateSpritesEnabled],a
|
ld [wUpdateSpritesEnabled],a
|
||||||
ld a,h
|
ld a,h
|
||||||
ld [wd128],a
|
ld [wItemListPointer],a
|
||||||
ld a,l
|
ld a,l
|
||||||
ld [wd129],a
|
ld [wItemListPointer + 1],a
|
||||||
ld de,wStringBuffer2 + 11
|
ld de,wStringBuffer2 + 11
|
||||||
.loop
|
.loop
|
||||||
ld a,[hli]
|
ld a,[hli]
|
||||||
|
|
@ -1336,7 +1336,7 @@ AddAmountSoldToMoney:: ; 2b9e (0:2b9e)
|
||||||
; INPUT:
|
; INPUT:
|
||||||
; HL = address of inventory (either wNumBagItems or wNumBoxItems)
|
; HL = address of inventory (either wNumBagItems or wNumBoxItems)
|
||||||
; [wWhichPokemon] = index (within the inventory) of the item to remove
|
; [wWhichPokemon] = index (within the inventory) of the item to remove
|
||||||
; [wcf96] = quantity to remove
|
; [wItemQuantity] = quantity to remove
|
||||||
RemoveItemFromInventory:: ; 2bbb (0:2bbb)
|
RemoveItemFromInventory:: ; 2bbb (0:2bbb)
|
||||||
ld a,[H_LOADEDROMBANK]
|
ld a,[H_LOADEDROMBANK]
|
||||||
push af
|
push af
|
||||||
|
|
@ -1353,7 +1353,7 @@ RemoveItemFromInventory:: ; 2bbb (0:2bbb)
|
||||||
; INPUT:
|
; INPUT:
|
||||||
; HL = address of inventory (either wNumBagItems or wNumBoxItems)
|
; HL = address of inventory (either wNumBagItems or wNumBoxItems)
|
||||||
; [wcf91] = item ID
|
; [wcf91] = item ID
|
||||||
; [wcf96] = item quantity
|
; [wItemQuantity] = item quantity
|
||||||
; sets carry flag if successful, unsets carry flag if unsuccessful
|
; sets carry flag if successful, unsets carry flag if unsuccessful
|
||||||
AddItemToInventory:: ; 2bcf (0:2bcf)
|
AddItemToInventory:: ; 2bcf (0:2bcf)
|
||||||
push bc
|
push bc
|
||||||
|
|
@ -1461,9 +1461,12 @@ DisplayListMenuIDLoop:: ; 2c53 (0:2c53)
|
||||||
.buttonAPressed
|
.buttonAPressed
|
||||||
ld a,[wCurrentMenuItem]
|
ld a,[wCurrentMenuItem]
|
||||||
call PlaceUnfilledArrowMenuCursor
|
call PlaceUnfilledArrowMenuCursor
|
||||||
|
|
||||||
|
; pointless because both values are overwritten before they are read
|
||||||
ld a,$01
|
ld a,$01
|
||||||
ld [wd12e],a
|
ld [wMenuExitMethod],a
|
||||||
ld [wd12d],a
|
ld [wChosenMenuItem],a
|
||||||
|
|
||||||
xor a
|
xor a
|
||||||
ld [wcc37],a
|
ld [wcc37],a
|
||||||
ld a,[wCurrentMenuItem]
|
ld a,[wCurrentMenuItem]
|
||||||
|
|
@ -1506,7 +1509,7 @@ DisplayListMenuIDLoop:: ; 2c53 (0:2c53)
|
||||||
; if it's an item menu
|
; if it's an item menu
|
||||||
inc hl
|
inc hl
|
||||||
ld a,[hl] ; a = item quantity
|
ld a,[hl] ; a = item quantity
|
||||||
ld [wcf97],a
|
ld [wMaxItemQuantity],a
|
||||||
.skipGettingQuantity
|
.skipGettingQuantity
|
||||||
ld a,[wcf91]
|
ld a,[wcf91]
|
||||||
ld [wd0b5],a
|
ld [wd0b5],a
|
||||||
|
|
@ -1527,10 +1530,10 @@ DisplayListMenuIDLoop:: ; 2c53 (0:2c53)
|
||||||
.storeChosenEntry ; store the menu entry that the player chose and return
|
.storeChosenEntry ; store the menu entry that the player chose and return
|
||||||
ld de,wcd6d
|
ld de,wcd6d
|
||||||
call CopyStringToCF4B ; copy name to wcf4b
|
call CopyStringToCF4B ; copy name to wcf4b
|
||||||
ld a,$01
|
ld a,CHOSE_MENU_ITEM
|
||||||
ld [wd12e],a
|
ld [wMenuExitMethod],a
|
||||||
ld a,[wCurrentMenuItem]
|
ld a,[wCurrentMenuItem]
|
||||||
ld [wd12d],a
|
ld [wChosenMenuItem],a
|
||||||
xor a
|
xor a
|
||||||
ld [hJoy7],a ; joypad state update flag
|
ld [hJoy7],a ; joypad state update flag
|
||||||
ld hl,wd730
|
ld hl,wd730
|
||||||
|
|
@ -1584,7 +1587,7 @@ DisplayChooseQuantityMenu:: ; 2d57 (0:2d57)
|
||||||
ld de,InitialQuantityText
|
ld de,InitialQuantityText
|
||||||
call PlaceString
|
call PlaceString
|
||||||
xor a
|
xor a
|
||||||
ld [wcf96],a ; initialize current quantity to 0
|
ld [wItemQuantity],a ; initialize current quantity to 0
|
||||||
jp .incrementQuantity
|
jp .incrementQuantity
|
||||||
.waitForKeyPressLoop
|
.waitForKeyPressLoop
|
||||||
call JoypadLowSensitivity
|
call JoypadLowSensitivity
|
||||||
|
|
@ -1599,10 +1602,10 @@ DisplayChooseQuantityMenu:: ; 2d57 (0:2d57)
|
||||||
jr nz,.decrementQuantity
|
jr nz,.decrementQuantity
|
||||||
jr .waitForKeyPressLoop
|
jr .waitForKeyPressLoop
|
||||||
.incrementQuantity
|
.incrementQuantity
|
||||||
ld a,[wcf97] ; max quantity
|
ld a,[wMaxItemQuantity]
|
||||||
inc a
|
inc a
|
||||||
ld b,a
|
ld b,a
|
||||||
ld hl,wcf96 ; current quantity
|
ld hl,wItemQuantity ; current quantity
|
||||||
inc [hl]
|
inc [hl]
|
||||||
ld a,[hl]
|
ld a,[hl]
|
||||||
cp b
|
cp b
|
||||||
|
|
@ -1612,11 +1615,11 @@ DisplayChooseQuantityMenu:: ; 2d57 (0:2d57)
|
||||||
ld [hl],a
|
ld [hl],a
|
||||||
jr .handleNewQuantity
|
jr .handleNewQuantity
|
||||||
.decrementQuantity
|
.decrementQuantity
|
||||||
ld hl,wcf96 ; current quantity
|
ld hl,wItemQuantity ; current quantity
|
||||||
dec [hl]
|
dec [hl]
|
||||||
jr nz,.handleNewQuantity
|
jr nz,.handleNewQuantity
|
||||||
; wrap to the max quantity if the player goes below 1
|
; wrap to the max quantity if the player goes below 1
|
||||||
ld a,[wcf97] ; max quantity
|
ld a,[wMaxItemQuantity]
|
||||||
ld [hl],a
|
ld [hl],a
|
||||||
.handleNewQuantity
|
.handleNewQuantity
|
||||||
hlCoord 17, 10
|
hlCoord 17, 10
|
||||||
|
|
@ -1625,7 +1628,7 @@ DisplayChooseQuantityMenu:: ; 2d57 (0:2d57)
|
||||||
jr nz,.printQuantity
|
jr nz,.printQuantity
|
||||||
.printPrice
|
.printPrice
|
||||||
ld c,$03
|
ld c,$03
|
||||||
ld a,[wcf96]
|
ld a,[wItemQuantity]
|
||||||
ld b,a
|
ld b,a
|
||||||
ld hl,$ff9f ; total price
|
ld hl,$ff9f ; total price
|
||||||
; initialize total price to 0
|
; initialize total price to 0
|
||||||
|
|
@ -1641,7 +1644,7 @@ DisplayChooseQuantityMenu:: ; 2d57 (0:2d57)
|
||||||
pop bc
|
pop bc
|
||||||
dec b
|
dec b
|
||||||
jr nz,.addLoop
|
jr nz,.addLoop
|
||||||
ld a,[$ff8e]
|
ld a,[hHalveItemPrices]
|
||||||
and a ; should the price be halved (for selling items)?
|
and a ; should the price be halved (for selling items)?
|
||||||
jr z,.skipHalvingPrice
|
jr z,.skipHalvingPrice
|
||||||
xor a
|
xor a
|
||||||
|
|
@ -1666,7 +1669,7 @@ DisplayChooseQuantityMenu:: ; 2d57 (0:2d57)
|
||||||
call PrintBCDNumber
|
call PrintBCDNumber
|
||||||
hlCoord 9, 10
|
hlCoord 9, 10
|
||||||
.printQuantity
|
.printQuantity
|
||||||
ld de,wcf96 ; current quantity
|
ld de,wItemQuantity ; current quantity
|
||||||
ld bc,$8102 ; print leading zeroes, 1 byte, 2 digits
|
ld bc,$8102 ; print leading zeroes, 1 byte, 2 digits
|
||||||
call PrintNumber
|
call PrintNumber
|
||||||
jp .waitForKeyPressLoop
|
jp .waitForKeyPressLoop
|
||||||
|
|
@ -1688,9 +1691,9 @@ SpacesBetweenQuantityAndPriceText:: ; 2e34 (0:2e34)
|
||||||
|
|
||||||
ExitListMenu:: ; 2e3b (0:2e3b)
|
ExitListMenu:: ; 2e3b (0:2e3b)
|
||||||
ld a,[wCurrentMenuItem]
|
ld a,[wCurrentMenuItem]
|
||||||
ld [wd12d],a
|
ld [wChosenMenuItem],a
|
||||||
ld a,$02
|
ld a,CANCELLED_MENU
|
||||||
ld [wd12e],a
|
ld [wMenuExitMethod],a
|
||||||
ld [wcc37],a
|
ld [wcc37],a
|
||||||
xor a
|
xor a
|
||||||
ld [hJoy7],a
|
ld [hJoy7],a
|
||||||
|
|
@ -1775,7 +1778,7 @@ PrintListMenuEntries:: ; 2e5a (0:2e5a)
|
||||||
call PlaceString
|
call PlaceString
|
||||||
pop de
|
pop de
|
||||||
pop hl
|
pop hl
|
||||||
ld a,[wcf93]
|
ld a,[wPrintItemPrices]
|
||||||
and a ; should prices be printed?
|
and a ; should prices be printed?
|
||||||
jr z,.skipPrintingItemPrice
|
jr z,.skipPrintingItemPrice
|
||||||
.printItemPrice
|
.printItemPrice
|
||||||
|
|
@ -1839,7 +1842,7 @@ PrintListMenuEntries:: ; 2e5a (0:2e5a)
|
||||||
ld a,[wd11e]
|
ld a,[wd11e]
|
||||||
ld [wcf91],a
|
ld [wcf91],a
|
||||||
call IsKeyItem ; check if item is unsellable
|
call IsKeyItem ; check if item is unsellable
|
||||||
ld a,[wd124]
|
ld a,[wIsKeyItem]
|
||||||
and a ; is the item unsellable?
|
and a ; is the item unsellable?
|
||||||
jr nz,.skipPrintingItemQuantity ; if so, don't print the quantity
|
jr nz,.skipPrintingItemQuantity ; if so, don't print the quantity
|
||||||
push hl
|
push hl
|
||||||
|
|
@ -1850,7 +1853,7 @@ PrintListMenuEntries:: ; 2e5a (0:2e5a)
|
||||||
ld a,[wd11e]
|
ld a,[wd11e]
|
||||||
push af
|
push af
|
||||||
ld a,[de]
|
ld a,[de]
|
||||||
ld [wcf97],a
|
ld [wMaxItemQuantity],a
|
||||||
push de
|
push de
|
||||||
ld de,wd11e
|
ld de,wd11e
|
||||||
ld [de],a
|
ld [de],a
|
||||||
|
|
@ -2101,7 +2104,7 @@ UseItem:: ; 30bc (0:30bc)
|
||||||
; hl = address of inventory (either wNumBagItems or wNumBoxItems)
|
; hl = address of inventory (either wNumBagItems or wNumBoxItems)
|
||||||
; [wcf91] = item ID
|
; [wcf91] = item ID
|
||||||
; [wWhichPokemon] = index of item within inventory
|
; [wWhichPokemon] = index of item within inventory
|
||||||
; [wcf96] = quantity to toss
|
; [wItemQuantity] = quantity to toss
|
||||||
; OUTPUT:
|
; OUTPUT:
|
||||||
; clears carry flag if the item is tossed, sets carry flag if not
|
; clears carry flag if the item is tossed, sets carry flag if not
|
||||||
TossItem:: ; 30c4 (0:30c4)
|
TossItem:: ; 30c4 (0:30c4)
|
||||||
|
|
@ -2121,7 +2124,7 @@ TossItem:: ; 30c4 (0:30c4)
|
||||||
; INPUT:
|
; INPUT:
|
||||||
; [wcf91] = item ID
|
; [wcf91] = item ID
|
||||||
; OUTPUT:
|
; OUTPUT:
|
||||||
; [wd124] = result
|
; [wIsKeyItem] = result
|
||||||
; 00: item is not key item
|
; 00: item is not key item
|
||||||
; 01: item is key item
|
; 01: item is key item
|
||||||
IsKeyItem:: ; 30d9 (0:30d9)
|
IsKeyItem:: ; 30d9 (0:30d9)
|
||||||
|
|
@ -3826,13 +3829,13 @@ AddEnemyMonToPlayerParty:: ; 3a53 (0:3a53)
|
||||||
ld [MBC1RomBank], a
|
ld [MBC1RomBank], a
|
||||||
ret
|
ret
|
||||||
|
|
||||||
Func_3a68:: ; 3a68 (0:3a68)
|
MoveMon:: ; 3a68 (0:3a68)
|
||||||
ld a, [H_LOADEDROMBANK]
|
ld a, [H_LOADEDROMBANK]
|
||||||
push af
|
push af
|
||||||
ld a, BANK(MoveMon)
|
ld a, BANK(_MoveMon)
|
||||||
ld [H_LOADEDROMBANK], a
|
ld [H_LOADEDROMBANK], a
|
||||||
ld [MBC1RomBank], a
|
ld [MBC1RomBank], a
|
||||||
call MoveMon
|
call _MoveMon
|
||||||
pop bc
|
pop bc
|
||||||
ld a, b
|
ld a, b
|
||||||
ld [H_LOADEDROMBANK], a
|
ld [H_LOADEDROMBANK], a
|
||||||
|
|
@ -4568,7 +4571,7 @@ GiveItem::
|
||||||
ld [wd11e], a
|
ld [wd11e], a
|
||||||
ld [wcf91], a
|
ld [wcf91], a
|
||||||
ld a, c
|
ld a, c
|
||||||
ld [wcf96], a
|
ld [wItemQuantity], a
|
||||||
ld hl,wNumBagItems
|
ld hl,wNumBagItems
|
||||||
call AddItemToInventory
|
call AddItemToInventory
|
||||||
ret nc
|
ret nc
|
||||||
|
|
|
||||||
|
|
@ -301,7 +301,7 @@ OverworldLoopLessDelay::
|
||||||
and a
|
and a
|
||||||
jp nz,CheckWarpsNoCollision
|
jp nz,CheckWarpsNoCollision
|
||||||
predef ApplyOutOfBattlePoisonDamage ; also increment daycare mon exp
|
predef ApplyOutOfBattlePoisonDamage ; also increment daycare mon exp
|
||||||
ld a,[wd12d]
|
ld a,[wOutOfBattleBlackout]
|
||||||
and a
|
and a
|
||||||
jp nz,HandleBlackOut ; if all pokemon fainted
|
jp nz,HandleBlackOut ; if all pokemon fainted
|
||||||
.newBattle
|
.newBattle
|
||||||
|
|
|
||||||
2
hram.asm
2
hram.asm
|
|
@ -26,6 +26,8 @@ hSpriteIndexOrTextID EQU $FF8C
|
||||||
|
|
||||||
hPartyMonIndex EQU $FF8C
|
hPartyMonIndex EQU $FF8C
|
||||||
|
|
||||||
|
hHalveItemPrices EQU $FF8E
|
||||||
|
|
||||||
; Multiplcation and division variables are meant
|
; Multiplcation and division variables are meant
|
||||||
; to overlap for back-to-back usage. Big endian.
|
; to overlap for back-to-back usage. Big endian.
|
||||||
|
|
||||||
|
|
|
||||||
63
main.asm
63
main.asm
|
|
@ -1457,7 +1457,7 @@ DoBuySellQuitMenu: ; 74ea (1:74ea)
|
||||||
set 6, a ; no printing delay
|
set 6, a ; no printing delay
|
||||||
ld [wd730], a
|
ld [wd730], a
|
||||||
xor a
|
xor a
|
||||||
ld [wd12d], a
|
ld [wChosenMenuItem], a
|
||||||
ld a, BUY_SELL_QUIT_MENU_TEMPLATE
|
ld a, BUY_SELL_QUIT_MENU_TEMPLATE
|
||||||
ld [wTextBoxID], a
|
ld [wTextBoxID], a
|
||||||
call DisplayTextBoxID
|
call DisplayTextBoxID
|
||||||
|
|
@ -1482,24 +1482,24 @@ DoBuySellQuitMenu: ; 74ea (1:74ea)
|
||||||
jr nz, .pressedA
|
jr nz, .pressedA
|
||||||
bit 1, a ; was B pressed? (always true since only A/B are watched)
|
bit 1, a ; was B pressed? (always true since only A/B are watched)
|
||||||
jr z, .pressedA
|
jr z, .pressedA
|
||||||
ld a, $2
|
ld a, CANCELLED_MENU
|
||||||
ld [wd12e], a
|
ld [wMenuExitMethod], a
|
||||||
jr .quit
|
jr .quit
|
||||||
.pressedA
|
.pressedA
|
||||||
ld a, $1
|
ld a, CHOSE_MENU_ITEM
|
||||||
ld [wd12e], a
|
ld [wMenuExitMethod], a
|
||||||
ld a, [wCurrentMenuItem]
|
ld a, [wCurrentMenuItem]
|
||||||
ld [wd12d], a
|
ld [wChosenMenuItem], a
|
||||||
ld b, a
|
ld b, a
|
||||||
ld a, [wMaxMenuItem]
|
ld a, [wMaxMenuItem]
|
||||||
cp b
|
cp b
|
||||||
jr z, .quit
|
jr z, .quit
|
||||||
ret
|
ret
|
||||||
.quit
|
.quit
|
||||||
ld a, $2
|
ld a, CANCELLED_MENU
|
||||||
ld [wd12e], a
|
ld [wMenuExitMethod], a
|
||||||
ld a, [wCurrentMenuItem]
|
ld a, [wCurrentMenuItem]
|
||||||
ld [wd12d], a
|
ld [wChosenMenuItem], a
|
||||||
scf
|
scf
|
||||||
ret
|
ret
|
||||||
|
|
||||||
|
|
@ -1512,9 +1512,12 @@ DisplayTwoOptionMenu: ; 7559 (1:7559)
|
||||||
ld a, [wd730]
|
ld a, [wd730]
|
||||||
set 6, a ; no printing delay
|
set 6, a ; no printing delay
|
||||||
ld [wd730], a
|
ld [wd730], a
|
||||||
|
|
||||||
|
; pointless because both values are overwritten before they are read
|
||||||
xor a
|
xor a
|
||||||
ld [wd12d], a
|
ld [wChosenMenuItem], a
|
||||||
ld [wd12e], a
|
ld [wMenuExitMethod], a
|
||||||
|
|
||||||
ld a, A_BUTTON | B_BUTTON
|
ld a, A_BUTTON | B_BUTTON
|
||||||
ld [wMenuWatchedKeys], a
|
ld [wMenuWatchedKeys], a
|
||||||
ld a, $1
|
ld a, $1
|
||||||
|
|
@ -1614,23 +1617,23 @@ DisplayTwoOptionMenu: ; 7559 (1:7559)
|
||||||
jr nz, .choseSecondMenuItem ; automatically choose the second option if B is pressed
|
jr nz, .choseSecondMenuItem ; automatically choose the second option if B is pressed
|
||||||
.pressedAButton
|
.pressedAButton
|
||||||
ld a, [wCurrentMenuItem]
|
ld a, [wCurrentMenuItem]
|
||||||
ld [wd12d], a
|
ld [wChosenMenuItem], a
|
||||||
and a
|
and a
|
||||||
jr nz, .choseSecondMenuItem
|
jr nz, .choseSecondMenuItem
|
||||||
; chose first menu item
|
; chose first menu item
|
||||||
ld a, $1
|
ld a, CHOSE_FIRST_ITEM
|
||||||
ld [wd12e], a
|
ld [wMenuExitMethod], a
|
||||||
ld c, 15
|
ld c, 15
|
||||||
call DelayFrames
|
call DelayFrames
|
||||||
call TwoOptionMenu_RestoreScreenTiles
|
call TwoOptionMenu_RestoreScreenTiles
|
||||||
and a
|
and a
|
||||||
ret
|
ret
|
||||||
.choseSecondMenuItem
|
.choseSecondMenuItem
|
||||||
ld a, $1
|
ld a, 1
|
||||||
ld [wCurrentMenuItem], a
|
ld [wCurrentMenuItem], a
|
||||||
ld [wd12d], a
|
ld [wChosenMenuItem], a
|
||||||
ld a, $2
|
ld a, CHOSE_SECOND_ITEM
|
||||||
ld [wd12e], a
|
ld [wMenuExitMethod], a
|
||||||
ld c, 15
|
ld c, 15
|
||||||
call DelayFrames
|
call DelayFrames
|
||||||
call TwoOptionMenu_RestoreScreenTiles
|
call TwoOptionMenu_RestoreScreenTiles
|
||||||
|
|
@ -2631,7 +2634,7 @@ ApplyOutOfBattlePoisonDamage: ; c69c (3:469c)
|
||||||
.noBlackOut
|
.noBlackOut
|
||||||
xor a
|
xor a
|
||||||
.done
|
.done
|
||||||
ld [wd12d], a
|
ld [wOutOfBattleBlackout], a
|
||||||
ret
|
ret
|
||||||
|
|
||||||
LoadTilesetHeader: ; c754 (3:4754)
|
LoadTilesetHeader: ; c754 (3:4754)
|
||||||
|
|
@ -2777,10 +2780,10 @@ CyclingIsFunText: ; cdff (3:4dff)
|
||||||
; INPUT:
|
; INPUT:
|
||||||
; hl = address of inventory (either wNumBagItems or wNumBoxItems)
|
; hl = address of inventory (either wNumBagItems or wNumBoxItems)
|
||||||
; [wcf91] = item ID
|
; [wcf91] = item ID
|
||||||
; [wcf96] = item quantity
|
; [wItemQuantity] = item quantity
|
||||||
; sets carry flag if successful, unsets carry flag if unsuccessful
|
; sets carry flag if successful, unsets carry flag if unsuccessful
|
||||||
AddItemToInventory_: ; ce04 (3:4e04)
|
AddItemToInventory_: ; ce04 (3:4e04)
|
||||||
ld a,[wcf96] ; a = item quantity
|
ld a,[wItemQuantity] ; a = item quantity
|
||||||
push af
|
push af
|
||||||
push bc
|
push bc
|
||||||
push de
|
push de
|
||||||
|
|
@ -2827,12 +2830,12 @@ AddItemToInventory_: ; ce04 (3:4e04)
|
||||||
add hl,bc ; hl = address to store the item
|
add hl,bc ; hl = address to store the item
|
||||||
ld a,[wcf91]
|
ld a,[wcf91]
|
||||||
ld [hli],a ; store item ID
|
ld [hli],a ; store item ID
|
||||||
ld a,[wcf96]
|
ld a,[wItemQuantity]
|
||||||
ld [hli],a ; store item quantity
|
ld [hli],a ; store item quantity
|
||||||
ld [hl],$ff ; store terminator
|
ld [hl],$ff ; store terminator
|
||||||
jp .success
|
jp .success
|
||||||
.increaseItemQuantity ; increase the quantity of an item already in the inventory
|
.increaseItemQuantity ; increase the quantity of an item already in the inventory
|
||||||
ld a,[wcf96]
|
ld a,[wItemQuantity]
|
||||||
ld b,a ; b = quantity to add
|
ld b,a ; b = quantity to add
|
||||||
ld a,[hl] ; a = existing item quantity
|
ld a,[hl] ; a = existing item quantity
|
||||||
add b ; a = new item quantity
|
add b ; a = new item quantity
|
||||||
|
|
@ -2841,7 +2844,7 @@ AddItemToInventory_: ; ce04 (3:4e04)
|
||||||
; if the new quantity is greater than or equal to 100,
|
; if the new quantity is greater than or equal to 100,
|
||||||
; try to max out the current slot and add the rest in a new slot
|
; try to max out the current slot and add the rest in a new slot
|
||||||
sub a,99
|
sub a,99
|
||||||
ld [wcf96],a ; a = amount left over (to put in the new slot)
|
ld [wItemQuantity],a ; a = amount left over (to put in the new slot)
|
||||||
ld a,d
|
ld a,d
|
||||||
and a ; is there room for a new item slot?
|
and a ; is there room for a new item slot?
|
||||||
jr z,.increaseItemQuantityFailed
|
jr z,.increaseItemQuantityFailed
|
||||||
|
|
@ -2864,14 +2867,14 @@ AddItemToInventory_: ; ce04 (3:4e04)
|
||||||
pop bc
|
pop bc
|
||||||
pop bc
|
pop bc
|
||||||
ld a,b
|
ld a,b
|
||||||
ld [wcf96],a ; restore the initial value from when the function was called
|
ld [wItemQuantity],a ; restore the initial value from when the function was called
|
||||||
ret
|
ret
|
||||||
|
|
||||||
; function to remove an item (in varying quantities) from the player's bag or PC box
|
; function to remove an item (in varying quantities) from the player's bag or PC box
|
||||||
; INPUT:
|
; INPUT:
|
||||||
; hl = address of inventory (either wNumBagItems or wNumBoxItems)
|
; hl = address of inventory (either wNumBagItems or wNumBoxItems)
|
||||||
; [wWhichPokemon] = index (within the inventory) of the item to remove
|
; [wWhichPokemon] = index (within the inventory) of the item to remove
|
||||||
; [wcf96] = quantity to remove
|
; [wItemQuantity] = quantity to remove
|
||||||
RemoveItemFromInventory_: ; ce74 (3:4e74)
|
RemoveItemFromInventory_: ; ce74 (3:4e74)
|
||||||
push hl
|
push hl
|
||||||
inc hl
|
inc hl
|
||||||
|
|
@ -2883,12 +2886,12 @@ RemoveItemFromInventory_: ; ce74 (3:4e74)
|
||||||
inc h
|
inc h
|
||||||
.noCarry
|
.noCarry
|
||||||
inc hl
|
inc hl
|
||||||
ld a,[wcf96] ; quantity being removed
|
ld a,[wItemQuantity] ; quantity being removed
|
||||||
ld e,a
|
ld e,a
|
||||||
ld a,[hl] ; a = current quantity
|
ld a,[hl] ; a = current quantity
|
||||||
sub e
|
sub e
|
||||||
ld [hld],a ; store new quantity
|
ld [hld],a ; store new quantity
|
||||||
ld [wcf97],a
|
ld [wMaxItemQuantity],a
|
||||||
and a
|
and a
|
||||||
jr nz,.skipMovingUpSlots
|
jr nz,.skipMovingUpSlots
|
||||||
; if the remaining quantity is 0,
|
; if the remaining quantity is 0,
|
||||||
|
|
@ -2909,7 +2912,7 @@ RemoveItemFromInventory_: ; ce74 (3:4e74)
|
||||||
ld [wListScrollOffset],a
|
ld [wListScrollOffset],a
|
||||||
ld [wCurrentMenuItem],a
|
ld [wCurrentMenuItem],a
|
||||||
ld [wcc2c],a
|
ld [wcc2c],a
|
||||||
ld [wd07e],a
|
ld [wSavedListScrollOffset],a
|
||||||
pop hl
|
pop hl
|
||||||
ld a,[hl] ; a = number of items in inventory
|
ld a,[hl] ; a = number of items in inventory
|
||||||
dec a ; decrement the number of items
|
dec a ; decrement the number of items
|
||||||
|
|
@ -3863,7 +3866,7 @@ _AddEnemyMonToPlayerParty: ; f49d (3:749d)
|
||||||
and a
|
and a
|
||||||
ret ; return success
|
ret ; return success
|
||||||
|
|
||||||
MoveMon: ; f51e (3:751e)
|
_MoveMon: ; f51e (3:751e)
|
||||||
ld a, [wcf95]
|
ld a, [wcf95]
|
||||||
and a
|
and a
|
||||||
jr z, .checkPartyMonSlots
|
jr z, .checkPartyMonSlots
|
||||||
|
|
|
||||||
|
|
@ -26,7 +26,7 @@ CeruleanHouse2Text1: ; 74e15 (1d:4e15)
|
||||||
ld a, h
|
ld a, h
|
||||||
ld [wList + 1], a
|
ld [wList + 1], a
|
||||||
xor a
|
xor a
|
||||||
ld [wcf93], a
|
ld [wPrintItemPrices], a
|
||||||
ld [wMenuItemToSwap], a
|
ld [wMenuItemToSwap], a
|
||||||
ld a, SPECIALLISTMENU
|
ld a, SPECIALLISTMENU
|
||||||
ld [wListMenuID], a
|
ld [wListMenuID], a
|
||||||
|
|
|
||||||
|
|
@ -49,7 +49,7 @@ DayCareMText1: ; 56254 (15:6254)
|
||||||
ld [W_DAYCARE_IN_USE], a
|
ld [W_DAYCARE_IN_USE], a
|
||||||
ld a, $3
|
ld a, $3
|
||||||
ld [wcf95], a
|
ld [wcf95], a
|
||||||
call Func_3a68
|
call MoveMon
|
||||||
xor a
|
xor a
|
||||||
ld [wcf95], a
|
ld [wcf95], a
|
||||||
call RemovePokemon
|
call RemovePokemon
|
||||||
|
|
@ -158,14 +158,14 @@ DayCareMScript_562e1: ; 562e1 (15:62e1)
|
||||||
predef SubBCDPredef
|
predef SubBCDPredef
|
||||||
ld a, (SFX_02_5a - SFX_Headers_02) / 3
|
ld a, (SFX_02_5a - SFX_Headers_02) / 3
|
||||||
call PlaySoundWaitForCurrent
|
call PlaySoundWaitForCurrent
|
||||||
ld a, $13
|
ld a, MONEY_BOX
|
||||||
ld [wTextBoxID], a
|
ld [wTextBoxID], a
|
||||||
call DisplayTextBoxID
|
call DisplayTextBoxID
|
||||||
ld hl, DayCareMText_5644f
|
ld hl, DayCareMText_5644f
|
||||||
call PrintText
|
call PrintText
|
||||||
ld a, $2
|
ld a, $2
|
||||||
ld [wcf95], a
|
ld [wcf95], a
|
||||||
call Func_3a68
|
call MoveMon
|
||||||
ld a, [wDayCareMonSpecies]
|
ld a, [wDayCareMonSpecies]
|
||||||
ld [wcf91], a
|
ld [wcf91], a
|
||||||
ld a, [wPartyCount]
|
ld a, [wPartyCount]
|
||||||
|
|
|
||||||
|
|
@ -641,7 +641,7 @@ OaksLabScript_1d00a: ; 1d00a (7:500a)
|
||||||
ld a, c
|
ld a, c
|
||||||
ld [wWhichPokemon], a
|
ld [wWhichPokemon], a
|
||||||
ld a, $1
|
ld a, $1
|
||||||
ld [wcf96], a
|
ld [wItemQuantity], a
|
||||||
jp RemoveItemFromInventory
|
jp RemoveItemFromInventory
|
||||||
|
|
||||||
OaksLabScript_1d02b: ; 1d02b (7:502b)
|
OaksLabScript_1d02b: ; 1d02b (7:502b)
|
||||||
|
|
|
||||||
64
wram.asm
64
wram.asm
|
|
@ -746,7 +746,13 @@ wAnimSoundID:: ; cf07
|
||||||
|
|
||||||
wcf08:: ds 1 ; used as a storage value for the bank to return to after a BankswitchHome (bankswitch in homebank)
|
wcf08:: ds 1 ; used as a storage value for the bank to return to after a BankswitchHome (bankswitch in homebank)
|
||||||
wcf09:: ds 1 ; used as a temp storage value for the bank to switch to
|
wcf09:: ds 1 ; used as a temp storage value for the bank to switch to
|
||||||
wcf0a:: ds 1 ; used as flags for Poke Mart
|
|
||||||
|
wBoughtOrSoldItemInMart:: ; cf0a
|
||||||
|
; 0 = nothing bought or sold in pokemart
|
||||||
|
; 1 = bought or sold something in pokemart
|
||||||
|
; this value is not used for anything
|
||||||
|
ds 1
|
||||||
|
|
||||||
wBattleResult:: ; cf0b
|
wBattleResult:: ; cf0b
|
||||||
; $00 - win
|
; $00 - win
|
||||||
; $01 - lose
|
; $01 - lose
|
||||||
|
|
@ -831,7 +837,9 @@ wWhichPokemon:: ; cf92
|
||||||
; which pokemon you selected
|
; which pokemon you selected
|
||||||
ds 1
|
ds 1
|
||||||
|
|
||||||
wcf93:: ds 1 ; used with lists
|
wPrintItemPrices:: ; cf93
|
||||||
|
; if non-zero, then print item prices when displaying lists
|
||||||
|
ds 1
|
||||||
|
|
||||||
wHPBarType:: ; cf94
|
wHPBarType:: ; cf94
|
||||||
; type of HP bar
|
; type of HP bar
|
||||||
|
|
@ -844,8 +852,12 @@ wListMenuID:: ; cf94
|
||||||
ds 1
|
ds 1
|
||||||
|
|
||||||
wcf95:: ds 1 ; used with RemovePokemon (BoxMons, Daycare, Trades, etc.)
|
wcf95:: ds 1 ; used with RemovePokemon (BoxMons, Daycare, Trades, etc.)
|
||||||
wcf96:: ds 1 ; used with removing items
|
|
||||||
wcf97:: ds 1 ; used with printing item quantities?
|
wItemQuantity:: ; cf96
|
||||||
|
ds 1
|
||||||
|
|
||||||
|
wMaxItemQuantity:: ; cf97
|
||||||
|
ds 1
|
||||||
|
|
||||||
; LoadMonData copies mon data here
|
; LoadMonData copies mon data here
|
||||||
wLoadedMon:: party_struct wLoadedMon ; cf98
|
wLoadedMon:: party_struct wLoadedMon ; cf98
|
||||||
|
|
@ -1126,7 +1138,13 @@ W_ANIMATIONID:: ; d07c
|
||||||
ds 1
|
ds 1
|
||||||
|
|
||||||
wd07d:: ds 1 ; used with naming functions and party display type
|
wd07d:: ds 1 ; used with naming functions and party display type
|
||||||
wd07e:: ds 3 ; used with mart and inventory
|
|
||||||
|
wSavedListScrollOffset:: ; d07e
|
||||||
|
; used by the pokemart code to save the existing value of wListScrollOffset
|
||||||
|
; so that it can be restored when the player is done with the pokemart NPC
|
||||||
|
ds 1
|
||||||
|
|
||||||
|
ds 2
|
||||||
|
|
||||||
; base coordinates of frame block
|
; base coordinates of frame block
|
||||||
W_BASECOORDX:: ; d081
|
W_BASECOORDX:: ; d081
|
||||||
|
|
@ -1353,7 +1371,10 @@ wWalkBikeSurfStateCopy:: ; d11a
|
||||||
; wWalkBikeSurfState is sometimes copied here, but it doesn't seem to be used for anything
|
; wWalkBikeSurfState is sometimes copied here, but it doesn't seem to be used for anything
|
||||||
ds 1
|
ds 1
|
||||||
|
|
||||||
wd11b:: ds 1 ; used with mart text box and cable club
|
wInitListType:: ; d11b
|
||||||
|
; the type of list for InitList to init
|
||||||
|
ds 1
|
||||||
|
|
||||||
wd11c:: ds 1 ; temp storage value for catching pokemon
|
wd11c:: ds 1 ; temp storage value for catching pokemon
|
||||||
wd11d:: ds 1 ; used with battle switchout and testing if the enemy mon fainted
|
wd11d:: ds 1 ; used with battle switchout and testing if the enemy mon fainted
|
||||||
wd11e:: ds 1 ; used as a Pokemon and Item storage value. Also used as an output value for CountSetBits
|
wd11e:: ds 1 ; used as a Pokemon and Item storage value. Also used as an output value for CountSetBits
|
||||||
|
|
@ -1365,7 +1386,7 @@ wNumRunAttempts::
|
||||||
|
|
||||||
wd121:: ds 1 ; used with evolving pokemon
|
wd121:: ds 1 ; used with evolving pokemon
|
||||||
wd122:: ds 2 ; saved ROM bank number for vblank
|
wd122:: ds 2 ; saved ROM bank number for vblank
|
||||||
wd124:: ds 1 ; used as an output value when determining if an item is a key item
|
wIsKeyItem:: ds 1 ; d124
|
||||||
|
|
||||||
wTextBoxID:: ; d125
|
wTextBoxID:: ; d125
|
||||||
ds 1
|
ds 1
|
||||||
|
|
@ -1375,16 +1396,35 @@ wd126:: ds 1 ; not exactly sure what this is used for, but it seems to be used a
|
||||||
W_CURENEMYLVL:: ; d127
|
W_CURENEMYLVL:: ; d127
|
||||||
ds 1
|
ds 1
|
||||||
|
|
||||||
wd128:: ds 1 ; used as a pointer to displaying Poke Mart inventory, also used to store the pointer of LoadItemList (pointer to item list initially in hl)
|
wItemListPointer:: ; d128
|
||||||
wd129:: ds 1 ; second half of above mentioned pointer
|
; pointer to list of items terminated by $FF
|
||||||
|
ds 2
|
||||||
|
|
||||||
wd12a:: ds 1 ; Number of list entries for displaying a list
|
wd12a:: ds 1 ; Number of list entries for displaying a list
|
||||||
|
|
||||||
wLinkState:: ; d12b
|
wLinkState:: ; d12b
|
||||||
ds 1
|
ds 1
|
||||||
|
|
||||||
wTwoOptionMenuID:: ds 1
|
wTwoOptionMenuID:: ; d12c
|
||||||
wd12d:: ds 1 ; used with item menus and pokemart menu, also used with testing if all Pokemon Fainted?
|
ds 1
|
||||||
wd12e:: ds 1 ; used as an output value to determine if A or B was pressed in a yes/no box
|
|
||||||
|
wChosenMenuItem:: ; d12d
|
||||||
|
; the id of the menu item the player ultimately chose
|
||||||
|
|
||||||
|
wOutOfBattleBlackout:: ; d12d
|
||||||
|
; non-zero when the whole party has fainted due to out-of-battle poison damage
|
||||||
|
ds 1
|
||||||
|
|
||||||
|
wMenuExitMethod:: ; d12e
|
||||||
|
; the way the user exited a menu
|
||||||
|
; for list menus and the buy/sell/quit menu:
|
||||||
|
; $01 = the user pressed A to choose a menu item
|
||||||
|
; $02 = the user pressed B to cancel
|
||||||
|
; for two-option menus:
|
||||||
|
; $01 = the user pressed A with the first menu item selected
|
||||||
|
; $02 = the user pressed B or pressed A with the second menu item selected
|
||||||
|
ds 1
|
||||||
|
|
||||||
wd12f:: ds 1 ; used in some coordinatestuff, npc pathstuff, and game corner prize stuff
|
wd12f:: ds 1 ; used in some coordinatestuff, npc pathstuff, and game corner prize stuff
|
||||||
wd130:: ds 1 ; saved value of screen Y coord of trainer sprite
|
wd130:: ds 1 ; saved value of screen Y coord of trainer sprite
|
||||||
wd131:: ds 1 ; saved value of screen X coord of trainer sprite
|
wd131:: ds 1 ; saved value of screen X coord of trainer sprite
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue