2018-01-24 08:17:05 -08:00
|
|
|
|
PokemonCenterPC: ; 1559a
|
2015-11-16 18:46:36 -08:00
|
|
|
|
call PC_CheckPartyForPokemon
|
|
|
|
|
ret c
|
|
|
|
|
call PC_PlayBootSound
|
2017-12-10 19:34:42 -08:00
|
|
|
|
ld hl, PokecenterPCText_BootedUpPC
|
2015-11-16 18:46:36 -08:00
|
|
|
|
call PC_DisplayText
|
2017-12-10 19:34:42 -08:00
|
|
|
|
ld hl, PokecenterPCText_AccessWhosePC
|
2015-11-16 18:46:36 -08:00
|
|
|
|
call PC_DisplayTextWaitMenu
|
|
|
|
|
ld hl, .TopMenu
|
2018-01-23 13:08:43 -08:00
|
|
|
|
call LoadMenuHeader
|
2015-11-16 18:46:36 -08:00
|
|
|
|
.loop
|
|
|
|
|
xor a
|
|
|
|
|
ld [hBGMapMode], a
|
|
|
|
|
call .ChooseWhichPCListToUse
|
2015-12-18 17:07:09 -08:00
|
|
|
|
ld [wWhichIndexSet], a
|
2015-11-16 18:46:36 -08:00
|
|
|
|
call DoNthMenu
|
|
|
|
|
jr c, .shutdown
|
2018-01-23 14:39:09 -08:00
|
|
|
|
ld a, [wMenuSelection]
|
2015-11-16 18:46:36 -08:00
|
|
|
|
ld hl, .JumpTable
|
|
|
|
|
call MenuJumptable
|
|
|
|
|
jr nc, .loop
|
|
|
|
|
|
|
|
|
|
.shutdown
|
|
|
|
|
call PC_PlayShutdownSound
|
|
|
|
|
call ExitMenu
|
2015-12-24 19:58:42 -08:00
|
|
|
|
call CloseWindow
|
2015-11-16 18:46:36 -08:00
|
|
|
|
ret
|
|
|
|
|
|
2016-04-10 11:42:14 -07:00
|
|
|
|
.TopMenu:
|
2018-01-14 02:59:56 -08:00
|
|
|
|
db MENU_BACKUP_TILES | MENU_NO_CLICK_SFX ; flags
|
2018-01-13 13:38:14 -08:00
|
|
|
|
menu_coords 0, 0, 15, 12
|
2018-01-23 13:08:43 -08:00
|
|
|
|
dw .MenuData
|
2015-11-16 18:46:36 -08:00
|
|
|
|
db 1 ; default option
|
|
|
|
|
|
2018-01-23 13:08:43 -08:00
|
|
|
|
.MenuData:
|
2018-01-14 02:59:56 -08:00
|
|
|
|
db STATICMENU_CURSOR | STATICMENU_WRAP ; flags
|
2015-11-16 18:46:36 -08:00
|
|
|
|
db 0 ; items
|
|
|
|
|
dw .WhichPC
|
|
|
|
|
dw PlaceNthMenuStrings
|
|
|
|
|
dw .JumpTable
|
|
|
|
|
|
2018-05-18 19:18:00 -07:00
|
|
|
|
PCPC_PLAYERS_PC EQU 0
|
|
|
|
|
PCPC_BILLS_PC EQU 1
|
|
|
|
|
PCPC_OAKS_PC EQU 2
|
|
|
|
|
PCPC_HALL_OF_FAME EQU 3
|
|
|
|
|
PCPC_TURN_OFF EQU 4
|
|
|
|
|
|
2016-04-10 11:42:14 -07:00
|
|
|
|
.JumpTable:
|
2018-05-18 19:18:00 -07:00
|
|
|
|
; entries correspond to PCPC_* constants
|
|
|
|
|
dw PlayersPC, .String_PlayersPC
|
|
|
|
|
dw BillsPC, .String_BillsPC
|
|
|
|
|
dw OaksPC, .String_OaksPC
|
2015-11-16 18:46:36 -08:00
|
|
|
|
dw HallOfFamePC, .String_HallOfFame
|
2018-05-18 19:18:00 -07:00
|
|
|
|
dw TurnOffPC, .String_TurnOff
|
2015-11-16 18:46:36 -08:00
|
|
|
|
|
2016-03-01 19:31:21 -08:00
|
|
|
|
.String_PlayersPC: db "<PLAYER>'s PC@"
|
|
|
|
|
.String_BillsPC: db "BILL's PC@"
|
|
|
|
|
.String_OaksPC: db "PROF.OAK's PC@"
|
|
|
|
|
.String_HallOfFame: db "HALL OF FAME@"
|
|
|
|
|
.String_TurnOff: db "TURN OFF@"
|
2015-11-16 18:46:36 -08:00
|
|
|
|
|
2016-04-10 11:42:14 -07:00
|
|
|
|
.WhichPC:
|
2018-05-18 19:18:00 -07:00
|
|
|
|
; before Pokédex
|
|
|
|
|
db 3
|
|
|
|
|
db PCPC_BILLS_PC
|
|
|
|
|
db PCPC_PLAYERS_PC
|
|
|
|
|
db PCPC_TURN_OFF
|
|
|
|
|
db -1 ; end
|
2015-11-16 18:46:36 -08:00
|
|
|
|
|
|
|
|
|
; before Hall Of Fame
|
2018-05-18 19:18:00 -07:00
|
|
|
|
db 4
|
|
|
|
|
db PCPC_BILLS_PC
|
|
|
|
|
db PCPC_PLAYERS_PC
|
|
|
|
|
db PCPC_OAKS_PC
|
|
|
|
|
db PCPC_TURN_OFF
|
|
|
|
|
db -1 ; end
|
2015-11-16 18:46:36 -08:00
|
|
|
|
|
|
|
|
|
; postgame
|
2018-05-18 19:18:00 -07:00
|
|
|
|
db 5
|
|
|
|
|
db PCPC_BILLS_PC
|
|
|
|
|
db PCPC_PLAYERS_PC
|
|
|
|
|
db PCPC_OAKS_PC
|
|
|
|
|
db PCPC_HALL_OF_FAME
|
|
|
|
|
db PCPC_TURN_OFF
|
|
|
|
|
db -1 ; end
|
2015-11-16 18:46:36 -08:00
|
|
|
|
|
2016-04-10 11:42:14 -07:00
|
|
|
|
.ChooseWhichPCListToUse:
|
2015-11-16 18:46:36 -08:00
|
|
|
|
call CheckReceivedDex
|
|
|
|
|
jr nz, .got_dex
|
2018-05-18 19:18:00 -07:00
|
|
|
|
ld a, 0 ; before Pokédex
|
2015-11-16 18:46:36 -08:00
|
|
|
|
ret
|
|
|
|
|
|
|
|
|
|
.got_dex
|
|
|
|
|
ld a, [wHallOfFameCount]
|
|
|
|
|
and a
|
2018-05-18 19:18:00 -07:00
|
|
|
|
ld a, 1 ; before Hall Of Fame
|
2015-11-16 18:46:36 -08:00
|
|
|
|
ret z
|
2018-05-18 19:18:00 -07:00
|
|
|
|
ld a, 2 ; postgame
|
2015-11-16 18:46:36 -08:00
|
|
|
|
ret
|
|
|
|
|
; 15650
|
|
|
|
|
|
|
|
|
|
PC_CheckPartyForPokemon: ; 15650
|
2018-01-23 14:39:09 -08:00
|
|
|
|
ld a, [wPartyCount]
|
2015-11-16 18:46:36 -08:00
|
|
|
|
and a
|
|
|
|
|
ret nz
|
|
|
|
|
ld de, SFX_CHOOSE_PC_OPTION
|
|
|
|
|
call PlaySFX
|
2016-03-01 19:31:21 -08:00
|
|
|
|
ld hl, .MustHavePokemonToUse
|
2015-11-16 18:46:36 -08:00
|
|
|
|
call PC_DisplayText
|
|
|
|
|
scf
|
|
|
|
|
ret
|
|
|
|
|
|
2016-04-10 11:42:14 -07:00
|
|
|
|
.MustHavePokemonToUse:
|
2015-11-16 18:46:36 -08:00
|
|
|
|
; Bzzzzt! You must have a #MON to use this!
|
|
|
|
|
text_jump UnknownText_0x1c1328
|
|
|
|
|
db "@"
|
|
|
|
|
; 0x15668
|
|
|
|
|
|
|
|
|
|
BillsPC: ; 15668
|
|
|
|
|
call PC_PlayChoosePCSound
|
2017-12-10 19:34:42 -08:00
|
|
|
|
ld hl, PokecenterPCText_AccessedBillsPC
|
2015-11-16 18:46:36 -08:00
|
|
|
|
call PC_DisplayText
|
2017-12-24 09:47:30 -08:00
|
|
|
|
farcall _BillsPC
|
2015-11-16 18:46:36 -08:00
|
|
|
|
and a
|
|
|
|
|
ret
|
|
|
|
|
; 15679 (5:5679)
|
|
|
|
|
|
|
|
|
|
PlayersPC: ; 15679
|
|
|
|
|
call PC_PlayChoosePCSound
|
2017-12-10 19:34:42 -08:00
|
|
|
|
ld hl, PokecenterPCText_AccessedOwnPC
|
2015-11-16 18:46:36 -08:00
|
|
|
|
call PC_DisplayText
|
|
|
|
|
ld b, $0
|
|
|
|
|
call _PlayersPC
|
|
|
|
|
and a
|
|
|
|
|
ret
|
|
|
|
|
; 15689
|
|
|
|
|
|
|
|
|
|
OaksPC: ; 15689
|
|
|
|
|
call PC_PlayChoosePCSound
|
2017-12-10 19:34:42 -08:00
|
|
|
|
ld hl, PokecenterPCText_AccessedOaksPC
|
2015-11-16 18:46:36 -08:00
|
|
|
|
call PC_DisplayText
|
2017-12-24 09:47:30 -08:00
|
|
|
|
farcall ProfOaksPC
|
2015-11-16 18:46:36 -08:00
|
|
|
|
and a
|
|
|
|
|
ret
|
|
|
|
|
; 1569a
|
|
|
|
|
|
|
|
|
|
HallOfFamePC: ; 1569a
|
|
|
|
|
call PC_PlayChoosePCSound
|
|
|
|
|
call FadeToMenu
|
2017-12-24 09:47:30 -08:00
|
|
|
|
farcall _HallOfFamePC
|
2015-12-01 18:54:11 -08:00
|
|
|
|
call CloseSubmenu
|
2015-11-16 18:46:36 -08:00
|
|
|
|
and a
|
|
|
|
|
ret
|
|
|
|
|
; 156ab
|
|
|
|
|
|
|
|
|
|
TurnOffPC: ; 156ab
|
2017-12-10 19:34:42 -08:00
|
|
|
|
ld hl, PokecenterPCText_LinkClosed
|
2015-11-16 18:46:36 -08:00
|
|
|
|
call PrintText
|
|
|
|
|
scf
|
|
|
|
|
ret
|
|
|
|
|
; 156b3
|
|
|
|
|
|
|
|
|
|
PC_PlayBootSound: ; 156b3
|
|
|
|
|
ld de, SFX_BOOT_PC
|
|
|
|
|
jr PC_WaitPlaySFX
|
|
|
|
|
|
|
|
|
|
PC_PlayShutdownSound: ; 156b8
|
|
|
|
|
ld de, SFX_SHUT_DOWN_PC
|
|
|
|
|
call PC_WaitPlaySFX
|
|
|
|
|
call WaitSFX
|
|
|
|
|
ret
|
|
|
|
|
|
|
|
|
|
PC_PlayChoosePCSound: ; 156c2
|
|
|
|
|
ld de, SFX_CHOOSE_PC_OPTION
|
|
|
|
|
jr PC_WaitPlaySFX
|
|
|
|
|
|
2016-03-01 19:31:21 -08:00
|
|
|
|
PC_PlaySwapItemsSound: ; 156c7
|
2015-11-16 18:46:36 -08:00
|
|
|
|
ld de, SFX_SWITCH_POKEMON
|
|
|
|
|
call PC_WaitPlaySFX
|
|
|
|
|
ld de, SFX_SWITCH_POKEMON
|
|
|
|
|
|
|
|
|
|
PC_WaitPlaySFX: ; 156d0
|
|
|
|
|
push de
|
|
|
|
|
call WaitSFX
|
|
|
|
|
pop de
|
|
|
|
|
call PlaySFX
|
|
|
|
|
ret
|
|
|
|
|
; 156d9
|
|
|
|
|
|
2018-01-22 16:10:09 -08:00
|
|
|
|
_PlayersHousePC: ; 156d9
|
2015-11-16 18:46:36 -08:00
|
|
|
|
call PC_PlayBootSound
|
|
|
|
|
ld hl, UnknownText_0x156ff
|
|
|
|
|
call PC_DisplayText
|
|
|
|
|
ld b, $1
|
|
|
|
|
call _PlayersPC
|
|
|
|
|
and a
|
|
|
|
|
jr nz, .asm_156f9
|
|
|
|
|
call OverworldTextModeSwitch
|
2015-11-25 07:16:29 -08:00
|
|
|
|
call ApplyTilemap
|
2015-11-16 18:46:36 -08:00
|
|
|
|
call UpdateSprites
|
|
|
|
|
call PC_PlayShutdownSound
|
|
|
|
|
ld c, $0
|
|
|
|
|
ret
|
|
|
|
|
|
|
|
|
|
.asm_156f9
|
|
|
|
|
call ClearBGPalettes
|
|
|
|
|
ld c, $1
|
|
|
|
|
ret
|
|
|
|
|
; 156ff
|
|
|
|
|
|
|
|
|
|
UnknownText_0x156ff: ; 0x156ff
|
|
|
|
|
; turned on the PC.
|
|
|
|
|
text_jump UnknownText_0x1c1353
|
|
|
|
|
db "@"
|
|
|
|
|
; 0x15704
|
|
|
|
|
|
|
|
|
|
_PlayersPC: ; 15704
|
|
|
|
|
ld a, b
|
2015-12-18 17:07:09 -08:00
|
|
|
|
ld [wWhichIndexSet], a
|
2015-11-16 18:46:36 -08:00
|
|
|
|
ld hl, UnknownText_0x157cc
|
|
|
|
|
call PC_DisplayTextWaitMenu
|
|
|
|
|
call Function15715
|
|
|
|
|
call ExitMenu
|
|
|
|
|
ret
|
|
|
|
|
; 15715
|
|
|
|
|
|
|
|
|
|
Function15715: ; 15715
|
|
|
|
|
xor a
|
2016-03-01 19:31:21 -08:00
|
|
|
|
ld [wPCItemsCursor], a
|
|
|
|
|
ld [wPCItemsScrollPosition], a
|
2018-01-22 16:10:09 -08:00
|
|
|
|
ld hl, PlayersPCMenuData
|
2018-01-23 13:08:43 -08:00
|
|
|
|
call LoadMenuHeader
|
2015-11-16 18:46:36 -08:00
|
|
|
|
.asm_15722
|
|
|
|
|
call UpdateTimePals
|
|
|
|
|
call DoNthMenu
|
|
|
|
|
jr c, .asm_15731
|
|
|
|
|
call MenuJumptable
|
|
|
|
|
jr nc, .asm_15722
|
|
|
|
|
jr .asm_15732
|
|
|
|
|
|
|
|
|
|
.asm_15731
|
|
|
|
|
xor a
|
|
|
|
|
|
|
|
|
|
.asm_15732
|
|
|
|
|
call ExitMenu
|
|
|
|
|
ret
|
|
|
|
|
; 15736
|
|
|
|
|
|
2018-01-22 16:10:09 -08:00
|
|
|
|
PlayersPCMenuData: ; 0x15736
|
2018-01-14 02:59:56 -08:00
|
|
|
|
db MENU_BACKUP_TILES ; flags
|
2015-11-16 18:46:36 -08:00
|
|
|
|
db 0, 0 ; top left corner coords (y, x)
|
|
|
|
|
db 12, 15 ; bottom right corner coords (y, x)
|
2018-01-23 13:08:43 -08:00
|
|
|
|
dw .PlayersPCMenuData
|
2015-11-16 18:46:36 -08:00
|
|
|
|
db 1 ; default selected option
|
|
|
|
|
|
2018-01-23 13:08:43 -08:00
|
|
|
|
.PlayersPCMenuData:
|
2018-01-14 02:59:56 -08:00
|
|
|
|
db STATICMENU_CURSOR | STATICMENU_WRAP ; flags
|
2015-11-16 18:46:36 -08:00
|
|
|
|
db 0 ; # items?
|
2018-01-22 16:10:09 -08:00
|
|
|
|
dw .PlayersPCMenuList1
|
2015-11-16 18:46:36 -08:00
|
|
|
|
dw PlaceNthMenuStrings
|
2018-01-22 16:10:09 -08:00
|
|
|
|
dw .PlayersPCMenuPointers
|
2015-11-16 18:46:36 -08:00
|
|
|
|
|
2018-05-18 19:18:00 -07:00
|
|
|
|
PLAYERSPC_WITHDRAW_ITEM EQU 0
|
|
|
|
|
PLAYERSPC_DEPOSIT_ITEM EQU 1
|
|
|
|
|
PLAYERSPC_TOSS_ITEM EQU 2
|
|
|
|
|
PLAYERSPC_MAIL_BOX EQU 3
|
|
|
|
|
PLAYERSPC_DECORATION EQU 4
|
|
|
|
|
PLAYERSPC_TURN_OFF EQU 5
|
|
|
|
|
PLAYERSPC_LOG_OFF EQU 6
|
|
|
|
|
|
2018-01-22 16:10:09 -08:00
|
|
|
|
.PlayersPCMenuPointers: ; 0x15746
|
2018-05-18 19:18:00 -07:00
|
|
|
|
; entries correspond to PLAYERSPC_* constants
|
2018-01-22 16:10:09 -08:00
|
|
|
|
dw PlayerWithdrawItemMenu, .WithdrawItem
|
|
|
|
|
dw PlayerDepositItemMenu, .DepositItem
|
|
|
|
|
dw PlayerTossItemMenu, .TossItem
|
|
|
|
|
dw PlayerMailBoxMenu, .MailBox
|
|
|
|
|
dw PlayerDecorationMenu, .Decoration
|
|
|
|
|
dw PlayerLogOffMenu, .LogOff
|
|
|
|
|
dw PlayerLogOffMenu, .TurnOff
|
2015-11-16 18:46:36 -08:00
|
|
|
|
|
2016-04-10 11:42:14 -07:00
|
|
|
|
.WithdrawItem: db "WITHDRAW ITEM@"
|
|
|
|
|
.DepositItem: db "DEPOSIT ITEM@"
|
|
|
|
|
.TossItem: db "TOSS ITEM@"
|
|
|
|
|
.MailBox: db "MAIL BOX@"
|
|
|
|
|
.Decoration: db "DECORATION@"
|
|
|
|
|
.TurnOff: db "TURN OFF@"
|
|
|
|
|
.LogOff: db "LOG OFF@"
|
2015-11-16 18:46:36 -08:00
|
|
|
|
|
2018-01-22 16:10:09 -08:00
|
|
|
|
.PlayersPCMenuList1:
|
2015-11-16 18:46:36 -08:00
|
|
|
|
db 5
|
2018-05-18 19:18:00 -07:00
|
|
|
|
db PLAYERSPC_WITHDRAW_ITEM
|
|
|
|
|
db PLAYERSPC_DEPOSIT_ITEM
|
|
|
|
|
db PLAYERSPC_TOSS_ITEM
|
|
|
|
|
db PLAYERSPC_MAIL_BOX
|
|
|
|
|
db PLAYERSPC_TURN_OFF
|
|
|
|
|
db -1 ; end
|
2015-11-16 18:46:36 -08:00
|
|
|
|
|
2018-01-22 16:10:09 -08:00
|
|
|
|
.PlayersPCMenuList2:
|
2015-11-16 18:46:36 -08:00
|
|
|
|
db 6
|
2018-05-18 19:18:00 -07:00
|
|
|
|
db PLAYERSPC_WITHDRAW_ITEM
|
|
|
|
|
db PLAYERSPC_DEPOSIT_ITEM
|
|
|
|
|
db PLAYERSPC_TOSS_ITEM
|
|
|
|
|
db PLAYERSPC_MAIL_BOX
|
|
|
|
|
db PLAYERSPC_DECORATION
|
|
|
|
|
db PLAYERSPC_LOG_OFF
|
|
|
|
|
db -1 ; end
|
2015-11-16 18:46:36 -08:00
|
|
|
|
|
|
|
|
|
PC_DisplayTextWaitMenu: ; 157bb
|
2018-01-23 14:39:09 -08:00
|
|
|
|
ld a, [wOptions]
|
2015-11-16 18:46:36 -08:00
|
|
|
|
push af
|
|
|
|
|
set NO_TEXT_SCROLL, a
|
2018-01-23 14:39:09 -08:00
|
|
|
|
ld [wOptions], a
|
2015-11-16 18:46:36 -08:00
|
|
|
|
call MenuTextBox
|
|
|
|
|
pop af
|
2018-01-23 14:39:09 -08:00
|
|
|
|
ld [wOptions], a
|
2015-11-16 18:46:36 -08:00
|
|
|
|
ret
|
|
|
|
|
; 157cc
|
|
|
|
|
|
|
|
|
|
UnknownText_0x157cc: ; 0x157cc
|
|
|
|
|
; What do you want to do?
|
|
|
|
|
text_jump UnknownText_0x1c1368
|
|
|
|
|
db "@"
|
|
|
|
|
; 0x157d1
|
|
|
|
|
|
2018-01-22 16:10:09 -08:00
|
|
|
|
PlayerWithdrawItemMenu: ; 0x157d1
|
2018-01-23 13:08:43 -08:00
|
|
|
|
call LoadStandardMenuHeader
|
2017-12-24 09:47:30 -08:00
|
|
|
|
farcall ClearPCItemScreen
|
2016-03-01 19:31:21 -08:00
|
|
|
|
.loop
|
|
|
|
|
call PCItemsJoypad
|
|
|
|
|
jr c, .quit
|
|
|
|
|
call .Submenu
|
|
|
|
|
jr .loop
|
2015-11-16 18:46:36 -08:00
|
|
|
|
|
2016-03-01 19:31:21 -08:00
|
|
|
|
.quit
|
2015-12-01 18:54:11 -08:00
|
|
|
|
call CloseSubmenu
|
2015-11-16 18:46:36 -08:00
|
|
|
|
xor a
|
|
|
|
|
ret
|
|
|
|
|
|
2016-04-10 11:42:14 -07:00
|
|
|
|
.Submenu:
|
2015-11-16 18:46:36 -08:00
|
|
|
|
; check if the item has a quantity
|
2017-12-24 09:47:30 -08:00
|
|
|
|
farcall _CheckTossableItem
|
2015-11-16 18:46:36 -08:00
|
|
|
|
ld a, [wItemAttributeParamBuffer]
|
|
|
|
|
and a
|
|
|
|
|
jr z, .askquantity
|
|
|
|
|
|
|
|
|
|
; items without quantity are always ×1
|
|
|
|
|
ld a, 1
|
|
|
|
|
ld [wItemQuantityChangeBuffer], a
|
|
|
|
|
jr .withdraw
|
|
|
|
|
|
|
|
|
|
.askquantity
|
|
|
|
|
ld hl, .HowManyText
|
|
|
|
|
call MenuTextBox
|
2017-12-24 09:47:30 -08:00
|
|
|
|
farcall SelectQuantityToToss
|
2015-11-16 18:46:36 -08:00
|
|
|
|
call ExitMenu
|
|
|
|
|
call ExitMenu
|
|
|
|
|
jr c, .done
|
|
|
|
|
|
|
|
|
|
.withdraw
|
|
|
|
|
ld a, [wItemQuantityChangeBuffer]
|
2018-01-23 14:39:09 -08:00
|
|
|
|
ld [wBuffer1], a ; quantity
|
|
|
|
|
ld a, [wCurItemQuantity]
|
|
|
|
|
ld [wBuffer2], a
|
|
|
|
|
ld hl, wNumItems
|
2015-11-16 18:46:36 -08:00
|
|
|
|
call ReceiveItem
|
|
|
|
|
jr nc, .PackFull
|
2018-01-23 14:39:09 -08:00
|
|
|
|
ld a, [wBuffer1]
|
2015-11-16 18:46:36 -08:00
|
|
|
|
ld [wItemQuantityChangeBuffer], a
|
2018-01-23 14:39:09 -08:00
|
|
|
|
ld a, [wBuffer2]
|
|
|
|
|
ld [wCurItemQuantity], a
|
|
|
|
|
ld hl, wPCItems
|
2015-11-16 18:46:36 -08:00
|
|
|
|
call TossItem
|
2018-01-16 11:30:10 -08:00
|
|
|
|
predef PartyMonItemName
|
2015-11-16 18:46:36 -08:00
|
|
|
|
ld hl, .WithdrewText
|
|
|
|
|
call MenuTextBox
|
|
|
|
|
xor a
|
|
|
|
|
ld [hBGMapMode], a
|
|
|
|
|
call ExitMenu
|
|
|
|
|
ret
|
|
|
|
|
|
2016-04-10 11:42:14 -07:00
|
|
|
|
.PackFull:
|
2015-11-16 18:46:36 -08:00
|
|
|
|
ld hl, .NoRoomText
|
|
|
|
|
call MenuTextBoxBackup
|
|
|
|
|
ret
|
|
|
|
|
|
|
|
|
|
.done
|
|
|
|
|
ret
|
|
|
|
|
|
2016-04-10 11:42:14 -07:00
|
|
|
|
.HowManyText: ; 0x15850
|
2018-01-22 16:10:09 -08:00
|
|
|
|
text_jump _PlayersPCHowManyWithdrawText
|
2015-11-16 18:46:36 -08:00
|
|
|
|
db "@"
|
|
|
|
|
|
2016-04-10 11:42:14 -07:00
|
|
|
|
.WithdrewText: ; 0x15855
|
2018-01-22 16:10:09 -08:00
|
|
|
|
text_jump _PlayersPCWithdrewItemsText
|
2015-11-16 18:46:36 -08:00
|
|
|
|
db "@"
|
|
|
|
|
|
2016-04-10 11:42:14 -07:00
|
|
|
|
.NoRoomText: ; 0x1585a
|
2018-01-22 16:10:09 -08:00
|
|
|
|
text_jump _PlayersPCNoRoomWithdrawText
|
2015-11-16 18:46:36 -08:00
|
|
|
|
db "@"
|
|
|
|
|
|
2018-01-22 16:10:09 -08:00
|
|
|
|
PlayerTossItemMenu: ; 0x1585f
|
2018-01-23 13:08:43 -08:00
|
|
|
|
call LoadStandardMenuHeader
|
2017-12-24 09:47:30 -08:00
|
|
|
|
farcall ClearPCItemScreen
|
2016-03-01 19:31:21 -08:00
|
|
|
|
.loop
|
|
|
|
|
call PCItemsJoypad
|
|
|
|
|
jr c, .quit
|
2018-01-23 14:39:09 -08:00
|
|
|
|
ld de, wPCItems
|
2017-12-24 09:47:30 -08:00
|
|
|
|
farcall TossItemFromPC
|
2016-03-01 19:31:21 -08:00
|
|
|
|
jr .loop
|
2015-11-16 18:46:36 -08:00
|
|
|
|
|
2016-03-01 19:31:21 -08:00
|
|
|
|
.quit
|
2015-12-01 18:54:11 -08:00
|
|
|
|
call CloseSubmenu
|
2015-11-16 18:46:36 -08:00
|
|
|
|
xor a
|
|
|
|
|
ret
|
|
|
|
|
; 0x1587d
|
|
|
|
|
|
2018-01-22 16:10:09 -08:00
|
|
|
|
PlayerDecorationMenu: ; 0x1587d
|
|
|
|
|
farcall _PlayerDecorationMenu
|
2015-11-16 18:46:36 -08:00
|
|
|
|
ld a, c
|
|
|
|
|
and a
|
|
|
|
|
ret z
|
|
|
|
|
scf
|
|
|
|
|
ret
|
|
|
|
|
; 0x15888
|
|
|
|
|
|
2018-01-22 16:10:09 -08:00
|
|
|
|
PlayerLogOffMenu: ; 0x15888
|
2015-11-16 18:46:36 -08:00
|
|
|
|
xor a
|
|
|
|
|
scf
|
|
|
|
|
ret
|
|
|
|
|
; 0x1588b
|
|
|
|
|
|
2018-01-22 16:10:09 -08:00
|
|
|
|
PlayerDepositItemMenu: ; 0x1588b
|
2016-03-01 19:31:21 -08:00
|
|
|
|
call .CheckItemsInBag
|
|
|
|
|
jr c, .nope
|
2015-11-16 18:46:36 -08:00
|
|
|
|
call DisableSpriteUpdates
|
2018-01-23 13:08:43 -08:00
|
|
|
|
call LoadStandardMenuHeader
|
2017-12-24 09:47:30 -08:00
|
|
|
|
farcall DepositSellInitPackBuffers
|
2016-03-01 19:31:21 -08:00
|
|
|
|
.loop
|
2017-12-24 09:47:30 -08:00
|
|
|
|
farcall DepositSellPack
|
2018-01-11 12:36:11 -08:00
|
|
|
|
ld a, [wPackUsedItem]
|
2015-11-16 18:46:36 -08:00
|
|
|
|
and a
|
2016-03-01 19:31:21 -08:00
|
|
|
|
jr z, .close
|
|
|
|
|
call .TryDepositItem
|
2017-12-24 09:47:30 -08:00
|
|
|
|
farcall CheckRegisteredItem
|
2016-03-01 19:31:21 -08:00
|
|
|
|
jr .loop
|
2015-11-16 18:46:36 -08:00
|
|
|
|
|
2016-03-01 19:31:21 -08:00
|
|
|
|
.close
|
2015-12-01 18:54:11 -08:00
|
|
|
|
call CloseSubmenu
|
2015-11-16 18:46:36 -08:00
|
|
|
|
|
2016-03-01 19:31:21 -08:00
|
|
|
|
.nope
|
2015-11-16 18:46:36 -08:00
|
|
|
|
xor a
|
|
|
|
|
ret
|
|
|
|
|
|
2016-04-10 11:42:14 -07:00
|
|
|
|
.CheckItemsInBag:
|
2017-12-24 09:47:30 -08:00
|
|
|
|
farcall HasNoItems
|
2015-11-16 18:46:36 -08:00
|
|
|
|
ret nc
|
2016-03-01 19:31:21 -08:00
|
|
|
|
ld hl, .NoItemsInBag
|
2015-11-16 18:46:36 -08:00
|
|
|
|
call MenuTextBoxBackup
|
|
|
|
|
scf
|
|
|
|
|
ret
|
|
|
|
|
|
2016-04-10 11:42:14 -07:00
|
|
|
|
.NoItemsInBag:
|
2015-11-16 18:46:36 -08:00
|
|
|
|
; No items here!
|
|
|
|
|
text_jump UnknownText_0x1c13df
|
|
|
|
|
db "@"
|
|
|
|
|
|
2016-04-10 11:42:14 -07:00
|
|
|
|
.TryDepositItem:
|
2015-11-25 07:16:29 -08:00
|
|
|
|
ld a, [wSpriteUpdatesEnabled]
|
2015-11-16 18:46:36 -08:00
|
|
|
|
push af
|
|
|
|
|
ld a, $0
|
2015-11-25 07:16:29 -08:00
|
|
|
|
ld [wSpriteUpdatesEnabled], a
|
2017-12-24 09:47:30 -08:00
|
|
|
|
farcall CheckItemMenu
|
2015-11-16 18:46:36 -08:00
|
|
|
|
ld a, [wItemAttributeParamBuffer]
|
2015-12-26 18:59:03 -08:00
|
|
|
|
ld hl, .dw
|
2015-11-16 18:46:36 -08:00
|
|
|
|
rst JumpTable
|
|
|
|
|
pop af
|
2015-11-25 07:16:29 -08:00
|
|
|
|
ld [wSpriteUpdatesEnabled], a
|
2015-11-16 18:46:36 -08:00
|
|
|
|
ret
|
|
|
|
|
|
2016-03-01 19:31:21 -08:00
|
|
|
|
.dw
|
2018-05-18 19:18:00 -07:00
|
|
|
|
; entries correspond to ITEMMENU_* constants
|
|
|
|
|
dw .tossable ; ITEMMENU_NOUSE
|
2015-11-16 18:46:36 -08:00
|
|
|
|
dw .no_toss
|
|
|
|
|
dw .no_toss
|
|
|
|
|
dw .no_toss
|
2018-05-18 19:18:00 -07:00
|
|
|
|
dw .tossable ; ITEMMENU_CURRENT
|
|
|
|
|
dw .tossable ; ITEMMENU_PARTY
|
|
|
|
|
dw .tossable ; ITEMMENU_CLOSE
|
2015-11-16 18:46:36 -08:00
|
|
|
|
|
2016-03-01 19:31:21 -08:00
|
|
|
|
.no_toss
|
2015-11-16 18:46:36 -08:00
|
|
|
|
ret
|
|
|
|
|
|
2016-03-01 19:31:21 -08:00
|
|
|
|
.tossable
|
2018-01-23 14:39:09 -08:00
|
|
|
|
ld a, [wBuffer1]
|
2015-11-16 18:46:36 -08:00
|
|
|
|
push af
|
2018-01-23 14:39:09 -08:00
|
|
|
|
ld a, [wBuffer2]
|
2015-11-16 18:46:36 -08:00
|
|
|
|
push af
|
2016-03-01 19:31:21 -08:00
|
|
|
|
call .DepositItem_
|
2015-11-16 18:46:36 -08:00
|
|
|
|
pop af
|
2018-01-23 14:39:09 -08:00
|
|
|
|
ld [wBuffer2], a
|
2015-11-16 18:46:36 -08:00
|
|
|
|
pop af
|
2018-01-23 14:39:09 -08:00
|
|
|
|
ld [wBuffer1], a
|
2015-11-16 18:46:36 -08:00
|
|
|
|
ret
|
|
|
|
|
|
2016-04-10 11:42:14 -07:00
|
|
|
|
.DepositItem_:
|
2017-12-24 09:47:30 -08:00
|
|
|
|
farcall _CheckTossableItem
|
2015-11-16 18:46:36 -08:00
|
|
|
|
ld a, [wItemAttributeParamBuffer]
|
|
|
|
|
and a
|
2016-03-01 19:31:21 -08:00
|
|
|
|
jr z, .AskQuantity
|
2015-11-16 18:46:36 -08:00
|
|
|
|
ld a, $1
|
|
|
|
|
ld [wItemQuantityChangeBuffer], a
|
2016-03-01 19:31:21 -08:00
|
|
|
|
jr .DepositItem
|
2015-11-16 18:46:36 -08:00
|
|
|
|
|
2016-04-10 11:42:14 -07:00
|
|
|
|
.AskQuantity:
|
2015-11-16 18:46:36 -08:00
|
|
|
|
ld hl, .HowManyText
|
|
|
|
|
call MenuTextBox
|
2017-12-24 09:47:30 -08:00
|
|
|
|
farcall SelectQuantityToToss
|
2015-11-16 18:46:36 -08:00
|
|
|
|
push af
|
|
|
|
|
call ExitMenu
|
|
|
|
|
call ExitMenu
|
|
|
|
|
pop af
|
2016-03-01 19:31:21 -08:00
|
|
|
|
jr c, .DeclinedToDeposit
|
2015-11-16 18:46:36 -08:00
|
|
|
|
|
2016-04-10 11:42:14 -07:00
|
|
|
|
.DepositItem:
|
2015-11-16 18:46:36 -08:00
|
|
|
|
ld a, [wItemQuantityChangeBuffer]
|
2018-01-23 14:39:09 -08:00
|
|
|
|
ld [wBuffer1], a
|
|
|
|
|
ld a, [wCurItemQuantity]
|
|
|
|
|
ld [wBuffer2], a
|
|
|
|
|
ld hl, wPCItems
|
2015-11-16 18:46:36 -08:00
|
|
|
|
call ReceiveItem
|
2016-03-01 19:31:21 -08:00
|
|
|
|
jr nc, .NoRoomInPC
|
2018-01-23 14:39:09 -08:00
|
|
|
|
ld a, [wBuffer1]
|
2015-11-16 18:46:36 -08:00
|
|
|
|
ld [wItemQuantityChangeBuffer], a
|
2018-01-23 14:39:09 -08:00
|
|
|
|
ld a, [wBuffer2]
|
|
|
|
|
ld [wCurItemQuantity], a
|
|
|
|
|
ld hl, wNumItems
|
2015-11-16 18:46:36 -08:00
|
|
|
|
call TossItem
|
2018-01-16 11:30:10 -08:00
|
|
|
|
predef PartyMonItemName
|
2015-11-16 18:46:36 -08:00
|
|
|
|
ld hl, .DepositText
|
|
|
|
|
call PrintText
|
|
|
|
|
ret
|
|
|
|
|
|
2016-04-10 11:42:14 -07:00
|
|
|
|
.NoRoomInPC:
|
2015-11-16 18:46:36 -08:00
|
|
|
|
ld hl, .NoRoomText
|
|
|
|
|
call PrintText
|
|
|
|
|
ret
|
|
|
|
|
|
2016-04-10 11:42:14 -07:00
|
|
|
|
.DeclinedToDeposit:
|
2015-11-16 18:46:36 -08:00
|
|
|
|
and a
|
|
|
|
|
ret
|
|
|
|
|
|
2016-04-10 11:42:14 -07:00
|
|
|
|
.HowManyText: ; 0x1596e
|
2018-01-22 16:10:09 -08:00
|
|
|
|
text_jump _PlayersPCHowManyDepositText
|
2015-11-16 18:46:36 -08:00
|
|
|
|
db "@"
|
|
|
|
|
|
2016-04-10 11:42:14 -07:00
|
|
|
|
.DepositText: ; 0x15973
|
2018-01-22 16:10:09 -08:00
|
|
|
|
text_jump _PlayersPCDepositItemsText
|
2015-11-16 18:46:36 -08:00
|
|
|
|
db "@"
|
|
|
|
|
|
2016-04-10 11:42:14 -07:00
|
|
|
|
.NoRoomText: ; 0x15978
|
2018-01-22 16:10:09 -08:00
|
|
|
|
text_jump _PlayersPCNoRoomDepositText
|
2015-11-16 18:46:36 -08:00
|
|
|
|
db "@"
|
|
|
|
|
|
2018-01-22 16:10:09 -08:00
|
|
|
|
PlayerMailBoxMenu: ; 0x1597d
|
|
|
|
|
farcall _PlayerMailBoxMenu
|
2015-11-16 18:46:36 -08:00
|
|
|
|
xor a
|
|
|
|
|
ret
|
|
|
|
|
; 0x15985
|
|
|
|
|
|
2016-03-01 19:31:21 -08:00
|
|
|
|
PCItemsJoypad: ; 0x15985
|
2015-11-16 18:46:36 -08:00
|
|
|
|
xor a
|
2016-03-01 19:31:21 -08:00
|
|
|
|
ld [wSwitchItem], a
|
|
|
|
|
.loop
|
2015-11-25 07:16:29 -08:00
|
|
|
|
ld a, [wSpriteUpdatesEnabled]
|
2015-11-16 18:46:36 -08:00
|
|
|
|
push af
|
|
|
|
|
ld a, $0
|
2015-11-25 07:16:29 -08:00
|
|
|
|
ld [wSpriteUpdatesEnabled], a
|
2016-03-01 19:31:21 -08:00
|
|
|
|
ld hl, .PCItemsMenuData
|
2018-01-23 13:08:43 -08:00
|
|
|
|
call CopyMenuHeader
|
2015-11-16 18:46:36 -08:00
|
|
|
|
hlcoord 0, 0
|
2016-03-01 19:31:21 -08:00
|
|
|
|
ld b, 10
|
|
|
|
|
ld c, 18
|
2015-11-16 18:46:36 -08:00
|
|
|
|
call TextBox
|
2016-03-01 19:31:21 -08:00
|
|
|
|
ld a, [wPCItemsCursor]
|
2015-11-16 18:46:36 -08:00
|
|
|
|
ld [wMenuCursorBuffer], a
|
2016-03-01 19:31:21 -08:00
|
|
|
|
ld a, [wPCItemsScrollPosition]
|
2015-11-23 13:04:53 -08:00
|
|
|
|
ld [wMenuScrollPosition], a
|
2015-12-17 19:31:16 -08:00
|
|
|
|
call ScrollingMenu
|
2015-11-23 13:04:53 -08:00
|
|
|
|
ld a, [wMenuScrollPosition]
|
2016-03-01 19:31:21 -08:00
|
|
|
|
ld [wPCItemsScrollPosition], a
|
2015-12-15 15:59:49 -08:00
|
|
|
|
ld a, [wMenuCursorY]
|
2016-03-01 19:31:21 -08:00
|
|
|
|
ld [wPCItemsCursor], a
|
2015-11-16 18:46:36 -08:00
|
|
|
|
pop af
|
2015-11-25 07:16:29 -08:00
|
|
|
|
ld [wSpriteUpdatesEnabled], a
|
2016-03-01 19:31:21 -08:00
|
|
|
|
ld a, [wSwitchItem]
|
2015-11-16 18:46:36 -08:00
|
|
|
|
and a
|
2016-03-01 19:31:21 -08:00
|
|
|
|
jr nz, .moving_stuff_around
|
2015-12-15 15:59:49 -08:00
|
|
|
|
ld a, [wMenuJoypad]
|
2016-03-01 19:31:21 -08:00
|
|
|
|
cp B_BUTTON
|
|
|
|
|
jr z, .b_1
|
|
|
|
|
cp A_BUTTON
|
|
|
|
|
jr z, .a_1
|
|
|
|
|
cp SELECT
|
|
|
|
|
jr z, .select_1
|
|
|
|
|
jr .next
|
|
|
|
|
|
|
|
|
|
.moving_stuff_around
|
2015-12-15 15:59:49 -08:00
|
|
|
|
ld a, [wMenuJoypad]
|
2016-03-01 19:31:21 -08:00
|
|
|
|
cp B_BUTTON
|
|
|
|
|
jr z, .b_2
|
|
|
|
|
cp A_BUTTON
|
|
|
|
|
jr z, .a_select_2
|
|
|
|
|
cp SELECT
|
|
|
|
|
jr z, .a_select_2
|
|
|
|
|
jr .next
|
|
|
|
|
|
|
|
|
|
.b_2
|
2015-11-16 18:46:36 -08:00
|
|
|
|
xor a
|
2016-03-01 19:31:21 -08:00
|
|
|
|
ld [wSwitchItem], a
|
|
|
|
|
jr .next
|
2015-11-16 18:46:36 -08:00
|
|
|
|
|
2016-03-01 19:31:21 -08:00
|
|
|
|
.a_select_2
|
|
|
|
|
call PC_PlaySwapItemsSound
|
|
|
|
|
.select_1
|
2017-12-24 09:47:30 -08:00
|
|
|
|
farcall SwitchItemsInBag
|
2016-03-01 19:31:21 -08:00
|
|
|
|
.next
|
|
|
|
|
jp .loop
|
2015-11-16 18:46:36 -08:00
|
|
|
|
|
2016-03-01 19:31:21 -08:00
|
|
|
|
.a_1
|
2017-12-24 09:47:30 -08:00
|
|
|
|
farcall ScrollingMenu_ClearLeftColumn
|
2015-12-17 19:31:16 -08:00
|
|
|
|
call PlaceHollowCursor
|
2015-11-16 18:46:36 -08:00
|
|
|
|
and a
|
|
|
|
|
ret
|
|
|
|
|
|
2016-03-01 19:31:21 -08:00
|
|
|
|
.b_1
|
2015-11-16 18:46:36 -08:00
|
|
|
|
scf
|
|
|
|
|
ret
|
|
|
|
|
|
2016-04-10 11:42:14 -07:00
|
|
|
|
.PCItemsMenuData:
|
2018-01-14 20:43:51 -08:00
|
|
|
|
db MENU_BACKUP_TILES ; flags
|
2018-01-13 13:38:14 -08:00
|
|
|
|
menu_coords 4, 1, 18, 10
|
2018-01-23 13:08:43 -08:00
|
|
|
|
dw .MenuData
|
2015-11-16 18:46:36 -08:00
|
|
|
|
db 1 ; default option
|
|
|
|
|
|
2018-01-23 13:08:43 -08:00
|
|
|
|
.MenuData:
|
2018-01-14 02:59:56 -08:00
|
|
|
|
db SCROLLINGMENU_ENABLE_SELECT | SCROLLINGMENU_ENABLE_FUNCTION3 | SCROLLINGMENU_DISPLAY_ARROWS ; flags
|
2015-11-16 18:46:36 -08:00
|
|
|
|
db 4, 8 ; rows/cols?
|
|
|
|
|
db 2 ; horizontal spacing?
|
2018-01-23 14:39:09 -08:00
|
|
|
|
dbw 0, wPCItems
|
2015-11-16 18:46:36 -08:00
|
|
|
|
dba PlaceMenuItemName
|
|
|
|
|
dba PlaceMenuItemQuantity
|
2015-11-23 13:04:53 -08:00
|
|
|
|
dba UpdateItemDescription
|
2015-11-16 18:46:36 -08:00
|
|
|
|
|
|
|
|
|
PC_DisplayText: ; 15a20
|
|
|
|
|
call MenuTextBox
|
|
|
|
|
call ExitMenu
|
|
|
|
|
ret
|
|
|
|
|
; 15a27
|
|
|
|
|
|
2017-12-10 19:34:42 -08:00
|
|
|
|
PokecenterPCText_BootedUpPC: ; 0x15a27
|
2015-11-16 18:46:36 -08:00
|
|
|
|
; turned on the PC.
|
|
|
|
|
text_jump UnknownText_0x1c144d
|
|
|
|
|
db "@"
|
|
|
|
|
; 0x15a2c
|
|
|
|
|
|
2017-12-10 19:34:42 -08:00
|
|
|
|
PokecenterPCText_AccessWhosePC: ; 0x15a2c
|
2015-11-16 18:46:36 -08:00
|
|
|
|
; Access whose PC?
|
|
|
|
|
text_jump UnknownText_0x1c1462
|
|
|
|
|
db "@"
|
|
|
|
|
; 0x15a31
|
|
|
|
|
|
2017-12-10 19:34:42 -08:00
|
|
|
|
PokecenterPCText_AccessedBillsPC: ; 0x15a31
|
2015-11-16 18:46:36 -08:00
|
|
|
|
; BILL's PC accessed. #MON Storage System opened.
|
|
|
|
|
text_jump UnknownText_0x1c1474
|
|
|
|
|
db "@"
|
|
|
|
|
; 0x15a36
|
|
|
|
|
|
2017-12-10 19:34:42 -08:00
|
|
|
|
PokecenterPCText_AccessedOwnPC: ; 0x15a36
|
2015-11-16 18:46:36 -08:00
|
|
|
|
; Accessed own PC. Item Storage System opened.
|
|
|
|
|
text_jump UnknownText_0x1c14a4
|
|
|
|
|
db "@"
|
|
|
|
|
; 0x15a3b
|
|
|
|
|
|
2017-12-10 19:34:42 -08:00
|
|
|
|
PokecenterPCText_AccessedOaksPC: ; 0x15a3b
|
2015-11-16 18:46:36 -08:00
|
|
|
|
; PROF.OAK's PC accessed. #DEX Rating System opened.
|
|
|
|
|
text_jump UnknownText_0x1c14d2
|
|
|
|
|
db "@"
|
|
|
|
|
; 0x15a40
|
|
|
|
|
|
2017-12-10 19:34:42 -08:00
|
|
|
|
PokecenterPCText_LinkClosed: ; 0x15a40
|
2015-11-16 18:46:36 -08:00
|
|
|
|
; … Link closed…
|
|
|
|
|
text_jump UnknownText_0x1c1505
|
|
|
|
|
db "@"
|
|
|
|
|
; 0x15a45
|