diff options
Diffstat (limited to 'engine/menus/naming_screen.asm')
-rw-r--r-- | engine/menus/naming_screen.asm | 177 |
1 files changed, 67 insertions, 110 deletions
diff --git a/engine/menus/naming_screen.asm b/engine/menus/naming_screen.asm index a958e10eb..fb42b1350 100644 --- a/engine/menus/naming_screen.asm +++ b/engine/menus/naming_screen.asm @@ -12,7 +12,7 @@ _NamingScreen: ; 0x116b7 ; 0x116c1 -NamingScreen: ; 116c1 +NamingScreen: ld hl, wNamingScreenDestinationPointer ld [hl], e inc hl @@ -45,9 +45,8 @@ NamingScreen: ; 116c1 call ClearJoypad ret -; 116f8 -.SetUpNamingScreen: ; 116f8 +.SetUpNamingScreen: call ClearBGPalettes ld b, SCGB_DIPLOMA call GetSGBLayout @@ -63,9 +62,8 @@ NamingScreen: ; 116c1 call NamingScreen_InitNameEntry ret -; 1171d -.GetNamingScreenSetup: ; 1171d +.GetNamingScreenSetup: ld a, [wNamingScreenType] and 7 ld e, a @@ -78,9 +76,8 @@ NamingScreen: ; 116c1 ld l, a jp hl -; 1172e -.Jumptable: ; 1172e (4:572e) +.Jumptable: dw .Pokemon dw .Player dw .Rival @@ -90,7 +87,7 @@ NamingScreen: ; 116c1 dw .Pokemon dw .Pokemon -.Pokemon: ; 1173e (4:573e) +.Pokemon: ld a, [wCurPartySpecies] ld [wd265], a ld hl, LoadMenuMonIcon @@ -121,15 +118,13 @@ NamingScreen: ; 116c1 call .StoreMonIconParams ret -; 11780 (4:5780) -.NicknameStrings: ; 11780 +.NicknameStrings: db "'S@" db "NICKNAME?@" -; 1178d -.Player: ; 1178d (4:578d) +.Player: farcall GetPlayerIcon call .LoadSprite hlcoord 5, 2 @@ -138,14 +133,12 @@ NamingScreen: ; 116c1 call .StoreSpriteIconParams ret -; 117a3 (4:57a3) -.PlayerNameString: ; 117a3 +.PlayerNameString: db "YOUR NAME?@" -; 117ae -.Rival: ; 117ae (4:57ae) +.Rival: ld de, SilverSpriteGFX ld b, BANK(SilverSpriteGFX) call .LoadSprite @@ -155,14 +148,12 @@ NamingScreen: ; 116c1 call .StoreSpriteIconParams ret -; 117c3 (4:57c3) -.RivalNameString: ; 117c3 +.RivalNameString: db "RIVAL'S NAME?@" -; 117d1 -.Mom: ; 117d1 (4:57d1) +.Mom: ld de, MomSpriteGFX ld b, BANK(MomSpriteGFX) call .LoadSprite @@ -172,14 +163,12 @@ NamingScreen: ; 116c1 call .StoreSpriteIconParams ret -; 117e6 (4:57e6) -.MomNameString: ; 117e6 +.MomNameString: db "MOTHER'S NAME?@" -; 117f5 -.Box: ; 117f5 (4:57f5) +.Box: ld de, PokeBallSpriteGFX ld hl, vTiles0 tile $00 lb bc, BANK(PokeBallSpriteGFX), 4 @@ -200,28 +189,24 @@ NamingScreen: ; 116c1 call .StoreBoxIconParams ret -; 11822 (4:5822) -.BoxNameString: ; 11822 +.BoxNameString: db "BOX NAME?@" -; 1182c -.Tomodachi: ; 1182c (4:582c) +.Tomodachi: hlcoord 3, 2 ld de, .oTomodachi_no_namae_sutoringu call PlaceString call .StoreSpriteIconParams ret -; 11839 (4:5839) -.oTomodachi_no_namae_sutoringu ; 11839 +.oTomodachi_no_namae_sutoringu db "おともだち の なまえは?@" -; 11847 -.LoadSprite: ; 11847 (4:5847) +.LoadSprite: push de ld hl, vTiles0 tile $00 ld c, $4 @@ -253,22 +238,22 @@ NamingScreen: ; 116c1 call _InitSpriteAnimStruct ret -.StoreMonIconParams: ; 1187b (4:587b) +.StoreMonIconParams: ld a, MON_NAME_LENGTH - 1 hlcoord 5, 6 jr .StoreParams -.StoreSpriteIconParams: ; 11882 (4:5882) +.StoreSpriteIconParams: ld a, PLAYER_NAME_LENGTH - 1 hlcoord 5, 6 jr .StoreParams -.StoreBoxIconParams: ; 11889 (4:5889) +.StoreBoxIconParams: ld a, BOX_NAME_LENGTH - 1 hlcoord 5, 4 jr .StoreParams -.StoreParams: ; 11890 (4:5890) +.StoreParams: ld [wNamingScreenMaxNameLength], a ld a, l ld [wNamingScreenStringEntryCoord], a @@ -276,7 +261,7 @@ NamingScreen: ; 116c1 ld [wNamingScreenStringEntryCoord + 1], a ret -NamingScreen_IsTargetBox: ; 1189c +NamingScreen_IsTargetBox: push bc push af ld a, [wNamingScreenType] @@ -287,9 +272,8 @@ NamingScreen_IsTargetBox: ; 1189c pop bc ret -; 118a8 -NamingScreen_InitText: ; 118a8 +NamingScreen_InitText: call WaitTop hlcoord 0, 0 ld bc, SCREEN_WIDTH * SCREEN_HEIGHT @@ -304,7 +288,7 @@ NamingScreen_InitText: ; 118a8 .not_box call ClearBox ld de, NameInputUpper -NamingScreen_ApplyTextInputMode: ; 118ca +NamingScreen_ApplyTextInputMode: call NamingScreen_IsTargetBox jr nz, .not_box ld hl, BoxNameInputLower - NameInputLower @@ -350,9 +334,8 @@ NamingScreen_ApplyTextInputMode: ; 118ca jr nz, .row ret -; 11915 -NamingScreenJoypadLoop: ; 11915 +NamingScreenJoypadLoop: call JoyTextDelay ld a, [wJumptableIndex] bit 7, a @@ -373,9 +356,8 @@ NamingScreenJoypadLoop: ; 11915 scf ret -; 11940 -.UpdateStringEntry: ; 11940 +.UpdateStringEntry: xor a ld [hBGMapMode], a hlcoord 1, 5 @@ -399,9 +381,8 @@ NamingScreenJoypadLoop: ; 11915 ld [hBGMapMode], a ret -; 11968 -.RunJumptable: ; 11968 +.RunJumptable: ld a, [wJumptableIndex] ld e, a ld d, $0 @@ -413,13 +394,12 @@ NamingScreenJoypadLoop: ; 11915 ld l, a jp hl -; 11977 -.Jumptable: ; 11977 (4:5977) +.Jumptable: dw .InitCursor dw .ReadButtons -.InitCursor: ; 1197b (4:597b) +.InitCursor: depixel 10, 3 call NamingScreen_IsTargetBox jr nz, .got_cursor_position @@ -441,7 +421,7 @@ NamingScreenJoypadLoop: ; 11915 inc [hl] ret -.ReadButtons: ; 119a1 (4:59a1) +.ReadButtons: ld hl, hJoyPressed ; $ffa7 ld a, [hl] and A_BUTTON @@ -510,13 +490,13 @@ NamingScreenJoypadLoop: ; 11915 call NamingScreen_ApplyTextInputMode ret -.GetCursorPosition: ; 11a0b (4:5a0b) +.GetCursorPosition: ld hl, wNamingScreenCursorObjectPointer ld c, [hl] inc hl ld b, [hl] -NamingScreen_GetCursorPosition: ; 11a11 (4:5a11) +NamingScreen_GetCursorPosition: ld hl, SPRITEANIMSTRUCT_0D add hl, bc ld a, [hl] @@ -551,7 +531,7 @@ NamingScreen_GetCursorPosition: ; 11a11 (4:5a11) xor a ret -NamingScreen_AnimateCursor: ; 11a3b (4:5a3b) +NamingScreen_AnimateCursor: call .GetDPad ld hl, SPRITEANIMSTRUCT_0D add hl, bc @@ -590,17 +570,15 @@ NamingScreen_AnimateCursor: ; 11a3b (4:5a3b) ld [hl], a ret -; 11a79 (4:5a79) -.LetterEntries: ; 11a79 +.LetterEntries: db $00, $10, $20, $30, $40, $50, $60, $70, $80 -.CaseDelEnd: ; 11a82 +.CaseDelEnd: db $00, $00, $00, $30, $30, $30, $60, $60, $60 -; 11a8b -.GetDPad: ; 11a8b (4:5a8b) +.GetDPad: ld hl, hJoyLast ld a, [hl] and D_UP @@ -713,9 +691,9 @@ NamingScreen_AnimateCursor: ; 11a3b (4:5a3b) inc [hl] ret -NamingScreen_TryAddCharacter: ; 11b14 (4:5b14) +NamingScreen_TryAddCharacter: ld a, [wNamingScreenLastCharacter] ; lost -MailComposition_TryAddCharacter: ; 11b17 (4:5b17) +MailComposition_TryAddCharacter: ld a, [wNamingScreenMaxNameLength] ld c, a ld a, [wNamingScreenCurrNameLength] @@ -724,11 +702,11 @@ MailComposition_TryAddCharacter: ; 11b17 (4:5b17) ld a, [wNamingScreenLastCharacter] -NamingScreen_LoadNextCharacter: ; 11b23 +NamingScreen_LoadNextCharacter: call NamingScreen_GetTextCursorPosition ld [hl], a -NamingScreen_AdvanceCursor_CheckEndOfString: ; 11b27 +NamingScreen_AdvanceCursor_CheckEndOfString: ld hl, wNamingScreenCurrNameLength inc [hl] call NamingScreen_GetTextCursorPosition @@ -743,7 +721,6 @@ NamingScreen_AdvanceCursor_CheckEndOfString: ; 11b27 scf ret -; 11b39 (4:5b39) ; unused ld a, [wNamingScreenCurrNameLength] @@ -769,13 +746,11 @@ NamingScreen_AdvanceCursor_CheckEndOfString: ; 11b27 ld a, [hl] jr NamingScreen_LoadNextCharacter -; 11b56 INCLUDE "data/text/unused_dakutens.asm" -; 11bbc -NamingScreen_DeleteCharacter: ; 11bbc (4:5bbc) +NamingScreen_DeleteCharacter: ld hl, wNamingScreenCurrNameLength ld a, [hl] and a @@ -790,7 +765,7 @@ NamingScreen_DeleteCharacter: ; 11bbc (4:5bbc) ld [hl], NAMINGSCREEN_MIDDLELINE ret -NamingScreen_GetTextCursorPosition: ; 11bd0 (4:5bd0) +NamingScreen_GetTextCursorPosition: push af ld hl, wNamingScreenDestinationPointer ld a, [hli] @@ -803,9 +778,8 @@ NamingScreen_GetTextCursorPosition: ; 11bd0 (4:5bd0) pop af ret -; 11be0 -NamingScreen_InitNameEntry: ; 11be0 +NamingScreen_InitNameEntry: ; load NAMINGSCREEN_UNDERLINE, (NAMINGSCREEN_MIDDLELINE * [wNamingScreenMaxNameLength]), "@" into the dw address at wNamingScreenDestinationPointer ld hl, wNamingScreenDestinationPointer ld a, [hli] @@ -824,9 +798,8 @@ NamingScreen_InitNameEntry: ; 11be0 ld [hl], "@" ret -; 11bf7 -NamingScreen_StoreEntry: ; 11bf7 (4:5bf7) +NamingScreen_StoreEntry: ld hl, wNamingScreenDestinationPointer ld a, [hli] ld h, [hl] @@ -847,7 +820,7 @@ NamingScreen_StoreEntry: ; 11bf7 (4:5bf7) jr nz, .loop ret -NamingScreen_GetLastCharacter: ; 11c11 (4:5c11) +NamingScreen_GetLastCharacter: ld hl, wNamingScreenCursorObjectPointer ld c, [hl] inc hl @@ -890,7 +863,7 @@ NamingScreen_GetLastCharacter: ; 11c11 (4:5c11) ld [wNamingScreenLastCharacter], a ret -LoadNamingScreenGFX: ; 11c51 +LoadNamingScreenGFX: call ClearSprites callfar ClearSpriteAnims call LoadStandardFont @@ -935,30 +908,23 @@ LoadNamingScreenGFX: ; 11c51 ld [hWX], a ret -; 11cb7 -NamingScreenGFX_Border: ; 11cb7 +NamingScreenGFX_Border: INCBIN "gfx/naming_screen/border.2bpp" -; 11cc7 -NamingScreenGFX_Cursor: ; 11cc7 +NamingScreenGFX_Cursor: INCBIN "gfx/naming_screen/cursor.2bpp" -; 11ce7 INCLUDE "data/text/name_input_chars.asm" -; 11e5d NamingScreenGFX_End: ; unused INCBIN "gfx/naming_screen/end.1bpp" -; 11e6d NamingScreenGFX_MiddleLine: INCBIN "gfx/naming_screen/middle_line.1bpp" -; 11e6d -NamingScreenGFX_UnderLine: ; 11e6d +NamingScreenGFX_UnderLine: INCBIN "gfx/naming_screen/underline.1bpp" -; 11e75 _ComposeMailMessage: ; 11e75 (mail?) ld hl, wNamingScreenDestinationPointer @@ -986,7 +952,7 @@ _ComposeMailMessage: ; 11e75 (mail?) ld [hMapAnims], a ret -.InitBlankMail: ; 11e9a (4:5e9a) +.InitBlankMail: call ClearBGPalettes call DisableLCD call LoadNamingScreenGFX @@ -1030,25 +996,21 @@ _ComposeMailMessage: ; 11e75 (mail?) ld [hl], "<NEXT>" ret -; 11ef4 (4:5ef4) -.MailIcon: ; 11ef4 +.MailIcon: INCBIN "gfx/icons/mail_big.2bpp" -; 11f74 -.initwNamingScreenMaxNameLength ; 11f74 (4:5f74) +.initwNamingScreenMaxNameLength ld a, MAIL_MSG_LENGTH + 1 ld [wNamingScreenMaxNameLength], a ret -; 11f7a (4:5f7a) .UnusedString11f7a: db "メールを かいてね@" -; 11f84 -.InitCharset: ; 11f84 (4:5f84) +.InitCharset: call WaitTop hlcoord 0, 0 ld bc, 6 * SCREEN_WIDTH @@ -1063,7 +1025,7 @@ INCBIN "gfx/icons/mail_big.2bpp" call ClearBox ld de, MailEntry_Uppercase -.PlaceMailCharset: ; 11fa9 (4:5fa9) +.PlaceMailCharset: hlcoord 1, 7 ld b, 6 .next @@ -1082,7 +1044,7 @@ INCBIN "gfx/icons/mail_big.2bpp" jr nz, .next ret -.DoMailEntry: ; 11fc0 (4:5fc0) +.DoMailEntry: call JoyTextDelay ld a, [wJumptableIndex] bit 7, a @@ -1103,7 +1065,7 @@ INCBIN "gfx/icons/mail_big.2bpp" scf ret -.Update: ; 11feb (4:5feb) +.Update: xor a ld [hBGMapMode], a hlcoord 1, 1 @@ -1119,7 +1081,7 @@ INCBIN "gfx/icons/mail_big.2bpp" ld [hBGMapMode], a ret -.DoJumptable: ; 12008 (4:6008) +.DoJumptable: ld a, [wJumptableIndex] ld e, a ld d, 0 @@ -1131,11 +1093,11 @@ INCBIN "gfx/icons/mail_big.2bpp" ld l, a jp hl -.Jumptable: ; 12017 (4:6017) +.Jumptable: dw .init_blinking_cursor dw .process_joypad -.init_blinking_cursor ; 1201b (4:601b) +.init_blinking_cursor depixel 9, 2 ld a, SPRITE_ANIM_INDEX_COMPOSE_MAIL_CURSOR call _InitSpriteAnimStruct @@ -1153,7 +1115,7 @@ INCBIN "gfx/icons/mail_big.2bpp" inc [hl] ret -.process_joypad ; 1203a (4:603a) +.process_joypad ld hl, hJoyPressed ; $ffa7 ld a, [hl] and A_BUTTON @@ -1240,7 +1202,7 @@ INCBIN "gfx/icons/mail_big.2bpp" ; called from engine/sprite_anims.asm -ComposeMail_AnimateCursor: ; 120c1 (4:60c1) +ComposeMail_AnimateCursor: call .GetDPad ld hl, SPRITEANIMSTRUCT_0D add hl, bc @@ -1274,17 +1236,15 @@ ComposeMail_AnimateCursor: ; 120c1 (4:60c1) ld [hl], a ret -; 120f8 (4:60f8) -.LetterEntries: ; 120f8 +.LetterEntries: db $00, $10, $20, $30, $40, $50, $60, $70, $80, $90 -.CaseDelEnd: ; 12102 +.CaseDelEnd: db $00, $00, $00, $30, $30, $30, $60, $60, $60, $60 -; 1210c -.GetDPad: ; 1210c (4:610c) +.GetDPad: ld hl, hJoyLast ld a, [hl] and D_UP @@ -1386,13 +1346,13 @@ ComposeMail_AnimateCursor: ; 120c1 (4:60c1) ld [hl], $5 ret -NamingScreen_PressedA_GetCursorCommand: ; 12185 (4:6185) +NamingScreen_PressedA_GetCursorCommand: ld hl, wNamingScreenCursorObjectPointer ld c, [hl] inc hl ld b, [hl] -ComposeMail_GetCursorPosition: ; 1218b (4:618b) +ComposeMail_GetCursorPosition: ld hl, SPRITEANIMSTRUCT_0D add hl, bc ld a, [hl] @@ -1420,11 +1380,10 @@ ComposeMail_GetCursorPosition: ; 1218b (4:618b) xor a ret -MailComposition_TryAddLastCharacter: ; 121ac (4:61ac) +MailComposition_TryAddLastCharacter: ld a, [wNamingScreenLastCharacter] jp MailComposition_TryAddCharacter -; 121b2 (4:61b2) ; unused ld a, [wNamingScreenCurrNameLength] @@ -1460,8 +1419,6 @@ MailComposition_TryAddLastCharacter: ; 121ac (4:61ac) ld a, [hl] jp NamingScreen_LoadNextCharacter -; 121dd INCLUDE "data/text/mail_input_chars.asm" -; 122c1 |