menu stuff

This commit is contained in:
YamaArashi 2015-07-15 20:04:58 -07:00
parent ac78dda7d8
commit bd7d981593
26 changed files with 506 additions and 420 deletions

View file

@ -109,6 +109,14 @@ NAME_PLAYER_SCREEN EQU 0
NAME_RIVAL_SCREEN EQU 1 NAME_RIVAL_SCREEN EQU 1
NAME_MON_SCREEN EQU 2 NAME_MON_SCREEN EQU 2
; mon data locations
; Note that some values are not supported by all functions that use these values.
PLAYER_PARTY_DATA EQU 0
ENEMY_PARTY_DATA EQU 1
BOX_DATA EQU 2
DAYCARE_DATA EQU 3
BATTLE_MON_DATA EQU 4
; serial ; serial
ESTABLISH_CONNECTION_WITH_INTERNAL_CLOCK EQU $01 ESTABLISH_CONNECTION_WITH_INTERNAL_CLOCK EQU $01

View file

@ -102,10 +102,10 @@ InitList: ; 39bd5 (e:5bd5)
ld [wItemPrices + 1], a ld [wItemPrices + 1], a
ret ret
; get species of mon e in list [wcc49] for LoadMonData ; get species of mon e in list [wMonDataLocation] for LoadMonData
GetMonSpecies: ; 39c37 (e:5c37) GetMonSpecies: ; 39c37 (e:5c37)
ld hl, wPartySpecies ld hl, wPartySpecies
ld a, [wcc49] ld a, [wMonDataLocation]
and a and a
jr z, .getSpecies jr z, .getSpecies
dec a dec a

View file

@ -1809,7 +1809,7 @@ SendOutMon: ; 3cc91 (f:4c91)
predef LoadMonBackPic predef LoadMonBackPic
xor a xor a
ld [$ffe1], a ld [$ffe1], a
ld hl, wcc2d ld hl, wBattleAndStartSavedMenuItem
ld [hli], a ld [hli], a
ld [hl], a ld [hl], a
ld [wBoostExpByExpAll], a ld [wBoostExpByExpAll], a
@ -2123,7 +2123,7 @@ DisplayBattleMenu: ; 3ceb3 (f:4eb3)
.oldManName .oldManName
db "OLD MAN@" db "OLD MAN@"
.handleBattleMenuInput .handleBattleMenuInput
ld a, [wcc2d] ld a, [wBattleAndStartSavedMenuItem]
ld [wCurrentMenuItem], a ld [wCurrentMenuItem], a
ld [wLastMenuItem], a ld [wLastMenuItem], a
sub 2 ; check if the cursor is in the left column sub 2 ; check if the cursor is in the left column
@ -2206,7 +2206,7 @@ DisplayBattleMenu: ; 3ceb3 (f:4eb3)
ld a, [W_BATTLETYPE] ld a, [W_BATTLETYPE]
cp $2 ; is it a Safari battle? cp $2 ; is it a Safari battle?
ld a, [wCurrentMenuItem] ld a, [wCurrentMenuItem]
ld [wcc2d], a ld [wBattleAndStartSavedMenuItem], a
jr z, .handleMenuSelection jr z, .handleMenuSelection
; not Safari battle ; not Safari battle
; swap the IDs of the item menu and party menu (this is probably because they swapped the positions ; swap the IDs of the item menu and party menu (this is probably because they swapped the positions
@ -2299,11 +2299,11 @@ DisplayBagMenu:
ld [wPrintItemPrices], a ld [wPrintItemPrices], a
ld a, ITEMLISTMENU ld a, ITEMLISTMENU
ld [wListMenuID], a ld [wListMenuID], a
ld a, [wcc2c] ld a, [wBagSavedMenuItem]
ld [wCurrentMenuItem], a ld [wCurrentMenuItem], a
call DisplayListMenuID call DisplayListMenuID
ld a, [wCurrentMenuItem] ld a, [wCurrentMenuItem]
ld [wcc2c], a ld [wBagSavedMenuItem], a
ld a, $0 ld a, $0
ld [wMenuWatchMovingOutOfBounds], a ld [wMenuWatchMovingOutOfBounds], a
ld [wMenuItemToSwap], a ld [wMenuItemToSwap], a
@ -2435,8 +2435,8 @@ PartyMenuOrRockOrRun:
and a ; was Switch selected? and a ; was Switch selected?
jr z, .switchMon ; if so, jump jr z, .switchMon ; if so, jump
; Stats was selected ; Stats was selected
xor a xor a ; PLAYER_PARTY_DATA
ld [wcc49], a ld [wMonDataLocation], a
ld hl, wPartyMon1 ld hl, wPartyMon1
call ClearSprites call ClearSprites
; display the two status screens ; display the two status screens
@ -2935,8 +2935,8 @@ PrintMenuItem: ; 3d4b6 (f:54b6)
; isn't actually selected (just pointed to by the cursor) ; isn't actually selected (just pointed to by the cursor)
ld a, [wPlayerMonNumber] ld a, [wPlayerMonNumber]
ld [wWhichPokemon], a ld [wWhichPokemon], a
ld a, $4 ld a, BATTLE_MON_DATA
ld [wcc49], a ld [wMonDataLocation], a
callab GetMaxPP callab GetMaxPP
ld hl, wCurrentMenuItem ld hl, wCurrentMenuItem
ld c, [hl] ld c, [hl]
@ -8243,14 +8243,14 @@ ChargeEffect: ; 3f88c (f:788c)
ld a, b ld a, b
call PlayBattleAnimation call PlayBattleAnimation
ld a, [de] ld a, [de]
ld [wWhichTrade], a ld [wChargeMoveNum], a
ld hl, ChargeMoveEffectText ld hl, ChargeMoveEffectText
jp PrintText jp PrintText
ChargeMoveEffectText: ; 3f8c8 (f:78c8) ChargeMoveEffectText: ; 3f8c8 (f:78c8)
TX_FAR _ChargeMoveEffectText TX_FAR _ChargeMoveEffectText
TX_ASM TX_ASM
ld a, [wWhichTrade] ld a, [wChargeMoveNum]
cp RAZOR_WIND cp RAZOR_WIND
ld hl, MadeWhirlwindText ld hl, MadeWhirlwindText
jr z, .asm_3f8f8 jr z, .asm_3f8f8

View file

@ -54,7 +54,7 @@ EndOfBattle: ; 137aa (4:77aa)
ld [wd11f], a ld [wd11f], a
ld [wNumRunAttempts], a ld [wNumRunAttempts], a
ld [wEscapedFromBattle], a ld [wEscapedFromBattle], a
ld hl, wcc2b ld hl, wPartyAndBillsPCSavedMenuItem
ld [hli], a ld [hli], a
ld [hli], a ld [hli], a
ld [hli], a ld [hli], a

View file

@ -148,8 +148,8 @@ GainExperience: ; 5524f (15:524f)
call GetPartyMonName call GetPartyMonName
ld hl, GainedText ld hl, GainedText
call PrintText call PrintText
xor a ; party mon data xor a ; PLAYER_PARTY_DATA
ld [wcc49], a ld [wMonDataLocation], a
call LoadMonData call LoadMonData
pop hl pop hl
ld bc, wPartyMon1Level - wPartyMon1Exp ld bc, wPartyMon1Level - wPartyMon1Exp
@ -242,15 +242,15 @@ GainExperience: ; 5524f (15:524f)
.printGrewLevelText .printGrewLevelText
ld hl, GrewLevelText ld hl, GrewLevelText
call PrintText call PrintText
xor a ; party mon data xor a ; PLAYER_PARTY_DATA
ld [wcc49], a ld [wMonDataLocation], a
call LoadMonData call LoadMonData
ld d, $1 ld d, $1
callab PrintStatsBox callab PrintStatsBox
call WaitForTextScrollButtonPress call WaitForTextScrollButtonPress
call LoadScreenTilesFromBuffer1 call LoadScreenTilesFromBuffer1
xor a xor a ; PLAYER_PARTY_DATA
ld [wcc49], a ld [wMonDataLocation], a
ld a, [wd0b5] ld a, [wd0b5]
ld [wd11e], a ld [wd11e], a
predef LearnMoveFromLevelUp predef LearnMoveFromLevelUp

View file

@ -4,7 +4,7 @@ InitBattleVariables: ; 525af (14:65af)
xor a xor a
ld [wActionResultOrTookBattleTurn], a ld [wActionResultOrTookBattleTurn], a
ld [wBattleResult], a ld [wBattleResult], a
ld hl, wcc2b ld hl, wPartyAndBillsPCSavedMenuItem
ld [hli], a ld [hli], a
ld [hli], a ld [hli], a
ld [hli], a ld [hli], a

View file

@ -55,8 +55,8 @@ ReadTrainer: ; 39c53 (e:5c53)
and a ; have we reached the end of the trainer data? and a ; have we reached the end of the trainer data?
jr z,.FinishUp jr z,.FinishUp
ld [wcf91],a ; write species somewhere (XXX why?) ld [wcf91],a ; write species somewhere (XXX why?)
ld a,1 ld a,ENEMY_PARTY_DATA
ld [wcc49],a ld [wMonDataLocation],a
push hl push hl
call AddPartyMon call AddPartyMon
pop hl pop hl
@ -72,8 +72,8 @@ ReadTrainer: ; 39c53 (e:5c53)
ld [W_CURENEMYLVL],a ld [W_CURENEMYLVL],a
ld a,[hli] ld a,[hli]
ld [wcf91],a ld [wcf91],a
ld a,1 ld a,ENEMY_PARTY_DATA
ld [wcc49],a ld [wMonDataLocation],a
push hl push hl
call AddPartyMon call AddPartyMon
pop hl pop hl

View file

@ -55,8 +55,8 @@ Evolution_PartyMonLoop: ; loop over party mons
push hl push hl
ld a, [wcf91] ld a, [wcf91]
push af push af
xor a xor a ; PLAYER_PARTY_DATA
ld [wcc49], a ld [wMonDataLocation], a
call LoadMonData call LoadMonData
pop af pop af
ld [wcf91], a ld [wcf91], a
@ -206,7 +206,7 @@ Evolution_PartyMonLoop: ; loop over party mons
ld a, [wd0b5] ld a, [wd0b5]
ld [wd11e], a ld [wd11e], a
xor a xor a
ld [wcc49], a ld [wMonDataLocation], a
call LearnMoveFromLevelUp call LearnMoveFromLevelUp
pop hl pop hl
predef SetPartyMonTypes predef SetPartyMonTypes
@ -345,12 +345,13 @@ LearnMoveFromLevelUp: ; 3af5b (e:6f5b)
ld a, [hli] ; move ID ld a, [hli] ; move ID
jr nz, .learnSetLoop jr nz, .learnSetLoop
ld d, a ; ID of move to learn ld d, a ; ID of move to learn
ld a, [wcc49] ld a, [wMonDataLocation]
and a and a
jr nz, .next jr nz, .next
; if [wcc49] is 0, get the address of the mon's current moves ; If [wMonDataLocation] is 0 (PLAYER_PARTY_DATA), get the address of the mon's
; there is no reason to make this conditional because the code wouldn't work properly without doing this ; current moves in party data. Every call to this function sets
; every call to this function sets [wcc49] to 0 ; [wMonDataLocation] to 0 because other data locations are not supported.
; If it is not 0, this function will not work properly.
ld hl, wPartyMon1Moves ld hl, wPartyMon1Moves
ld a, [wWhichPokemon] ld a, [wWhichPokemon]
ld bc, wPartyMon2 - wPartyMon1 ld bc, wPartyMon2 - wPartyMon1

View file

@ -16,7 +16,7 @@ _GivePokemon: ; 4fda5 (13:7da5)
call SetPokedexOwnedFlag call SetPokedexOwnedFlag
callab SendNewMonToBox callab SendNewMonToBox
ld hl, wcf4b ld hl, wcf4b
ld a, [wd5a0] ld a, [wCurrentBoxNum]
and $7f and $7f
cp 9 cp 9
jr c, .asm_4fdec jr c, .asm_4fdec

View file

@ -130,11 +130,11 @@ InGameTrade_DoTrade: ; 71c07 (1c:5c07)
ld a,[wInGameTradeReceiveMonSpecies] ld a,[wInGameTradeReceiveMonSpecies]
ld [wcf91],a ld [wcf91],a
xor a xor a
ld [wcc49],a ld [wMonDataLocation],a ; not used
ld [wRemoveMonFromBox],a ld [wRemoveMonFromBox],a
call RemovePokemon call RemovePokemon
ld a,$80 ld a,$80 ; prevent the player from naming the mon
ld [wcc49],a ld [wMonDataLocation],a
call AddPartyMon call AddPartyMon
call InGameTrade_CopyDataToReceivedMon call InGameTrade_CopyDataToReceivedMon
callab EvolveTradeMon callab EvolveTradeMon

View file

@ -423,8 +423,8 @@ ItemUseBall: ; d687 (3:5687)
ld a,[wPartyCount] ld a,[wPartyCount]
cp a,PARTY_LENGTH ;is party full? cp a,PARTY_LENGTH ;is party full?
jr z,.sendToBox jr z,.sendToBox
xor a xor a ; PLAYER_PARTY_DATA
ld [wcc49],a ld [wMonDataLocation],a
call ClearSprites call ClearSprites
call AddPartyMon ;add mon to Party call AddPartyMon ;add mon to Party
jr .End jr .End
@ -1265,14 +1265,14 @@ ItemUseMedicine: ; dabb (3:5abb)
ld [wWhichPokemon],a ld [wWhichPokemon],a
ld a,e ld a,e
ld [wd11e],a ld [wd11e],a
xor a xor a ; PLAYER_PARTY_DATA
ld [wcc49],a ; load from player's party ld [wMonDataLocation],a
call LoadMonData call LoadMonData
ld d,$01 ld d,$01
callab PrintStatsBox ; display new stats text box callab PrintStatsBox ; display new stats text box
call WaitForTextScrollButtonPress ; wait for button press call WaitForTextScrollButtonPress ; wait for button press
xor a xor a ; PLAYER_PARTY_DATA
ld [wcc49],a ld [wMonDataLocation],a
predef LearnMoveFromLevelUp ; learn level up move, if any predef LearnMoveFromLevelUp ; learn level up move, if any
xor a xor a
ld [wForceEvolution],a ld [wForceEvolution],a
@ -1963,8 +1963,8 @@ ItemUsePPRestore: ; e31e (3:631e)
; unsets zero flag if PP was restored, sets zero flag if not ; unsets zero flag if PP was restored, sets zero flag if not
; however, this is bugged for Max Ethers and Max Elixirs (see below) ; however, this is bugged for Max Ethers and Max Elixirs (see below)
.restorePP .restorePP
xor a xor a ; PLAYER_PARTY_DATA
ld [wcc49],a ; party pokemon ld [wMonDataLocation],a
call GetMaxPP call GetMaxPP
ld hl,wPartyMon1Moves ld hl,wPartyMon1Moves
ld bc,44 ld bc,44
@ -2379,7 +2379,7 @@ AddBonusPP: ; e642 (3:6642)
; gets max PP of a pokemon's move (including PP from PP Ups) ; gets max PP of a pokemon's move (including PP from PP Ups)
; INPUT: ; INPUT:
; [wWhichPokemon] = index of pokemon within party/box ; [wWhichPokemon] = index of pokemon within party/box
; [wcc49] = pokemon source ; [wMonDataLocation] = pokemon source
; 00: player's party ; 00: player's party
; 01: enemy's party ; 01: enemy's party
; 02: current box ; 02: current box
@ -2389,7 +2389,7 @@ AddBonusPP: ; e642 (3:6642)
; OUTPUT: ; OUTPUT:
; [wd11e] = max PP ; [wd11e] = max PP
GetMaxPP: ; e677 (3:6677) GetMaxPP: ; e677 (3:6677)
ld a,[wcc49] ld a,[wMonDataLocation]
and a and a
ld hl,wPartyMon1Moves ld hl,wPartyMon1Moves
ld bc,wPartyMon2 - wPartyMon1 ld bc,wPartyMon2 - wPartyMon1
@ -2426,7 +2426,7 @@ GetMaxPP: ; e677 (3:6677)
pop hl pop hl
push bc push bc
ld bc,21 ; PP offset if not player's in-battle pokemon data ld bc,21 ; PP offset if not player's in-battle pokemon data
ld a,[wcc49] ld a,[wMonDataLocation]
cp a,4 ; player's in-battle pokemon? cp a,4 ; player's in-battle pokemon?
jr nz,.addPPOffset jr nz,.addPPOffset
ld bc,17 ; PP offset if player's in-battle pokemon data ld bc,17 ; PP offset if player's in-battle pokemon data

View file

@ -1,44 +1,44 @@
Func_213c8:: ; 213c8 (8:53c8) DisplayPCMainMenu:: ; 213c8 (8:53c8)
xor a xor a
ld [H_AUTOBGTRANSFERENABLED], a ld [H_AUTOBGTRANSFERENABLED], a
call SaveScreenTilesToBuffer2 call SaveScreenTilesToBuffer2
ld a, [wNumHoFTeams] ld a, [wNumHoFTeams]
and a and a
jr nz, .asm_213f3 jr nz, .leaguePCAvailable
ld a, [wd74b] ld a, [wd74b]
bit 5, a bit 5, a ; received pokedex?
jr z, .asm_213ea jr z, .noOaksPC
ld a, [wNumHoFTeams] ld a, [wNumHoFTeams]
and a and a
jr nz, .asm_213f3 jr nz, .leaguePCAvailable
hlCoord 0, 0 hlCoord 0, 0
ld b, $8 ld b, 8
ld c, $e ld c, 14
jr .asm_213fa jr .next
.asm_213ea .noOaksPC
hlCoord 0, 0 hlCoord 0, 0
ld b, $6 ld b, 6
ld c, $e ld c, 14
jr .asm_213fa jr .next
.asm_213f3 .leaguePCAvailable
hlCoord 0, 0 hlCoord 0, 0
ld b, $a ld b, 10
ld c, $e ld c, 14
.asm_213fa .next
call TextBoxBorder call TextBoxBorder
call UpdateSprites call UpdateSprites
ld a, $3 ld a, 3
ld [wMaxMenuItem], a ld [wMaxMenuItem], a
ld a, [wd7f1] ld a, [wd7f1]
bit 0, a bit 0, a
jr nz, .asm_21414 jr nz, .metBill
hlCoord 2, 2 hlCoord 2, 2
ld de, SomeonesPCText ld de, SomeonesPCText
jr .asm_2141a jr .next2
.asm_21414 .metBill
hlCoord 2, 2 hlCoord 2, 2
ld de, BillsPCText ld de, BillsPCText
.asm_2141a .next2
call PlaceString call PlaceString
hlCoord 2, 4 hlCoord 2, 4
ld de, wPlayerName ld de, wPlayerName
@ -48,43 +48,43 @@ Func_213c8:: ; 213c8 (8:53c8)
ld de, PlayersPCText ld de, PlayersPCText
call PlaceString call PlaceString
ld a, [wd74b] ld a, [wd74b]
bit 5, a bit 5, a ; received pokedex?
jr z, .asm_21462 jr z, .noOaksPC2
hlCoord 2, 6 hlCoord 2, 6
ld de, OaksPCText ld de, OaksPCText
call PlaceString call PlaceString
ld a, [wNumHoFTeams] ld a, [wNumHoFTeams]
and a and a
jr z, .asm_2145a jr z, .noLeaguePC
ld a, $4 ld a, 4
ld [wMaxMenuItem], a ld [wMaxMenuItem], a
hlCoord 2, 8 hlCoord 2, 8
ld de, PKMNLeaguePCText ld de, PKMNLeaguePCText
call PlaceString call PlaceString
hlCoord 2, 10 hlCoord 2, 10
ld de, LogOffPCText ld de, LogOffPCText
jr .asm_2146d jr .next3
.asm_2145a .noLeaguePC
hlCoord 2, 8 hlCoord 2, 8
ld de, LogOffPCText ld de, LogOffPCText
jr .asm_2146d jr .next3
.asm_21462 .noOaksPC2
ld a, $2 ld a, $2
ld [wMaxMenuItem], a ld [wMaxMenuItem], a
hlCoord 2, 6 hlCoord 2, 6
ld de, LogOffPCText ld de, LogOffPCText
.asm_2146d .next3
call PlaceString call PlaceString
ld a, $3 ld a, A_BUTTON | B_BUTTON
ld [wMenuWatchedKeys], a ld [wMenuWatchedKeys], a
ld a, $2 ld a, 2
ld [wTopMenuItemY], a ld [wTopMenuItemY], a
ld a, $1 ld a, 1
ld [wTopMenuItemX], a ld [wTopMenuItemX], a
xor a xor a
ld [wCurrentMenuItem], a ld [wCurrentMenuItem], a
ld [wLastMenuItem], a ld [wLastMenuItem], a
ld a, $1 ld a, 1
ld [H_AUTOBGTRANSFERENABLED], a ld [H_AUTOBGTRANSFERENABLED], a
ret ret
@ -99,23 +99,23 @@ BillsPC_:: ; 0x214c2
ld hl, wd730 ld hl, wd730
set 6, [hl] set 6, [hl]
xor a xor a
ld [wccd3], a ld [wParentMenuItem], a
inc a ; MONSTER_NAME inc a ; MONSTER_NAME
ld [wNameListType], a ld [wNameListType], a
call LoadHpBarAndStatusTilePatterns call LoadHpBarAndStatusTilePatterns
ld a, [wListScrollOffset] ld a, [wListScrollOffset]
push af push af
ld a, [wFlags_0xcd60] ld a, [wFlags_0xcd60]
bit 3, a bit 3, a ; accessing Bill's PC through another PC?
jr nz, BillsPCMenu jr nz, BillsPCMenu
; accessing it directly
ld a, $99 ld a, $99
call PlaySound call PlaySound
ld hl, SwitchOnText ld hl, SwitchOnText
call PrintText call PrintText
Func_214e8: ; 214e8 (8:54e8) BillsPCMenu: ; 214e8 (8:54e8)
BillsPCMenu: ld a, [wParentMenuItem]
ld a, [wccd3]
ld [wCurrentMenuItem], a ld [wCurrentMenuItem], a
ld hl, vChars2 + $780 ld hl, vChars2 + $780
ld de, PokeballTileGraphics ld de, PokeballTileGraphics
@ -123,79 +123,81 @@ BillsPCMenu:
call CopyVideoData call CopyVideoData
call LoadScreenTilesFromBuffer2DisableBGTransfer call LoadScreenTilesFromBuffer2DisableBGTransfer
hlCoord 0, 0 hlCoord 0, 0
ld b, $a ld b, 10
ld c, $c ld c, 12
call TextBoxBorder call TextBoxBorder
hlCoord 2, 2 hlCoord 2, 2
ld de, BillsPCMenuText ld de, BillsPCMenuText
call PlaceString call PlaceString
ld hl, wTopMenuItemY ld hl, wTopMenuItemY
ld a, $2 ld a, 2
ld [hli], a ld [hli], a ; wTopMenuItemY
dec a dec a
ld [hli], a ld [hli], a ; wTopMenuItemX
inc hl inc hl
inc hl inc hl
ld a, $4 ld a, 4
ld [hli], a ld [hli], a ; wMaxMenuItem
ld a, $3 ld a, A_BUTTON | B_BUTTON
ld [hli], a ld [hli], a ; wMenuWatchedKeys
xor a xor a
ld [hli], a ld [hli], a ; wLastMenuItem
ld [hli], a ld [hli], a ; wPartyAndBillsPCSavedMenuItem
ld hl, wListScrollOffset ld hl, wListScrollOffset
ld [hli], a ld [hli], a ; wListScrollOffset
ld [hl], a ld [hl], a ; wMenuWatchMovingOutOfBounds
ld [wPlayerMonNumber], a ld [wPlayerMonNumber], a
ld hl, WhatText ld hl, WhatText
call PrintText call PrintText
hlCoord 9, 14 hlCoord 9, 14
ld b, $2 ld b, 2
ld c, $9 ld c, 9
call TextBoxBorder call TextBoxBorder
ld a, [wd5a0] ld a, [wCurrentBoxNum]
and $7f and $7f
cp 9 cp 9
jr c, .asm_2154f jr c, .singleDigitBoxNum
; two digit box num
sub 9 sub 9
hlCoord 17, 16 hlCoord 17, 16
ld [hl], "1" ld [hl], "1"
add "0" add "0"
jr .asm_21551 jr .next
.asm_2154f .singleDigitBoxNum
add "1" add "1"
.asm_21551 .next
Coorda 18, 16 Coorda 18, 16
hlCoord 10, 16 hlCoord 10, 16
ld de, BoxNoPCText ld de, BoxNoPCText
call PlaceString call PlaceString
ld a, $1 ld a, 1
ld [H_AUTOBGTRANSFERENABLED], a ld [H_AUTOBGTRANSFERENABLED], a
call Delay3 call Delay3
call HandleMenuInput call HandleMenuInput
bit 1, a bit 1, a
jp nz, Func_21588 ; b button jp nz, ExitBillsPC ; b button
call PlaceUnfilledArrowMenuCursor call PlaceUnfilledArrowMenuCursor
ld a, [wCurrentMenuItem] ld a, [wCurrentMenuItem]
ld [wccd3], a ld [wParentMenuItem], a
and a and a
jp z, Func_21618 ; withdraw jp z, BillsPCWithdraw ; withdraw
cp $1 cp $1
jp z, Func_215ac ; deposit jp z, BillsPCDeposit ; deposit
cp $2 cp $2
jp z, Func_21673 ; release jp z, BillsPCRelease ; release
cp $3 cp $3
jp z, Func_216b3 ; change box jp z, BillsPCChangeBox ; change box
Func_21588: ; 21588 (8:5588) ExitBillsPC: ; 21588 (8:5588)
ld a, [wFlags_0xcd60] ld a, [wFlags_0xcd60]
bit 3, a bit 3, a ; accessing Bill's PC through another PC?
jr nz, .asm_2159a jr nz, .next
; accessing it directly
call LoadTextBoxTilePatterns call LoadTextBoxTilePatterns
ld a, $9a ld a, $9a
call PlaySound call PlaySound
call WaitForSoundToFinish call WaitForSoundToFinish
.asm_2159a .next
ld hl, wFlags_0xcd60 ld hl, wFlags_0xcd60
res 5, [hl] res 5, [hl]
call LoadScreenTilesFromBuffer2 call LoadScreenTilesFromBuffer2
@ -205,26 +207,25 @@ Func_21588: ; 21588 (8:5588)
res 6, [hl] res 6, [hl]
ret ret
Func_215ac: ; 215ac (8:55ac) BillsPCDeposit: ; 215ac (8:55ac)
BillsPCDeposit:
ld a, [wPartyCount] ld a, [wPartyCount]
dec a dec a
jr nz, .asm_215bb jr nz, .partyLargeEnough
ld hl, CantDepositLastMonText ld hl, CantDepositLastMonText
call PrintText call PrintText
jp BillsPCMenu jp BillsPCMenu
.asm_215bb .partyLargeEnough
ld a, [W_NUMINBOX] ld a, [W_NUMINBOX]
cp MONS_PER_BOX cp MONS_PER_BOX
jr nz, .asm_215cb jr nz, .boxNotFull
ld hl, BoxFullText ld hl, BoxFullText
call PrintText call PrintText
jp BillsPCMenu jp BillsPCMenu
.asm_215cb .boxNotFull
ld hl, wPartyCount ld hl, wPartyCount
call Func_216be call DisplayMonListMenu
jp c, BillsPCMenu jp c, BillsPCMenu
call Func_2174b call DisplayDepositWithdrawMenu
jp nc, BillsPCMenu jp nc, BillsPCMenu
ld a, [wcf91] ld a, [wcf91]
call GetCryData call GetCryData
@ -236,45 +237,45 @@ BillsPCDeposit:
ld [wRemoveMonFromBox], a ld [wRemoveMonFromBox], a
call RemovePokemon call RemovePokemon
call WaitForSoundToFinish call WaitForSoundToFinish
ld hl, wWhichTrade ld hl, wBoxNumString
ld a, [wd5a0] ld a, [wCurrentBoxNum]
and $7f and $7f
cp 9 cp 9
jr c, .asm_2160a jr c, .singleDigitBoxNum
sub 9 sub 9
ld [hl], "1" ld [hl], "1"
inc hl inc hl
add "0" add "0"
jr .asm_2160c jr .next
.asm_2160a .singleDigitBoxNum
add "1" add "1"
.asm_2160c .next
ld [hli], a ld [hli], a
ld [hl], $50 ld [hl], $50
ld hl, MonWasStoredText ld hl, MonWasStoredText
call PrintText call PrintText
jp BillsPCMenu jp BillsPCMenu
Func_21618: ; 21618 (8:5618) BillsPCWithdraw: ; 21618 (8:5618)
ld a, [W_NUMINBOX] ld a, [W_NUMINBOX]
and a and a
jr nz, .asm_21627 jr nz, .boxNotEmpty
ld hl, NoMonText ld hl, NoMonText
call PrintText call PrintText
jp Func_214e8 jp BillsPCMenu
.asm_21627 .boxNotEmpty
ld a, [wPartyCount] ld a, [wPartyCount]
cp PARTY_LENGTH cp PARTY_LENGTH
jr nz, .asm_21637 jr nz, .partyNotFull
ld hl, CantTakeMonText ld hl, CantTakeMonText
call PrintText call PrintText
jp Func_214e8 jp BillsPCMenu
.asm_21637 .partyNotFull
ld hl, W_NUMINBOX ld hl, W_NUMINBOX
call Func_216be call DisplayMonListMenu
jp c, Func_214e8 jp c, BillsPCMenu
call Func_2174b call DisplayDepositWithdrawMenu
jp nc, Func_214e8 jp nc, BillsPCMenu
ld a, [wWhichPokemon] ld a, [wWhichPokemon]
ld hl, wBoxMonNicks ld hl, wBoxMonNicks
call GetPartyMonName call GetPartyMonName
@ -290,25 +291,25 @@ Func_21618: ; 21618 (8:5618)
call WaitForSoundToFinish call WaitForSoundToFinish
ld hl, MonIsTakenOutText ld hl, MonIsTakenOutText
call PrintText call PrintText
jp Func_214e8 jp BillsPCMenu
Func_21673: ; 21673 (8:5673) BillsPCRelease: ; 21673 (8:5673)
ld a, [W_NUMINBOX] ld a, [W_NUMINBOX]
and a and a
jr nz, .asm_21682 jr nz, .loop
ld hl, NoMonText ld hl, NoMonText
call PrintText call PrintText
jp Func_214e8 jp BillsPCMenu
.asm_21682 .loop
ld hl, W_NUMINBOX ld hl, W_NUMINBOX
call Func_216be call DisplayMonListMenu
jp c, Func_214e8 jp c, BillsPCMenu
ld hl, OnceReleasedText ld hl, OnceReleasedText
call PrintText call PrintText
call YesNoChoice call YesNoChoice
ld a, [wCurrentMenuItem] ld a, [wCurrentMenuItem]
and a and a
jr nz, .asm_21682 jr nz, .loop
inc a inc a
ld [wRemoveMonFromBox], a ld [wRemoveMonFromBox], a
call RemovePokemon call RemovePokemon
@ -317,13 +318,13 @@ Func_21673: ; 21673 (8:5673)
call PlayCry call PlayCry
ld hl, MonWasReleasedText ld hl, MonWasReleasedText
call PrintText call PrintText
jp Func_214e8 jp BillsPCMenu
Func_216b3: ; 216b3 (8:56b3) BillsPCChangeBox: ; 216b3 (8:56b3)
callba ChangeBox callba ChangeBox
jp Func_214e8 jp BillsPCMenu
Func_216be: ; 216be (8:56be) DisplayMonListMenu: ; 216be (8:56be)
ld a, l ld a, l
ld [wListPointer], a ld [wListPointer], a
ld a, h ld a, h
@ -333,11 +334,11 @@ Func_216be: ; 216be (8:56be)
ld [wListMenuID], a ld [wListMenuID], a
inc a ; MONSTER_NAME inc a ; MONSTER_NAME
ld [wNameListType], a ld [wNameListType], a
ld a, [wcc2b] ld a, [wPartyAndBillsPCSavedMenuItem]
ld [wCurrentMenuItem], a ld [wCurrentMenuItem], a
call DisplayListMenuID call DisplayListMenuID
ld a, [wCurrentMenuItem] ld a, [wCurrentMenuItem]
ld [wcc2b], a ld [wPartyAndBillsPCSavedMenuItem], a
ret ret
BillsPCMenuText: ; 216e1 (8:56e1) BillsPCMenuText: ; 216e1 (8:56e1)
@ -354,17 +355,19 @@ ENDC
BoxNoPCText: ; 21713 (8:5713) BoxNoPCText: ; 21713 (8:5713)
db "BOX No.@" db "BOX No.@"
Func_2171b:: ; 2171b (8:571b) KnowsHMMove:: ; 2171b (8:571b)
; returns whether mon with party index [wWhichPokemon] knows an HM move
ld hl, wPartyMon1Moves ld hl, wPartyMon1Moves
ld bc, wPartyMon2 - wPartyMon1 ld bc, wPartyMon2 - wPartyMon1
jr .asm_21729 jr .next
; unreachable
ld hl, wBoxMon1Moves ld hl, wBoxMon1Moves
ld bc, wBoxMon2 - wBoxMon1 ld bc, wBoxMon2 - wBoxMon1
.asm_21729 .next
ld a, [wWhichPokemon] ld a, [wWhichPokemon]
call AddNTimes call AddNTimes
ld b, NUM_MOVES ld b, NUM_MOVES
.asm_21731 .loop
ld a, [hli] ld a, [hli]
push hl push hl
push bc push bc
@ -375,7 +378,7 @@ Func_2171b:: ; 2171b (8:571b)
pop hl pop hl
ret c ret c
dec b dec b
jr nz, .asm_21731 jr nz, .loop
and a and a
ret ret
@ -387,72 +390,72 @@ HMMoveArray: ; 21745 (8:5745)
db FLASH db FLASH
db -1 db -1
Func_2174b: ; 2174b (8:574b) DisplayDepositWithdrawMenu: ; 2174b (8:574b)
hlCoord 9, 10 hlCoord 9, 10
ld b, $6 ld b, 6
ld c, $9 ld c, 9
call TextBoxBorder call TextBoxBorder
ld a, [wccd3] ld a, [wParentMenuItem]
and a and a ; was the Deposit or Withdraw item selected in the parent menu?
ld de, DepositPCText ld de, DepositPCText
jr nz, .asm_21761 jr nz, .next
ld de, WithdrawPCText ld de, WithdrawPCText
.asm_21761 .next
hlCoord 11, 12 hlCoord 11, 12
call PlaceString call PlaceString
hlCoord 11, 14 hlCoord 11, 14
ld de, StatsCancelPCText ld de, StatsCancelPCText
call PlaceString call PlaceString
ld hl, wTopMenuItemY ld hl, wTopMenuItemY
ld a, $c ld a, 12
ld [hli], a ld [hli], a ; wTopMenuItemY
ld a, $a ld a, 10
ld [hli], a ld [hli], a ; wTopMenuItemX
xor a xor a
ld [hli], a ld [hli], a ; wCurrentMenuItem
inc hl inc hl
ld a, $2 ld a, 2
ld [hli], a ld [hli], a ; wMaxMenuItem
ld a, $3 ld a, A_BUTTON | B_BUTTON
ld [hli], a ld [hli], a ; wMenuWatchedKeys
xor a xor a
ld [hl], a ld [hl], a ; wLastMenuItem
ld hl, wListScrollOffset ld hl, wListScrollOffset
ld [hli], a ld [hli], a ; wListScrollOffset
ld [hl], a ld [hl], a ; wMenuWatchMovingOutOfBounds
ld [wPlayerMonNumber], a ld [wPlayerMonNumber], a
ld [wcc2b], a ld [wPartyAndBillsPCSavedMenuItem], a
.asm_2178f .loop
call HandleMenuInput call HandleMenuInput
bit 1, a bit 1, a ; pressed B?
jr nz, .asm_2179f jr nz, .exit
ld a, [wCurrentMenuItem] ld a, [wCurrentMenuItem]
and a and a
jr z, .asm_217a1 jr z, .choseDepositWithdraw
dec a dec a
jr z, .asm_217a3 jr z, .viewStats
.asm_2179f .exit
and a and a
ret ret
.asm_217a1 .choseDepositWithdraw
scf scf
ret ret
.asm_217a3 .viewStats
call SaveScreenTilesToBuffer1 call SaveScreenTilesToBuffer1
ld a, [wccd3] ld a, [wParentMenuItem]
and a and a
ld a, $0 ld a, PLAYER_PARTY_DATA
jr nz, .asm_217b0 jr nz, .next2
ld a, $2 ld a, BOX_DATA
.asm_217b0 .next2
ld [wcc49], a ld [wMonDataLocation], a
predef StatusScreen predef StatusScreen
predef StatusScreen2 predef StatusScreen2
call LoadScreenTilesFromBuffer1 call LoadScreenTilesFromBuffer1
call ReloadTilesetTilePatterns call ReloadTilesetTilePatterns
call GoPAL_SET_CF1C call GoPAL_SET_CF1C
call LoadGBPal call LoadGBPal
jr .asm_2178f jr .loop
DepositPCText: db "DEPOSIT@" DepositPCText: db "DEPOSIT@"
WithdrawPCText: db "WITHDRAW@" WithdrawPCText: db "WITHDRAW@"
@ -518,9 +521,9 @@ CableClubLeftGameboy:: ; 5824 (8:5825)
ld a, [W_CURMAP] ld a, [W_CURMAP]
cp BATTLE_CENTER cp BATTLE_CENTER
ld a, LINK_STATE_START_TRADE ld a, LINK_STATE_START_TRADE
jr z, .asm_2183a jr z, .next
inc a ; LINK_STATE_START_BATTLE inc a ; LINK_STATE_START_BATTLE
.asm_2183a .next
ld [wLinkState], a ld [wLinkState], a
call EnableAutoTextBoxDrawing call EnableAutoTextBoxDrawing
tx_pre_jump JustAMomentText tx_pre_jump JustAMomentText
@ -535,9 +538,9 @@ CableClubRightGameboy:: ; 5845 (8:5845)
ld a, [W_CURMAP] ld a, [W_CURMAP]
cp BATTLE_CENTER cp BATTLE_CENTER
ld a, LINK_STATE_START_TRADE ld a, LINK_STATE_START_TRADE
jr z, .asm_2185a jr z, .next
inc a ; LINK_STATE_START_BATTLE inc a ; LINK_STATE_START_BATTLE
.asm_2185a .next
ld [wLinkState], a ld [wLinkState], a
call EnableAutoTextBoxDrawing call EnableAutoTextBoxDrawing
tx_pre_jump JustAMomentText tx_pre_jump JustAMomentText

View file

@ -16,7 +16,7 @@ MainMenu: ; 5af2 (1:5af2)
call DelayFrames call DelayFrames
xor a ; LINK_STATE_NONE xor a ; LINK_STATE_NONE
ld [wLinkState],a ld [wLinkState],a
ld hl,wcc2b ld hl,wPartyAndBillsPCSavedMenuItem
ld [hli],a ld [hli],a
ld [hli],a ld [hli],a
ld [hli],a ld [hli],a
@ -457,7 +457,7 @@ DisplayOptionMenu: ; 5e8a (1:5e8a)
ld a,3 ; text speed cursor Y coordinate ld a,3 ; text speed cursor Y coordinate
ld [wTopMenuItemY],a ld [wTopMenuItemY],a
call SetCursorPositionsFromOptions call SetCursorPositionsFromOptions
ld a,[wWhichTrade] ; text speed cursor X coordinate ld a,[wOptionsTextSpeedCursorX] ; text speed cursor X coordinate
ld [wTopMenuItemX],a ld [wTopMenuItemX],a
ld a,$01 ld a,$01
ld [H_AUTOBGTRANSFERENABLED],a ; enable auto background transfer ld [H_AUTOBGTRANSFERENABLED],a ; enable auto background transfer
@ -507,7 +507,7 @@ DisplayOptionMenu: ; 5e8a (1:5e8a)
.downPressed .downPressed
cp a,16 cp a,16
ld b,-13 ld b,-13
ld hl,wWhichTrade ld hl,wOptionsTextSpeedCursorX
jr z,.updateMenuVariables jr z,.updateMenuVariables
ld b,5 ld b,5
cp a,3 cp a,3
@ -522,7 +522,7 @@ DisplayOptionMenu: ; 5e8a (1:5e8a)
.upPressed .upPressed
cp a,8 cp a,8
ld b,-5 ld b,-5
ld hl,wWhichTrade ld hl,wOptionsTextSpeedCursorX
jr z,.updateMenuVariables jr z,.updateMenuVariables
cp a,13 cp a,13
inc hl inc hl
@ -541,17 +541,17 @@ DisplayOptionMenu: ; 5e8a (1:5e8a)
call PlaceUnfilledArrowMenuCursor call PlaceUnfilledArrowMenuCursor
jp .loop jp .loop
.cursorInBattleAnimation .cursorInBattleAnimation
ld a,[wTrainerEngageDistance] ; battle animation cursor X coordinate ld a,[wOptionsBattleAnimCursorX] ; battle animation cursor X coordinate
xor a,$0b ; toggle between 1 and 10 xor a,$0b ; toggle between 1 and 10
ld [wTrainerEngageDistance],a ld [wOptionsBattleAnimCursorX],a
jp .eraseOldMenuCursor jp .eraseOldMenuCursor
.cursorInBattleStyle .cursorInBattleStyle
ld a,[wTrainerFacingDirection] ; battle style cursor X coordinate ld a,[wOptionsBattleStyleCursorX] ; battle style cursor X coordinate
xor a,$0b ; toggle between 1 and 10 xor a,$0b ; toggle between 1 and 10
ld [wTrainerFacingDirection],a ld [wOptionsBattleStyleCursorX],a
jp .eraseOldMenuCursor jp .eraseOldMenuCursor
.pressedLeftInTextSpeed .pressedLeftInTextSpeed
ld a,[wWhichTrade] ; text speed cursor X coordinate ld a,[wOptionsTextSpeedCursorX] ; text speed cursor X coordinate
cp a,1 cp a,1
jr z,.updateTextSpeedXCoord jr z,.updateTextSpeedXCoord
cp a,7 cp a,7
@ -562,7 +562,7 @@ DisplayOptionMenu: ; 5e8a (1:5e8a)
sub a,7 sub a,7
jr .updateTextSpeedXCoord jr .updateTextSpeedXCoord
.pressedRightInTextSpeed .pressedRightInTextSpeed
ld a,[wWhichTrade] ; text speed cursor X coordinate ld a,[wOptionsTextSpeedCursorX] ; text speed cursor X coordinate
cp a,14 cp a,14
jr z,.updateTextSpeedXCoord jr z,.updateTextSpeedXCoord
cp a,7 cp a,7
@ -572,7 +572,7 @@ DisplayOptionMenu: ; 5e8a (1:5e8a)
.fromFastToMedium .fromFastToMedium
add a,6 add a,6
.updateTextSpeedXCoord .updateTextSpeedXCoord
ld [wWhichTrade],a ; text speed cursor X coordinate ld [wOptionsTextSpeedCursorX],a ; text speed cursor X coordinate
jp .eraseOldMenuCursor jp .eraseOldMenuCursor
TextSpeedOptionText: ; 5fc0 (1:5fc0) TextSpeedOptionText: ; 5fc0 (1:5fc0)
@ -593,7 +593,7 @@ OptionMenuCancelText: ; 6018 (1:6018)
; sets the options variable according to the current placement of the menu cursors in the options menu ; sets the options variable according to the current placement of the menu cursors in the options menu
SetOptionsFromCursorPositions: ; 601f (1:601f) SetOptionsFromCursorPositions: ; 601f (1:601f)
ld hl,TextSpeedOptionData ld hl,TextSpeedOptionData
ld a,[wWhichTrade] ; text speed cursor X coordinate ld a,[wOptionsTextSpeedCursorX] ; text speed cursor X coordinate
ld c,a ld c,a
.loop .loop
ld a,[hli] ld a,[hli]
@ -604,7 +604,7 @@ SetOptionsFromCursorPositions: ; 601f (1:601f)
.textSpeedMatchFound .textSpeedMatchFound
ld a,[hl] ld a,[hl]
ld d,a ld d,a
ld a,[wTrainerEngageDistance] ; battle animation cursor X coordinate ld a,[wOptionsBattleAnimCursorX] ; battle animation cursor X coordinate
dec a dec a
jr z,.battleAnimationOn jr z,.battleAnimationOn
.battleAnimationOff .battleAnimationOff
@ -613,7 +613,7 @@ SetOptionsFromCursorPositions: ; 601f (1:601f)
.battleAnimationOn .battleAnimationOn
res 7,d res 7,d
.checkBattleStyle .checkBattleStyle
ld a,[wTrainerFacingDirection] ; battle style cursor X coordinate ld a,[wOptionsBattleStyleCursorX] ; battle style cursor X coordinate
dec a dec a
jr z,.battleStyleShift jr z,.battleStyleShift
.battleStyleSet .battleStyleSet
@ -638,7 +638,7 @@ SetCursorPositionsFromOptions: ; 604c (1:604c)
pop bc pop bc
dec hl dec hl
ld a,[hl] ld a,[hl]
ld [wWhichTrade],a ; text speed cursor X coordinate ld [wOptionsTextSpeedCursorX],a ; text speed cursor X coordinate
hlCoord 0, 3 hlCoord 0, 3
call .placeUnfilledRightArrow call .placeUnfilledRightArrow
sla c sla c
@ -646,7 +646,7 @@ SetCursorPositionsFromOptions: ; 604c (1:604c)
jr nc,.storeBattleAnimationCursorX jr nc,.storeBattleAnimationCursorX
ld a,10 ; Off ld a,10 ; Off
.storeBattleAnimationCursorX .storeBattleAnimationCursorX
ld [wTrainerEngageDistance],a ; battle animation cursor X coordinate ld [wOptionsBattleAnimCursorX],a ; battle animation cursor X coordinate
hlCoord 0, 8 hlCoord 0, 8
call .placeUnfilledRightArrow call .placeUnfilledRightArrow
sla c sla c
@ -654,7 +654,7 @@ SetCursorPositionsFromOptions: ; 604c (1:604c)
jr nc,.storeBattleStyleCursorX jr nc,.storeBattleStyleCursorX
ld a,10 ld a,10
.storeBattleStyleCursorX .storeBattleStyleCursorX
ld [wTrainerFacingDirection],a ; battle style cursor X coordinate ld [wOptionsBattleStyleCursorX],a ; battle style cursor X coordinate
hlCoord 0, 13 hlCoord 0, 13
call .placeUnfilledRightArrow call .placeUnfilledRightArrow
; cursor in front of Cancel ; cursor in front of Cancel

View file

@ -10,7 +10,7 @@ ActivatePC: ; 17e2c (5:7e2c)
call LoadScreenTilesFromBuffer2 call LoadScreenTilesFromBuffer2
call Delay3 call Delay3
PCMainMenu: ; 17e48 (5:7e48) PCMainMenu: ; 17e48 (5:7e48)
callba Func_213c8 callba DisplayPCMainMenu
ld hl, wFlags_0xcd60 ld hl, wFlags_0xcd60
set 5, [hl] set 5, [hl]
call HandleMenuInput call HandleMenuInput

View file

@ -5,18 +5,19 @@ PlayerPC: ; 78e6 (1:78e6)
ld [wNameListType], a ld [wNameListType], a
call SaveScreenTilesToBuffer1 call SaveScreenTilesToBuffer1
xor a xor a
ld [wcc2c], a ld [wBagSavedMenuItem], a
ld [wccd3], a ld [wParentMenuItem], a
ld a, [wFlags_0xcd60] ld a, [wFlags_0xcd60]
bit 3, a bit 3, a ; accessing player's PC through another PC?
jr nz, Func_790c jr nz, PlayerPCMenu
; accessing it directly
ld a, (SFX_02_45 - SFX_Headers_02) / 3 ld a, (SFX_02_45 - SFX_Headers_02) / 3
call PlaySound call PlaySound
ld hl, TurnedOnPC2Text ld hl, TurnedOnPC2Text
call PrintText call PrintText
Func_790c: ; 790c (1:790c) PlayerPCMenu: ; 790c (1:790c)
ld a, [wccd3] ld a, [wParentMenuItem]
ld [wCurrentMenuItem], a ld [wCurrentMenuItem], a
ld hl, wFlags_0xcd60 ld hl, wFlags_0xcd60
set 5, [hl] set 5, [hl]
@ -30,69 +31,69 @@ Func_790c: ; 790c (1:790c)
ld de, PlayersPCMenuEntries ld de, PlayersPCMenuEntries
call PlaceString call PlaceString
ld hl, wTopMenuItemY ld hl, wTopMenuItemY
ld a, $2 ld a, 2
ld [hli], a ld [hli], a ; wTopMenuItemY
dec a dec a
ld [hli], a ld [hli], a ; wTopMenuItemX
inc hl inc hl
inc hl inc hl
ld a, $3 ld a, 3
ld [hli], a ld [hli], a ; wMaxMenuItem
ld a, $3 ld a, A_BUTTON | B_BUTTON
ld [hli], a ld [hli], a ; wMenuWatchedKeys
xor a xor a
ld [hl], a ld [hl], a
ld hl, wListScrollOffset ld hl, wListScrollOffset
ld [hli], a ld [hli], a ; wListScrollOffset
ld [hl], a ld [hl], a ; wMenuWatchMovingOutOfBounds
ld [wPlayerMonNumber], a ld [wPlayerMonNumber], a
ld hl, WhatDoYouWantText ld hl, WhatDoYouWantText
call PrintText call PrintText
call HandleMenuInput call HandleMenuInput
bit 1, a bit 1, a
jp nz, Func_796d jp nz, ExitPlayerPC
call PlaceUnfilledArrowMenuCursor call PlaceUnfilledArrowMenuCursor
ld a, [wCurrentMenuItem] ld a, [wCurrentMenuItem]
ld [wccd3], a ld [wParentMenuItem], a
and a and a
jp z, Func_7a12 jp z, PlayerPCWithdraw
dec a dec a
jp z, Func_7995 jp z, PlayerPCDeposit
dec a dec a
jp z, Func_7a8f jp z, PlayerPCToss
Func_796d: ; 796d (1:796d) ExitPlayerPC: ; 796d (1:796d)
ld a, [wFlags_0xcd60] ld a, [wFlags_0xcd60]
bit 3, a bit 3, a ; accessing player's PC through another PC?
jr nz, .asm_797c jr nz, .next
; accessing it directly
ld a, (SFX_02_46 - SFX_Headers_02) / 3 ld a, (SFX_02_46 - SFX_Headers_02) / 3
call PlaySound call PlaySound
call WaitForSoundToFinish call WaitForSoundToFinish
.asm_797c .next
ld hl, wFlags_0xcd60 ld hl, wFlags_0xcd60
res 5, [hl] res 5, [hl]
call LoadScreenTilesFromBuffer2 call LoadScreenTilesFromBuffer2
xor a xor a
ld [wListScrollOffset], a ld [wListScrollOffset], a
ld [wcc2c], a ld [wBagSavedMenuItem], a
ld hl, wd730 ld hl, wd730
res 6, [hl] res 6, [hl]
xor a xor a
ld [wDoNotWaitForButtonPressAfterDisplayingText], a ld [wDoNotWaitForButtonPressAfterDisplayingText], a
ret ret
Func_7995: ; 7995 (1:7995) PlayerPCDeposit: ; 7995 (1:7995)
xor a xor a
ld [wCurrentMenuItem], a ld [wCurrentMenuItem], a
ld [wListScrollOffset], a ld [wListScrollOffset], a
ld a, [wNumBagItems] ld a, [wNumBagItems]
and a and a
jr nz, Func_79ab jr nz, .loop
ld hl, NothingToDepositText ld hl, NothingToDepositText
call PrintText call PrintText
jp Func_790c jp PlayerPCMenu
.loop
Func_79ab: ; 79ab (1:79ab)
ld hl, WhatToDepositText ld hl, WhatToDepositText
call PrintText call PrintText
ld hl, wNumBagItems ld hl, wNumBagItems
@ -102,29 +103,30 @@ Func_79ab: ; 79ab (1:79ab)
ld [wListPointer + 1], a ld [wListPointer + 1], a
xor a xor a
ld [wPrintItemPrices], a ld [wPrintItemPrices], a
ld a, $3 ld a, ITEMLISTMENU
ld [wListMenuID], a ld [wListMenuID], a
call DisplayListMenuID call DisplayListMenuID
jp c, Func_790c jp c, PlayerPCMenu
call IsKeyItem call IsKeyItem
ld a, $1 ld a, 1
ld [wItemQuantity], a ld [wItemQuantity], a
ld a, [wIsKeyItem] ld a, [wIsKeyItem]
and a and a
jr nz, .asm_79e7 jr nz, .next
; if it's not a key item, there can be more than one of the item
ld hl, DepositHowManyText ld hl, DepositHowManyText
call PrintText call PrintText
call DisplayChooseQuantityMenu call DisplayChooseQuantityMenu
cp $ff cp $ff
jp z, Func_79ab jp z, .loop
.asm_79e7 .next
ld hl, wNumBoxItems ld hl, wNumBoxItems
call AddItemToInventory call AddItemToInventory
jr c, .asm_79f8 jr c, .roomAvailable
ld hl, NoRoomToStoreText ld hl, NoRoomToStoreText
call PrintText call PrintText
jp Func_79ab jp .loop
.asm_79f8 .roomAvailable
ld hl, wNumBagItems ld hl, wNumBagItems
call RemoveItemFromInventory call RemoveItemFromInventory
call WaitForSoundToFinish call WaitForSoundToFinish
@ -133,20 +135,19 @@ Func_79ab: ; 79ab (1:79ab)
call WaitForSoundToFinish call WaitForSoundToFinish
ld hl, ItemWasStoredText ld hl, ItemWasStoredText
call PrintText call PrintText
jp Func_79ab jp .loop
Func_7a12: ; 7a12 (1:7a12) PlayerPCWithdraw: ; 7a12 (1:7a12)
xor a xor a
ld [wCurrentMenuItem], a ld [wCurrentMenuItem], a
ld [wListScrollOffset], a ld [wListScrollOffset], a
ld a, [wNumBoxItems] ld a, [wNumBoxItems]
and a and a
jr nz, Func_7a28 jr nz, .loop
ld hl, NothingStoredText ld hl, NothingStoredText
call PrintText call PrintText
jp Func_790c jp PlayerPCMenu
.loop
Func_7a28: ; 7a28 (1:7a28)
ld hl, WhatToWithdrawText ld hl, WhatToWithdrawText
call PrintText call PrintText
ld hl, wNumBoxItems ld hl, wNumBoxItems
@ -156,29 +157,30 @@ Func_7a28: ; 7a28 (1:7a28)
ld [wListPointer + 1], a ld [wListPointer + 1], a
xor a xor a
ld [wPrintItemPrices], a ld [wPrintItemPrices], a
ld a, $3 ld a, ITEMLISTMENU
ld [wListMenuID], a ld [wListMenuID], a
call DisplayListMenuID call DisplayListMenuID
jp c, Func_790c jp c, PlayerPCMenu
call IsKeyItem call IsKeyItem
ld a, $1 ld a, 1
ld [wItemQuantity], a ld [wItemQuantity], a
ld a, [wIsKeyItem] ld a, [wIsKeyItem]
and a and a
jr nz, .asm_7a64 jr nz, .next
; if it's not a key item, there can be more than one of the item
ld hl, WithdrawHowManyText ld hl, WithdrawHowManyText
call PrintText call PrintText
call DisplayChooseQuantityMenu call DisplayChooseQuantityMenu
cp $ff cp $ff
jp z, Func_7a28 jp z, .loop
.asm_7a64 .next
ld hl, wNumBagItems ld hl, wNumBagItems
call AddItemToInventory call AddItemToInventory
jr c, .asm_7a75 jr c, .roomAvailable
ld hl, CantCarryMoreText ld hl, CantCarryMoreText
call PrintText call PrintText
jp Func_7a28 jp .loop
.asm_7a75 .roomAvailable
ld hl, wNumBoxItems ld hl, wNumBoxItems
call RemoveItemFromInventory call RemoveItemFromInventory
call WaitForSoundToFinish call WaitForSoundToFinish
@ -187,20 +189,19 @@ Func_7a28: ; 7a28 (1:7a28)
call WaitForSoundToFinish call WaitForSoundToFinish
ld hl, WithdrewItemText ld hl, WithdrewItemText
call PrintText call PrintText
jp Func_7a28 jp .loop
Func_7a8f: ; 7a8f (1:7a8f) PlayerPCToss: ; 7a8f (1:7a8f)
xor a xor a
ld [wCurrentMenuItem], a ld [wCurrentMenuItem], a
ld [wListScrollOffset], a ld [wListScrollOffset], a
ld a, [wNumBoxItems] ld a, [wNumBoxItems]
and a and a
jr nz, Func_7aa5 jr nz, .loop
ld hl, NothingStoredText ld hl, NothingStoredText
call PrintText call PrintText
jp Func_790c jp PlayerPCMenu
.loop
Func_7aa5: ; 7aa5 (1:7aa5)
ld hl, WhatToTossText ld hl, WhatToTossText
call PrintText call PrintText
ld hl, wNumBoxItems ld hl, wNumBoxItems
@ -210,33 +211,34 @@ Func_7aa5: ; 7aa5 (1:7aa5)
ld [wListPointer + 1], a ld [wListPointer + 1], a
xor a xor a
ld [wPrintItemPrices], a ld [wPrintItemPrices], a
ld a, $3 ld a, ITEMLISTMENU
ld [wListMenuID], a ld [wListMenuID], a
push hl push hl
call DisplayListMenuID call DisplayListMenuID
pop hl pop hl
jp c, Func_790c jp c, PlayerPCMenu
push hl push hl
call IsKeyItem call IsKeyItem
pop hl pop hl
ld a, $1 ld a, 1
ld [wItemQuantity], a ld [wItemQuantity], a
ld a, [wIsKeyItem] ld a, [wIsKeyItem]
and a and a
jr nz, .asm_7aef jr nz, .next
ld a, [wcf91] ld a, [wcf91]
call IsItemHM call IsItemHM
jr c, .asm_7aef jr c, .next
; if it's not a key item, there can be more than one of the item
push hl push hl
ld hl, TossHowManyText ld hl, TossHowManyText
call PrintText call PrintText
call DisplayChooseQuantityMenu call DisplayChooseQuantityMenu
pop hl pop hl
cp $ff cp $ff
jp z, Func_7aa5 jp z, .loop
.asm_7aef .next
call TossItem call TossItem ; disallows tossing key items
jp Func_7aa5 jp .loop
PlayersPCMenuEntries: ; 7af5 (1:7af5) PlayersPCMenuEntries: ; 7af5 (1:7af5)
db "WITHDRAW ITEM" db "WITHDRAW ITEM"

View file

@ -54,7 +54,7 @@ RedisplayStartMenu:: ; 2adf (0:2adf)
.buttonPressed ; A, B, or Start button pressed .buttonPressed ; A, B, or Start button pressed
call PlaceUnfilledArrowMenuCursor call PlaceUnfilledArrowMenuCursor
ld a,[wCurrentMenuItem] ld a,[wCurrentMenuItem]
ld [wcc2d],a ; save current menu item ID ld [wBattleAndStartSavedMenuItem],a ; save current menu selection
ld a,b ld a,b
and a,%00001010 ; was the Start button or B button pressed? and a,%00001010 ; was the Start button or B button pressed?
jp nz,CloseStartMenu jp nz,CloseStartMenu

View file

@ -81,22 +81,22 @@ StartMenu_Pokemon: ; 130a9 (4:70a9)
jp z,.choseStats jp z,.choseStats
ld c,a ld c,a
ld b,0 ld b,0
ld hl,wWhichTrade ld hl,wFieldMoves
add hl,bc add hl,bc
jp .choseOutOfBattleMove jp .choseOutOfBattleMove
.choseSwitch .choseSwitch
ld a,[wPartyCount] ld a,[wPartyCount]
cp a,2 ; is there more than one pokemon in the party? cp a,2 ; is there more than one pokemon in the party?
jp c,StartMenu_Pokemon ; if not, no switching jp c,StartMenu_Pokemon ; if not, no switching
call SwitchPartyMon_Stats call SwitchPartyMon_InitVarOrSwapData ; init [wMenuItemToSwap]
ld a,SWAP_MONS_PARTY_MENU ld a,SWAP_MONS_PARTY_MENU
ld [wPartyMenuTypeOrMessageID],a ld [wPartyMenuTypeOrMessageID],a
call GoBackToPartyMenu call GoBackToPartyMenu
jp .checkIfPokemonChosen jp .checkIfPokemonChosen
.choseStats .choseStats
call ClearSprites call ClearSprites
xor a xor a ; PLAYER_PARTY_DATA
ld [wcc49],a ld [wMonDataLocation],a
predef StatusScreen predef StatusScreen
predef StatusScreen2 predef StatusScreen2
call ReloadMapData call ReloadMapData
@ -256,14 +256,14 @@ StartMenu_Pokemon: ; 130a9 (4:70a9)
ld a,[H_QUOTIENT + 2] ld a,[H_QUOTIENT + 2]
sbc b sbc b
jp nc,.notHealthyEnough jp nc,.notHealthyEnough
ld a,[wcc2b] ld a,[wPartyAndBillsPCSavedMenuItem]
push af push af
ld a,POTION ld a,POTION
ld [wcf91],a ld [wcf91],a
ld [wd152],a ld [wd152],a
call UseItem call UseItem
pop af pop af
ld [wcc2b],a ld [wPartyAndBillsPCSavedMenuItem],a
jp .loop jp .loop
.notHealthyEnough ; if current HP is less than 1/5 of max HP .notHealthyEnough ; if current HP is less than 1/5 of max HP
ld hl,.notHealthyEnoughText ld hl,.notHealthyEnoughText
@ -316,11 +316,11 @@ StartMenu_Item: ; 13302 (4:7302)
ld [wPrintItemPrices],a ld [wPrintItemPrices],a
ld a,ITEMLISTMENU ld a,ITEMLISTMENU
ld [wListMenuID],a ld [wListMenuID],a
ld a,[wcc2c] ld a,[wBagSavedMenuItem]
ld [wCurrentMenuItem],a ld [wCurrentMenuItem],a
call DisplayListMenuID call DisplayListMenuID
ld a,[wCurrentMenuItem] ld a,[wCurrentMenuItem]
ld [wcc2c],a ld [wBagSavedMenuItem],a
jr nc,.choseItem jr nc,.choseItem
.exitMenu .exitMenu
call LoadScreenTilesFromBuffer2 ; restore saved screen call LoadScreenTilesFromBuffer2 ; restore saved screen
@ -566,7 +566,7 @@ DrawTrainerInfo: ; 1349a (4:749a)
ld de,vChars1 + $570 ld de,vChars1 + $570
call TrainerInfo_FarCopyData call TrainerInfo_FarCopyData
call EnableLCD call EnableLCD
ld hl,wWhichTrade ld hl,wTrainerInfoTextBoxWidthPlus1
ld a,18 + 1 ld a,18 + 1
ld [hli],a ld [hli],a
dec a dec a
@ -574,7 +574,7 @@ DrawTrainerInfo: ; 1349a (4:749a)
ld [hl],1 ld [hl],1
hlCoord 0, 0 hlCoord 0, 0
call TrainerInfo_DrawTextBox call TrainerInfo_DrawTextBox
ld hl,wWhichTrade ld hl,wTrainerInfoTextBoxWidthPlus1
ld a,16 + 1 ld a,16 + 1
ld [hli],a ld [hli],a
dec a dec a
@ -627,15 +627,15 @@ TrainerInfo_BadgesText: ; 13597 (4:7597)
; height is always 6 ; height is always 6
; INPUT: ; INPUT:
; hl = destination address ; hl = destination address
; [wWhichTrade] = width + 1 ; [wTrainerInfoTextBoxWidthPlus1] = width
; [wTrainerEngageDistance] = width ; [wTrainerInfoTextBoxWidth] = width - 1
; [wTrainerFacingDirection] = distance from the end of a text box row to the start of the next ; [wTrainerInfoTextBoxNextRowOffset] = distance from the end of a text box row to the start of the next
TrainerInfo_DrawTextBox: ; 135a0 (4:75a0) TrainerInfo_DrawTextBox: ; 135a0 (4:75a0)
ld a,$79 ; upper left corner tile ID ld a,$79 ; upper left corner tile ID
ld de,$7a7b ; top edge and upper right corner tile ID's ld de,$7a7b ; top edge and upper right corner tile ID's
call TrainerInfo_DrawHorizontalEdge ; draw top edge call TrainerInfo_DrawHorizontalEdge ; draw top edge
call TrainerInfo_NextTextBoxRow call TrainerInfo_NextTextBoxRow
ld a,[wWhichTrade] ; width of the text box plus one ld a,[wTrainerInfoTextBoxWidthPlus1]
ld e,a ld e,a
ld d,0 ld d,0
ld c,6 ; height of the text box ld c,6 ; height of the text box
@ -651,7 +651,7 @@ TrainerInfo_DrawTextBox: ; 135a0 (4:75a0)
TrainerInfo_DrawHorizontalEdge: ; 135c3 (4:75c3) TrainerInfo_DrawHorizontalEdge: ; 135c3 (4:75c3)
ld [hli],a ; place left corner tile ld [hli],a ; place left corner tile
ld a,[wTrainerEngageDistance] ; width of the text box ld a,[wTrainerInfoTextBoxWidth]
ld c,a ld c,a
ld a,d ld a,d
.loop .loop
@ -663,7 +663,7 @@ TrainerInfo_DrawHorizontalEdge: ; 135c3 (4:75c3)
ret ret
TrainerInfo_NextTextBoxRow: ; 135d0 (4:75d0) TrainerInfo_NextTextBoxRow: ; 135d0 (4:75d0)
ld a,[wTrainerFacingDirection] ; distance to the start of the next row ld a,[wTrainerInfoTextBoxNextRowOffset] ; distance to the start of the next row
.loop .loop
inc hl inc hl
dec a dec a
@ -704,62 +704,65 @@ StartMenu_Option: ; 135f6 (4:75f6)
jp RedisplayStartMenu jp RedisplayStartMenu
SwitchPartyMon: ; 13613 (4:7613) SwitchPartyMon: ; 13613 (4:7613)
call SwitchPartyMon_Stats call SwitchPartyMon_InitVarOrSwapData ; swap data
ld a, [wWhichTrade] ld a, [wSwappedMenuItem]
call SwitchPartyMon_OAM call SwitchPartyMon_ClearGfx
ld a, [wCurrentMenuItem] ld a, [wCurrentMenuItem]
call SwitchPartyMon_OAM call SwitchPartyMon_ClearGfx
jp RedrawPartyMenu_ jp RedrawPartyMenu_
SwitchPartyMon_OAM: ; 13625 (4:7625) SwitchPartyMon_ClearGfx: ; 13625 (4:7625)
push af push af
hlCoord 0, 0 hlCoord 0, 0
ld bc, SCREEN_WIDTH * 2 ld bc, SCREEN_WIDTH * 2
call AddNTimes call AddNTimes
ld c, SCREEN_WIDTH * 2 ld c, SCREEN_WIDTH * 2
ld a, " " ld a, " "
.asm_13633 .clearMonBGLoop ; clear the mon's row in the party menu
ld [hli], a ld [hli], a
dec c dec c
jr nz, .asm_13633 jr nz, .clearMonBGLoop
pop af pop af
ld hl, wOAMBuffer ld hl, wOAMBuffer
ld bc, $10 ld bc, $10
call AddNTimes call AddNTimes
ld de, $4 ld de, $4
ld c, e ld c, e
.asm_13645 .clearMonOAMLoop
ld [hl], $a0 ld [hl], $a0
add hl, de add hl, de
dec c dec c
jr nz, .asm_13645 jr nz, .clearMonOAMLoop
call WaitForSoundToFinish call WaitForSoundToFinish
ld a, (SFX_02_58 - SFX_Headers_02) / 3 ld a, (SFX_02_58 - SFX_Headers_02) / 3
jp PlaySound jp PlaySound
SwitchPartyMon_Stats: ; 13653 (4:7653) SwitchPartyMon_InitVarOrSwapData: ; 13653 (4:7653)
; This is used to initialise [wMenuItemToSwap] and to actually swap the data.
ld a, [wMenuItemToSwap] ld a, [wMenuItemToSwap]
and a and a ; has [wMenuItemToSwap] been initialised yet?
jr nz, .asm_13661 jr nz, .pickedMonsToSwap
; If not, initialise [wMenuItemToSwap] so that it matches the current mon.
ld a, [wWhichPokemon] ld a, [wWhichPokemon]
inc a inc a ; [wMenuItemToSwap] counts from 1
ld [wMenuItemToSwap], a ld [wMenuItemToSwap], a
ret ret
.asm_13661 .pickedMonsToSwap
xor a xor a
ld [wPartyMenuTypeOrMessageID], a ld [wPartyMenuTypeOrMessageID], a
ld a, [wMenuItemToSwap] ld a, [wMenuItemToSwap]
dec a dec a
ld b, a ld b, a
ld a, [wCurrentMenuItem] ld a, [wCurrentMenuItem]
ld [wWhichTrade], a ld [wSwappedMenuItem], a
cp b cp b ; swapping a mon with itself?
jr nz, .asm_1367b jr nz, .swappingDifferentMons
; can't swap a mon with itself
xor a xor a
ld [wMenuItemToSwap], a ld [wMenuItemToSwap], a
ld [wPartyMenuTypeOrMessageID], a ld [wPartyMenuTypeOrMessageID], a
ret ret
.asm_1367b .swappingDifferentMons
ld a, b ld a, b
ld [wMenuItemToSwap], a ld [wMenuItemToSwap], a
push hl push hl
@ -770,20 +773,20 @@ SwitchPartyMon_Stats: ; 13653 (4:7653)
ld a, [wCurrentMenuItem] ld a, [wCurrentMenuItem]
add l add l
ld l, a ld l, a
jr nc, .asm_1368e jr nc, .noCarry
inc h inc h
.asm_1368e .noCarry
ld a, [wMenuItemToSwap] ld a, [wMenuItemToSwap]
add e add e
ld e, a ld e, a
jr nc, .asm_13696 jr nc, .noCarry2
inc d inc d
.asm_13696 .noCarry2
ld a, [hl] ld a, [hl]
ld [H_DIVIDEND], a ; (aliases: H_PRODUCT, H_PASTLEADINGZEROES, H_QUOTIENT) ld [hSwapTemp], a
ld a, [de] ld a, [de]
ld [hl], a ld [hl], a
ld a, [H_DIVIDEND] ; (aliases: H_PRODUCT, H_PASTLEADINGZEROES, H_QUOTIENT) ld a, [hSwapTemp]
ld [de], a ld [de], a
ld hl, wPartyMons ld hl, wPartyMons
ld bc, wPartyMon2 - wPartyMon1 ld bc, wPartyMon2 - wPartyMon1
@ -791,19 +794,19 @@ SwitchPartyMon_Stats: ; 13653 (4:7653)
call AddNTimes call AddNTimes
push hl push hl
ld de, wSwitchPartyMonTempBuffer ld de, wSwitchPartyMonTempBuffer
ld bc, $2c ld bc, wPartyMon2 - wPartyMon1
call CopyData call CopyData
ld hl, wPartyMons ld hl, wPartyMons
ld bc, $2c ld bc, wPartyMon2 - wPartyMon1
ld a, [wMenuItemToSwap] ld a, [wMenuItemToSwap]
call AddNTimes call AddNTimes
pop de pop de
push hl push hl
ld bc, $2c ld bc, wPartyMon2 - wPartyMon1
call CopyData call CopyData
pop de pop de
ld hl, wSwitchPartyMonTempBuffer ld hl, wSwitchPartyMonTempBuffer
ld bc, $2c ld bc, wPartyMon2 - wPartyMon1
call CopyData call CopyData
ld hl, wPartyMonOT ld hl, wPartyMonOT
ld a, [wCurrentMenuItem] ld a, [wCurrentMenuItem]
@ -842,7 +845,7 @@ SwitchPartyMon_Stats: ; 13653 (4:7653)
ld bc, $b ld bc, $b
call CopyData call CopyData
ld a, [wMenuItemToSwap] ld a, [wMenuItemToSwap]
ld [wWhichTrade], a ld [wSwappedMenuItem], a
xor a xor a
ld [wMenuItemToSwap], a ld [wMenuItemToSwap], a
ld [wPartyMenuTypeOrMessageID], a ld [wPartyMenuTypeOrMessageID], a

View file

@ -65,9 +65,10 @@ DrawHP_: ; 128fb (4:68fb)
; Predef 0x37 ; Predef 0x37
StatusScreen: ; 12953 (4:6953) StatusScreen: ; 12953 (4:6953)
call LoadMonData call LoadMonData
ld a, [wcc49] ld a, [wMonDataLocation]
cp $2 ; 2 means we're in a PC box cp BOX_DATA
jr c, .DontRecalculate jr c, .DontRecalculate
; mon is in a box or daycare
ld a, [wLoadedMonBoxLevel] ld a, [wLoadedMonBoxLevel]
ld [wLoadedMonLevel], a ld [wLoadedMonLevel], a
ld [W_CURENEMYLVL], a ld [W_CURENEMYLVL], a
@ -148,13 +149,13 @@ StatusScreen: ; 12953 (4:6953)
hlCoord 11, 10 hlCoord 11, 10
predef PrintMonType predef PrintMonType
ld hl, NamePointers2 ld hl, NamePointers2
call .asm_12a7e call .GetStringPointer
ld d, h ld d, h
ld e, l ld e, l
hlCoord 9, 1 hlCoord 9, 1
call PlaceString ; Pokémon name call PlaceString ; Pokémon name
ld hl, OTPointers ld hl, OTPointers
call .asm_12a7e call .GetStringPointer
ld d, h ld d, h
ld e, l ld e, l
hlCoord 12, 16 hlCoord 12, 16
@ -175,17 +176,18 @@ StatusScreen: ; 12953 (4:6953)
pop af pop af
ld [hTilesetType], a ld [hTilesetType], a
ret ret
.asm_12a7e ; I don't know what this does, iterates over pointers?
ld a, [wcc49] .GetStringPointer
ld a, [wMonDataLocation]
add a add a
ld c, a ld c, a
ld b, $0 ld b, 0
add hl, bc add hl, bc
ld a, [hli] ld a, [hli]
ld h, [hl] ld h, [hl]
ld l, a ld l, a
ld a, [wcc49] ld a, [wMonDataLocation]
cp $3 cp DAYCARE_DATA
ret z ret z
ld a, [wWhichPokemon] ld a, [wWhichPokemon]
jp SkipFixedLengthTextEntries jp SkipFixedLengthTextEntries

View file

@ -309,7 +309,7 @@ Func_73863: ; 73863 (1c:7863)
Func_7387b: ; 7387b (1c:787b) Func_7387b: ; 7387b (1c:787b)
ld hl, PointerTable_73895 ld hl, PointerTable_73895
ld a, [wd5a0] ld a, [wCurrentBoxNum]
and $7f and $7f
cp NUM_BOXES / 2 cp NUM_BOXES / 2
ld b, $2 ld b, $2
@ -341,7 +341,7 @@ ChangeBox:: ; 738a1 (1c:78a1)
ld a, [wCurrentMenuItem] ld a, [wCurrentMenuItem]
and a and a
ret nz ; return if No was chosen ret nz ; return if No was chosen
ld hl, wd5a0 ld hl, wCurrentBoxNum
bit 7, [hl] bit 7, [hl]
call z, Func_73a29 call z, Func_73a29
call Func_7393f call Func_7393f
@ -360,7 +360,7 @@ ChangeBox:: ; 738a1 (1c:78a1)
call Func_7390e call Func_7390e
ld a, [wCurrentMenuItem] ld a, [wCurrentMenuItem]
set 7, a set 7, a
ld [wd5a0], a ld [wCurrentBoxNum], a
call Func_7387b call Func_7387b
ld de, W_NUMINBOX ld de, W_NUMINBOX
call Func_7390e call Func_7390e
@ -422,7 +422,7 @@ Func_7393f: ; 7393f (1c:793f)
ld [wTopMenuItemX], a ld [wTopMenuItemX], a
xor a xor a
ld [wMenuWatchMovingOutOfBounds], a ld [wMenuWatchMovingOutOfBounds], a
ld a, [wd5a0] ld a, [wCurrentBoxNum]
and $7f and $7f
ld [wCurrentMenuItem], a ld [wCurrentMenuItem], a
ld [wLastMenuItem], a ld [wLastMenuItem], a
@ -443,7 +443,7 @@ Func_7393f: ; 7393f (1c:793f)
call PlaceString call PlaceString
ld hl, hFlags_0xFFF6 ld hl, hFlags_0xFFF6
res 2, [hl] res 2, [hl]
ld a, [wd5a0] ld a, [wCurrentBoxNum]
and $7f and $7f
cp 9 cp 9
jr c, .asm_739a6 jr c, .asm_739a6
@ -561,7 +561,7 @@ Func_73a84: ; 73a84 (1c:7a84)
ld [MBC1SRamBankingMode], a ld [MBC1SRamBankingMode], a
ld [MBC1SRamEnable], a ld [MBC1SRamEnable], a
pop hl pop hl
ld a, [wd5a0] ld a, [wCurrentBoxNum]
and $7f and $7f
ld c, a ld c, a
ld b, $0 ld b, $0

View file

@ -243,7 +243,7 @@ DrawHPBar:: ; 1336 (0:1336)
; loads base stats to W_MONHDEXNUM ; loads base stats to W_MONHDEXNUM
; INPUT: ; INPUT:
; [wWhichPokemon] = index of pokemon within party/box ; [wWhichPokemon] = index of pokemon within party/box
; [wcc49] = source ; [wMonDataLocation] = source
; 00: player's party ; 00: player's party
; 01: enemy's party ; 01: enemy's party
; 02: current box ; 02: current box
@ -376,15 +376,15 @@ PartyMenuInit:: ; 1420 (0:1420)
call LoadHpBarAndStatusTilePatterns call LoadHpBarAndStatusTilePatterns
ld hl, wd730 ld hl, wd730
set 6, [hl] ; turn off letter printing delay set 6, [hl] ; turn off letter printing delay
xor a xor a ; PLAYER_PARTY_DATA
ld [wcc49], a ld [wMonDataLocation], a
ld [wMenuWatchMovingOutOfBounds], a ld [wMenuWatchMovingOutOfBounds], a
ld hl, wTopMenuItemY ld hl, wTopMenuItemY
inc a inc a
ld [hli], a ; top menu item Y ld [hli], a ; top menu item Y
xor a xor a
ld [hli], a ; top menu item X ld [hli], a ; top menu item X
ld a, [wcc2b] ld a, [wPartyAndBillsPCSavedMenuItem]
push af push af
ld [hli], a ; current menu item ID ld [hli], a ; current menu item ID
inc hl inc hl
@ -420,7 +420,7 @@ HandlePartyMenuInput:: ; 145a (0:145a)
xor a xor a
ld [wd09b],a ld [wd09b],a
ld a,[wCurrentMenuItem] ld a,[wCurrentMenuItem]
ld [wcc2b],a ld [wPartyAndBillsPCSavedMenuItem],a
ld hl,wd730 ld hl,wd730
res 6,[hl] ; turn on letter printing delay res 6,[hl] ; turn on letter printing delay
ld a,[wMenuItemToSwap] ld a,[wMenuItemToSwap]
@ -1803,11 +1803,11 @@ PrintListMenuEntries:: ; 2e5a (0:2e5a)
ld hl,wPartyCount ld hl,wPartyCount
ld a,[wListPointer] ld a,[wListPointer]
cp l ; is it a list of party pokemon or box pokemon? cp l ; is it a list of party pokemon or box pokemon?
ld a,$00 ld a,PLAYER_PARTY_DATA
jr z,.next jr z,.next
ld a,$02 ld a,BOX_DATA
.next .next
ld [wcc49],a ld [wMonDataLocation],a
ld hl,wWhichPokemon ld hl,wWhichPokemon
ld a,[hl] ld a,[hl]
ld b,a ld b,a
@ -1818,7 +1818,7 @@ PrintListMenuEntries:: ; 2e5a (0:2e5a)
add b add b
ld [hl],a ld [hl],a
call LoadMonData ; load pokemon info call LoadMonData ; load pokemon info
ld a,[wcc49] ld a,[wMonDataLocation]
and a ; is it a list of party pokemon or box pokemon? and a ; is it a list of party pokemon or box pokemon?
jr z,.skipCopyingLevel jr z,.skipCopyingLevel
.copyLevel .copyLevel
@ -2751,7 +2751,7 @@ SetSpriteImageIndexAfterSettingFacingDirection:: ; 34b9 (0:34b9)
; INPUT: ; INPUT:
; hl = address of array ; hl = address of array
; OUTPUT: ; OUTPUT:
; [wWhichTrade] = if there is match, the matching array index ; [wCoordIndex] = if there is match, the matching array index
; sets carry if the coordinates are in the array, clears carry if not ; sets carry if the coordinates are in the array, clears carry if not
ArePlayerCoordsInArray:: ; 34bf (0:34bf) ArePlayerCoordsInArray:: ; 34bf (0:34bf)
ld a,[W_YCOORD] ld a,[W_YCOORD]
@ -2762,13 +2762,13 @@ ArePlayerCoordsInArray:: ; 34bf (0:34bf)
CheckCoords:: ; 34c7 (0:34c7) CheckCoords:: ; 34c7 (0:34c7)
xor a xor a
ld [wWhichTrade],a ld [wCoordIndex],a
.loop .loop
ld a,[hli] ld a,[hli]
cp a,$ff ; reached terminator? cp a,$ff ; reached terminator?
jr z,.notInArray jr z,.notInArray
push hl push hl
ld hl,wWhichTrade ld hl,wCoordIndex
inc [hl] inc [hl]
pop hl pop hl
.compareYCoord .compareYCoord
@ -2792,7 +2792,7 @@ CheckCoords:: ; 34c7 (0:34c7)
; hl = address of array ; hl = address of array
; [H_SPRITEINDEX] = index of boulder sprite ; [H_SPRITEINDEX] = index of boulder sprite
; OUTPUT: ; OUTPUT:
; [wWhichTrade] = if there is match, the matching array index ; [wCoordIndex] = if there is match, the matching array index
; sets carry if the coordinates are in the array, clears carry if not ; sets carry if the coordinates are in the array, clears carry if not
CheckBoulderCoords:: ; 34e4 (0:34e4) CheckBoulderCoords:: ; 34e4 (0:34e4)
push hl push hl
@ -4586,8 +4586,8 @@ GivePokemon::
ld [wcf91], a ld [wcf91], a
ld a, c ld a, c
ld [W_CURENEMYLVL], a ld [W_CURENEMYLVL], a
xor a xor a ; PLAYER_PARTY_DATA
ld [wcc49], a ld [wMonDataLocation], a
ld b, BANK(_GivePokemon) ld b, BANK(_GivePokemon)
ld hl, _GivePokemon ld hl, _GivePokemon
jp Bankswitch jp Bankswitch

View file

@ -44,6 +44,9 @@ hNPCMovementDirections2Index EQU $FF95
; CalcPositionOfPlayerRelativeToNPC ; CalcPositionOfPlayerRelativeToNPC
hNPCSpriteOffset EQU $FF95 hNPCSpriteOffset EQU $FF95
; temp value used when swapping bytes
hSwapTemp EQU $FF95
; 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.
@ -198,6 +201,8 @@ hTilesetType EQU $FFD7
H_CURRENTSPRITEOFFSET EQU $FFDA ; multiple of $10 H_CURRENTSPRITEOFFSET EQU $FFDA ; multiple of $10
hNewPartyLength EQU $FFE4
hDividend2 EQU $FFE5 hDividend2 EQU $FFE5
hDivisor2 EQU $FFE6 hDivisor2 EQU $FFE6
hQuotient2 EQU $FFE7 hQuotient2 EQU $FFE7

View file

@ -80,7 +80,7 @@ SonyText: db "SONY@"
LoadMonData_: LoadMonData_:
; Load monster [wWhichPokemon] from list [wcc49]: ; Load monster [wWhichPokemon] from list [wMonDataLocation]:
; 0: partymon ; 0: partymon
; 1: enemymon ; 1: enemymon
; 2: boxmon ; 2: boxmon
@ -90,8 +90,8 @@ LoadMonData_:
ld a, [wDayCareMonSpecies] ld a, [wDayCareMonSpecies]
ld [wcf91], a ld [wcf91], a
ld a, [wcc49] ld a, [wMonDataLocation]
cp 3 cp DAYCARE_DATA
jr z, .GetMonHeader jr z, .GetMonHeader
ld a, [wWhichPokemon] ld a, [wWhichPokemon]
@ -105,8 +105,8 @@ LoadMonData_:
ld hl, wPartyMons ld hl, wPartyMons
ld bc, wPartyMon2 - wPartyMon1 ld bc, wPartyMon2 - wPartyMon1
ld a, [wcc49] ld a, [wMonDataLocation]
cp 1 cp ENEMY_PARTY_DATA
jr c, .getMonEntry jr c, .getMonEntry
ld hl, wEnemyMons ld hl, wEnemyMons
@ -564,7 +564,7 @@ TestBattle:
ld a, 20 ld a, 20
ld [W_CURENEMYLVL], a ld [W_CURENEMYLVL], a
xor a xor a
ld [wcc49], a ld [wMonDataLocation], a
ld [W_CURMAP], a ld [W_CURMAP], a
call AddPartyMon call AddPartyMon
@ -1090,7 +1090,7 @@ DrawStartMenu: ; 710b (1:710b)
ld [wTopMenuItemY],a ; Y position of first menu choice ld [wTopMenuItemY],a ; Y position of first menu choice
ld a,$0b ld a,$0b
ld [wTopMenuItemX],a ; X position of first menu choice ld [wTopMenuItemX],a ; X position of first menu choice
ld a,[wcc2d] ; remembered menu selection from last time ld a,[wBattleAndStartSavedMenuItem] ; remembered menu selection from last time
ld [wCurrentMenuItem],a ld [wCurrentMenuItem],a
ld [wLastMenuItem],a ld [wLastMenuItem],a
xor a xor a
@ -2926,7 +2926,7 @@ RemoveItemFromInventory_: ; ce74 (3:4e74)
xor a xor a
ld [wListScrollOffset],a ld [wListScrollOffset],a
ld [wCurrentMenuItem],a ld [wCurrentMenuItem],a
ld [wcc2c],a ld [wBagSavedMenuItem],a
ld [wSavedListScrollOffset],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
@ -3553,36 +3553,40 @@ ResetBoulderPushFlags: ; f2dd (3:72dd)
ret ret
_AddPartyMon: ; f2e5 (3:72e5) _AddPartyMon: ; f2e5 (3:72e5)
; Adds a new mon to the player's or enemy's party.
; [wMonDataLocation] is used in an unusual way in this function.
; If the lower nybble is 0, the mon is added to the player's party, else the enemy's.
; If the entire value is 0, then the player is allowed to name the mon.
ld de, wPartyCount ld de, wPartyCount
ld a, [wcc49] ld a, [wMonDataLocation]
and $f and $f
jr z, .asm_f2f2 jr z, .next
ld de, wEnemyPartyCount ld de, wEnemyPartyCount
.asm_f2f2 .next
ld a, [de] ld a, [de]
inc a inc a
cp PARTY_LENGTH + 1 cp PARTY_LENGTH + 1
ret nc ret nc ; return if the party is already full
ld [de], a ld [de], a
ld a, [de] ld a, [de]
ld [$ffe4], a ld [hNewPartyLength], a
add e add e
ld e, a ld e, a
jr nc, .asm_f300 jr nc, .noCarry
inc d inc d
.asm_f300 .noCarry
ld a, [wcf91] ld a, [wcf91]
ld [de], a ld [de], a ; write species of new mon in party list
inc de inc de
ld a, $ff ld a, $ff ; terminator
ld [de], a ld [de], a
ld hl, wPartyMonOT ld hl, wPartyMonOT
ld a, [wcc49] ld a, [wMonDataLocation]
and $f and $f
jr z, .asm_f315 jr z, .next2
ld hl, wEnemyMonOT ld hl, wEnemyMonOT
.asm_f315 .next2
ld a, [$ffe4] ld a, [hNewPartyLength]
dec a dec a
call SkipFixedLengthTextEntries call SkipFixedLengthTextEntries
ld d, h ld d, h
@ -3590,24 +3594,24 @@ _AddPartyMon: ; f2e5 (3:72e5)
ld hl, wPlayerName ld hl, wPlayerName
ld bc, $b ld bc, $b
call CopyData call CopyData
ld a, [wcc49] ld a, [wMonDataLocation]
and a and a
jr nz, .asm_f33f jr nz, .skipNaming
ld hl, wPartyMonNicks ld hl, wPartyMonNicks
ld a, [$ffe4] ld a, [hNewPartyLength]
dec a dec a
call SkipFixedLengthTextEntries call SkipFixedLengthTextEntries
ld a, NAME_MON_SCREEN ld a, NAME_MON_SCREEN
ld [wNamingScreenType], a ld [wNamingScreenType], a
predef AskName predef AskName
.asm_f33f .skipNaming
ld hl, wPartyMons ld hl, wPartyMons
ld a, [wcc49] ld a, [wMonDataLocation]
and $f and $f
jr z, .asm_f34c jr z, .next3
ld hl, wEnemyMons ld hl, wEnemyMons
.asm_f34c .next3
ld a, [$ffe4] ld a, [hNewPartyLength]
dec a dec a
ld bc, wPartyMon2 - wPartyMon1 ld bc, wPartyMon2 - wPartyMon1
call AddNTimes call AddNTimes
@ -3619,15 +3623,17 @@ _AddPartyMon: ; f2e5 (3:72e5)
call GetMonHeader call GetMonHeader
ld hl, W_MONHEADER ld hl, W_MONHEADER
ld a, [hli] ld a, [hli]
ld [de], a ld [de], a ; species
inc de inc de
pop hl pop hl
push hl push hl
ld a, [wcc49] ld a, [wMonDataLocation]
and $f and $f
ld a, $98 ; set enemy trainer mon IVs to fixed average values ld a, $98 ; set enemy trainer mon IVs to fixed average values
ld b, $88 ld b, $88
jr nz, .writeFreshMonData jr nz, .next4
; If the mon is being added to the player's party, update the pokedex.
ld a, [wcf91] ld a, [wcf91]
ld [wd11e], a ld [wd11e], a
push de push de
@ -3650,24 +3656,29 @@ _AddPartyMon: ; f2e5 (3:72e5)
pop bc pop bc
ld hl, wPokedexSeen ld hl, wPokedexSeen
call FlagAction call FlagAction
pop hl pop hl
push hl push hl
ld a, [W_ISINBATTLE] ld a, [W_ISINBATTLE]
and a and a ; is this a wild mon caught in battle?
jr nz, .copyEnemyMonData jr nz, .copyEnemyMonData
; Not wild.
call Random ; generate random IVs call Random ; generate random IVs
ld b, a ld b, a
call Random call Random
.writeFreshMonData ; f3b3
.next4
push bc push bc
ld bc, $1b ld bc, wPartyMon1DVs - wPartyMon1
add hl, bc add hl, bc
pop bc pop bc
ld [hli], a ld [hli], a
ld [hl], b ; write IVs ld [hl], b ; write IVs
ld bc, $fff4 ld bc, (wPartyMon1HPExp - 1) - (wPartyMon1DVs + 1)
add hl, bc add hl, bc
ld a, $1 ld a, 1
ld c, a ld c, a
xor a xor a
ld b, a ld b, a
@ -3679,13 +3690,13 @@ _AddPartyMon: ; f2e5 (3:72e5)
ld [de], a ld [de], a
inc de inc de
xor a xor a
ld [de], a ; level (?) ld [de], a ; box level
inc de inc de
ld [de], a ; status ailments ld [de], a ; status ailments
inc de inc de
jr .copyMonTypesAndMoves jr .copyMonTypesAndMoves
.copyEnemyMonData .copyEnemyMonData
ld bc, $1b ld bc, wPartyMon1DVs - wPartyMon1
add hl, bc add hl, bc
ld a, [wEnemyMonDVs] ; copy IVs from cur enemy mon ld a, [wEnemyMonDVs] ; copy IVs from cur enemy mon
ld [hli], a ld [hli], a
@ -3698,7 +3709,7 @@ _AddPartyMon: ; f2e5 (3:72e5)
ld [de], a ld [de], a
inc de inc de
xor a xor a
ld [de], a ; level (?) ld [de], a ; box level
inc de inc de
ld a, [wEnemyMonStatus] ; copy status ailments from cur enemy mon ld a, [wEnemyMonStatus] ; copy status ailments from cur enemy mon
ld [de], a ld [de], a
@ -3711,7 +3722,7 @@ _AddPartyMon: ; f2e5 (3:72e5)
ld a, [hli] ; type 2 ld a, [hli] ; type 2
ld [de], a ld [de], a
inc de inc de
ld a, [hli] ; unused (?) ld a, [hli] ; catch rate (held item in gen 2)
ld [de], a ld [de], a
ld hl, W_MONHMOVES ld hl, W_MONHMOVES
ld a, [hli] ld a, [hli]
@ -4035,7 +4046,7 @@ _MoveMon: ; f51e (3:751e)
push hl push hl
srl a srl a
add $2 add $2
ld [wcc49], a ld [wMonDataLocation], a
call LoadMonData call LoadMonData
callba CalcLevelFromExperience callba CalcLevelFromExperience
ld a, d ld a, d
@ -4477,7 +4488,7 @@ START_MONEY EQU $3000
inc hl inc hl
ld [hl], a ld [hl], a
ld [wcc49], a ld [wMonDataLocation], a
ld hl, W_OBTAINEDBADGES ld hl, W_OBTAINEDBADGES
ld [hli], a ld [hli], a

View file

@ -35,11 +35,11 @@ DayCareMText1: ; 56254 (15:6254)
pop af pop af
ld hl, DayCareMText_56437 ld hl, DayCareMText_56437
jp c, DayCareMScript_56409 jp c, DayCareMScript_56409
callab Func_2171b callab KnowsHMMove
ld hl, DayCareMText_5644a ld hl, DayCareMText_5644a
jp c, DayCareMScript_56409 jp c, DayCareMScript_56409
xor a xor a
ld [wcc2b], a ld [wPartyAndBillsPCSavedMenuItem], a
ld a, [wWhichPokemon] ld a, [wWhichPokemon]
ld hl, wPartyMonNicks ld hl, wPartyMonNicks
call GetPartyMonName call GetPartyMonName
@ -62,8 +62,8 @@ DayCareMScript_562e1: ; 562e1 (15:62e1)
xor a xor a
ld hl, W_DAYCAREMONNAME ld hl, W_DAYCAREMONNAME
call GetPartyMonName call GetPartyMonName
ld a, $3 ld a, DAYCARE_DATA
ld [wcc49], a ld [wMonDataLocation], a
call LoadMonData call LoadMonData
callab CalcLevelFromExperience callab CalcLevelFromExperience
ld a, d ld a, d

View file

@ -898,9 +898,9 @@ OaksLabMonChoiceMenu: ; 1d1b3 (7:51b3)
call PrintText call PrintText
ld hl, OaksLabReceivedMonText ld hl, OaksLabReceivedMonText
call PrintText call PrintText
xor a xor a ; PLAYER_PARTY_DATA
ld [wcc49], a ld [wMonDataLocation], a
ld a, $5 ld a, 5
ld [W_CURENEMYLVL], a ld [W_CURENEMYLVL], a
ld a, [wcf91] ld a, [wcf91]
ld [wd11e], a ld [wd11e], a

View file

@ -1816,7 +1816,7 @@ _MonWasStoredText:: ; 0x8a159
TX_RAM wcf4b TX_RAM wcf4b
text " was" text " was"
line "stored in Box @" line "stored in Box @"
TX_RAM wWhichTrade TX_RAM wBoxNumString
text "." text "."
prompt prompt

View file

@ -236,15 +236,32 @@ wLastMenuItem:: ; cc2a
; id of previously selected menu item ; id of previously selected menu item
ds 1 ds 1
; group these 3 addresses together because of an ld a,[hli] wPartyAndBillsPCSavedMenuItem:: ; cc2b
wcc2b:: ds 1 ; used in party menu ; It is mainly used by the party menu to remember the cursor position while the
wcc2c:: ds 1 ; used in item related menus (inventory, pc) ; menu isn't active.
wcc2d:: ds 1 ; also used in inventory, supposed to save an item id ; It is also used to remember the cursor position of mon lists (for the
; withdraw/deposit/release actions) in Bill's PC so that it doesn't get lost
; when you choose a mon from the list and a sub-menu is shown. It's reset when
; you return to the main Bill's PC menu.
ds 1
wBagSavedMenuItem:: ; cc2c
; It is used by the bag list to remember the cursor position while the menu
; isn't active.
ds 1
wBattleAndStartSavedMenuItem:: ; cc2d
; It is used by the start menu to remember the cursor position while the menu
; isn't active.
; The battle menu uses it so that the cursor position doesn't get lost when
; a sub-menu is shown. It's reset at the start of each battle.
ds 1
wPlayerMoveListIndex:: ; cc2e wPlayerMoveListIndex:: ; cc2e
ds 1 ds 1
wPlayerMonNumber:: ; cc2f wPlayerMonNumber:: ; cc2f
; index in party of currently battling mon
ds 1 ds 1
wMenuCursorLocation:: ; cc30 wMenuCursorLocation:: ; cc30
@ -326,7 +343,17 @@ wWhichTradeMonSelectionMenu:: ; cc49
; $00 = player mons ; $00 = player mons
; $01 = enemy mons ; $01 = enemy mons
wcc49:: ds 1 ; used in some pokemon related stuff (some kind of species storage byte) wMonDataLocation:: ; cc49
; 0 = player's party
; 1 = enemy party
; 2 = current box
; 3 = daycare
; 4 = in-battle mon
;
; AddPartyMon uses it slightly differently.
; If the lower nybble is 0, the mon is added to the player's party, else the enemy's.
; If the entire value is 0, then the player is allowed to name the mon.
ds 1
wMenuWrappingEnabled:: ; cc4a wMenuWrappingEnabled:: ; cc4a
; set to 1 if you can go from the bottom to the top or top to bottom of a menu ; set to 1 if you can go from the bottom to the top or top to bottom of a menu
@ -402,6 +429,8 @@ wSimulatedJoypadStatesEnd:: ; ccd3
; the list starts above this address and extends downwards in memory until here ; the list starts above this address and extends downwards in memory until here
; overloaded with below labels ; overloaded with below labels
wParentMenuItem:: ; ccd3
wccd3:: ds 1 ; used in battle, pokemon, PC and game corner stuff wccd3:: ds 1 ; used in battle, pokemon, PC and game corner stuff
wForceEvolution:: wForceEvolution::
wccd4:: ds 1 ; has a direct reference for simulated joypad stuff in vermillion and seafoam wccd4:: ds 1 ; has a direct reference for simulated joypad stuff in vermillion and seafoam
@ -605,6 +634,18 @@ wOverrideSimulatedJoypadStatesMask:: ; cd3b
ds 1 ds 1
wChargeMoveNum:: ; cd3d
wCoordIndex:: ; cd3d
wOptionsTextSpeedCursorX:: ; cd3d
wBoxNumString:: ; cd3d
wTrainerInfoTextBoxWidthPlus1:: ; cd3d
wSwappedMenuItem:: ; cd3d
wHoFMonSpecies:: ; cd3d wHoFMonSpecies:: ; cd3d
wFieldMoves:: ; cd3d wFieldMoves:: ; cd3d
@ -648,6 +689,10 @@ wWhichTrade:: ; cd3d
wTrainerSpriteOffset:: ; cd3d wTrainerSpriteOffset:: ; cd3d
ds 1 ds 1
wOptionsBattleAnimCursorX:: ; cd3e
wTrainerInfoTextBoxWidth:: ; cd3e
wHoFPartyMonIndex:: ; cd3e wHoFPartyMonIndex:: ; cd3e
wNumCreditsMonsDisplayed:: ; cd3e wNumCreditsMonsDisplayed:: ; cd3e
@ -676,6 +721,10 @@ wHiddenObjectFunctionRomBank:: ; cd3e
wTrainerEngageDistance:: ; cd3e wTrainerEngageDistance:: ; cd3e
ds 1 ds 1
wOptionsBattleStyleCursorX:: ; cd3f
wTrainerInfoTextBoxNextRowOffset:: ; cd3f
wHoFMonLevel:: ; cd3f wHoFMonLevel:: ; cd3f
wBadgeOrFaceTiles:: ; cd3f wBadgeOrFaceTiles:: ; cd3f
@ -850,6 +899,7 @@ wRightGBMonSpecies:: ; cd5f
wFlags_0xcd60:: ; cd60 wFlags_0xcd60:: ; cd60
; bit 0: is player engaged by trainer (to avoid being engaged by multiple trainers simultaneously) ; bit 0: is player engaged by trainer (to avoid being engaged by multiple trainers simultaneously)
; bit 1: boulder dust animation (from using Strength) pending ; bit 1: boulder dust animation (from using Strength) pending
; bit 3: using generic PC
; bit 5: don't play sound when A or B is pressed in menu ; bit 5: don't play sound when A or B is pressed in menu
; bit 6: tried pushing against boulder once (you need to push twice before it will move) ; bit 6: tried pushing against boulder once (you need to push twice before it will move)
ds 1 ds 1
@ -1976,7 +2026,8 @@ wBoxItems:: ; d53b
ds 50 * 2 ds 50 * 2
ds 1 ; end ds 1 ; end
wd5a0:: ds 2 ; current box number wCurrentBoxNum:: ; d5a0
ds 2
wNumHoFTeams:: ; d5a2 wNumHoFTeams:: ; d5a2
; number of HOF teams ; number of HOF teams