2018-01-22 17:03:18 +00:00
|
|
|
; StartMenu.Items indexes
|
|
|
|
const_def
|
|
|
|
const STARTMENUITEM_POKEDEX ; 0
|
|
|
|
const STARTMENUITEM_POKEMON ; 1
|
|
|
|
const STARTMENUITEM_PACK ; 2
|
|
|
|
const STARTMENUITEM_STATUS ; 3
|
|
|
|
const STARTMENUITEM_SAVE ; 4
|
|
|
|
const STARTMENUITEM_OPTION ; 5
|
|
|
|
const STARTMENUITEM_EXIT ; 6
|
|
|
|
const STARTMENUITEM_POKEGEAR ; 7
|
|
|
|
const STARTMENUITEM_QUIT ; 8
|
|
|
|
|
2018-06-24 14:09:41 +00:00
|
|
|
StartMenu::
|
2015-12-19 19:48:30 +00:00
|
|
|
call ClearWindowData
|
2015-11-11 21:11:08 +00:00
|
|
|
|
|
|
|
ld de, SFX_MENU
|
|
|
|
call PlaySFX
|
|
|
|
|
2017-12-24 17:47:30 +00:00
|
|
|
farcall ReanchorBGMap_NoOAMUpdate
|
2015-11-11 21:11:08 +00:00
|
|
|
|
2017-12-28 12:15:46 +00:00
|
|
|
ld hl, wStatusFlags2
|
2018-01-22 20:40:43 +00:00
|
|
|
bit STATUSFLAGS2_BUG_CONTEST_TIMER_F, [hl]
|
2018-01-23 21:08:43 +00:00
|
|
|
ld hl, .MenuHeader
|
2015-11-11 21:11:08 +00:00
|
|
|
jr z, .GotMenuData
|
2018-01-23 21:08:43 +00:00
|
|
|
ld hl, .ContestMenuHeader
|
2015-11-11 21:11:08 +00:00
|
|
|
|
2018-06-25 16:24:18 +00:00
|
|
|
.GotMenuData:
|
2018-01-23 21:08:43 +00:00
|
|
|
call LoadMenuHeader
|
2015-11-11 21:11:08 +00:00
|
|
|
call .SetUpMenuItems
|
2017-12-10 00:41:03 +00:00
|
|
|
ld a, [wBattleMenuCursorBuffer]
|
2015-11-11 21:11:08 +00:00
|
|
|
ld [wMenuCursorBuffer], a
|
2018-07-23 04:13:43 +00:00
|
|
|
call .DrawMenuAccount
|
2016-05-10 16:31:49 +00:00
|
|
|
call DrawVariableLengthMenuBox
|
2015-11-11 21:11:08 +00:00
|
|
|
call .DrawBugContestStatusBox
|
2016-05-10 16:31:49 +00:00
|
|
|
call SafeUpdateSprites
|
2020-02-13 17:30:13 +00:00
|
|
|
call _OpenAndCloseMenu_HDMATransferTilemapAndAttrmap
|
2017-12-24 17:47:30 +00:00
|
|
|
farcall LoadFonts_NoOAMUpdate
|
2015-11-11 21:11:08 +00:00
|
|
|
call .DrawBugContestStatus
|
|
|
|
call UpdateTimePals
|
|
|
|
jr .Select
|
|
|
|
|
2016-04-10 18:42:14 +00:00
|
|
|
.Reopen:
|
2015-11-11 21:11:08 +00:00
|
|
|
call UpdateSprites
|
|
|
|
call UpdateTimePals
|
|
|
|
call .SetUpMenuItems
|
2017-12-10 00:41:03 +00:00
|
|
|
ld a, [wBattleMenuCursorBuffer]
|
2015-11-11 21:11:08 +00:00
|
|
|
ld [wMenuCursorBuffer], a
|
|
|
|
|
2016-04-10 18:42:14 +00:00
|
|
|
.Select:
|
2015-11-11 21:11:08 +00:00
|
|
|
call .GetInput
|
|
|
|
jr c, .Exit
|
2018-07-23 04:13:43 +00:00
|
|
|
call ._DrawMenuAccount
|
2015-11-11 21:11:08 +00:00
|
|
|
ld a, [wMenuCursorBuffer]
|
2017-12-10 00:41:03 +00:00
|
|
|
ld [wBattleMenuCursorBuffer], a
|
2015-11-11 21:11:08 +00:00
|
|
|
call PlayClickSFX
|
2015-12-18 03:31:16 +00:00
|
|
|
call PlaceHollowCursor
|
2015-11-11 21:11:08 +00:00
|
|
|
call .OpenMenu
|
|
|
|
|
|
|
|
; Menu items have different return functions.
|
|
|
|
; For example, saving exits the menu.
|
|
|
|
ld hl, .MenuReturns
|
|
|
|
ld e, a
|
|
|
|
ld d, 0
|
|
|
|
add hl, de
|
2015-12-27 02:59:03 +00:00
|
|
|
add hl, de
|
2015-11-11 21:11:08 +00:00
|
|
|
ld a, [hli]
|
|
|
|
ld h, [hl]
|
|
|
|
ld l, a
|
2017-06-09 21:01:10 +00:00
|
|
|
jp hl
|
2015-11-11 21:11:08 +00:00
|
|
|
|
2016-04-10 18:42:14 +00:00
|
|
|
.MenuReturns:
|
2015-11-11 21:11:08 +00:00
|
|
|
dw .Reopen
|
|
|
|
dw .Exit
|
2015-11-25 15:16:29 +00:00
|
|
|
dw .ExitMenuCallFuncCloseText
|
|
|
|
dw .ExitMenuRunScriptCloseText
|
2015-11-11 21:11:08 +00:00
|
|
|
dw .ExitMenuRunScript
|
|
|
|
dw .ReturnEnd
|
|
|
|
dw .ReturnRedraw
|
|
|
|
|
2016-04-10 18:42:14 +00:00
|
|
|
.Exit:
|
2018-08-25 18:28:22 +00:00
|
|
|
ldh a, [hOAMUpdate]
|
2015-11-11 21:11:08 +00:00
|
|
|
push af
|
|
|
|
ld a, 1
|
2018-08-25 18:28:22 +00:00
|
|
|
ldh [hOAMUpdate], a
|
2015-11-11 21:11:08 +00:00
|
|
|
call LoadFontsExtra
|
|
|
|
pop af
|
2018-08-25 18:28:22 +00:00
|
|
|
ldh [hOAMUpdate], a
|
2016-04-10 18:42:14 +00:00
|
|
|
.ReturnEnd:
|
2015-11-11 21:11:08 +00:00
|
|
|
call ExitMenu
|
2016-04-10 18:42:14 +00:00
|
|
|
.ReturnEnd2:
|
2015-11-25 15:16:29 +00:00
|
|
|
call CloseText
|
2015-11-11 21:11:08 +00:00
|
|
|
call UpdateTimePals
|
|
|
|
ret
|
|
|
|
|
2016-04-10 18:42:14 +00:00
|
|
|
.GetInput:
|
2015-11-11 21:11:08 +00:00
|
|
|
; Return carry on exit, and no-carry on selection.
|
|
|
|
xor a
|
2018-08-25 18:28:22 +00:00
|
|
|
ldh [hBGMapMode], a
|
2018-07-23 04:13:43 +00:00
|
|
|
call ._DrawMenuAccount
|
2015-11-11 21:11:08 +00:00
|
|
|
call SetUpMenu
|
|
|
|
ld a, $ff
|
2018-01-23 22:39:09 +00:00
|
|
|
ld [wMenuSelection], a
|
2015-11-11 21:11:08 +00:00
|
|
|
.loop
|
|
|
|
call .PrintMenuAccount
|
2016-03-02 03:31:21 +00:00
|
|
|
call GetScrollingMenuJoypad
|
2015-12-15 23:59:49 +00:00
|
|
|
ld a, [wMenuJoypad]
|
2015-11-11 21:11:08 +00:00
|
|
|
cp B_BUTTON
|
|
|
|
jr z, .b
|
|
|
|
cp A_BUTTON
|
|
|
|
jr z, .a
|
|
|
|
jr .loop
|
|
|
|
.a
|
|
|
|
call PlayClickSFX
|
|
|
|
and a
|
|
|
|
ret
|
|
|
|
.b
|
|
|
|
scf
|
|
|
|
ret
|
|
|
|
|
2018-06-24 14:09:41 +00:00
|
|
|
.ExitMenuRunScript:
|
2015-11-11 21:11:08 +00:00
|
|
|
call ExitMenu
|
|
|
|
ld a, HMENURETURN_SCRIPT
|
2018-08-25 18:28:22 +00:00
|
|
|
ldh [hMenuReturn], a
|
2015-11-11 21:11:08 +00:00
|
|
|
ret
|
|
|
|
|
2018-06-24 14:09:41 +00:00
|
|
|
.ExitMenuRunScriptCloseText:
|
2015-11-11 21:11:08 +00:00
|
|
|
call ExitMenu
|
|
|
|
ld a, HMENURETURN_SCRIPT
|
2018-08-25 18:28:22 +00:00
|
|
|
ldh [hMenuReturn], a
|
2015-11-11 21:11:08 +00:00
|
|
|
jr .ReturnEnd2
|
|
|
|
|
2018-06-24 14:09:41 +00:00
|
|
|
.ExitMenuCallFuncCloseText:
|
2015-11-11 21:11:08 +00:00
|
|
|
call ExitMenu
|
|
|
|
ld hl, wQueuedScriptAddr
|
|
|
|
ld a, [hli]
|
|
|
|
ld h, [hl]
|
|
|
|
ld l, a
|
|
|
|
ld a, [wQueuedScriptBank]
|
|
|
|
rst FarCall
|
|
|
|
jr .ReturnEnd2
|
|
|
|
|
2018-06-24 14:09:41 +00:00
|
|
|
.ReturnRedraw:
|
2015-11-11 21:11:08 +00:00
|
|
|
call .Clear
|
|
|
|
jp .Reopen
|
|
|
|
|
2018-06-24 14:09:41 +00:00
|
|
|
.Clear:
|
2015-11-12 04:38:57 +00:00
|
|
|
call ClearBGPalettes
|
2015-11-11 21:11:08 +00:00
|
|
|
call Call_ExitMenu
|
2015-12-19 01:07:09 +00:00
|
|
|
call ReloadTilesetAndPalettes
|
2018-07-23 04:13:43 +00:00
|
|
|
call .DrawMenuAccount
|
2016-05-10 16:31:49 +00:00
|
|
|
call DrawVariableLengthMenuBox
|
2015-11-11 21:11:08 +00:00
|
|
|
call .DrawBugContestStatus
|
|
|
|
call UpdateSprites
|
2020-06-21 20:27:43 +00:00
|
|
|
call GSReloadPalettes
|
2016-01-06 12:44:50 +00:00
|
|
|
call FinishExitMenu
|
2015-11-11 21:11:08 +00:00
|
|
|
ret
|
|
|
|
|
2018-01-23 21:08:43 +00:00
|
|
|
.MenuHeader:
|
2018-01-14 10:59:56 +00:00
|
|
|
db MENU_BACKUP_TILES ; flags
|
2018-01-13 21:38:14 +00:00
|
|
|
menu_coords 10, 0, SCREEN_WIDTH - 1, SCREEN_HEIGHT - 1
|
2015-11-11 21:11:08 +00:00
|
|
|
dw .MenuData
|
|
|
|
db 1 ; default selection
|
|
|
|
|
2018-01-23 21:08:43 +00:00
|
|
|
.ContestMenuHeader:
|
2018-01-14 10:59:56 +00:00
|
|
|
db MENU_BACKUP_TILES ; flags
|
2018-01-13 21:38:14 +00:00
|
|
|
menu_coords 10, 2, SCREEN_WIDTH - 1, SCREEN_HEIGHT - 1
|
2015-11-11 21:11:08 +00:00
|
|
|
dw .MenuData
|
|
|
|
db 1 ; default selection
|
|
|
|
|
2016-04-10 18:42:14 +00:00
|
|
|
.MenuData:
|
2018-01-14 10:59:56 +00:00
|
|
|
db STATICMENU_CURSOR | STATICMENU_WRAP | STATICMENU_ENABLE_START ; flags
|
2015-11-11 21:11:08 +00:00
|
|
|
dn 0, 0 ; rows, columns
|
2018-01-23 22:39:09 +00:00
|
|
|
dw wMenuItemsList
|
2015-11-11 21:11:08 +00:00
|
|
|
dw .MenuString
|
|
|
|
dw .Items
|
|
|
|
|
2016-04-10 18:42:14 +00:00
|
|
|
.Items:
|
2018-01-22 17:03:18 +00:00
|
|
|
; entries correspond to STARTMENUITEM_* constants
|
2015-11-11 21:11:08 +00:00
|
|
|
dw StartMenu_Pokedex, .PokedexString, .PokedexDesc
|
|
|
|
dw StartMenu_Pokemon, .PartyString, .PartyDesc
|
|
|
|
dw StartMenu_Pack, .PackString, .PackDesc
|
|
|
|
dw StartMenu_Status, .StatusString, .StatusDesc
|
|
|
|
dw StartMenu_Save, .SaveString, .SaveDesc
|
|
|
|
dw StartMenu_Option, .OptionString, .OptionDesc
|
|
|
|
dw StartMenu_Exit, .ExitString, .ExitDesc
|
|
|
|
dw StartMenu_Pokegear, .PokegearString, .PokegearDesc
|
|
|
|
dw StartMenu_Quit, .QuitString, .QuitDesc
|
|
|
|
|
2018-01-22 17:03:18 +00:00
|
|
|
.PokedexString: db "#DEX@"
|
|
|
|
.PartyString: db "#MON@"
|
|
|
|
.PackString: db "PACK@"
|
|
|
|
.StatusString: db "<PLAYER>@"
|
|
|
|
.SaveString: db "SAVE@"
|
|
|
|
.OptionString: db "OPTION@"
|
|
|
|
.ExitString: db "EXIT@"
|
|
|
|
.PokegearString: db "<POKE>GEAR@"
|
|
|
|
.QuitString: db "QUIT@"
|
|
|
|
|
|
|
|
.PokedexDesc:
|
|
|
|
db "#MON"
|
2016-06-07 12:13:08 +00:00
|
|
|
next "database@"
|
2015-11-11 21:11:08 +00:00
|
|
|
|
2018-01-22 17:03:18 +00:00
|
|
|
.PartyDesc:
|
|
|
|
db "Party <PKMN>"
|
2016-06-07 12:13:08 +00:00
|
|
|
next "status@"
|
2015-11-11 21:11:08 +00:00
|
|
|
|
2018-01-22 17:03:18 +00:00
|
|
|
.PackDesc:
|
|
|
|
db "Contains"
|
2016-06-07 12:13:08 +00:00
|
|
|
next "items@"
|
2015-11-11 21:11:08 +00:00
|
|
|
|
2018-01-22 17:03:18 +00:00
|
|
|
.PokegearDesc:
|
|
|
|
db "Trainer's"
|
2016-06-07 12:13:08 +00:00
|
|
|
next "key device@"
|
2015-11-11 21:11:08 +00:00
|
|
|
|
2018-01-22 17:03:18 +00:00
|
|
|
.StatusDesc:
|
|
|
|
db "Your own"
|
2016-06-07 12:13:08 +00:00
|
|
|
next "status@"
|
2015-11-11 21:11:08 +00:00
|
|
|
|
2018-01-22 17:03:18 +00:00
|
|
|
.SaveDesc:
|
|
|
|
db "Save your"
|
2016-06-07 12:13:08 +00:00
|
|
|
next "progress@"
|
2015-11-11 21:11:08 +00:00
|
|
|
|
2018-01-22 17:03:18 +00:00
|
|
|
.OptionDesc:
|
|
|
|
db "Change"
|
2016-06-07 12:13:08 +00:00
|
|
|
next "settings@"
|
2015-11-11 21:11:08 +00:00
|
|
|
|
2018-01-22 17:03:18 +00:00
|
|
|
.ExitDesc:
|
|
|
|
db "Close this"
|
2016-06-07 12:13:08 +00:00
|
|
|
next "menu@"
|
2015-11-11 21:11:08 +00:00
|
|
|
|
2018-01-22 17:03:18 +00:00
|
|
|
.QuitDesc:
|
|
|
|
db "Quit and"
|
2016-06-07 12:13:08 +00:00
|
|
|
next "be judged.@"
|
2015-11-11 21:11:08 +00:00
|
|
|
|
2018-06-24 14:09:41 +00:00
|
|
|
.OpenMenu:
|
2018-01-23 22:39:09 +00:00
|
|
|
ld a, [wMenuSelection]
|
2015-11-11 21:11:08 +00:00
|
|
|
call .GetMenuAccountTextPointer
|
|
|
|
ld a, [hli]
|
|
|
|
ld h, [hl]
|
|
|
|
ld l, a
|
2017-06-09 21:01:10 +00:00
|
|
|
jp hl
|
2015-11-11 21:11:08 +00:00
|
|
|
|
2018-06-24 14:09:41 +00:00
|
|
|
.MenuString:
|
2015-11-11 21:11:08 +00:00
|
|
|
push de
|
2018-01-23 22:39:09 +00:00
|
|
|
ld a, [wMenuSelection]
|
2015-11-11 21:11:08 +00:00
|
|
|
call .GetMenuAccountTextPointer
|
|
|
|
inc hl
|
2015-12-27 02:59:03 +00:00
|
|
|
inc hl
|
2015-11-11 21:11:08 +00:00
|
|
|
ld a, [hli]
|
|
|
|
ld d, [hl]
|
|
|
|
ld e, a
|
|
|
|
pop hl
|
|
|
|
call PlaceString
|
|
|
|
ret
|
|
|
|
|
2018-06-24 14:09:41 +00:00
|
|
|
.MenuDesc:
|
2015-11-11 21:11:08 +00:00
|
|
|
push de
|
2018-01-23 22:39:09 +00:00
|
|
|
ld a, [wMenuSelection]
|
2015-11-11 21:11:08 +00:00
|
|
|
cp $ff
|
|
|
|
jr z, .none
|
|
|
|
call .GetMenuAccountTextPointer
|
|
|
|
rept 4
|
|
|
|
inc hl
|
|
|
|
endr
|
|
|
|
ld a, [hli]
|
|
|
|
ld d, [hl]
|
|
|
|
ld e, a
|
|
|
|
pop hl
|
|
|
|
call PlaceString
|
|
|
|
ret
|
|
|
|
.none
|
|
|
|
pop de
|
|
|
|
ret
|
|
|
|
|
2018-06-24 14:09:41 +00:00
|
|
|
.GetMenuAccountTextPointer:
|
2015-11-11 21:11:08 +00:00
|
|
|
ld e, a
|
|
|
|
ld d, 0
|
2018-01-23 21:08:43 +00:00
|
|
|
ld hl, wMenuDataPointerTableAddr
|
2015-11-11 21:11:08 +00:00
|
|
|
ld a, [hli]
|
|
|
|
ld h, [hl]
|
|
|
|
ld l, a
|
|
|
|
rept 6
|
|
|
|
add hl, de
|
|
|
|
endr
|
|
|
|
ret
|
|
|
|
|
2018-06-24 14:09:41 +00:00
|
|
|
.SetUpMenuItems:
|
2015-11-11 21:11:08 +00:00
|
|
|
xor a
|
2015-12-19 01:07:09 +00:00
|
|
|
ld [wWhichIndexSet], a
|
2015-11-11 21:11:08 +00:00
|
|
|
call .FillMenuList
|
|
|
|
|
2017-12-28 12:15:46 +00:00
|
|
|
ld hl, wStatusFlags
|
2018-01-22 20:40:43 +00:00
|
|
|
bit STATUSFLAGS_POKEDEX_F, [hl]
|
2015-11-11 21:11:08 +00:00
|
|
|
jr z, .no_pokedex
|
2018-01-22 17:03:18 +00:00
|
|
|
ld a, STARTMENUITEM_POKEDEX
|
2015-11-11 21:11:08 +00:00
|
|
|
call .AppendMenuList
|
|
|
|
.no_pokedex
|
|
|
|
|
2018-01-23 22:39:09 +00:00
|
|
|
ld a, [wPartyCount]
|
2015-11-11 21:11:08 +00:00
|
|
|
and a
|
|
|
|
jr z, .no_pokemon
|
2018-01-22 17:03:18 +00:00
|
|
|
ld a, STARTMENUITEM_POKEMON
|
2015-11-11 21:11:08 +00:00
|
|
|
call .AppendMenuList
|
|
|
|
.no_pokemon
|
|
|
|
|
|
|
|
ld a, [wLinkMode]
|
|
|
|
and a
|
|
|
|
jr nz, .no_pack
|
2017-12-28 12:15:46 +00:00
|
|
|
ld hl, wStatusFlags2
|
2018-01-22 20:40:43 +00:00
|
|
|
bit STATUSFLAGS2_BUG_CONTEST_TIMER_F, [hl]
|
2015-11-11 21:11:08 +00:00
|
|
|
jr nz, .no_pack
|
2018-01-22 17:03:18 +00:00
|
|
|
ld a, STARTMENUITEM_PACK
|
2015-11-11 21:11:08 +00:00
|
|
|
call .AppendMenuList
|
|
|
|
.no_pack
|
|
|
|
|
|
|
|
ld hl, wPokegearFlags
|
2018-01-22 17:03:18 +00:00
|
|
|
bit POKEGEAR_OBTAINED_F, [hl]
|
2015-11-11 21:11:08 +00:00
|
|
|
jr z, .no_pokegear
|
2018-01-22 17:03:18 +00:00
|
|
|
ld a, STARTMENUITEM_POKEGEAR
|
2015-11-11 21:11:08 +00:00
|
|
|
call .AppendMenuList
|
|
|
|
.no_pokegear
|
|
|
|
|
2018-01-22 20:40:43 +00:00
|
|
|
ld a, STARTMENUITEM_STATUS
|
2015-11-11 21:11:08 +00:00
|
|
|
call .AppendMenuList
|
|
|
|
|
|
|
|
ld a, [wLinkMode]
|
|
|
|
and a
|
|
|
|
jr nz, .no_save
|
2017-12-28 12:15:46 +00:00
|
|
|
ld hl, wStatusFlags2
|
2018-01-22 20:40:43 +00:00
|
|
|
bit STATUSFLAGS2_BUG_CONTEST_TIMER_F, [hl]
|
2018-01-22 17:03:18 +00:00
|
|
|
ld a, STARTMENUITEM_QUIT
|
2015-11-11 21:11:08 +00:00
|
|
|
jr nz, .write
|
2018-01-22 17:03:18 +00:00
|
|
|
ld a, STARTMENUITEM_SAVE
|
2015-11-11 21:11:08 +00:00
|
|
|
.write
|
|
|
|
call .AppendMenuList
|
|
|
|
.no_save
|
|
|
|
|
2018-01-22 17:03:18 +00:00
|
|
|
ld a, STARTMENUITEM_OPTION
|
2015-11-11 21:11:08 +00:00
|
|
|
call .AppendMenuList
|
2018-01-22 17:03:18 +00:00
|
|
|
ld a, STARTMENUITEM_EXIT
|
2015-11-11 21:11:08 +00:00
|
|
|
call .AppendMenuList
|
|
|
|
ld a, c
|
2018-01-23 22:39:09 +00:00
|
|
|
ld [wMenuItemsList], a
|
2015-11-11 21:11:08 +00:00
|
|
|
ret
|
|
|
|
|
2018-06-24 14:09:41 +00:00
|
|
|
.FillMenuList:
|
2015-11-11 21:11:08 +00:00
|
|
|
xor a
|
2018-01-23 22:39:09 +00:00
|
|
|
ld hl, wMenuItemsList
|
2015-11-11 21:11:08 +00:00
|
|
|
ld [hli], a
|
|
|
|
ld a, -1
|
2018-01-23 22:39:09 +00:00
|
|
|
ld bc, wMenuItemsListEnd - (wMenuItemsList + 1)
|
2015-11-11 21:11:08 +00:00
|
|
|
call ByteFill
|
2018-01-23 22:39:09 +00:00
|
|
|
ld de, wMenuItemsList + 1
|
2015-11-11 21:11:08 +00:00
|
|
|
ld c, 0
|
|
|
|
ret
|
|
|
|
|
2018-06-24 14:09:41 +00:00
|
|
|
.AppendMenuList:
|
2015-11-11 21:11:08 +00:00
|
|
|
ld [de], a
|
|
|
|
inc de
|
|
|
|
inc c
|
|
|
|
ret
|
|
|
|
|
2018-07-23 04:13:43 +00:00
|
|
|
.DrawMenuAccount:
|
|
|
|
jp ._DrawMenuAccount
|
2015-11-11 21:11:08 +00:00
|
|
|
|
2018-06-24 14:09:41 +00:00
|
|
|
.PrintMenuAccount:
|
2015-11-11 21:11:08 +00:00
|
|
|
call .IsMenuAccountOn
|
|
|
|
ret z
|
2018-07-23 04:13:43 +00:00
|
|
|
call ._DrawMenuAccount
|
2015-11-11 21:11:08 +00:00
|
|
|
decoord 0, 14
|
|
|
|
jp .MenuDesc
|
|
|
|
|
2018-07-23 04:13:43 +00:00
|
|
|
._DrawMenuAccount:
|
2015-11-11 21:11:08 +00:00
|
|
|
call .IsMenuAccountOn
|
|
|
|
ret z
|
|
|
|
hlcoord 0, 13
|
|
|
|
lb bc, 5, 10
|
|
|
|
call ClearBox
|
|
|
|
hlcoord 0, 13
|
|
|
|
ld b, 3
|
|
|
|
ld c, 8
|
2019-04-08 12:15:10 +00:00
|
|
|
jp TextboxPalette
|
2015-11-11 21:11:08 +00:00
|
|
|
|
2018-06-24 14:09:41 +00:00
|
|
|
.IsMenuAccountOn:
|
2018-01-23 22:39:09 +00:00
|
|
|
ld a, [wOptions2]
|
2018-01-22 17:03:18 +00:00
|
|
|
and 1 << MENU_ACCOUNT
|
2015-11-11 21:11:08 +00:00
|
|
|
ret
|
|
|
|
|
2018-06-24 14:09:41 +00:00
|
|
|
.DrawBugContestStatusBox:
|
2017-12-28 12:15:46 +00:00
|
|
|
ld hl, wStatusFlags2
|
2018-01-22 20:40:43 +00:00
|
|
|
bit STATUSFLAGS2_BUG_CONTEST_TIMER_F, [hl]
|
2015-11-11 21:11:08 +00:00
|
|
|
ret z
|
2017-12-24 17:47:30 +00:00
|
|
|
farcall StartMenu_DrawBugContestStatusBox
|
2015-11-11 21:11:08 +00:00
|
|
|
ret
|
|
|
|
|
2018-06-24 14:09:41 +00:00
|
|
|
.DrawBugContestStatus:
|
2017-12-28 12:15:46 +00:00
|
|
|
ld hl, wStatusFlags2
|
2018-01-22 20:40:43 +00:00
|
|
|
bit STATUSFLAGS2_BUG_CONTEST_TIMER_F, [hl]
|
2015-11-11 21:11:08 +00:00
|
|
|
jr nz, .contest
|
|
|
|
ret
|
|
|
|
.contest
|
2017-12-24 17:47:30 +00:00
|
|
|
farcall StartMenu_PrintBugContestStatus
|
2015-11-11 21:11:08 +00:00
|
|
|
ret
|
|
|
|
|
2018-06-24 14:09:41 +00:00
|
|
|
StartMenu_Exit:
|
2015-11-11 21:11:08 +00:00
|
|
|
; Exit the menu.
|
|
|
|
|
|
|
|
ld a, 1
|
|
|
|
ret
|
|
|
|
|
2018-06-24 14:09:41 +00:00
|
|
|
StartMenu_Quit:
|
2015-11-11 21:11:08 +00:00
|
|
|
; Retire from the bug catching contest.
|
|
|
|
|
2019-10-20 22:24:17 +00:00
|
|
|
ld hl, .StartMenuContestEndText
|
2015-11-17 22:56:49 +00:00
|
|
|
call StartMenuYesNo
|
2015-11-11 21:11:08 +00:00
|
|
|
jr c, .DontEndContest
|
|
|
|
ld a, BANK(BugCatchingContestReturnToGateScript)
|
|
|
|
ld hl, BugCatchingContestReturnToGateScript
|
|
|
|
call FarQueueScript
|
|
|
|
ld a, 4
|
|
|
|
ret
|
|
|
|
|
2016-04-10 18:42:14 +00:00
|
|
|
.DontEndContest:
|
2015-11-11 21:11:08 +00:00
|
|
|
ld a, 0
|
|
|
|
ret
|
|
|
|
|
2019-10-20 22:24:17 +00:00
|
|
|
.StartMenuContestEndText:
|
|
|
|
text_far _StartMenuContestEndText
|
2018-11-17 18:33:03 +00:00
|
|
|
text_end
|
2015-11-11 21:11:08 +00:00
|
|
|
|
2018-06-24 14:09:41 +00:00
|
|
|
StartMenu_Save:
|
2015-11-11 21:11:08 +00:00
|
|
|
; Save the game.
|
|
|
|
|
|
|
|
call BufferScreen
|
2017-12-24 17:47:30 +00:00
|
|
|
farcall SaveMenu
|
2020-06-18 14:11:12 +00:00
|
|
|
jr nc, .saved
|
2015-11-11 21:11:08 +00:00
|
|
|
ld a, 0
|
|
|
|
ret
|
2020-06-18 14:11:12 +00:00
|
|
|
|
|
|
|
.saved
|
2015-11-11 21:11:08 +00:00
|
|
|
ld a, 1
|
|
|
|
ret
|
|
|
|
|
2018-06-24 14:09:41 +00:00
|
|
|
StartMenu_Option:
|
2015-11-11 21:11:08 +00:00
|
|
|
; Game options.
|
|
|
|
|
|
|
|
call FadeToMenu
|
2020-06-18 14:11:12 +00:00
|
|
|
farcall Option
|
2015-11-11 21:11:08 +00:00
|
|
|
ld a, 6
|
|
|
|
ret
|
|
|
|
|
2018-06-24 14:09:41 +00:00
|
|
|
StartMenu_Status:
|
2015-11-11 21:11:08 +00:00
|
|
|
; Player status.
|
|
|
|
|
|
|
|
call FadeToMenu
|
2017-12-24 17:47:30 +00:00
|
|
|
farcall TrainerCard
|
2015-12-02 02:54:11 +00:00
|
|
|
call CloseSubmenu
|
2015-11-11 21:11:08 +00:00
|
|
|
ld a, 0
|
|
|
|
ret
|
|
|
|
|
2018-06-24 14:09:41 +00:00
|
|
|
StartMenu_Pokedex:
|
2018-01-23 22:39:09 +00:00
|
|
|
ld a, [wPartyCount]
|
2015-11-11 21:11:08 +00:00
|
|
|
and a
|
2020-06-18 14:11:12 +00:00
|
|
|
jr z, .empty
|
2015-11-11 21:11:08 +00:00
|
|
|
|
|
|
|
call FadeToMenu
|
2017-12-24 17:47:30 +00:00
|
|
|
farcall Pokedex
|
2015-12-02 02:54:11 +00:00
|
|
|
call CloseSubmenu
|
2015-11-11 21:11:08 +00:00
|
|
|
|
2020-06-18 14:11:12 +00:00
|
|
|
.empty
|
2015-11-11 21:11:08 +00:00
|
|
|
ld a, 0
|
|
|
|
ret
|
|
|
|
|
2018-06-24 14:09:41 +00:00
|
|
|
StartMenu_Pokegear:
|
2015-11-11 21:11:08 +00:00
|
|
|
call FadeToMenu
|
2017-12-24 17:47:30 +00:00
|
|
|
farcall PokeGear
|
2015-12-02 02:54:11 +00:00
|
|
|
call CloseSubmenu
|
2015-11-11 21:11:08 +00:00
|
|
|
ld a, 0
|
|
|
|
ret
|
|
|
|
|
2018-06-24 14:09:41 +00:00
|
|
|
StartMenu_Pack:
|
2015-11-11 21:11:08 +00:00
|
|
|
call FadeToMenu
|
2017-12-24 17:47:30 +00:00
|
|
|
farcall Pack
|
2018-01-11 20:36:11 +00:00
|
|
|
ld a, [wPackUsedItem]
|
2015-11-11 21:11:08 +00:00
|
|
|
and a
|
2015-11-17 22:56:49 +00:00
|
|
|
jr nz, .used_item
|
2015-12-02 02:54:11 +00:00
|
|
|
call CloseSubmenu
|
2015-11-11 21:11:08 +00:00
|
|
|
ld a, 0
|
|
|
|
ret
|
2015-11-17 22:56:49 +00:00
|
|
|
|
|
|
|
.used_item
|
|
|
|
call ExitAllMenus
|
2015-11-11 21:11:08 +00:00
|
|
|
ld a, 4
|
|
|
|
ret
|
|
|
|
|
2018-06-24 14:09:41 +00:00
|
|
|
StartMenu_Pokemon:
|
2018-01-23 22:39:09 +00:00
|
|
|
ld a, [wPartyCount]
|
2015-11-11 21:11:08 +00:00
|
|
|
and a
|
|
|
|
jr z, .return
|
|
|
|
|
|
|
|
call FadeToMenu
|
|
|
|
|
|
|
|
.choosemenu
|
|
|
|
xor a
|
2018-01-23 22:39:09 +00:00
|
|
|
ld [wPartyMenuActionText], a ; Choose a POKéMON.
|
2015-11-12 04:38:57 +00:00
|
|
|
call ClearBGPalettes
|
2015-11-11 21:11:08 +00:00
|
|
|
|
|
|
|
.menu
|
2017-12-24 17:47:30 +00:00
|
|
|
farcall LoadPartyMenuGFX
|
|
|
|
farcall InitPartyMenuWithCancel
|
|
|
|
farcall InitPartyMenuGFX
|
2015-11-11 21:11:08 +00:00
|
|
|
|
|
|
|
.menunoreload
|
2017-12-24 17:47:30 +00:00
|
|
|
farcall WritePartyMenuTilemap
|
|
|
|
farcall PrintPartyMenuText
|
2015-11-11 21:11:08 +00:00
|
|
|
call WaitBGMap
|
|
|
|
call SetPalettes ; load regular palettes?
|
|
|
|
call DelayFrame
|
2017-12-24 17:47:30 +00:00
|
|
|
farcall PartyMenuSelect
|
2015-11-11 21:11:08 +00:00
|
|
|
jr c, .return ; if cancelled or pressed B
|
|
|
|
|
|
|
|
call PokemonActionSubmenu
|
|
|
|
cp 3
|
|
|
|
jr z, .menu
|
|
|
|
cp 0
|
|
|
|
jr z, .choosemenu
|
|
|
|
cp 1
|
|
|
|
jr z, .menunoreload
|
|
|
|
cp 2
|
|
|
|
jr z, .quit
|
|
|
|
|
|
|
|
.return
|
2015-12-02 02:54:11 +00:00
|
|
|
call CloseSubmenu
|
2015-11-11 21:11:08 +00:00
|
|
|
ld a, 0
|
|
|
|
ret
|
|
|
|
|
|
|
|
.quit
|
|
|
|
ld a, b
|
|
|
|
push af
|
2015-11-17 22:56:49 +00:00
|
|
|
call ExitAllMenus
|
2015-11-11 21:11:08 +00:00
|
|
|
pop af
|
|
|
|
ret
|