summaryrefslogtreecommitdiff
path: root/engine/startmenu.asm
diff options
context:
space:
mode:
Diffstat (limited to 'engine/startmenu.asm')
-rwxr-xr-xengine/startmenu.asm230
1 files changed, 113 insertions, 117 deletions
diff --git a/engine/startmenu.asm b/engine/startmenu.asm
index 25a3eee39..b2b82bd6a 100755
--- a/engine/startmenu.asm
+++ b/engine/startmenu.asm
@@ -12,7 +12,7 @@ StartMenu:: ; 125cd
ld hl, .MenuDataHeader
jr z, .GotMenuData
ld hl, .ContestMenuDataHeader
-.GotMenuData
+.GotMenuData:
call LoadMenuDataHeader
call .SetUpMenuItems
@@ -28,14 +28,14 @@ StartMenu:: ; 125cd
call UpdateTimePals
jr .Select
-.Reopen
+.Reopen:
call UpdateSprites
call UpdateTimePals
call .SetUpMenuItems
ld a, [wd0d2]
ld [wMenuCursorBuffer], a
-.Select
+.Select:
call .GetInput
jr c, .Exit
call .DrawMenuAccount
@@ -57,7 +57,7 @@ StartMenu:: ; 125cd
ld l, a
jp [hl]
-.MenuReturns
+.MenuReturns:
dw .Reopen
dw .Exit
dw .ExitMenuCallFuncCloseText
@@ -66,7 +66,7 @@ StartMenu:: ; 125cd
dw .ReturnEnd
dw .ReturnRedraw
-.Exit
+.Exit:
ld a, [hOAMUpdate]
push af
ld a, 1
@@ -74,14 +74,14 @@ StartMenu:: ; 125cd
call LoadFontsExtra
pop af
ld [hOAMUpdate], a
-.ReturnEnd
+.ReturnEnd:
call ExitMenu
-.ReturnEnd2
+.ReturnEnd2:
call CloseText
call UpdateTimePals
ret
-.GetInput
+.GetInput:
; Return carry on exit, and no-carry on selection.
xor a
ld [hBGMapMode], a
@@ -91,7 +91,7 @@ StartMenu:: ; 125cd
ld [MenuSelection], a
.loop
call .PrintMenuAccount
- call Function1f1a
+ call GetScrollingMenuJoypad
ld a, [wMenuJoypad]
cp B_BUTTON
jr z, .b
@@ -107,21 +107,21 @@ StartMenu:: ; 125cd
ret
; 12691
-.ExitMenuRunScript ; 12691
+.ExitMenuRunScript: ; 12691
call ExitMenu
ld a, HMENURETURN_SCRIPT
ld [hMenuReturn], a
ret
; 12699
-.ExitMenuRunScriptCloseText ; 12699
+.ExitMenuRunScriptCloseText: ; 12699
call ExitMenu
ld a, HMENURETURN_SCRIPT
ld [hMenuReturn], a
jr .ReturnEnd2
; 126a2
-.ExitMenuCallFuncCloseText ; 126a2
+.ExitMenuCallFuncCloseText: ; 126a2
call ExitMenu
ld hl, wQueuedScriptAddr
ld a, [hli]
@@ -132,12 +132,12 @@ StartMenu:: ; 125cd
jr .ReturnEnd2
; 126b1
-.ReturnRedraw ; 126b1
+.ReturnRedraw: ; 126b1
call .Clear
jp .Reopen
; 126b7
-.Clear ; 126b7
+.Clear: ; 126b7
call ClearBGPalettes
call Call_ExitMenu
call ReloadTilesetAndPalettes
@@ -151,28 +151,28 @@ StartMenu:: ; 125cd
; 126d3
-.MenuDataHeader
+.MenuDataHeader:
db $40 ; tile backup
db 0, 10 ; start coords
db 17, 19 ; end coords
dw .MenuData
db 1 ; default selection
-.ContestMenuDataHeader
+.ContestMenuDataHeader:
db $40 ; tile backup
db 2, 10 ; start coords
db 17, 19 ; end coords
dw .MenuData
db 1 ; default selection
-.MenuData
+.MenuData:
db %10101000 ; x padding, wrap around, start can close
dn 0, 0 ; rows, columns
dw MenuItemsList
dw .MenuString
dw .Items
-.Items
+.Items:
dw StartMenu_Pokedex, .PokedexString, .PokedexDesc
dw StartMenu_Pokemon, .PartyString, .PartyDesc
dw StartMenu_Pack, .PackString, .PackDesc
@@ -183,45 +183,45 @@ StartMenu:: ; 125cd
dw StartMenu_Pokegear, .PokegearString, .PokegearDesc
dw StartMenu_Quit, .QuitString, .QuitDesc
-.PokedexString db "#DEX@"
-.PartyString db "#MON@"
-.PackString db "PACK@"
-.StatusString db "<PLAYER>@"
-.SaveString db "SAVE@"
-.OptionString db "OPTION@"
-.ExitString db "EXIT@"
-.PokegearString db $24, "GEAR@"
-.QuitString db "QUIT@"
-
-.PokedexDesc db "#MON"
+.PokedexString: db "#DEX@"
+.PartyString: db "#MON@"
+.PackString: db "PACK@"
+.StatusString: db "<PLAYER>@"
+.SaveString: db "SAVE@"
+.OptionString: db "OPTION@"
+.ExitString: db "EXIT@"
+.PokegearString: db $24, "GEAR@"
+.QuitString: db "QUIT@"
+
+.PokedexDesc: db "#MON"
next "database@"
-.PartyDesc db "Party ", $4a
+.PartyDesc: db "Party ", $4a
next "status@"
-.PackDesc db "Contains"
+.PackDesc: db "Contains"
next "items@"
-.PokegearDesc db "Trainer's"
+.PokegearDesc: db "Trainer's"
next "key device@"
-.StatusDesc db "Your own"
+.StatusDesc: db "Your own"
next "status@"
-.SaveDesc db "Save your"
+.SaveDesc: db "Save your"
next "progress@"
-.OptionDesc db "Change"
+.OptionDesc: db "Change"
next "settings@"
-.ExitDesc db "Close this"
+.ExitDesc: db "Close this"
next "menu@"
-.QuitDesc db "Quit and"
+.QuitDesc: db "Quit and"
next "be judged.@"
-.OpenMenu ; 127e5
+.OpenMenu: ; 127e5
ld a, [MenuSelection]
call .GetMenuAccountTextPointer
ld a, [hli]
@@ -230,7 +230,7 @@ StartMenu:: ; 125cd
jp [hl]
; 127ef
-.MenuString ; 127ef
+.MenuString: ; 127ef
push de
ld a, [MenuSelection]
call .GetMenuAccountTextPointer
@@ -244,7 +244,7 @@ StartMenu:: ; 125cd
ret
; 12800
-.MenuDesc ; 12800
+.MenuDesc: ; 12800
push de
ld a, [MenuSelection]
cp $ff
@@ -265,7 +265,7 @@ endr
; 12819
-.GetMenuAccountTextPointer ; 12819
+.GetMenuAccountTextPointer: ; 12819
ld e, a
ld d, 0
ld hl, wMenuData2PointerTableAddr
@@ -279,7 +279,7 @@ endr
; 12829
-.SetUpMenuItems ; 12829
+.SetUpMenuItems: ; 12829
xor a
ld [wWhichIndexSet], a
call .FillMenuList
@@ -340,7 +340,7 @@ endr
; 1288d
-.FillMenuList ; 1288d
+.FillMenuList: ; 1288d
xor a
ld hl, MenuItemsList
ld [hli], a
@@ -352,18 +352,18 @@ endr
ret
; 128a0
-.AppendMenuList ; 128a0
+.AppendMenuList: ; 128a0
ld [de], a
inc de
inc c
ret
; 128a4
-.DrawMenuAccount_ ; 128a4
+.DrawMenuAccount_: ; 128a4
jp .DrawMenuAccount
; 128a7
-.PrintMenuAccount ; 128a7
+.PrintMenuAccount: ; 128a7
call .IsMenuAccountOn
ret z
call .DrawMenuAccount
@@ -371,7 +371,7 @@ endr
jp .MenuDesc
; 128b4
-.DrawMenuAccount ; 128b4
+.DrawMenuAccount: ; 128b4
call .IsMenuAccountOn
ret z
hlcoord 0, 13
@@ -383,13 +383,13 @@ endr
jp TextBoxPalette
; 128cb
-.IsMenuAccountOn ; 128cb
+.IsMenuAccountOn: ; 128cb
ld a, [Options2]
and 1
ret
; 128d1
-.DrawBugContestStatusBox ; 128d1
+.DrawBugContestStatusBox: ; 128d1
ld hl, StatusFlags2
bit 2, [hl] ; bug catching contest
ret z
@@ -397,7 +397,7 @@ endr
ret
; 128de
-.DrawBugContestStatus ; 128de
+.DrawBugContestStatus: ; 128de
ld hl, StatusFlags2
bit 2, [hl] ; bug catching contest
jr nz, .contest
@@ -428,11 +428,11 @@ StartMenu_Quit: ; 128f0
ld a, 4
ret
-.DontEndContest
+.DontEndContest:
ld a, 0
ret
-.EndTheContestText
+.EndTheContestText:
text_jump UnknownText_0x1c1a6c
db "@"
; 1290b
@@ -591,70 +591,66 @@ HasNoItems: ; 129d5
and a
ret
-Function129f4: ; 129f4
+TossItemFromPC: ; 129f4
push de
call PartyMonItemName
callba _CheckTossableItem
ld a, [wItemAttributeParamBuffer]
and a
- jr nz, .asm_12a3f
- ld hl, UnknownText_0x12a45
+ jr nz, .key_item
+ ld hl, .TossHowMany
call MenuTextBox
callba SelectQuantityToToss
push af
call CloseWindow
call ExitMenu
pop af
- jr c, .asm_12a42
- ld hl, UnknownText_0x12a4a
+ jr c, .quit
+ ld hl, .ConfirmToss
call MenuTextBox
call YesNoBox
push af
call ExitMenu
pop af
- jr c, .asm_12a42
+ jr c, .quit
pop hl
ld a, [wd107]
call TossItem
call PartyMonItemName
- ld hl, UnknownText_0x12a4f
+ ld hl, .TossedThisMany
call MenuTextBox
call ExitMenu
and a
ret
-.asm_12a3f
- call Function12a54
-.asm_12a42
+
+.key_item
+ call .CantToss
+.quit
pop hl
scf
ret
-; 12a45 (4:6a45)
-UnknownText_0x12a45: ; 0x12a45
+.TossHowMany:
; Toss out how many @ (S)?
text_jump UnknownText_0x1c1a90
db "@"
-; 0x12a4a
-UnknownText_0x12a4a: ; 0x12a4a
+.ConfirmToss:
; Throw away @ @ (S)?
text_jump UnknownText_0x1c1aad
db "@"
-; 0x12a4f
-UnknownText_0x12a4f: ; 0x12a4f
+.TossedThisMany:
; Discarded @ (S).
text_jump UnknownText_0x1c1aca
db "@"
-; 0x12a54
-Function12a54: ; 12a54 (4:6a54)
- ld hl, UnknownText_0x12a5b
+.CantToss:
+ ld hl, .TooImportantToToss
call MenuTextBoxBackup
ret
-; 12a5b (4:6a5b)
-UnknownText_0x12a5b: ; 0x12a5b
+.TooImportantToToss:
; That's too impor- tant to toss out!
text_jump UnknownText_0x1c1adf
db "@"
@@ -711,7 +707,7 @@ PokemonActionSubmenu: ; 12a88
ld a, 0
ret
-.Actions
+.Actions:
dbw MONMENU_CUT, MonMenu_Cut ; Cut
dbw MONMENU_FLY, MonMenu_Fly ; Fly
dbw MONMENU_SURF, MonMenu_Surf ; Surf
@@ -780,7 +776,7 @@ SwitchPartyMons: ; 12aec
ld a, 1
ret
-.DontSwitch
+.DontSwitch:
xor a
ld [PartyMenuActionText], a
call CancelPokemonAction
@@ -830,7 +826,7 @@ GiveTakePartyMonItem: ; 12b60
; 12ba9
-.GiveItem: ; 12ba9
+.GiveItem:
callba DepositSellInitPackBuffers
@@ -986,7 +982,7 @@ GiveTakeItemMenuData: ; 12c9b
dw .Items
db 1 ; default option
-.Items
+.Items:
db %10000000 ; x padding
db 2 ; # items
db "GIVE@"
@@ -1136,12 +1132,12 @@ MonMailAction: ; 12d45
call MenuTextBoxBackup
jr .done
-.MailboxFull
+.MailboxFull:
ld hl, .mailboxfulltext
call MenuTextBoxBackup
jr .done
-.RemoveMailToBag
+.RemoveMailToBag:
ld hl, .mailwilllosemessagetext
call StartMenuYesNo
jr c, .done
@@ -1157,7 +1153,7 @@ MonMailAction: ; 12d45
call MenuTextBoxBackup
jr .done
-.BagIsFull
+.BagIsFull:
ld hl, .bagfulltext
call MenuTextBoxBackup
jr .done
@@ -1168,7 +1164,7 @@ MonMailAction: ; 12d45
; 12dc9
-.MenuDataHeader: ; 0x12dc9
+.MenuDataHeader:
db $40 ; flags
db 10, 12 ; start coords
db 17, 19 ; end coords
@@ -1176,7 +1172,7 @@ MonMailAction: ; 12d45
db 1 ; default option
; 0x12dd1
-.MenuData2: ; 0x12dd1
+.MenuData2:
db $80 ; flags
db 3 ; items
db "READ@"
@@ -1185,37 +1181,37 @@ MonMailAction: ; 12d45
; 0x12de2
-.mailwilllosemessagetext: ; 0x12de2
+.mailwilllosemessagetext
; The MAIL will lose its message. OK?
text_jump UnknownText_0x1c1c22
db "@"
; 0x12de7
-.tookmailfrommontext: ; 0x12de7
+.tookmailfrommontext
; MAIL detached from <POKEMON>.
text_jump UnknownText_0x1c1c47
db "@"
; 0x12dec
-.bagfulltext: ; 0x12dec
+.bagfulltext
; There's no space for removing MAIL.
text_jump UnknownText_0x1c1c62
db "@"
; 0x12df1
-.sendmailtopctext: ; 0x12df1
+.sendmailtopctext
; Send the removed MAIL to your PC?
text_jump UnknownText_0x1c1c86
db "@"
; 0x12df6
-.mailboxfulltext: ; 0x12df6
+.mailboxfulltext
; Your PC's MAILBOX is full.
text_jump UnknownText_0x1c1ca9
db "@"
; 0x12dfb
-.sentmailtopctext: ; 0x12dfb
+.sentmailtopctext
; The MAIL was sent to your PC.
text_jump UnknownText_0x1c1cc4
db "@"
@@ -1246,7 +1242,7 @@ MonMenu_Cut: ; 12e1b
ld a, $2
ret
-.Fail
+.Fail:
ld a, $3
ret
; 12e30
@@ -1264,15 +1260,15 @@ MonMenu_Fly: ; 12e30
ld a, $2
ret
-.Fail
+.Fail:
ld a, $3
ret
-.Error
+.Error:
ld a, $0
ret
-.Unused
+.Unused:
ld a, $1
ret
; 12e55
@@ -1286,7 +1282,7 @@ MonMenu_Flash: ; 12e55
ld a, $2
ret
-.Fail
+.Fail:
ld a, $3
ret
; 12e6a
@@ -1300,7 +1296,7 @@ MonMenu_Strength: ; 12e6a
ld a, $2
ret
-.Fail
+.Fail:
ld a, $3
ret
; 12e7f
@@ -1314,7 +1310,7 @@ MonMenu_Whirlpool: ; 12e7f
ld a, $2
ret
-.Fail
+.Fail:
ld a, $3
ret
; 12e94
@@ -1328,7 +1324,7 @@ MonMenu_Waterfall: ; 12e94
ld a, $2
ret
-.Fail
+.Fail:
ld a, $3
ret
; 12ea9
@@ -1342,7 +1338,7 @@ MonMenu_Teleport: ; 12ea9
ld a, $2
ret
-.Fail
+.Fail:
ld a, $3
ret
; 12ebd
@@ -1356,7 +1352,7 @@ MonMenu_Surf: ; 12ebd
ld a, $2
ret
-.Fail
+.Fail:
ld a, $3
ret
; 12ed1
@@ -1370,7 +1366,7 @@ MonMenu_Dig: ; 12ed1
ld a, $2
ret
-.Fail
+.Fail:
ld a, $3
ret
; 12ee6
@@ -1381,7 +1377,7 @@ MonMenu_Softboiled_MilkDrink: ; 12ee6
callba Softboiled_MilkDrinkFunction
jr .finish
-.NotEnoughHP
+.NotEnoughHP:
ld hl, .Text_NotEnoughHP
call PrintText
@@ -1392,13 +1388,13 @@ MonMenu_Softboiled_MilkDrink: ; 12ee6
ret
; 12f00
-.Text_NotEnoughHP: ; 0x12f00
+.Text_NotEnoughHP:
; Not enough HP!
text_jump UnknownText_0x1c1ce3
db "@"
; 0x12f05
-.CheckMonHasEnoughHP: ; 12f05
+.CheckMonHasEnoughHP:
; Need to have at least (MaxHP / 5) HP left.
ld a, MON_MAXHP
call GetPartyParamLocation
@@ -1429,7 +1425,7 @@ MonMenu_Headbutt: ; 12f26
ld a, $2
ret
-.Fail
+.Fail:
ld a, $3
ret
; 12f3b
@@ -1443,7 +1439,7 @@ MonMenu_RockSmash: ; 12f3b
ld a, $2
ret
-.Fail
+.Fail:
ld a, $3
ret
; 12f50
@@ -1471,7 +1467,7 @@ ChooseMoveToDelete: ; 12f5b
ret
; 12f73
-.asm_12f73: ; 12f73
+.asm_12f73
call SetUpMoveScreenBG
ld de, DeleteMoveScreenAttrs
call SetMenuAttributes
@@ -1480,27 +1476,27 @@ ChooseMoveToDelete: ; 12f5b
set 6, [hl]
jr .asm_12f93
-.asm_12f86: ; 12f86
+.asm_12f86
call ScrollingMenuJoypad
bit 1, a
jp nz, .asm_12f9f
bit 0, a
jp nz, .asm_12f9c
-.asm_12f93: ; 12f93
+.asm_12f93
call PrepareToPlaceMoveData
call PlaceMoveData
jp .asm_12f86
; 12f9c
-.asm_12f9c: ; 12f9c
+.asm_12f9c
and a
jr .asm_12fa0
-.asm_12f9f: ; 12f9f
+.asm_12f9f
scf
-.asm_12fa0: ; 12fa0
+.asm_12fa0
push af
xor a
ld [wSwitchMon], a
@@ -1583,7 +1579,7 @@ MoveScreenLoop: ; 12fd5
ld de, String_1316b
call PlaceString
jp .joy_loop
-.b_button: ; 13038
+.b_button
call PlayClickSFX
call WaitSFX
ld a, [wMoveSwapBuffer]
@@ -1600,7 +1596,7 @@ MoveScreenLoop: ; 12fd5
jp .loop
; 1305b
-.d_right: ; 1305b
+.d_right
ld a, [wMoveSwapBuffer]
and a
jp nz, .joy_loop
@@ -1615,7 +1611,7 @@ MoveScreenLoop: ; 12fd5
jp z, .joy_loop
jp MoveScreenLoop
-.d_left: ; 13075
+.d_left
ld a, [wMoveSwapBuffer]
and a
jp nz, .joy_loop
@@ -1665,7 +1661,7 @@ MoveScreenLoop: ; 12fd5
jr .cycle_left_loop
; 130c6
-.a_button: ; 130c6
+.a_button
call PlayClickSFX
call WaitSFX
ld a, [wMoveSwapBuffer]
@@ -1716,7 +1712,7 @@ MoveScreenLoop: ; 12fd5
jp .loop
; 1313a
-.copy_move: ; 1313a
+.copy_move
push hl
ld a, [wMenuCursorY]
dec a
@@ -1739,7 +1735,7 @@ MoveScreenLoop: ; 12fd5
ret
; 13154
-.exit: ; 13154
+.exit
xor a
ld [wMoveSwapBuffer], a
ld hl, w2DMenuFlags1
@@ -1776,7 +1772,7 @@ SetUpMoveScreenBG: ; 13172
ld a, [hl]
ld [wd265], a
ld e, $2
- callba Function8e83f
+ callba LoadMenuMonIcon
hlcoord 0, 1
ld b, 9
ld c, 18