diff options
Diffstat (limited to 'src/naming_screen.c')
-rw-r--r-- | src/naming_screen.c | 211 |
1 files changed, 172 insertions, 39 deletions
diff --git a/src/naming_screen.c b/src/naming_screen.c index a282b728a..68eeded91 100644 --- a/src/naming_screen.c +++ b/src/naming_screen.c @@ -54,7 +54,7 @@ static const u8 *const sTransferredToPCMessages[] = gText_PkmnTransferredLanettesPCBoxFull }; -static const u8 gUnknown_0858BDC8[] = _("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz!"); +static const u8 sText_AlphabetUpperLower[] = _("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz!"); static const struct BgTemplate gUnknown_0858BE00[] = { @@ -221,7 +221,7 @@ static void NamingScreen_TurnOffScreen(void); static void NamingScreen_InitDisplayMode(void); static void VBlankCB_NamingScreen(void); static void sub_80E501C(void); -static bool8 sub_80E503C(u8); +static bool8 IsLetter(u8); void DoNamingScreen(u8 templateNum, u8 *destBuffer, u16 monSpecies, u16 monGender, u32 monPersonality, MainCallback returnCallback) { @@ -913,7 +913,7 @@ static void CursorInit(void) gNamingScreenData->cursorSpriteId = CreateSprite(&gUnknown_0858C138, 38, 88, 1); sub_80E3E3C(1); gSprites[gNamingScreenData->cursorSpriteId].oam.priority = 1; - gSprites[gNamingScreenData->cursorSpriteId].oam.objMode = 1; + gSprites[gNamingScreenData->cursorSpriteId].oam.objMode = ST_OAM_OBJ_BLEND; gSprites[gNamingScreenData->cursorSpriteId].data[6] = 1; gSprites[gNamingScreenData->cursorSpriteId].data[6] = 2; SetCursorPos(0, 0); @@ -1526,8 +1526,8 @@ static void TaskDummy3(void) static const u8 sGenderColors[2][3] = { - {0, 9, 8}, - {0, 5, 4} + {TEXT_COLOR_TRANSPARENT, TEXT_COLOR_LIGHT_BLUE, TEXT_COLOR_BLUE}, + {TEXT_COLOR_TRANSPARENT, TEXT_COLOR_LIGHT_RED, TEXT_COLOR_RED} }; static void sub_80E49BC(void) @@ -1679,7 +1679,7 @@ static void sub_80E4D10(void) { temp[0] = gNamingScreenData->textBuffer[i]; temp[1] = gText_ExpandedPlaceholder_Empty[0]; - unk2 = (sub_80E503C(temp[0]) == 1) ? 2 : 0; + unk2 = (IsLetter(temp[0]) == TRUE) ? 2 : 0; AddTextPrinterParameterized(gNamingScreenData->windows[2], 1, temp, i * 8 + unk + unk2, 1, 0xFF, NULL); } @@ -1689,17 +1689,17 @@ static void sub_80E4D10(void) PutWindowTilemap(gNamingScreenData->windows[2]); } -struct TextColorThing // needed because of alignment... it's so stupid +struct TextColor // Needed because of alignment { u8 colors[3][4]; }; -static const struct TextColorThing sUnkColorStruct = +static const struct TextColor sTextColorStruct = { { - {13, 1, 2}, - {14, 1, 2}, - {15, 1, 2} + {TEXT_DYNAMIC_COLOR_4, TEXT_COLOR_WHITE, TEXT_COLOR_DARK_GREY}, + {TEXT_DYNAMIC_COLOR_5, TEXT_COLOR_WHITE, TEXT_COLOR_DARK_GREY}, + {TEXT_DYNAMIC_COLOR_6, TEXT_COLOR_WHITE, TEXT_COLOR_DARK_GREY} } }; @@ -1710,11 +1710,11 @@ static const u8 sFillValues[KBPAGE_COUNT] = [KBPAGE_SYMBOLS] = PIXEL_FILL(0xF) }; -static const u8 *const sUnkColors[KBPAGE_COUNT] = +static const u8 *const sKeyboardTextColors[KBPAGE_COUNT] = { - [KBPAGE_LETTERS_LOWER] = sUnkColorStruct.colors[1], - [KBPAGE_LETTERS_UPPER] = sUnkColorStruct.colors[0], - [KBPAGE_SYMBOLS] = sUnkColorStruct.colors[2] + [KBPAGE_LETTERS_LOWER] = sTextColorStruct.colors[1], + [KBPAGE_LETTERS_UPPER] = sTextColorStruct.colors[0], + [KBPAGE_SYMBOLS] = sTextColorStruct.colors[2] }; static void sub_80E4DE4(u8 window, u8 page) @@ -1725,7 +1725,7 @@ static void sub_80E4DE4(u8 window, u8 page) for (i = 0; i < KBROW_COUNT; i++) { - AddTextPrinterParameterized3(window, 1, 0, i * 16 + 1, sUnkColors[page], 0, sNamingScreenKeyboardText[page][i]); + AddTextPrinterParameterized3(window, 1, 0, i * 16 + 1, sKeyboardTextColors[page], 0, sNamingScreenKeyboardText[page][i]); } PutWindowTilemap(window); @@ -1767,7 +1767,7 @@ static void sub_80E4E5C(void) static void sub_80E4EF0(void) { - const u8 color[3] = { 15, 1, 2 }; + const u8 color[3] = { TEXT_DYNAMIC_COLOR_6, TEXT_COLOR_WHITE, TEXT_COLOR_DARK_GREY }; FillWindowPixelBuffer(gNamingScreenData->windows[4], PIXEL_FILL(15)); AddTextPrinterParameterized3(gNamingScreenData->windows[4], 0, 2, 1, color, 0, gText_MoveOkBack); @@ -1815,13 +1815,13 @@ static void sub_80E501C(void) ShowBg(3); } -static bool8 sub_80E503C(u8 character) +static bool8 IsLetter(u8 character) { u8 i; - for (i = 0; gUnknown_0858BDC8[i] != EOS; i++) + for (i = 0; sText_AlphabetUpperLower[i] != EOS; i++) { - if (character == gUnknown_0858BDC8[i]) + if (character == sText_AlphabetUpperLower[i]) return FALSE; } return FALSE; @@ -1948,37 +1948,170 @@ const struct OamData gOamData_858BFFC = static const struct Subsprite gUnknown_0858C004[] = { - {-20, -16, 1, 1, 0, 1}, - { 12, -16, 0, 0, 4, 1}, - {-20, -8, 1, 1, 5, 1}, - { 12, -8, 0, 0, 9, 1}, - {-20, 0, 1, 1, 10, 1}, - { 12, 0, 0, 0, 14, 1}, - {-20, 8, 1, 1, 15, 1}, - { 12, 8, 0, 0, 19, 1} + { + .x = -20, + .y = -16, + .shape = SPRITE_SHAPE(32x8), + .size = SPRITE_SIZE(32x8), + .tileOffset = 0, + .priority = 1 + }, + { + .x = 12, + .y = -16, + .shape = SPRITE_SHAPE(8x8), + .size = SPRITE_SIZE(8x8), + .tileOffset = 4, + .priority = 1 + }, + { + .x = -20, + .y = -8, + .shape = SPRITE_SHAPE(32x8), + .size = SPRITE_SIZE(32x8), + .tileOffset = 5, + .priority = 1 + }, + { + .x = 12, + .y = -8, + .shape = SPRITE_SHAPE(8x8), + .size = SPRITE_SIZE(8x8), + .tileOffset = 9, + .priority = 1 + }, + { + .x = -20, + .y = 0, + .shape = SPRITE_SHAPE(32x8), + .size = SPRITE_SIZE(32x8), + .tileOffset = 10, + .priority = 1 + }, + { + .x = 12, + .y = 0, + .shape = SPRITE_SHAPE(8x8), + .size = SPRITE_SIZE(8x8), + .tileOffset = 14, + .priority = 1 + }, + { + .x = -20, + .y = 8, + .shape = SPRITE_SHAPE(32x8), + .size = SPRITE_SIZE(32x8), + .tileOffset = 15, + .priority = 1 + }, + { + .x = 12, + .y = 8, + .shape = SPRITE_SHAPE(8x8), + .size = SPRITE_SIZE(8x8), + .tileOffset = 19, + .priority = 1 + } }; static const struct Subsprite gUnknown_0858C024[] = { - {-12, -4, 1, 0, 0, 1}, - { 4, -4, 0, 0, 2, 1} + { + .x = -12, + .y = -4, + .shape = SPRITE_SHAPE(16x8), + .size = SPRITE_SIZE(16x8), + .tileOffset = 0, + .priority = 1 + }, + { + .x = 4, + .y = -4, + .shape = SPRITE_SHAPE(8x8), + .size = SPRITE_SIZE(8x8), + .tileOffset = 2, + .priority = 1 + } }; static const struct Subsprite gUnknown_0858C02C[] = { - {-20, -12, 1, 1, 0, 1}, - { 12, -12, 0, 0, 4, 1}, - {-20, -4, 1, 1, 5, 1}, - { 12, -4, 0, 0, 9, 1}, - {-20, 4, 1, 1, 10, 1}, - { 12, 4, 0, 0, 14, 1} + { + .x = -20, + .y = -12, + .shape = SPRITE_SHAPE(32x8), + .size = SPRITE_SIZE(32x8), + .tileOffset = 0, + .priority = 1 + }, + { + .x = 12, + .y = -12, + .shape = SPRITE_SHAPE(8x8), + .size = SPRITE_SIZE(8x8), + .tileOffset = 4, + .priority = 1 + }, + { + .x = -20, + .y = -4, + .shape = SPRITE_SHAPE(32x8), + .size = SPRITE_SIZE(32x8), + .tileOffset = 5, + .priority = 1 + }, + { + .x = 12, + .y = -4, + .shape = SPRITE_SHAPE(8x8), + .size = SPRITE_SIZE(8x8), + .tileOffset = 9, + .priority = 1 + }, + { + .x = -20, + .y = 4, + .shape = SPRITE_SHAPE(32x8), + .size = SPRITE_SIZE(32x8), + .tileOffset = 10, + .priority = 1 + }, + { + .x = 12, + .y = 4, + .shape = SPRITE_SHAPE(8x8), + .size = SPRITE_SIZE(8x8), + .tileOffset = 14, + .priority = 1 + } }; static const struct Subsprite gUnknown_0858C044[] = { - {-8, -12, 1, 0, 0, 3}, - {-8, -4, 1, 0, 2, 3}, - {-8, 4, 1, 0, 4, 3} + { + .x = -8, + .y = -12, + .shape = SPRITE_SHAPE(16x8), + .size = SPRITE_SIZE(16x8), + .tileOffset = 0, + .priority = 3 + }, + { + .x = -8, + .y = -4, + .shape = SPRITE_SHAPE(16x8), + .size = SPRITE_SIZE(16x8), + .tileOffset = 2, + .priority = 3 + }, + { + .x = -8, + .y = 4, + .shape = SPRITE_SHAPE(16x8), + .size = SPRITE_SIZE(16x8), + .tileOffset = 4, + .priority = 3 + } }; static const struct SubspriteTable gUnknown_0858C050[] = |