diff options
Diffstat (limited to 'src/engine/naming_screen.c')
-rw-r--r-- | src/engine/naming_screen.c | 65 |
1 files changed, 21 insertions, 44 deletions
diff --git a/src/engine/naming_screen.c b/src/engine/naming_screen.c index 440504d5a..ca77c5483 100644 --- a/src/engine/naming_screen.c +++ b/src/engine/naming_screen.c @@ -26,8 +26,6 @@ #define COLUMN_COUNT 10 #endif -extern u16 gKeyRepeatStartDelay; - extern u8 CreateMonIcon(u16 species, void (*callback)(struct Sprite *), s16 x, s16 y, u8 subpriority, u32 personality); const u8 gSpriteImage_83CE094[] = INCBIN_U8("graphics/naming_screen/pc_icon/0.4bpp"); @@ -258,20 +256,7 @@ static void NamingScreen_InitDisplayMode(void) static void NamingScreen_ClearVram(void) { - u8 *addr = (void *)VRAM; - u32 size = 0x10000; - - while (1) - { - DmaFill16(3, 0, addr, 0x1000); - addr += 0x1000; - size -= 0x1000; - if (size <= 0x1000) - { - DmaFill16(3, 0, addr, size); - break; - } - } + DmaFill16Large(3, 0, (void *)VRAM, 0x10000, 0x1000); } static void NamingScreen_ClearOam(void) @@ -325,8 +310,8 @@ static void NamingScreen_Init(void) static void NamingScreen_SetUpWindow(void) { - SetUpWindowConfig(&gWindowConfig_81E6E88); - InitMenuWindow(&gWindowConfig_81E6E88); + Text_LoadWindowTemplate(&gWindowTemplate_81E6E88); + InitMenuWindow(&gWindowTemplate_81E6E88); } static void NamingScreen_ResetObjects(void) @@ -503,7 +488,7 @@ static bool8 MainState_6(struct Task *task) static bool8 MainState_UpdateSentToPCMessage(struct Task *task) { - if (MenuUpdateWindowText()) + if (Menu_UpdateWindowText()) namingScreenDataPtr->state++; return FALSE; } @@ -1610,8 +1595,8 @@ static void DisplaySentToPCMessage(void) { StringCopy(gStringVar1, namingScreenDataPtr->destBuffer); StringExpandPlaceholders(gStringVar4, gOtherText_SentToPC); - BasicInitMenuWindow(&gWindowConfig_81E6E88); - MenuDisplayMessageBox(); + BasicInitMenuWindow(&gWindowTemplate_81E6E88); + Menu_DisplayDialogueFrame(); MenuPrintMessageDefaultCoords(gStringVar4); } @@ -1629,16 +1614,8 @@ static void sub_80B7558(void) static void sub_80B7568(void) { - const void *src; - void *dst; - - src = gNamingScreenMenu_Gfx; - dst = (void *)(VRAM + gMenuMessageBoxContentTileOffset * 32); - DmaCopy16(3, src, dst, 0x800); - - src = gNamingScreenMenu_Gfx; - dst = (void *)(VRAM + 0x8000 + gMenuMessageBoxContentTileOffset * 32); - DmaCopy16(3, src, dst, 0x800); + DmaCopy16Defvars(3, gNamingScreenMenu_Gfx, (void *)(VRAM + gMenuMessageBoxContentTileOffset * 32), 0x800); + DmaCopy16Defvars(3, gNamingScreenMenu_Gfx, (void *)(VRAM + 0x8000 + gMenuMessageBoxContentTileOffset * 32), 0x800); } static void sub_80B75B0(void) @@ -1757,19 +1734,19 @@ static void (*const gUnknown_083CE310[][2])(void) = sub_80B7844, }; -static const struct WindowConfig *const gUnknown_083CE328[][2][2] = +static const struct WindowTemplate *const gUnknown_083CE328[][2][2] = { { - {&gWindowConfig_81E6EDC, &gWindowConfig_81E6EF8}, - {&gWindowConfig_81E6EA4, &gWindowConfig_81E6EC0}, + {&gWindowTemplate_81E6EDC, &gWindowTemplate_81E6EF8}, + {&gWindowTemplate_81E6EA4, &gWindowTemplate_81E6EC0}, }, { - {&gWindowConfig_81E6EA4, &gWindowConfig_81E6EC0}, - {&gWindowConfig_81E6F14, &gWindowConfig_81E6F30}, + {&gWindowTemplate_81E6EA4, &gWindowTemplate_81E6EC0}, + {&gWindowTemplate_81E6F14, &gWindowTemplate_81E6F30}, }, { - {&gWindowConfig_81E6F14, &gWindowConfig_81E6F30}, - {&gWindowConfig_81E6EDC, &gWindowConfig_81E6EF8}, + {&gWindowTemplate_81E6F14, &gWindowTemplate_81E6F30}, + {&gWindowTemplate_81E6EDC, &gWindowTemplate_81E6EF8}, }, }; @@ -1838,15 +1815,15 @@ static void PrintKeyboardCharacters(u8 page) //print letters on page s16 r5; for (i = 0, r5 = 9; i < 4; i++, r5 += 2) - MenuPrint(sKeyboardCharacters[page][i], 3, r5); + Menu_PrintText(sKeyboardCharacters[page][i], 3, r5); } static void sub_80B78A8(void) { - BasicInitMenuWindow(&gWindowConfig_81E6F4C); + BasicInitMenuWindow(&gWindowTemplate_81E6F4C); gUnknown_083CE358[namingScreenDataPtr->templateNum](); gUnknown_083CE368[namingScreenDataPtr->template->unk3](); - MenuPrint(namingScreenDataPtr->template->title, 9, 2); + Menu_PrintText(namingScreenDataPtr->template->title, 9, 2); } static void nullsub_61(void) @@ -1870,7 +1847,7 @@ static void sub_80B7924(void) { if ((s16)namingScreenDataPtr->unk40 == MON_FEMALE) genderSymbol[0] = 0xB6; //female symbol - MenuPrint(genderSymbol, 0x14, 4); + Menu_PrintText(genderSymbol, 0x14, 4); } } @@ -1886,8 +1863,8 @@ static void sub_80B7960(void) string[5] = 1; string += 6; StringCopy(string, namingScreenDataPtr->textBuffer); - BasicInitMenuWindow(&gWindowConfig_81E6F4C); - MenuPrint(gStringVar1, namingScreenDataPtr->unk2, 4); + BasicInitMenuWindow(&gWindowTemplate_81E6F4C); + Menu_PrintText(gStringVar1, namingScreenDataPtr->unk2, 4); } //-------------------------------------------------- |