diff options
101 files changed, 2577 insertions, 2484 deletions
diff --git a/asm/battle_1.s b/asm/battle_1.s index f0a883ec4..da604c6b6 100644 --- a/asm/battle_1.s +++ b/asm/battle_1.s @@ -448,16 +448,16 @@ _0800D748: .4byte 0x0000bf40 sub_800D74C: @ 800D74C push {r4,lr} movs r0, 0x12 - bl SetTextWindowBaseTileNum + bl TextWindow_SetBaseTileNum ldr r4, _0800D79C @ =gUnknown_03004210 adds r0, r4, 0 movs r1, 0x1 - bl LoadTextWindowGraphics_OverridePalSlot + bl TextWindow_LoadStdFrameGraphicsOverridePal movs r0, 0x22 - bl SetTextWindowBaseTileNum + bl TextWindow_SetBaseTileNum adds r0, r4, 0 movs r1, 0x1 - bl LoadTextWindowGraphics_OverridePalSlot + bl TextWindow_LoadStdFrameGraphicsOverridePal ldr r3, _0800D7A0 @ =gPlttBufferUnfaded adds r0, r3, 0 adds r0, 0xB8 @@ -1055,9 +1055,9 @@ _0800DE88: str r0, [sp, 0x4] adds r0, r1, 0 adds r1, r7, 0 - bl sub_8002E4C + bl Text_InitWindow8002E4C ldr r0, [sp, 0xC] - bl sub_8002F44 + bl Text_PrintWindow8002F44 ldr r2, _0800DEDC @ =gUnknown_081F9680 + 0x8 adds r4, r2 ldr r2, [r4] @@ -1111,9 +1111,9 @@ _0800DF04: movs r5, 0x1 str r5, [sp, 0x4] adds r0, r4, 0 - bl sub_8002E4C + bl Text_InitWindow8002E4C adds r0, r4, 0 - bl sub_8002F44 + bl Text_PrintWindow8002F44 mov r0, r8 ldr r2, [r0, 0x38] mov r0, r9 @@ -1134,9 +1134,9 @@ _0800DF04: str r0, [sp] str r5, [sp, 0x4] adds r0, r4, 0 - bl sub_8002E4C + bl Text_InitWindow8002E4C adds r0, r4, 0 - bl sub_8002F44 + bl Text_PrintWindow8002F44 mov r5, r8 ldr r2, [r5, 0x44] mov r0, r9 diff --git a/asm/contest_link_80C2020.s b/asm/contest_link_80C2020.s index 608daba87..71788c918 100644 --- a/asm/contest_link_80C2020.s +++ b/asm/contest_link_80C2020.s @@ -12,12 +12,12 @@ sub_80C2020: @ 80C2020 lsls r5, 19 movs r0, 0x40 strh r0, [r5] - ldr r4, _080C20F0 @ =gWindowConfig_81E6FA0 + ldr r4, _080C20F0 @ =gWindowTemplate_81E6FA0 adds r0, r4, 0 - bl SetUpWindowConfig + bl Text_LoadWindowTemplate ldr r0, _080C20F4 @ =gMenuWindow adds r1, r4, 0 - bl InitWindowFromConfig + bl Text_InitWindowWithTemplate ldr r1, _080C20F8 @ =REG_BG0CNT movs r2, 0xF8 lsls r2, 6 @@ -110,7 +110,7 @@ sub_80C2020: @ 80C2020 pop {r0} bx r0 .align 2, 0 -_080C20F0: .4byte gWindowConfig_81E6FA0 +_080C20F0: .4byte gWindowTemplate_81E6FA0 _080C20F4: .4byte gMenuWindow _080C20F8: .4byte REG_BG0CNT _080C20FC: .4byte 0x00001803 @@ -188,7 +188,7 @@ _080C2162: lsls r2, 2 movs r1, 0 bl LoadCompressedPalette - ldr r0, _080C2234 @ =gWindowConfig_81E6FA0 + ldr r0, _080C2234 @ =gWindowTemplate_81E6FA0 bl LoadFontDefaultPalette movs r6, 0 _080C21C0: @@ -242,7 +242,7 @@ _080C2224: .4byte 0x0600e000 _080C2228: .4byte gUnknown_08D1A250 _080C222C: .4byte 0x0600f000 _080C2230: .4byte gUnknown_08D1A618 -_080C2234: .4byte gWindowConfig_81E6FA0 +_080C2234: .4byte gWindowTemplate_81E6FA0 _080C2238: .4byte 0x000060b2 _080C223C: .4byte 0x000060a4 _080C2240: @@ -357,7 +357,7 @@ _080C230A: lsrs r3, 24 str r3, [sp] movs r3, 0x7 - bl sub_8003460 + bl Text_InitWindowAndPrintText add sp, 0x4 pop {r4-r7} pop {r0} @@ -2170,7 +2170,7 @@ sub_80C3158: @ 80C3158 lsls r0, 22 lsrs r0, 22 strh r0, [r4, 0x6] - ldr r1, _080C32C4 @ =gWindowConfig_81E7278 + ldr r1, _080C32C4 @ =gWindowTemplate_81E7278 mov r8, r1 ldr r7, _080C32C8 @ =0x06010000 ldr r2, _080C32CC @ =0x040000d4 @@ -2194,7 +2194,7 @@ _080C31CE: bge _080C31CE mov r0, r8 mov r1, r9 - bl GetStringWidthGivenWindowConfig + bl Text_GetStringWidthFromWindowTemplate lsls r0, 24 lsrs r5, r0, 24 ldr r2, _080C32D4 @ =gDisplayedStringBattle @@ -2296,7 +2296,7 @@ _080C32B2: b _080C3322 .align 2, 0 _080C32C0: .4byte gSprites -_080C32C4: .4byte gWindowConfig_81E7278 +_080C32C4: .4byte gWindowTemplate_81E7278 _080C32C8: .4byte 0x06010000 _080C32CC: .4byte 0x040000d4 _080C32D0: .4byte 0x85000100 diff --git a/asm/pokemon_storage_system.s b/asm/pokemon_storage_system.s index 69c6d9e4f..d878821cb 100644 --- a/asm/pokemon_storage_system.s +++ b/asm/pokemon_storage_system.s @@ -539,7 +539,7 @@ StorageSystemClearMessageWindow: @ 8095EA0 movs r1, 0xF movs r2, 0x1B movs r3, 0x12 - bl MenuFillWindowRectWithBlankTile + bl Menu_BlankWindowRect pop {r0} bx r0 thumb_func_end StorageSystemClearMessageWindow @@ -578,7 +578,7 @@ _08095EE0: _08095EF4: ldrb r0, [r4, 0xA] bl StorageSystemCreatePrimaryMenu - bl MenuDisplayMessageBox + bl Menu_DisplayDialogueFrame ldr r1, _08095F18 @ =gUnknown_083B600C movs r2, 0xA ldrsh r0, [r4, r2] @@ -588,7 +588,7 @@ _08095EF4: ldr r0, [r0] movs r1, 0x2 movs r2, 0xF - bl MenuPrint + bl Menu_PrintText b _08095F28 .align 2, 0 _08095F18: .4byte gUnknown_083B600C @@ -604,7 +604,7 @@ _08095F28: strh r0, [r4, 0x8] b _080960F4 _08095F30: - bl ProcessMenuInput + bl Menu_ProcessInput lsls r0, 24 asrs r0, 24 strh r0, [r4, 0xC] @@ -676,18 +676,18 @@ _08095FA2: ldr r0, [r1] movs r1, 0x2 movs r2, 0xF - bl MenuPrint + bl Menu_PrintText b _080960F4 .align 2, 0 _08095FC0: .4byte gMain _08095FC4: .4byte gUnknown_083B600C _08095FC8: - bl HandleDestroyMenuCursors + bl Menu_DestroyCursor movs r0, 0 movs r1, 0 movs r2, 0xD movs r3, 0x9 - bl MenuZeroFillWindowRect + bl Menu_EraseWindowRect bl ScriptContext2_Disable bl EnableBothScriptContexts adds r0, r5, 0 @@ -723,7 +723,7 @@ _08096008: _08096022: movs r1, 0x2 movs r2, 0xF - bl MenuPrint + bl Menu_PrintText movs r0, 0x3 strh r0, [r4, 0x8] b _080960F4 @@ -760,8 +760,8 @@ _08096042: _0809606A: movs r0, 0x1 negs r0, r0 - bl MoveMenuCursor - bl GetMenuCursorPos + bl Menu_MoveCursor + bl Menu_GetCursorPos lsls r0, 24 lsrs r0, 24 strh r0, [r4, 0xA] @@ -788,8 +788,8 @@ _08096090: strh r2, [r4, 0xA] _080960A8: movs r0, 0x1 - bl MoveMenuCursor - bl GetMenuCursorPos + bl Menu_MoveCursor + bl Menu_GetCursorPos lsls r0, 24 lsrs r0, 24 strh r0, [r4, 0xA] @@ -805,7 +805,7 @@ _080960C2: ldr r0, [r0] movs r1, 0x2 movs r2, 0xF - bl MenuPrint + bl Menu_PrintText movs r0, 0x2 strh r0, [r4, 0x8] b _080960F4 @@ -892,12 +892,12 @@ StorageSystemCreatePrimaryMenu: @ 8096168 movs r1, 0 movs r2, 0xD movs r3, 0x9 - bl MenuDrawTextWindow + bl Menu_DrawStdWindowFrame ldr r3, _080961A4 @ =gUnknown_083B600C movs r0, 0x1 movs r1, 0x1 movs r2, 0x4 - bl PrintMenuItems + bl Menu_PrintItems str r4, [sp] movs r0, 0xC str r0, [sp, 0x4] @@ -1640,10 +1640,10 @@ sub_80966F4: @ 80966F4 ldr r0, _08096778 @ =0x81000200 str r0, [r4, 0x8] ldr r0, [r4, 0x8] - ldr r0, _0809677C @ =gWindowConfig_81E6D38 + ldr r0, _0809677C @ =gWindowTemplate_81E6D38 adds r1, r5, 0 mov r2, r8 - bl sub_8004E3C + bl Text_InitWindow8004E3C str r5, [r4] str r6, [r4, 0x4] ldr r0, _08096780 @ =0x80000200 @@ -1662,7 +1662,7 @@ _0809676C: .4byte gUnknown_083B6DB8 _08096770: .4byte 0x00001111 _08096774: .4byte 0x040000d4 _08096778: .4byte 0x81000200 -_0809677C: .4byte gWindowConfig_81E6D38 +_0809677C: .4byte gWindowTemplate_81E6D38 _08096780: .4byte 0x80000200 thumb_func_end sub_80966F4 @@ -1846,18 +1846,18 @@ _080968D4: bl sub_8096804 b _0809697A _080968E8: - ldr r0, _080968F0 @ =gWindowConfig_81E6D00 - bl SetUpWindowConfig + ldr r0, _080968F0 @ =gWindowTemplate_81E6D00 + bl Text_LoadWindowTemplate b _0809697A .align 2, 0 -_080968F0: .4byte gWindowConfig_81E6D00 +_080968F0: .4byte gWindowTemplate_81E6D00 _080968F4: - ldr r0, _08096900 @ =gWindowConfig_81E6D00 + ldr r0, _08096900 @ =gWindowTemplate_81E6D00 bl InitMenuWindow - bl MenuZeroFillScreen + bl Menu_EraseScreen b _0809697A .align 2, 0 -_08096900: .4byte gWindowConfig_81E6D00 +_08096900: .4byte gWindowTemplate_81E6D00 _08096904: bl sub_80967DC bl sub_8096848 @@ -1985,18 +1985,18 @@ _08096A28: .4byte gSharedMem _08096A2C: .4byte gUnknown_0203847D _08096A30: .4byte gUnknown_0203847F _08096A34: - ldr r0, _08096A3C @ =gWindowConfig_81E6D00 - bl SetUpWindowConfig + ldr r0, _08096A3C @ =gWindowTemplate_81E6D00 + bl Text_LoadWindowTemplate b _08096AD8 .align 2, 0 -_08096A3C: .4byte gWindowConfig_81E6D00 +_08096A3C: .4byte gWindowTemplate_81E6D00 _08096A40: - ldr r0, _08096A4C @ =gWindowConfig_81E6D00 + ldr r0, _08096A4C @ =gWindowTemplate_81E6D00 bl InitMenuWindow - bl MenuZeroFillScreen + bl Menu_EraseScreen b _08096AD8 .align 2, 0 -_08096A4C: .4byte gWindowConfig_81E6D00 +_08096A4C: .4byte gWindowTemplate_81E6D00 _08096A50: bl sub_80967DC b _08096AD8 @@ -3370,7 +3370,7 @@ _080975EC: adds r0, 0x1 strb r0, [r1, 0x4] _08097600: - bl ProcessMenuInputNoWrap + bl Menu_ProcessInputNoWrap lsls r0, 24 asrs r1, r0, 24 cmp r1, 0 @@ -4113,7 +4113,7 @@ _08097C18: .align 2, 0 _08097C28: .4byte gMain _08097C2C: - bl ProcessMenuInputNoWrap + bl Menu_ProcessInputNoWrap lsls r0, 24 asrs r1, r0, 24 cmp r1, 0 @@ -4247,7 +4247,7 @@ _08097D38: .align 2, 0 _08097D48: .4byte gMain _08097D4C: - bl ProcessMenuInputNoWrap + bl Menu_ProcessInputNoWrap lsls r0, 24 asrs r1, r0, 24 cmp r1, 0 @@ -4940,27 +4940,27 @@ _08098302: movs r1, 0xB movs r2, 0x9 movs r3, 0x11 - bl MenuZeroFillWindowRect + bl Menu_EraseWindowRect ldr r4, _0809834C @ =gSharedMem + 0x127A adds r0, r4, 0 movs r1, 0x1 movs r2, 0x10 - bl MenuPrint + bl Menu_PrintText adds r0, r4, 0 subs r0, 0x6B movs r1, 0x1 movs r2, 0xB - bl MenuPrint + bl Menu_PrintText adds r0, r4, 0 subs r0, 0x46 movs r1, 0 movs r2, 0xD - bl MenuPrint + bl Menu_PrintText subs r4, 0x21 adds r0, r4, 0 movs r1, 0x1 movs r2, 0xF - bl MenuPrint + bl Menu_PrintText pop {r4} pop {r0} bx r0 @@ -5657,7 +5657,7 @@ sub_8098A38: @ 8098A38 lsls r4, 24 asrs r4, 24 adds r0, r4, 0 - bl MoveMenuCursor + bl Menu_MoveCursor pop {r4} pop {r0} bx r0 @@ -5666,17 +5666,17 @@ sub_8098A38: @ 8098A38 thumb_func_start sub_8098A5C sub_8098A5C: @ 8098A5C push {lr} - bl HandleDestroyMenuCursors + bl Menu_DestroyCursor movs r0, 0xA movs r1, 0x10 movs r2, 0x1D movs r3, 0x13 - bl MenuZeroFillWindowRect + bl Menu_EraseWindowRect movs r0, 0x17 movs r1, 0xA movs r2, 0x1D movs r3, 0xF - bl MenuZeroFillWindowRect + bl Menu_EraseWindowRect pop {r0} bx r0 thumb_func_end sub_8098A5C @@ -8745,10 +8745,10 @@ sub_809A1BC: @ 809A1BC ldr r0, _0809A230 @ =0x81000100 str r0, [r4, 0x8] ldr r0, [r4, 0x8] - ldr r0, _0809A234 @ =gWindowConfig_81E6D38 + ldr r0, _0809A234 @ =gWindowTemplate_81E6D38 adds r1, r5, 0 str r3, [sp, 0x4] - bl sub_8004E3C + bl Text_InitWindow8004E3C str r5, [r4] ldr r3, [sp, 0x4] str r3, [r4, 0x4] @@ -8785,7 +8785,7 @@ sub_809A1BC: @ 809A1BC _0809A228: .4byte gUnknown_083B6DB8 _0809A22C: .4byte 0x040000d4 _0809A230: .4byte 0x81000100 -_0809A234: .4byte gWindowConfig_81E6D38 +_0809A234: .4byte gWindowTemplate_81E6D38 _0809A238: .4byte 0x80000040 thumb_func_end sub_809A1BC @@ -14483,7 +14483,7 @@ sub_809CE84: @ 809CE84 ldrb r1, [r6] movs r2, 0x1D movs r3, 0xF - bl MenuDrawTextWindow + bl Menu_DrawStdWindowFrame ldrb r0, [r5] adds r0, 0x1 lsls r0, 24 @@ -14498,7 +14498,7 @@ sub_809CE84: @ 809CE84 lsls r3, 5 adds r4, r3 adds r3, r4, 0 - bl PrintMenuItems + bl Menu_PrintItems ldrb r1, [r5] adds r1, 0x1 lsls r1, 24 @@ -14559,7 +14559,7 @@ _0809CF52: bl PlaySE movs r0, 0x1 negs r0, r0 - bl MoveMenuCursor + bl Menu_MoveCursor b _0809CF8E .align 2, 0 _0809CF6C: .4byte gMain @@ -14571,10 +14571,10 @@ _0809CF70: movs r0, 0x5 bl PlaySE movs r0, 0x1 - bl MoveMenuCursor + bl Menu_MoveCursor b _0809CF8E _0809CF86: - bl GetMenuCursorPos + bl Menu_GetCursorPos lsls r0, 24 lsrs r5, r0, 24 _0809CF8E: @@ -14582,7 +14582,7 @@ _0809CF8E: negs r0, r0 cmp r5, r0 beq _0809CFB2 - bl HandleDestroyMenuCursors + bl Menu_DestroyCursor ldr r0, _0809CFD0 @ =gUnknown_083B6DB4 ldr r1, [r0] ldr r2, _0809CFD4 @ =0x000011ba @@ -14593,7 +14593,7 @@ _0809CF8E: ldrb r1, [r1] movs r2, 0x1D movs r3, 0xF - bl MenuZeroFillWindowRect + bl Menu_EraseWindowRect _0809CFB2: cmp r5, 0 blt _0809CFC4 diff --git a/asm/pokenav.s b/asm/pokenav.s index 83ceed00f..7c766addc 100644 --- a/asm/pokenav.s +++ b/asm/pokenav.s @@ -229,7 +229,7 @@ _080F07E0: lsrs r1, 16 bl sub_80F445C _080F07F4: - ldr r0, _080F0814 @ =gWindowConfig_81E710C + ldr r0, _080F0814 @ =gWindowTemplate_81E710C bl BasicInitMenuWindow ldr r0, _080F0818 @ =gUnknown_083DFEC4 ldr r0, [r0] @@ -237,13 +237,13 @@ _080F07F4: adds r0, r1 movs r1, 0x1 movs r2, 0x6 - bl MenuPrint + bl Menu_PrintText _080F080A: pop {r0} bx r0 .align 2, 0 _080F0810: .4byte 0x00008788 -_080F0814: .4byte gWindowConfig_81E710C +_080F0814: .4byte gWindowTemplate_81E710C _080F0818: .4byte gUnknown_083DFEC4 thumb_func_end ShowMapNamePopUpWindow @@ -252,7 +252,7 @@ sub_80F081C: @ 80F081C push {r4,r5,lr} lsls r0, 24 lsrs r5, r0, 24 - ldr r0, _080F0838 @ =gWindowConfig_81E710C + ldr r0, _080F0838 @ =gWindowTemplate_81E710C bl BasicInitMenuWindow cmp r5, 0x4 bhi _080F08C6 @@ -262,7 +262,7 @@ sub_80F081C: @ 80F081C ldr r0, [r0] mov pc, r0 .align 2, 0 -_080F0838: .4byte gWindowConfig_81E710C +_080F0838: .4byte gWindowTemplate_81E710C _080F083C: .4byte _080F0840 .align 2, 0 _080F0840: @@ -342,17 +342,17 @@ _080F08E0: .4byte 0x0001869f thumb_func_start sub_80F08E4 sub_80F08E4: @ 80F08E4 push {lr} - ldr r0, _080F08FC @ =gWindowConfig_81E710C + ldr r0, _080F08FC @ =gWindowTemplate_81E710C bl BasicInitMenuWindow movs r0, 0 movs r1, 0x9 movs r2, 0xB movs r3, 0x10 - bl MenuZeroFillWindowRect + bl Menu_EraseWindowRect pop {r0} bx r0 .align 2, 0 -_080F08FC: .4byte gWindowConfig_81E710C +_080F08FC: .4byte gWindowTemplate_81E710C thumb_func_end sub_80F08E4 thumb_func_start sub_80F0900 @@ -376,7 +376,7 @@ sub_80F0900: @ 80F0900 movs r1, 0x1 movs r2, 0x1F movs r3, 0xF - bl MenuZeroFillWindowRect + bl Menu_EraseWindowRect _080F092A: ldrh r0, [r5] lsrs r2, r4, 16 @@ -527,13 +527,13 @@ _080F0A40: adds r0, r4, 0 adds r1, r3, 0 bl sub_80F4428 - ldr r0, _080F0A70 @ =gWindowConfig_81E70D4 + ldr r0, _080F0A70 @ =gWindowTemplate_81E70D4 bl BasicInitMenuWindow lsls r2, r5, 24 lsrs r2, 24 adds r0, r4, 0 movs r1, 0xD - bl MenuPrint + bl Menu_PrintText pop {r4,r5} pop {r0} bx r0 @@ -541,7 +541,7 @@ _080F0A40: _080F0A64: .4byte gUnknown_083DFEC4 _080F0A68: .4byte 0x000087c8 _080F0A6C: .4byte 0x00008788 -_080F0A70: .4byte gWindowConfig_81E70D4 +_080F0A70: .4byte gWindowTemplate_81E70D4 thumb_func_end sub_80F0A24 thumb_func_start sub_80F0A74 @@ -561,13 +561,13 @@ sub_80F0A74: @ 80F0A74 bl sub_80F700C movs r0, 0x1F ands r7, r0 - ldr r0, _080F0AE4 @ =gWindowConfig_81E70D4 + ldr r0, _080F0AE4 @ =gWindowTemplate_81E70D4 bl BasicInitMenuWindow lsls r2, r7, 3 adds r0, r4, 0 movs r1, 0x61 movs r3, 0 - bl MenuPrint_PixelCoords + bl Menu_PrintTextPixelCoords ldr r1, _080F0AE8 @ =0x0000d158 adds r0, r5, r1 ldrh r0, [r0] @@ -597,7 +597,7 @@ sub_80F0A74: @ 80F0A74 .align 2, 0 _080F0ADC: .4byte gUnknown_083DFEC4 _080F0AE0: .4byte 0x00008788 -_080F0AE4: .4byte gWindowConfig_81E70D4 +_080F0AE4: .4byte gWindowTemplate_81E70D4 _080F0AE8: .4byte 0x0000d158 _080F0AEC: .4byte 0x0000ceed _080F0AF0: .4byte 0x0600f000 @@ -688,13 +688,13 @@ _080F0B60: ldrsh r0, [r0, r1] cmp r2, r0 beq _080F0BAA - ldr r0, _080F0BC8 @ =gWindowConfig_81E70D4 + ldr r0, _080F0BC8 @ =gWindowTemplate_81E70D4 bl BasicInitMenuWindow adds r1, r4, 0 adds r3, r1, 0x1 movs r0, 0xC movs r2, 0x1F - bl MenuZeroFillWindowRect + bl Menu_EraseWindowRect _080F0BAA: ldrh r0, [r6] cmp r0, 0 @@ -709,9 +709,9 @@ _080F0BB4: _080F0BBC: .4byte 0x00000306 _080F0BC0: .4byte 0x00008778 _080F0BC4: .4byte 0x0000876c -_080F0BC8: .4byte gWindowConfig_81E70D4 +_080F0BC8: .4byte gWindowTemplate_81E70D4 _080F0BCC: - ldr r0, _080F0C10 @ =gWindowConfig_81E70D4 + ldr r0, _080F0C10 @ =gWindowTemplate_81E70D4 bl BasicInitMenuWindow ldr r1, _080F0C14 @ =0x00008778 adds r0, r5, r1 @@ -726,7 +726,7 @@ _080F0BE2: movs r0, 0xC adds r1, r4, 0 movs r2, 0x1F - bl MenuZeroFillWindowRect + bl Menu_EraseWindowRect adds r4, 0x2 movs r0, 0x1F ands r4, r0 @@ -745,7 +745,7 @@ _080F0BE2: movs r0, 0 b _080F0C22 .align 2, 0 -_080F0C10: .4byte gWindowConfig_81E70D4 +_080F0C10: .4byte gWindowTemplate_81E70D4 _080F0C14: .4byte 0x00008778 _080F0C18: .4byte gUnknown_083DFEC4 _080F0C1C: .4byte 0x0000d15c @@ -804,7 +804,7 @@ _080F0C64: bls _080F0CD0 movs r0, 0 strh r0, [r1] - ldr r0, _080F0CC4 @ =gWindowConfig_81E70D4 + ldr r0, _080F0CC4 @ =gWindowTemplate_81E70D4 bl BasicInitMenuWindow ldr r0, _080F0CC8 @ =0x00008770 adds r1, r4, r0 @@ -835,7 +835,7 @@ _080F0C64: .align 2, 0 _080F0CBC: .4byte 0x00000306 _080F0CC0: .4byte 0x0000ffff -_080F0CC4: .4byte gWindowConfig_81E70D4 +_080F0CC4: .4byte gWindowTemplate_81E70D4 _080F0CC8: .4byte 0x00008770 _080F0CCC: .4byte 0x00008778 _080F0CD0: @@ -942,7 +942,7 @@ _080F0D78: _080F0D8C: movs r0, 0 strh r0, [r1] - ldr r0, _080F0DBC @ =gWindowConfig_81E70D4 + ldr r0, _080F0DBC @ =gWindowTemplate_81E70D4 bl BasicInitMenuWindow ldr r0, _080F0DC0 @ =0x00008778 adds r1, r4, r0 @@ -962,7 +962,7 @@ _080F0D8C: mov pc, r0 .align 2, 0 _080F0DB8: .4byte 0x00000306 -_080F0DBC: .4byte gWindowConfig_81E70D4 +_080F0DBC: .4byte gWindowTemplate_81E70D4 _080F0DC0: .4byte 0x00008778 _080F0DC4: .4byte _080F0DC8 .align 2, 0 @@ -1032,7 +1032,7 @@ _080F0E42: _080F0E54: movs r1, 0x61 movs r3, 0 - bl MenuPrint_PixelCoords + bl Menu_PrintTextPixelCoords b _080F0EA0 .align 2, 0 _080F0E60: .4byte gUnknown_083DFEC4 @@ -1054,7 +1054,7 @@ _080F0E6C: adds r0, r4, 0 movs r1, 0x61 movs r3, 0 - bl MenuPrint_PixelCoords + bl Menu_PrintTextPixelCoords b _080F0D6C .align 2, 0 _080F0E94: .4byte gUnknown_083DFEC4 @@ -1141,13 +1141,13 @@ _080F0F10: adds r4, r0 movs r0, 0x1F ands r4, r0 - ldr r0, _080F0F60 @ =gWindowConfig_81E70D4 + ldr r0, _080F0F60 @ =gWindowTemplate_81E70D4 bl BasicInitMenuWindow adds r3, r4, 0x1 movs r0, 0xC adds r1, r4, 0 movs r2, 0x1F - bl MenuZeroFillWindowRect + bl Menu_EraseWindowRect ldrh r0, [r5] adds r0, 0x1 strh r0, [r5] @@ -1160,7 +1160,7 @@ _080F0F52: .align 2, 0 _080F0F58: .4byte 0x00000306 _080F0F5C: .4byte 0x00008778 -_080F0F60: .4byte gWindowConfig_81E70D4 +_080F0F60: .4byte gWindowTemplate_81E70D4 thumb_func_end sub_80F0EF4 thumb_func_start sub_80F0F64 @@ -1260,7 +1260,7 @@ sub_80F0FFC: @ 80F0FFC adds r0, r5, 0 movs r2, 0 bl GetMapSectionName - ldr r0, _080F1054 @ =gWindowConfig_81E710C + ldr r0, _080F1054 @ =gWindowTemplate_81E710C bl BasicInitMenuWindow adds r0, r5, 0 bl sub_80F19DC @@ -1274,7 +1274,7 @@ sub_80F0FFC: @ 80F0FFC adds r0, r4, 0 movs r1, 0 movs r2, 0x5 - bl MenuPrint + bl Menu_PrintText pop {r4,r5} pop {r0} bx r0 @@ -1282,7 +1282,7 @@ sub_80F0FFC: @ 80F0FFC _080F1048: .4byte gUnknown_083DFEC4 _080F104C: .4byte 0x00008788 _080F1050: .4byte 0x0000ceea -_080F1054: .4byte gWindowConfig_81E710C +_080F1054: .4byte gWindowTemplate_81E710C _080F1058: .4byte 0x0000d138 thumb_func_end sub_80F0FFC @@ -1357,17 +1357,17 @@ _080F10E8: _080F10FC: .4byte gUnknown_083DFEC4 _080F1100: .4byte 0x0000d162 _080F1104: - ldr r0, _080F110C @ =gWindowConfig_81E70B8 - bl SetUpWindowConfig + ldr r0, _080F110C @ =gWindowTemplate_81E70B8 + bl Text_LoadWindowTemplate b _080F1218 .align 2, 0 -_080F110C: .4byte gWindowConfig_81E70B8 +_080F110C: .4byte gWindowTemplate_81E70B8 _080F1110: - ldr r0, _080F1118 @ =gWindowConfig_81E70B8 + ldr r0, _080F1118 @ =gWindowTemplate_81E70B8 bl MultistepInitMenuWindowBegin b _080F1218 .align 2, 0 -_080F1118: .4byte gWindowConfig_81E70B8 +_080F1118: .4byte gWindowTemplate_81E70B8 _080F111C: bl MultistepInitMenuWindowContinue cmp r0, 0 @@ -1376,7 +1376,7 @@ _080F111C: _080F1126: b _080F1226 _080F1128: - bl MenuZeroFillScreen + bl Menu_EraseScreen b _080F1218 _080F112E: bl sub_80F1614 @@ -1761,7 +1761,7 @@ sub_80F1438: @ 80F1438 adds r0, r4, r1 movs r1, 0xD movs r2, 0x1 - bl MenuPrint + bl Menu_PrintText ldr r0, _080F1478 @ =0x00008788 adds r5, r4, r0 ldr r1, _080F147C @ =0x0000876e @@ -1775,7 +1775,7 @@ sub_80F1438: @ 80F1438 adds r0, r5, 0 movs r1, 0x1 movs r2, 0x5 - bl MenuPrint + bl Menu_PrintText pop {r4,r5} pop {r0} bx r0 @@ -1793,7 +1793,7 @@ sub_80F1480: @ 80F1480 movs r1, 0xD movs r2, 0x1B movs r3, 0x10 - bl MenuZeroFillWindowRect + bl Menu_EraseWindowRect pop {r0} bx r0 thumb_func_end sub_80F1480 @@ -1914,11 +1914,11 @@ _080F158A: adds r0, r6, 0 movs r1, 0xC movs r2, 0xD - bl MenuPrint + bl Menu_PrintText adds r0, r7, 0 movs r1, 0xC movs r2, 0xF - bl MenuPrint + bl Menu_PrintText pop {r4-r7} pop {r0} bx r0 @@ -1933,7 +1933,7 @@ sub_80F15A8: @ 80F15A8 movs r1, 0xD movs r2, 0x1B movs r3, 0x10 - bl MenuZeroFillWindowRect + bl Menu_EraseWindowRect ldr r0, _080F1600 @ =gUnknown_083DFEC4 ldr r4, [r0] ldr r0, _080F1604 @ =0x00008788 @@ -1964,7 +1964,7 @@ sub_80F15A8: @ 80F15A8 adds r0, r5, 0 movs r1, 0xC movs r2, 0xD - bl MenuPrint + bl Menu_PrintText pop {r4,r5} pop {r0} bx r0 @@ -2422,7 +2422,7 @@ _080F19B8: movs r1, 0x1 movs r2, 0x70 movs r3, 0x1 - bl MenuPrint_PixelCoords + bl Menu_PrintTextPixelCoords pop {r4,r5} pop {r0} bx r0 @@ -2502,7 +2502,7 @@ _080F1A46: movs r0, 0xE movs r2, 0x1C movs r3, 0xF - bl MenuFillWindowRectWithBlankTile + bl Menu_BlankWindowRect movs r0, 0 strb r0, [r5] _080F1A60: @@ -7663,9 +7663,9 @@ sub_80F4194: @ 80F4194 str r1, [r4, 0x4] str r3, [r4, 0x8] ldr r0, [r4, 0x8] - ldr r0, _080F42B4 @ =gWindowConfig_81E70F0 + ldr r0, _080F42B4 @ =gWindowTemplate_81E70F0 adds r1, r6, 0 - bl sub_8004E3C + bl Text_InitWindow8004E3C movs r3, 0x88 lsls r3, 2 adds r1, r6, r3 @@ -7779,7 +7779,7 @@ _080F42A4: .4byte gUnknown_083DFEC8 _080F42A8: .4byte 0x00001111 _080F42AC: .4byte 0x040000d4 _080F42B0: .4byte 0x81000140 -_080F42B4: .4byte gWindowConfig_81E70F0 +_080F42B4: .4byte gWindowTemplate_81E70F0 _080F42B8: .4byte 0x81000030 _080F42BC: .4byte 0x0fffffff _080F42C0: .4byte 0x80000040 diff --git a/data/graphics.s b/data/graphics.s index 7792e8a9e..6cc1c2db7 100644 --- a/data/graphics.s +++ b/data/graphics.s @@ -4522,7 +4522,7 @@ gPokenavRibbonPokeView_Gfx:: @ 8EA0028 .incbin "graphics/pokenav/ribbon_pokeview.4bpp" .align 2 -gMessageBox_Gfx:: @ 8EA0108 +gDialogueFrame_Gfx:: @ 8EA0108 .incbin "graphics/text_window/message_box.4bpp" .align 2 diff --git a/include/menu.h b/include/menu.h index 9a5ca62a0..3295cd5c5 100644 --- a/include/menu.h +++ b/include/menu.h @@ -26,45 +26,43 @@ extern u16 gMenuMessageBoxContentTileOffset; void CloseMenu(void); void AppendToList(u8 *list, u8 *pindex, u32 value); -void InitMenuWindow(const struct WindowConfig *); -void MultistepInitMenuWindowBegin(const struct WindowConfig *); +void InitMenuWindow(const struct WindowTemplate *); +void MultistepInitMenuWindowBegin(const struct WindowTemplate *); bool32 MultistepInitMenuWindowContinue(void); -void unref_sub_8071DA4(struct WindowConfig *, u16); -void MenuLoadTextWindowGraphics_OverrideFrameType(u8); -void MenuLoadTextWindowGraphics(void); -void BasicInitMenuWindow(const struct WindowConfig *); -void MenuPrint(const u8 *, u8, u8); -void MenuZeroFillWindowRect(u8, u8, u8, u8); -void MenuFillWindowRectWithBlankTile(u8, u8, u8, u8); -void MenuZeroFillScreen(void); -void MenuDrawTextWindow(u8, u8, u8, u8); +void unref_sub_8071DA4(struct WindowTemplate *, u16); +void Menu_LoadStdFrameGraphicsOverrideStyle(u8); +void Menu_LoadStdFrameGraphics(void); +void BasicInitMenuWindow(const struct WindowTemplate *); +void Menu_PrintText(const u8 *, u8, u8); +void Menu_EraseWindowRect(u8, u8, u8, u8); +void Menu_BlankWindowRect(u8, u8, u8, u8); +void Menu_EraseScreen(void); +void Menu_DrawStdWindowFrame(u8, u8, u8, u8); void sub_8071F40(const u8 *); void sub_8071F60(u8, u8, u8); u16 unref_sub_8071F98(u8, u8); void unref_sub_8071FBC(u16, u8, u8, u8, u8); -void MenuDisplayMessageBox(void); +void Menu_DisplayDialogueFrame(void); void MenuPrintMessage(const u8 *, u8, u8); void MenuPrintMessageDefaultCoords(const u8 *); -void MenuSetText(const u8 *); -u8 MenuUpdateWindowText(void); +void Menu_SetText(const u8 *); +u8 Menu_UpdateWindowText(void); u8 unref_sub_8072098(void); -void sub_80720B0(void); -u8 MoveMenuCursor(s8); -u8 MoveMenuCursorNoWrap(s8); -u8 GetMenuCursorPos(void); -s8 ProcessMenuInput(void); -s8 ProcessMenuInputNoWrap(void); -u8 MoveMenuCursor3(s8); -u8 MoveMenuCursor4(s8); +void Menu_ClearWindowText(void); +u8 Menu_MoveCursor(s8); +u8 Menu_MoveCursorNoWrap(s8); +u8 Menu_GetCursorPos(void); +s8 Menu_ProcessInput(void); +s8 Menu_ProcessInputNoWrap(void); void sub_807274C(u8, u8, u8, u8, const struct MenuAction[], u8, u32); -s8 sub_80727CC(void); -u8 sub_807288C(u8); -void PrintMenuItems(u8, u8, u8, const struct MenuAction[]); -void PrintMenuItemsReordered(u8 left, u8 top, u8 menuItemCount, const struct MenuAction2 menuItems[], const u8 *order); +s8 Menu_ProcessInputGridLayout(void); +u8 Menu_GetColumnXCoord(u8); +void Menu_PrintItems(u8, u8, u8, const struct MenuAction[]); +void Menu_PrintItemsReordered(u8 left, u8 top, u8 menuItemCount, const struct MenuAction2 menuItems[], const u8 *order); void InitYesNoMenu(u8, u8, u8); void DisplayYesNoMenu(u8, u8, u32); -s8 ProcessMenuInputNoWrap_(void); -u8 MenuPrint_PixelCoords(const u8 *, u8, u16, u8); +s8 Menu_ProcessInputNoWrap_(void); +u8 Menu_PrintTextPixelCoords(const u8 *, u8, u16, u8); u8 sub_8072A18(const u8 *, u8, u16, u8, u32); u8 unref_sub_8072A5C(u8 *, u8 *, u8, u16, u8, u32); int sub_8072AB0(const u8 *, u8, u16, u8, u8, u32); @@ -75,16 +73,15 @@ u8 *sub_8072C14(u8 *, s32, u8, u8); u8 *sub_8072C44(u8 *, s32, u8, u8); u8 *sub_8072C74(u8 *, const u8 *, u8, u8); u8 sub_8072CA4(const u8 *s); -u8 sub_8072CBC(void); -void sub_8072CD4(u8 *, u8 *, u8 *); -u32 MenuUpdateWindowText_OverrideLineLength(u8); +u8 Menu_GetTextWindowPaletteNum(void); +void Menu_GetTextColors(u8 *, u8 *, u8 *); +u32 Menu_UpdateWindowTextOverrideLineLength(u8); struct Window * unref_sub_8072D0C(void); u8 InitMenu(u8, u8, u8, u8, u8, u8); -void RedrawMenuCursor(u8, u8); void unref_sub_8072DC0(void); void sub_8072DCC(u8); void sub_8072DDC(u8); -void HandleDestroyMenuCursors(void); +void Menu_DestroyCursor(void); #if GERMAN u8 *de_sub_8073174(u8 *name, const u8 *format); diff --git a/include/menu_cursor.h b/include/menu_cursor.h index ca82ef244..8d9a4f23c 100644 --- a/include/menu_cursor.h +++ b/include/menu_cursor.h @@ -4,11 +4,11 @@ #include "sprite.h" void sub_814A590(void); -u8 sub_814A5C0(u8 a1, u16 a2, u8 a3, u16 a4, u8 a5); +u8 MenuCursor_Create814A5C0(u8 a1, u16 a2, u8 a3, u16 a4, u8 a5); u8 sub_814A758(u8 a1, u8 a2, u8 a3, u8 a4); u8 unref_sub_814A7AC(u8 a1, u16 a2, u8 a3); void DestroyMenuCursor(void); -void sub_814A880(u8 a1, u8 a2); +void MenuCursor_SetPos814A880(u8 a1, u8 a2); void sub_814A904(void); void sub_814A958(u8 a1); void sub_814AABC(void (*callback)(struct Sprite *)); @@ -16,8 +16,8 @@ void sub_814AAF8(u16 a1); void sub_814AB84(void); void unref_sub_814ABE4(int a1); u8 CreateBlendedOutlineCursor(u8 a1, u16 a2, u8 a3, u16 a4, u8 a5); -void sub_814AD44(void); -void sub_814AD7C(u8 a1, u8 a2); +void MenuCursor_Destroy814AD44(void); +void MenuCursor_SetPos814AD7C(u8 a1, u8 a2); void sub_814ADC8(void); void sub_814ADF4(u8 a1); diff --git a/include/text.h b/include/text.h index ebc4ebe7e..f0d039d45 100644 --- a/include/text.h +++ b/include/text.h @@ -74,7 +74,7 @@ #define CHAR_NEWLINE 0xFE #define EOS 0xFF // end of string -struct WindowConfig +struct WindowTemplate { u8 bgNum; u8 charBaseBlock; @@ -126,7 +126,7 @@ struct Window /*0x20*/ const u8 *text; /*0x24*/ u8 *tileData; /*0x28*/ u16 *tilemap; - /*0x2C*/ const struct WindowConfig *config; + /*0x2C*/ const struct WindowTemplate *template; }; extern vu16 *const gBGControlRegs[]; @@ -137,65 +137,65 @@ extern const u16 gUnknown_081E29D8[]; extern const u16 gUnknown_081E29E0[]; extern const u16 gUnknown_081E29E8[]; -extern const struct WindowConfig gWindowConfig_81E6C3C; -extern const struct WindowConfig gWindowConfig_81E6C58; -extern const struct WindowConfig gWindowConfig_81E6C74; -extern const struct WindowConfig gWindowConfig_81E6C90; -extern const struct WindowConfig gWindowConfig_81E6CAC; -extern const struct WindowConfig gWindowConfig_81E6CC8; -extern const struct WindowConfig gWindowConfig_81E6CE4; -extern const struct WindowConfig gWindowConfig_81E6D00; -extern const struct WindowConfig gWindowConfig_81E6D1C; -extern const struct WindowConfig gWindowConfig_81E6D38; -extern const struct WindowConfig gWindowConfig_81E6D54; -extern const struct WindowConfig gWindowConfig_81E6D70; -extern const struct WindowConfig gWindowConfig_81E6D8C; -extern const struct WindowConfig gWindowConfig_81E6DA8; -extern const struct WindowConfig WindowConfig_TrainerCard_Back_Values; -extern const struct WindowConfig WindowConfig_TrainerCard_Back_Labels; -extern const struct WindowConfig gWindowConfig_81E6DFC; -extern const struct WindowConfig gWindowConfig_81E6E18; -extern const struct WindowConfig gWindowConfig_81E6E34; -extern const struct WindowConfig gWindowConfig_81E6E50; -extern const struct WindowConfig gWindowConfig_81E6E6C; -extern const struct WindowConfig gWindowConfig_81E6E88; -extern const struct WindowConfig gWindowConfig_81E6EA4; -extern const struct WindowConfig gWindowConfig_81E6EC0; -extern const struct WindowConfig gWindowConfig_81E6EDC; -extern const struct WindowConfig gWindowConfig_81E6EF8; -extern const struct WindowConfig gWindowConfig_81E6F14; -extern const struct WindowConfig gWindowConfig_81E6F30; -extern const struct WindowConfig gWindowConfig_81E6F4C; -extern const struct WindowConfig gWindowConfig_81E6F68; -extern const struct WindowConfig gWindowConfig_81E6F84; -extern const struct WindowConfig gWindowConfig_81E6FA0; -extern const struct WindowConfig gWindowConfig_81E6FBC; -extern const struct WindowConfig gWindowConfig_81E6FD8; -extern const struct WindowConfig gWindowConfig_81E6FF4; -extern const struct WindowConfig gWindowConfig_81E7010; -extern const struct WindowConfig gWindowConfig_81E702C; -extern const struct WindowConfig gWindowConfig_81E7048; -extern const struct WindowConfig gWindowConfig_81E7064; -extern const struct WindowConfig gWindowConfig_81E7080; -extern const struct WindowConfig gWindowConfig_81E709C; -extern const struct WindowConfig gWindowConfig_81E70B8; -extern const struct WindowConfig gWindowConfig_81E70D4; -extern const struct WindowConfig gWindowConfig_81E70F0; -extern const struct WindowConfig gWindowConfig_81E710C; -extern const struct WindowConfig gWindowConfig_81E7128; -extern const struct WindowConfig gWindowConfig_81E7144; -extern const struct WindowConfig gWindowConfig_81E7160; -extern const struct WindowConfig gWindowConfig_81E717C; -extern const struct WindowConfig gWindowConfig_81E7198; -extern const struct WindowConfig gWindowConfig_81E71B4; -extern const struct WindowConfig gWindowConfig_81E71D0; -extern const struct WindowConfig gWindowConfig_81E71EC; -extern const struct WindowConfig gWindowConfig_81E7208; -extern const struct WindowConfig gWindowConfig_81E7224; -extern const struct WindowConfig gWindowConfig_81E7240; -extern const struct WindowConfig gWindowConfig_81E725C; -extern const struct WindowConfig gWindowConfig_81E7278; -extern const struct WindowConfig gWindowConfig_81E7294; +extern const struct WindowTemplate gWindowTemplate_81E6C3C; +extern const struct WindowTemplate gWindowTemplate_81E6C58; +extern const struct WindowTemplate gWindowTemplate_81E6C74; +extern const struct WindowTemplate gWindowTemplate_81E6C90; +extern const struct WindowTemplate gWindowTemplate_81E6CAC; +extern const struct WindowTemplate gWindowTemplate_81E6CC8; +extern const struct WindowTemplate gWindowTemplate_81E6CE4; +extern const struct WindowTemplate gWindowTemplate_81E6D00; +extern const struct WindowTemplate gWindowTemplate_81E6D1C; +extern const struct WindowTemplate gWindowTemplate_81E6D38; +extern const struct WindowTemplate gWindowTemplate_81E6D54; +extern const struct WindowTemplate gWindowTemplate_81E6D70; +extern const struct WindowTemplate gWindowTemplate_81E6D8C; +extern const struct WindowTemplate gWindowTemplate_81E6DA8; +extern const struct WindowTemplate gWindowTemplate_TrainerCard_Back_Values; +extern const struct WindowTemplate gWindowTemplate_TrainerCard_Back_Labels; +extern const struct WindowTemplate gWindowTemplate_81E6DFC; +extern const struct WindowTemplate gWindowTemplate_81E6E18; +extern const struct WindowTemplate gWindowTemplate_81E6E34; +extern const struct WindowTemplate gWindowTemplate_81E6E50; +extern const struct WindowTemplate gWindowTemplate_81E6E6C; +extern const struct WindowTemplate gWindowTemplate_81E6E88; +extern const struct WindowTemplate gWindowTemplate_81E6EA4; +extern const struct WindowTemplate gWindowTemplate_81E6EC0; +extern const struct WindowTemplate gWindowTemplate_81E6EDC; +extern const struct WindowTemplate gWindowTemplate_81E6EF8; +extern const struct WindowTemplate gWindowTemplate_81E6F14; +extern const struct WindowTemplate gWindowTemplate_81E6F30; +extern const struct WindowTemplate gWindowTemplate_81E6F4C; +extern const struct WindowTemplate gWindowTemplate_81E6F68; +extern const struct WindowTemplate gWindowTemplate_81E6F84; +extern const struct WindowTemplate gWindowTemplate_81E6FA0; +extern const struct WindowTemplate gWindowTemplate_81E6FBC; +extern const struct WindowTemplate gWindowTemplate_81E6FD8; +extern const struct WindowTemplate gWindowTemplate_81E6FF4; +extern const struct WindowTemplate gWindowTemplate_81E7010; +extern const struct WindowTemplate gWindowTemplate_81E702C; +extern const struct WindowTemplate gWindowTemplate_81E7048; +extern const struct WindowTemplate gWindowTemplate_81E7064; +extern const struct WindowTemplate gWindowTemplate_81E7080; +extern const struct WindowTemplate gWindowTemplate_81E709C; +extern const struct WindowTemplate gWindowTemplate_81E70B8; +extern const struct WindowTemplate gWindowTemplate_81E70D4; +extern const struct WindowTemplate gWindowTemplate_81E70F0; +extern const struct WindowTemplate gWindowTemplate_81E710C; +extern const struct WindowTemplate gWindowTemplate_81E7128; +extern const struct WindowTemplate gWindowTemplate_81E7144; +extern const struct WindowTemplate gWindowTemplate_81E7160; +extern const struct WindowTemplate gWindowTemplate_81E717C; +extern const struct WindowTemplate gWindowTemplate_81E7198; +extern const struct WindowTemplate gWindowTemplate_81E71B4; +extern const struct WindowTemplate gWindowTemplate_81E71D0; +extern const struct WindowTemplate gWindowTemplate_81E71EC; +extern const struct WindowTemplate gWindowTemplate_81E7208; +extern const struct WindowTemplate gWindowTemplate_81E7224; +extern const struct WindowTemplate gWindowTemplate_81E7240; +extern const struct WindowTemplate gWindowTemplate_81E725C; +extern const struct WindowTemplate gWindowTemplate_81E7278; +extern const struct WindowTemplate gWindowTemplate_81E7294; extern u16 gBGTilemapBuffers[4][0x400]; @@ -205,51 +205,51 @@ extern u8 gStringVar3[]; extern u8 gStringVar4[]; extern u8 gTileBuffer[]; -void LoadFontDefaultPalette(const struct WindowConfig *winConfig); -void SetUpWindowConfig(const struct WindowConfig *winConfig); +void LoadFontDefaultPalette(const struct WindowTemplate *winConfig); +void Text_LoadWindowTemplate(const struct WindowTemplate *winConfig); u16 InitWindowTileData(struct Window *win, u16 startOffset); u32 MultistepInitWindowTileData(struct Window *win, u16 startOffset); bool32 MultistepLoadFont(void); -void InitWindowFromConfig(struct Window *win, const struct WindowConfig *winConfig); -void InitWindow(struct Window *win, const u8 *text, u16 tileDataStartOffset, u8 left, u8 top); -void sub_8002E4C(struct Window *win, const u8 *text, u16 tileDataStartOffset, u8 left, u16 top, u32 a6); -void sub_8002E90(struct Window *win, const u8 *text); -void sub_8002EB0(struct Window *win, const u8 *text, u16 tileDataStartOffset, u8 left, u8 top); -u8 sub_8002F44(struct Window *win); -u8 sub_8003418(struct Window *win); -u8 sub_8003460(struct Window *win, const u8 *text, u16 tileDataStartOffset, u8 left, u8 top); +void Text_InitWindowWithTemplate(struct Window *win, const struct WindowTemplate *winConfig); +void Text_InitWindow(struct Window *win, const u8 *text, u16 tileDataStartOffset, u8 left, u8 top); +void Text_InitWindow8002E4C(struct Window *win, const u8 *text, u16 tileDataStartOffset, u8 left, u16 top, u32 a6); +void Text_SetWindowText(struct Window *win, const u8 *text); +void Text_InitWindow8002EB0(struct Window *win, const u8 *text, u16 tileDataStartOffset, u8 left, u8 top); +u8 Text_PrintWindow8002F44(struct Window *win); +u8 Text_PrintWindowSimple(struct Window *win); +u8 Text_InitWindowAndPrintText(struct Window *win, const u8 *text, u16 tileDataStartOffset, u8 left, u8 top); u8 sub_8003490(struct Window *win, u8 c, u16 tileDataStartOffset, u8 left, u8 top); void sub_80034D4(u8 *tileData, const u8 *text); u8 sub_80034EC(u8 *str); u8 *sub_8003504(u8 *dest, s32 value, u8 alignAmount, u8 alignType); u8 *sub_8003558(u8 *dest, const u8 *src, u8 alignAmount, u8 alignType); -u8 sub_80035AC(struct Window *win); -u8 sub_800374C(struct Window *win); -u8 sub_8003778(struct Window *win); -u8 sub_80037A0(struct Window *win); -u32 sub_80037C8(struct Window *win, u8 lineLength); -void ClearWindowTextLines(struct Window *win); -u16 GetWindowTilemapEntry(struct Window *win, u8 x, u8 y); -void DrawWindowRect(struct Window *win, u16 tilemapEntry, u8 left, u8 top, u8 right, u8 bottom); +u8 Text_UpdateWindow(struct Window *win); +u8 Text_UpdateWindowInBattle(struct Window *win); +u8 Text_UpdateWindowAutoscroll(struct Window *win); +u8 Text_UpdateWindowInContest(struct Window *win); +u32 Text_UpdateWindowOverrideLineLength(struct Window *win, u8 lineLength); +void Text_ClearWindow(struct Window *win); +u16 Text_GetWindowTilemapEntry(struct Window *win, u8 x, u8 y); +void Text_FillWindowBorder(struct Window *win, u16 tilemapEntry, u8 left, u8 top, u8 right, u8 bottom); void DrawWindowRect_DefaultPalette(struct Window *win, u16 tileNum, u8 left, u8 top, u8 right, u8 bottom); -void FillWindowRect(struct Window *win, u16 tilemapEntry, u8 left, u8 top, u8 right, u8 bottom); -void FillWindowRect_DefaultPalette(struct Window *win, u16 tileNum, u8 left, u8 top, u8 right, u8 bottom); -void ZeroFillWindowRect(struct Window *win, u8 left, u8 top, u8 right, u8 bottom); -void FillWindowRectWithBlankTile(struct Window *win, u8 left, u8 top, u8 right, u8 bottom); +void Text_FillWindowRect(struct Window *win, u16 tilemapEntry, u8 left, u8 top, u8 right, u8 bottom); +void Text_FillWindowRectDefPalette(struct Window *win, u16 tileNum, u8 left, u8 top, u8 right, u8 bottom); +void Text_EraseWindowRect(struct Window *win, u8 left, u8 top, u8 right, u8 bottom); +void Text_BlankWindowRect(struct Window *win, u8 left, u8 top, u8 right, u8 bottom); u8 GetExtCtrlCodeLength(u8 code); u8 *AlignInt1(struct Window *win, u8 *dest, s32 value, u8 alignAmount, u8 alignType); u8 *AlignInt2(struct Window *win, u8 *dest, s32 value, u8 alignAmount, u8 alignType); u8 *AlignString(struct Window *win, u8 *dest, const u8 *src, u8 alignAmount, u8 alignType); u8 GetStringWidth(struct Window *win, const u8 *s); -u8 sub_8004D04(struct Window *win, const u8 *text, u16 tileDataStartOffset, u8 left, u16 top, u32 a6); -u8 sub_8004D38(struct Window *win, const u8 *text, u16 tileDataStartOffset, u8 left, u8 top); -u8 sub_8004DB0(struct Window *win, const u8 *text, u16 tileDataStartOffset, u8 left, u8 top, u16 a6); -u8 sub_8004E24(struct Window *win); -void sub_8004E28(struct Window *win, u8 *foreground, u8 *background, u8 *shadow); -void sub_8004E3C(const struct WindowConfig *winConfig, u8 *tileData, const u8 *text); -u8 GetStringWidthGivenWindowConfig(const struct WindowConfig *winConfig, const u8 *s); +u8 Text_InitWindow8004D04(struct Window *win, const u8 *text, u16 tileDataStartOffset, u8 left, u16 top, u32 a6); +u8 Text_InitWindow8004D38(struct Window *win, const u8 *text, u16 tileDataStartOffset, u8 left, u8 top); +u8 Text_InitWindow8004DB0(struct Window *win, const u8 *text, u16 tileDataStartOffset, u8 left, u8 top, u16 a6); +u8 Text_GetWindowPaletteNum(struct Window *win); +void Text_GetTextColors(struct Window *win, u8 *foreground, u8 *background, u8 *shadow); +void Text_InitWindow8004E3C(const struct WindowTemplate *winConfig, u8 *tileData, const u8 *text); +u8 Text_GetStringWidthFromWindowTemplate(const struct WindowTemplate *winConfig, const u8 *s); void ConvertInternationalString(u8 *s, u8 language); -void StripExtCtrlCodes(u8 *str); +void Text_StripExtCtrlCodes(u8 *str); s32 StringCompareWithoutExtCtrlCodes(const u8 *str1, const u8 *str2); u8 sub_8004FD0(struct Window *win, u8 *dest, const u8 *src, u16 tileDataStartOffset, u8 left, u16 top, u8 width, u32 a8); diff --git a/include/text_window.h b/include/text_window.h index 7df1453ca..21e05ece0 100644 --- a/include/text_window.h +++ b/include/text_window.h @@ -9,17 +9,17 @@ struct FrameGraphics const u16 *palette; }; -u16 SetTextWindowBaseTileNum(u16 baseTileNum); -void LoadTextWindowGraphics(struct Window *win); -void LoadTextWindowGraphics_OverridePalSlot(struct Window *win, u8 palSlot); -void LoadTextWindowGraphics_OverrideFrameType(struct Window *win, u8 frameType); -void DrawTextWindow(struct Window *win, u8 left, u8 top, u8 right, u8 bottom); -const struct FrameGraphics *GetTextWindowFrameGraphics(u8 frameType); -u16 SetMessageBoxBaseTileNum(u16 baseTileNum); +u16 TextWindow_SetBaseTileNum(u16 baseTileNum); +void TextWindow_LoadStdFrameGraphics(struct Window *win); +void TextWindow_LoadStdFrameGraphicsOverridePal(struct Window *win, u8 palSlot); +void TextWindow_LoadStdFrameGraphicsOverrideStyle(struct Window *win, u8 frameType); +void TextWindow_DrawStdFrame(struct Window *win, u8 left, u8 top, u8 right, u8 bottom); +const struct FrameGraphics *TextWindow_GetFrameGraphics(u8 frameType); +u16 TextWindow_SetDlgFrameBaseTileNum(u16 baseTileNum); void unref_sub_80651DC(struct Window *, u8 *); -void DisplayMessageBox(struct Window *); -void DrawStandardMessageBox(struct Window *win); -void LoadMessageBoxTiles(struct Window *win); -void ClearStandardMessageBox(struct Window *win); +void TextWindow_DisplayDialogueFrame(struct Window *); +void TextWindow_DrawDialogueFrame(struct Window *win); +void TextWindow_LoadDialogueFrameTiles(struct Window *win); +void TextWindow_EraseDialogueFrame(struct Window *win); #endif // GUARD_TEXT_WINDOW_H diff --git a/src/battle/battle_2.c b/src/battle/battle_2.c index ae84e5585..249b67e0d 100644 --- a/src/battle/battle_2.c +++ b/src/battle/battle_2.c @@ -234,7 +234,7 @@ void InitBattle(void) } //sub_80895F8(gUnknown_081F9674.unk0, gUnknown_081F9674.unk4, gUnknown_081F9674.unk8); sub_80895F8(gUnknown_081F9674); - SetUpWindowConfig(&gWindowConfig_81E6C58); + Text_LoadWindowTemplate(&gWindowTemplate_81E6C58); ResetPaletteFade(); gBattle_BG0_X = 0; gBattle_BG0_Y = 0; @@ -245,9 +245,9 @@ void InitBattle(void) gUnknown_030041B0 = 0; gUnknown_030041B8 = 0; gBattleTerrain = BattleSetup_GetTerrain(); - InitWindowFromConfig(&gUnknown_03004210, &gWindowConfig_81E6C58); - InitWindowFromConfig(&gUnknown_030041D0, &gWindowConfig_81E71D0); - InitWindowFromConfig(&gUnknown_03004250, &gWindowConfig_81E71EC); + Text_InitWindowWithTemplate(&gUnknown_03004210, &gWindowTemplate_81E6C58); + Text_InitWindowWithTemplate(&gUnknown_030041D0, &gWindowTemplate_81E71D0); + Text_InitWindowWithTemplate(&gUnknown_03004250, &gWindowTemplate_81E71EC); sub_800D6D4(); sub_800DAB8(); ResetSpriteData(); @@ -553,7 +553,7 @@ void sub_800F02C(void) gUnknown_02023A00[i].status = GetMonData(&gPlayerParty[i], MON_DATA_STATUS); gUnknown_02023A00[i].personality = GetMonData(&gPlayerParty[i], MON_DATA_PERSONALITY); gUnknown_02023A00[i].gender = GetMonGender(&gPlayerParty[i]); - StripExtCtrlCodes(nickname); + Text_StripExtCtrlCodes(nickname); gUnknown_02023A00[i].language = GetMonData(&gPlayerParty[i], MON_DATA_LANGUAGE); if (gUnknown_02023A00[i].language != 1) PadNameString(nickname, 0); @@ -898,7 +898,7 @@ void BattleMainCB2(void) { AnimateSprites(); BuildOamBuffer(); - sub_800374C(&gUnknown_03004210); + Text_UpdateWindowInBattle(&gUnknown_03004210); UpdatePaletteFade(); RunTasks(); } @@ -1210,7 +1210,7 @@ void c2_8011A1C(void) gUnknown_03004DE0[0][i] = 0xFF10; gUnknown_03004DE0[1][i] = 0xFF10; } - SetUpWindowConfig(&gWindowConfig_81E6C58); + Text_LoadWindowTemplate(&gWindowTemplate_81E6C58); ResetPaletteFade(); gBattle_BG0_X = 0; gBattle_BG0_Y = 0; @@ -1221,9 +1221,9 @@ void c2_8011A1C(void) gUnknown_030041B0 = 0; gUnknown_030041B8 = 0; - InitWindowFromConfig(&gUnknown_03004210, &gWindowConfig_81E6C58); - InitWindowFromConfig(&gUnknown_030041D0, &gWindowConfig_81E71D0); - InitWindowFromConfig(&gUnknown_03004250, &gWindowConfig_81E71EC); + Text_InitWindowWithTemplate(&gUnknown_03004210, &gWindowTemplate_81E6C58); + Text_InitWindowWithTemplate(&gUnknown_030041D0, &gWindowTemplate_81E71D0); + Text_InitWindowWithTemplate(&gUnknown_03004250, &gWindowTemplate_81E71EC); sub_800D6D4(); LoadCompressedPalette(gUnknown_08D004E0, 0, 64); sub_800D74C(); diff --git a/src/battle/battle_4.c b/src/battle/battle_4.c index 5a20a8324..164329c1b 100644 --- a/src/battle/battle_4.c +++ b/src/battle/battle_4.c @@ -136,7 +136,7 @@ u16 GiveMoveToBattleMon(struct BattlePokemon *mon, u16 move); void IncrementGameStat(u8 index); u8 GetScaledHPFraction(s16 hp, s16 maxhp, u8 scale); u16 GetPokedexHeightWeight(u16 national_num, u8 heightweight); -u8 sub_814A5C0(u8 a1, u16 a2, u8 a3, u16 a4, u8 a5); +u8 MenuCursor_Create814A5C0(u8 a1, u16 a2, u8 a3, u16 a4, u8 a5); void DestroyMenuCursor(void); void sub_802BC6C(void); u8 sub_809FA30(void); @@ -155,7 +155,7 @@ u8 Overworld_GetMapTypeOfSaveblockLocation(void); u8 CalculatePlayerPartyCount(void); u16 Sqrt(u32 num); u8 sub_809070C(u16 nationalNum, u32 TiD, u32 PiD); //task prepare poke dex display -void sub_814A880(u8 a1, u8 a2); +void MenuCursor_SetPos814A880(u8 a1, u8 a2); u8 CheckMoveLimitations(u8 bank, u8 unusable_moves, u8 flags); bool8 IsLinkDoubleBattle(void); void sub_8094B6C(u8 bank, u8 partyID, u8 r2); @@ -10767,9 +10767,9 @@ void atk59_handlelearnnewmove(void) void sub_8023A80(void) { sub_802BBD4(0x18, 8, 0x1D, 0xD, 0); - InitWindow(&gUnknown_03004210, BattleText_YesNo, 0x100, 0x19, 0x9); - sub_8002F44(&gUnknown_03004210); - sub_814A5C0(0, 0xFFFF, 0xC, 0x2D9F, 0x20); + Text_InitWindow(&gUnknown_03004210, BattleText_YesNo, 0x100, 0x19, 0x9); + Text_PrintWindow8002F44(&gUnknown_03004210); + MenuCursor_Create814A5C0(0, 0xFFFF, 0xC, 0x2D9F, 0x20); } void sub_8023AD8(void) @@ -11714,9 +11714,9 @@ _08024AC4:\n\ str r0, [sp]\n\ adds r0, r4, 0\n\ movs r3, 0xC\n\ - bl InitWindow\n\ + bl Text_InitWindow\n\ adds r0, r4, 0\n\ - bl sub_8002F44\n\ + bl Text_PrintWindow8002F44\n\ ldr r1, _08024AEC @ =gSharedMem\n\ ldr r2, _08024AF0 @ =0x0001609c\n\ adds r1, r2\n\ @@ -11835,9 +11835,9 @@ _08024BC0:\n\ str r0, [sp]\n\ adds r0, r4, 0\n\ movs r3, 0xC\n\ - bl InitWindow\n\ + bl Text_InitWindow\n\ adds r0, r4, 0\n\ - bl sub_8002F44\n\ + bl Text_PrintWindow8002F44\n\ ldr r1, _08024BFC @ =gSharedMem\n\ ldr r0, _08024C00 @ =0x0001609c\n\ adds r1, r0\n\ @@ -17333,7 +17333,7 @@ _0802BC68: .4byte 0x00001025\n\ void sub_802BC6C(void) { - sub_814A880(0xC8, ((gBattleCommunication[1] << 28) + 1207959552) >> 24); //what could that be? + MenuCursor_SetPos814A880(0xC8, ((gBattleCommunication[1] << 28) + 1207959552) >> 24); //what could that be? } void nullsub_6(void) diff --git a/src/battle/battle_controller_linkopponent.c b/src/battle/battle_controller_linkopponent.c index 54181bc21..69306b725 100644 --- a/src/battle/battle_controller_linkopponent.c +++ b/src/battle/battle_controller_linkopponent.c @@ -1413,7 +1413,7 @@ void LinkOpponentHandlePrintString(void) gBattle_BG0_X = 0; gBattle_BG0_Y = 0; BufferStringBattle(*(u16 *)&gBattleBufferA[gActiveBank][2]); - sub_8002EB0(&gUnknown_03004210, gDisplayedStringBattle, 144, 2, 15); + Text_InitWindow8002EB0(&gUnknown_03004210, gDisplayedStringBattle, 144, 2, 15); gBattleBankFunc[gActiveBank] = sub_8037C2C; } diff --git a/src/battle/battle_controller_linkpartner.c b/src/battle/battle_controller_linkpartner.c index 2c78d4a82..c86c337d9 100644 --- a/src/battle/battle_controller_linkpartner.c +++ b/src/battle/battle_controller_linkpartner.c @@ -1358,7 +1358,7 @@ void LinkPartnerHandlePrintString(void) gBattle_BG0_X = 0; gBattle_BG0_Y = 0; BufferStringBattle(*(u16 *)&gBattleBufferA[gActiveBank][2]); - sub_8002EB0(&gUnknown_03004210, gDisplayedStringBattle, 144, 2, 15); + Text_InitWindow8002EB0(&gUnknown_03004210, gDisplayedStringBattle, 144, 2, 15); gBattleBankFunc[gActiveBank] = sub_811DFA0; } diff --git a/src/battle/battle_controller_opponent.c b/src/battle/battle_controller_opponent.c index ab7b6944b..622e3e9f9 100644 --- a/src/battle/battle_controller_opponent.c +++ b/src/battle/battle_controller_opponent.c @@ -1407,7 +1407,7 @@ void OpponentHandlePrintString(void) gBattle_BG0_X = 0; gBattle_BG0_Y = 0; BufferStringBattle(*(u16 *)&gBattleBufferA[gActiveBank][2]); - sub_8002EB0(&gUnknown_03004210, gDisplayedStringBattle, 144, 2, 15); + Text_InitWindow8002EB0(&gUnknown_03004210, gDisplayedStringBattle, 144, 2, 15); gBattleBankFunc[gActiveBank] = sub_80331D0; } diff --git a/src/battle/battle_controller_player.c b/src/battle/battle_controller_player.c index f992e3e51..489581132 100644 --- a/src/battle/battle_controller_player.c +++ b/src/battle/battle_controller_player.c @@ -744,9 +744,9 @@ void sub_802C68C(void) else gUnknown_03004344 = gMoveSelectionCursor[gActiveBank] + 1; sub_802E3B4(gUnknown_03004344, 27); - FillWindowRect(&gUnknown_03004210, 0x1016, 0x17, 0x37, 0x1C, 0x3A); - InitWindow(&gUnknown_03004210, BattleText_SwitchWhich, 0x290, 0x17, 0x37); - sub_8002F44(&gUnknown_03004210); + Text_FillWindowRect(&gUnknown_03004210, 0x1016, 0x17, 0x37, 0x1C, 0x3A); + Text_InitWindow(&gUnknown_03004210, BattleText_SwitchWhich, 0x290, 0x17, 0x37); + Text_PrintWindow8002F44(&gUnknown_03004210); gBattleBankFunc[gActiveBank] = sub_802CA60; } } @@ -853,9 +853,9 @@ void sub_802CA60(void) gBattleBankFunc[gActiveBank] = sub_802C68C; gMoveSelectionCursor[gActiveBank] = gUnknown_03004344; sub_802E3B4(gMoveSelectionCursor[gActiveBank], 0); - FillWindowRect(&gUnknown_03004210, 0x1016, 0x17, 0x37, 0x1C, 0x3A); - InitWindow(&gUnknown_03004210, BattleText_PP, 0x290, 0x17, 0x37); - sub_8002F44(&gUnknown_03004210); + Text_FillWindowRect(&gUnknown_03004210, 0x1016, 0x17, 0x37, 0x1C, 0x3A); + Text_InitWindow(&gUnknown_03004210, BattleText_PP, 0x290, 0x17, 0x37); + Text_PrintWindow8002F44(&gUnknown_03004210); sub_802E220(); sub_802E2D4(); } @@ -866,9 +866,9 @@ void sub_802CA60(void) sub_802E3B4(gMoveSelectionCursor[gActiveBank], 0); sub_802E12C(gMoveSelectionCursor[gActiveBank], BattleText_Format); gBattleBankFunc[gActiveBank] = sub_802C68C; - FillWindowRect(&gUnknown_03004210, 0x1016, 0x17, 0x37, 0x1C, 0x3A); - InitWindow(&gUnknown_03004210, BattleText_PP, 0x290, 0x17, 0x37); - sub_8002F44(&gUnknown_03004210); + Text_FillWindowRect(&gUnknown_03004210, 0x1016, 0x17, 0x37, 0x1C, 0x3A); + Text_InitWindow(&gUnknown_03004210, BattleText_PP, 0x290, 0x17, 0x37); + Text_PrintWindow8002F44(&gUnknown_03004210); sub_802E220(); sub_802E2D4(); } @@ -1557,13 +1557,13 @@ void sub_802E12C(s32 a, const u8 *b) StringCopy(gDisplayedStringBattle, b); StringAppend(gDisplayedStringBattle, gMoveNames[r4->moves[a]]); - InitWindow( + Text_InitWindow( &gUnknown_03004210, gDisplayedStringBattle, 0x300 + a * 20, (a & 1) ? 11 : 1, (a < 2) ? 0x37 : 0x39); - sub_8002F44(&gUnknown_03004210); + Text_PrintWindow8002F44(&gUnknown_03004210); } void sub_802E1B0(void) @@ -1572,7 +1572,7 @@ void sub_802E1B0(void) s32 i; gUnknown_03004348 = 0; - FillWindowRect(&gUnknown_03004210, 0x1016, 1, 0x37, 0x14, 0x3A); + Text_FillWindowRect(&gUnknown_03004210, 0x1016, 1, 0x37, 0x14, 0x3A); for (i = 0; i < 4; i++) { nullsub_7(i); @@ -1601,8 +1601,8 @@ void sub_802E220(void) str = ConvertIntToDecimalStringN(str, r4->pp[gMoveSelectionCursor[gActiveBank]], 1, 2); *str++ = CHAR_SLASH; ConvertIntToDecimalStringN(str, r4->unkC[gMoveSelectionCursor[gActiveBank]], 1, 2); - InitWindow(&gUnknown_03004210, gDisplayedStringBattle, 0x2A2, 0x19, 0x37); - sub_8002F44(&gUnknown_03004210); + Text_InitWindow(&gUnknown_03004210, gDisplayedStringBattle, 0x2A2, 0x19, 0x37); + Text_PrintWindow8002F44(&gUnknown_03004210); } } @@ -1613,8 +1613,8 @@ void sub_802E2D4(void) { if (gBattleBufferA[gActiveBank][2] == 1) { - FillWindowRect(&gUnknown_03004210, 0x1016, 0x17, 0x37, 0x1C, 0x3A); - InitWindow(&gUnknown_03004210, BattleText_ForgetMove, 0x290, 0x13, 0x37); + Text_FillWindowRect(&gUnknown_03004210, 0x1016, 0x17, 0x37, 0x1C, 0x3A); + Text_InitWindow(&gUnknown_03004210, BattleText_ForgetMove, 0x290, 0x13, 0x37); } else { @@ -1623,10 +1623,10 @@ void sub_802E2D4(void) str = StringCopy(str, BattleText_Format); StringCopy(str, gTypeNames[gBattleMoves[r4->moves[gMoveSelectionCursor[gActiveBank]]].type]); - FillWindowRect(&gUnknown_03004210, 0x1016, 0x17, 0x39, 0x1C, 0x3A); - InitWindow(&gUnknown_03004210, gDisplayedStringBattle, 0x2C0, 0x17, 0x39); + Text_FillWindowRect(&gUnknown_03004210, 0x1016, 0x17, 0x39, 0x1C, 0x3A); + Text_InitWindow(&gUnknown_03004210, gDisplayedStringBattle, 0x2C0, 0x17, 0x39); } - sub_8002F44(&gUnknown_03004210); + Text_PrintWindow8002F44(&gUnknown_03004210); } const u8 gUnknown_081FAE89[][2] = @@ -1652,7 +1652,7 @@ const u8 gUnknown_081FAE91[][2] = void sub_802E3B4(u8 a, int unused) { sub_814A958(0x48); - sub_814A880(gUnknown_081FAE89[a][0], gUnknown_081FAE89[a][1]); + MenuCursor_SetPos814A880(gUnknown_081FAE89[a][0], gUnknown_081FAE89[a][1]); } void nullsub_7(u8 a) @@ -1662,7 +1662,7 @@ void nullsub_7(u8 a) void sub_802E3E4(u8 a, int unused) { sub_814A958(0x2A); - sub_814A880(gUnknown_081FAE91[a][0], gUnknown_081FAE91[a][1]); + MenuCursor_SetPos814A880(gUnknown_081FAE91[a][0], gUnknown_081FAE91[a][1]); } void nullsub_8(u8 a) @@ -1697,7 +1697,7 @@ void b_link_standby_message(void) { gBattle_BG0_X = 0; gBattle_BG0_Y = 0; - sub_8002EB0(&gUnknown_03004210, BattleText_LinkStandby, 0x90, 2, 15); + Text_InitWindow8002EB0(&gUnknown_03004210, BattleText_LinkStandby, 0x90, 2, 15); } } @@ -2562,7 +2562,7 @@ void PlayerHandlePrintString(void) gBattle_BG0_X = 0; gBattle_BG0_Y = 0; BufferStringBattle(*(u16 *)&gBattleBufferA[gActiveBank][2]); - sub_8002EB0(&gUnknown_03004210, gDisplayedStringBattle, 0x90, 2, 15); + Text_InitWindow8002EB0(&gUnknown_03004210, gDisplayedStringBattle, 0x90, 2, 15); gBattleBankFunc[gActiveBank] = sub_802DF18; } @@ -2580,14 +2580,14 @@ void PlayerHandlecmd18(void) gBattle_BG0_X = 0; gBattle_BG0_Y = 160; - FillWindowRect(&gUnknown_03004210, 10, 2, 15, 27, 18); - FillWindowRect(&gUnknown_03004210, 10, 2, 35, 16, 38); + Text_FillWindowRect(&gUnknown_03004210, 10, 2, 15, 27, 18); + Text_FillWindowRect(&gUnknown_03004210, 10, 2, 35, 16, 38); gBattleBankFunc[gActiveBank] = sub_802C098; - InitWindow(&gUnknown_03004210, BattleText_MenuOptions, 400, 18, 35); - sub_8002F44(&gUnknown_03004210); - sub_814A5C0(0, 0xFFFF, 12, 11679, 0); + Text_InitWindow(&gUnknown_03004210, BattleText_MenuOptions, 400, 18, 35); + Text_PrintWindow8002F44(&gUnknown_03004210); + MenuCursor_Create814A5C0(0, 0xFFFF, 12, 11679, 0); for (r4 = 0; r4 < 4; r4++) nullsub_8(r4); @@ -2595,8 +2595,8 @@ void PlayerHandlecmd18(void) sub_802E3E4(gActionSelectionCursor[gActiveBank], 0); StrCpyDecodeToDisplayedStringBattle(BattleText_OtherMenu); - InitWindow(&gUnknown_03004210, gDisplayedStringBattle, SUB_803037C_TILE_DATA_OFFSET, 2, 35); - sub_8002F44(&gUnknown_03004210); + Text_InitWindow(&gUnknown_03004210, gDisplayedStringBattle, SUB_803037C_TILE_DATA_OFFSET, 2, 35); + Text_PrintWindow8002F44(&gUnknown_03004210); } void PlayerHandlecmd19() @@ -2605,7 +2605,7 @@ void PlayerHandlecmd19() void PlayerHandlecmd20(void) { - sub_814A5C0(0, 0xFFFF, 12, 0x2D9F, 0); + MenuCursor_Create814A5C0(0, 0xFFFF, 12, 0x2D9F, 0); sub_80304A8(); gBattleBankFunc[gActiveBank] = sub_802C68C; } @@ -2619,8 +2619,8 @@ void sub_80304A8(void) sub_802E3B4(gMoveSelectionCursor[gActiveBank], 0); if (gBattleBufferA[gActiveBank][2] != 1) { - InitWindow(&gUnknown_03004210, BattleText_PP, 656, 23, 55); - sub_8002F44(&gUnknown_03004210); + Text_InitWindow(&gUnknown_03004210, BattleText_PP, 656, 23, 55); + Text_PrintWindow8002F44(&gUnknown_03004210); } sub_802E220(); sub_802E2D4(); diff --git a/src/battle/battle_controller_safari.c b/src/battle/battle_controller_safari.c index 0a629ba4d..a4b610752 100644 --- a/src/battle/battle_controller_safari.c +++ b/src/battle/battle_controller_safari.c @@ -453,7 +453,7 @@ void SafariHandlePrintString(void) gBattle_BG0_X = 0; gBattle_BG0_Y = 0; BufferStringBattle(*(u16 *)&gBattleBufferA[gActiveBank][2]); - sub_8002EB0(&gUnknown_03004210, gDisplayedStringBattle, 144, 2, 15); + Text_InitWindow8002EB0(&gUnknown_03004210, gDisplayedStringBattle, 144, 2, 15); gBattleBankFunc[gActiveBank] = sub_812B694; } @@ -472,13 +472,13 @@ void SafariHandlecmd18(void) gBattle_BG0_X = 0; gBattle_BG0_Y = 160; gUnknown_03004210.paletteNum = 0; - FillWindowRect_DefaultPalette(&gUnknown_03004210, 10, 2, 15, 27, 18); - FillWindowRect_DefaultPalette(&gUnknown_03004210, 10, 2, 35, 16, 36); + Text_FillWindowRectDefPalette(&gUnknown_03004210, 10, 2, 15, 27, 18); + Text_FillWindowRectDefPalette(&gUnknown_03004210, 10, 2, 35, 16, 36); gBattleBankFunc[gActiveBank] = bx_battle_menu_t6_2; - InitWindow(&gUnknown_03004210, BattleText_MenuOptionsSafari, 400, 18, 35); - sub_8002F44(&gUnknown_03004210); - sub_814A5C0(0, 0xFFFF, 12, 11679, 0); + Text_InitWindow(&gUnknown_03004210, BattleText_MenuOptionsSafari, 400, 18, 35); + Text_PrintWindow8002F44(&gUnknown_03004210); + MenuCursor_Create814A5C0(0, 0xFFFF, 12, 11679, 0); for (i = 0; i < 4; i++) nullsub_8(i); @@ -486,8 +486,8 @@ void SafariHandlecmd18(void) sub_802E3E4(gActionSelectionCursor[gActiveBank], 0); StrCpyDecodeToDisplayedStringBattle(BattleText_PlayerMenu); - InitWindow(&gUnknown_03004210, gDisplayedStringBattle, SUB_812BB10_TILE_DATA_OFFSET, 2, 35); - sub_8002F44(&gUnknown_03004210); + Text_InitWindow(&gUnknown_03004210, gDisplayedStringBattle, SUB_812BB10_TILE_DATA_OFFSET, 2, 35); + Text_PrintWindow8002F44(&gUnknown_03004210); } void SafariHandlecmd19(void) diff --git a/src/battle/battle_controller_wally.c b/src/battle/battle_controller_wally.c index bd2b4a45b..6266d955c 100644 --- a/src/battle/battle_controller_wally.c +++ b/src/battle/battle_controller_wally.c @@ -1246,7 +1246,7 @@ void WallyHandlePrintString(void) if (*ptr == 2) DestroyMenuCursor(); BufferStringBattle(*ptr); - sub_8002EB0(&gUnknown_03004210, gDisplayedStringBattle, 0x90, 2, 15); + Text_InitWindow8002EB0(&gUnknown_03004210, gDisplayedStringBattle, 0x90, 2, 15); gBattleBankFunc[gActiveBank] = sub_8137454; } @@ -1265,22 +1265,22 @@ void WallyHandlecmd18(void) gBattle_BG0_X = 0; gBattle_BG0_Y = 160; gUnknown_03004210.paletteNum = 0; - FillWindowRect_DefaultPalette(&gUnknown_03004210, 10, 2, 15, 27, 18); - FillWindowRect_DefaultPalette(&gUnknown_03004210, 10, 2, 35, 16, 36); + Text_FillWindowRectDefPalette(&gUnknown_03004210, 10, 2, 15, 27, 18); + Text_FillWindowRectDefPalette(&gUnknown_03004210, 10, 2, 35, 16, 36); gBattleBankFunc[gActiveBank] = sub_81372BC; - InitWindow(&gUnknown_03004210, BattleText_MenuOptions, 400, 18, 35); - sub_8002F44(&gUnknown_03004210); - sub_814A5C0(0, 0xFFFF, 12, 0x2D9F, 0); + Text_InitWindow(&gUnknown_03004210, BattleText_MenuOptions, 400, 18, 35); + Text_PrintWindow8002F44(&gUnknown_03004210); + MenuCursor_Create814A5C0(0, 0xFFFF, 12, 0x2D9F, 0); for (i = 0; i < 4; i++) nullsub_8(i); sub_802E3E4(0, 0); StrCpyDecodeToDisplayedStringBattle(BattleText_WallyMenu); #ifdef ENGLISH - InitWindow(&gUnknown_03004210, gDisplayedStringBattle, 440, 2, 35); + Text_InitWindow(&gUnknown_03004210, gDisplayedStringBattle, 440, 2, 35); #else - InitWindow(&gUnknown_03004210, gDisplayedStringBattle, 444, 2, 35); + Text_InitWindow(&gUnknown_03004210, gDisplayedStringBattle, 444, 2, 35); #endif - sub_8002F44(&gUnknown_03004210); + Text_PrintWindow8002F44(&gUnknown_03004210); } void WallyHandlecmd19(void) diff --git a/src/battle/battle_party_menu.c b/src/battle/battle_party_menu.c index 7bce00d82..68a97c536 100644 --- a/src/battle/battle_party_menu.c +++ b/src/battle/battle_party_menu.c @@ -583,13 +583,13 @@ static void Task_HandlePopupMenuInput(u8 taskId) if (gMain.newAndRepeatedKeys & DPAD_UP) { PlaySE(SE_SELECT); - MoveMenuCursor(-1); + Menu_MoveCursor(-1); return; } if (gMain.newAndRepeatedKeys & DPAD_DOWN) { PlaySE(SE_SELECT); - MoveMenuCursor(1); + Menu_MoveCursor(1); return; } if (gMain.newKeys & A_BUTTON) @@ -598,7 +598,7 @@ static void Task_HandlePopupMenuInput(u8 taskId) func = PartyMenuGetPopupMenuFunc(gTasks[taskId].data[4], sBattlePartyPopupMenus, sBattlePartyMenuActions, - GetMenuCursorPos()); + Menu_GetCursorPos()); func(taskId); return; } @@ -723,7 +723,7 @@ static void Task_BattlePartyMenuShift(u8 taskId) static void Task_BattlePartyMenuCancel(u8 taskId) { - HandleDestroyMenuCursors(); + Menu_DestroyCursor(); ClosePartyPopupMenu(gTasks[taskId].data[4], sBattlePartyPopupMenus); gTasks[taskId].data[4] = gTasks[taskId].data[5]; PrintPartyMenuPromptText(0, 0); diff --git a/src/battle/battle_records.c b/src/battle/battle_records.c index 97740e3da..4979760d7 100644 --- a/src/battle/battle_records.c +++ b/src/battle/battle_records.c @@ -202,7 +202,7 @@ static void PrintLinkBattleWinsLossesDraws(struct LinkBattleRecord *records) ConvertIntToDecimalStringN_DigitWidth6(gStringVar1, GetGameStat(GAME_STAT_LINK_BATTLE_WINS), STR_CONV_MODE_RIGHT_ALIGN, 4); ConvertIntToDecimalStringN_DigitWidth6(gStringVar2, GetGameStat(GAME_STAT_LINK_BATTLE_LOSSES), STR_CONV_MODE_RIGHT_ALIGN, 4); ConvertIntToDecimalStringN_DigitWidth6(gStringVar3, GetGameStat(GAME_STAT_LINK_BATTLE_DRAWS), STR_CONV_MODE_RIGHT_ALIGN, 4); - MenuPrint(gOtherText_WinRecord, 3, 3); + Menu_PrintText(gOtherText_WinRecord, 3, 3); } static void PrintLinkBattleRecord(struct LinkBattleRecord *record, u8 y) @@ -217,39 +217,39 @@ static void PrintLinkBattleRecord(struct LinkBattleRecord *record, u8 y) buffer[4] = 0x11; buffer[5] = 1; StringCopy(buffer + 6, gOtherText_SevenDashes); - MenuPrint(buffer, 3, y); + Menu_PrintText(buffer, 3, y); StringCopy(buffer + 6, gOtherText_FourDashes); - MenuPrint(buffer, 11, y); - MenuPrint(buffer, 17, y); - MenuPrint(buffer, 23, y); + Menu_PrintText(buffer, 11, y); + Menu_PrintText(buffer, 17, y); + Menu_PrintText(buffer, 23, y); } else { StringFillWithTerminator(gStringVar1, 8); StringCopyN(gStringVar1, record->name, 7); - MenuPrint(gStringVar1, 3, y); + Menu_PrintText(gStringVar1, 3, y); gStringVar1[0] = EXT_CTRL_CODE_BEGIN; gStringVar1[1] = 0x14; gStringVar1[2] = 6; ConvertIntToDecimalStringN(gStringVar1 + 3, record->wins, STR_CONV_MODE_RIGHT_ALIGN, 4); - MenuPrint(gStringVar1, 11, y); + Menu_PrintText(gStringVar1, 11, y); ConvertIntToDecimalStringN(gStringVar1 + 3, record->losses, STR_CONV_MODE_RIGHT_ALIGN, 4); - MenuPrint(gStringVar1, 17, y); + Menu_PrintText(gStringVar1, 17, y); ConvertIntToDecimalStringN(gStringVar1 + 3, record->draws, STR_CONV_MODE_RIGHT_ALIGN, 4); - MenuPrint(gStringVar1, 23, y); + Menu_PrintText(gStringVar1, 23, y); } } void ShowLinkBattleRecords(void) { s32 i; - MenuDrawTextWindow(1, 0, 28, 18); + Menu_DrawStdWindowFrame(1, 0, 28, 18); sub_8072BD8(gOtherText_BattleResults, 0, 1, 240); PrintLinkBattleWinsLossesDraws(gSaveBlock1.linkBattleRecords); #if ENGLISH - MenuPrint(gOtherText_WinLoseDraw, 12, 6); + Menu_PrintText(gOtherText_WinLoseDraw, 12, 6); #elif GERMAN - MenuPrint_PixelCoords(gOtherText_WinLoseDraw, 88, 48, 1); + Menu_PrintTextPixelCoords(gOtherText_WinLoseDraw, 88, 48, 1); #endif for (i = 0; i < 5; i++) @@ -285,11 +285,11 @@ static bool32 sub_8110494(u8 level) static void PrintWinStreak(const u8 *str, u16 streak, u8 left, u8 top) { - MenuPrint(str, left, top); + Menu_PrintText(str, left, top); if (streak > 9999) streak = 9999; sub_8072C14(gStringVar1, streak, 24, 1); - MenuPrint(gOtherText_WinStreak, left + 7, top); + Menu_PrintText(gOtherText_WinStreak, left + 7, top); } static void PrintRecordWinStreak(u8 level, u8 left, u8 top) @@ -320,10 +320,10 @@ static void PrintLastWinStreak(u8 level, u8 left, u8 top) void ShowBattleTowerRecords(void) { u16 i; - MenuDrawTextWindow(3, 1, 27, 17); + Menu_DrawStdWindowFrame(3, 1, 27, 17); sub_8072BD8(gOtherText_BattleTowerResults, 3, 2, 0xC8); - MenuPrint(gOtherText_Lv50, 5, 6); - MenuPrint(gOtherText_Lv100, 5, 12); + Menu_PrintText(gOtherText_Lv50, 5, 6); + Menu_PrintText(gOtherText_Lv100, 5, 12); for (i = 5; i < 26; i++) { sub_8071F60(CHAR_HYPHEN, i, 10); diff --git a/src/battle/reshow_battle_screen.c b/src/battle/reshow_battle_screen.c index 6a6d7a137..42bb3ba7f 100644 --- a/src/battle/reshow_battle_screen.c +++ b/src/battle/reshow_battle_screen.c @@ -78,9 +78,9 @@ static void CB2_ReshowBattleScreenAfterMenu(void) { case 0: dp12_8087EA4(); - SetUpWindowConfig(&gWindowConfig_81E6C58); + Text_LoadWindowTemplate(&gWindowTemplate_81E6C58); ResetPaletteFade(); - InitWindowFromConfig(&gUnknown_03004210, &gWindowConfig_81E6C58); + Text_InitWindowWithTemplate(&gUnknown_03004210, &gWindowTemplate_81E6C58); gBattle_BG0_X = 0; gBattle_BG0_Y = 0; gBattle_BG1_X = 0; diff --git a/src/contest.c b/src/contest.c index c32719648..8985d6490 100644 --- a/src/contest.c +++ b/src/contest.c @@ -357,16 +357,16 @@ void LoadContestBgAfterMoveAnim(void) void SetUpContestWindow(void) { - SetUpWindowConfig(&gWindowConfig_81E6FD8); - InitWindowFromConfig(&gUnknown_03004210, &gWindowConfig_81E6FD8); - InitWindowFromConfig(&gMenuWindow, &gWindowConfig_81E6FF4); + Text_LoadWindowTemplate(&gWindowTemplate_81E6FD8); + Text_InitWindowWithTemplate(&gUnknown_03004210, &gWindowTemplate_81E6FD8); + Text_InitWindowWithTemplate(&gMenuWindow, &gWindowTemplate_81E6FF4); } void sub_80AB350(void) { u8 i; - LoadFontDefaultPalette(&gWindowConfig_81E6FD8); + LoadFontDefaultPalette(&gWindowTemplate_81E6FD8); FillPalette(0, 0, 2); for (i = 10; i < 14; i++) LoadPalette(gPlttBufferUnfaded + 241, 240 + i, 2); @@ -651,13 +651,13 @@ void sub_80ABB70(u8 taskId) InsertStringDigit(gDisplayedStringBattle, sContest.turnNumber + 1); sub_80AF138(); StringExpandPlaceholders(gStringVar4, gDisplayedStringBattle); - sub_8002EB0(&gMenuWindow, gStringVar4, 776, 1, 15); + Text_InitWindow8002EB0(&gMenuWindow, gStringVar4, 776, 1, 15); gTasks[taskId].func = sub_80ABC3C; } void sub_80ABC3C(u8 taskId) { - if (sub_80037A0(&gMenuWindow) == 1) + if (Text_UpdateWindowInContest(&gMenuWindow) == 1) gTasks[taskId].func = sub_80ABC70; } @@ -686,7 +686,7 @@ void sub_80ABCDC(u8 taskId) gBattle_BG0_Y = 0xA0; gBattle_BG2_Y = 0xA0; - FillWindowRect_DefaultPalette( + Text_FillWindowRectDefPalette( &gUnknown_03004210, 0, gUnknown_083CA340[0][0], @@ -715,17 +715,17 @@ void sub_80ABCDC(u8 taskId) } r5 = StringCopy(r5, gMoveNames[move]); - sub_8002E4C( + Text_InitWindow8002E4C( &gUnknown_03004210, sp8, 776 + i * 20, gUnknown_083CA340[i][0] * 8 + 4, gUnknown_083CA340[i][1] * 8, 1); - sub_8002F44(&gUnknown_03004210); + Text_PrintWindow8002F44(&gUnknown_03004210); } - sub_814A5C0(0, 0xFFFF, 12, 0x2D9F, 72); + MenuCursor_Create814A5C0(0, 0xFFFF, 12, 0x2D9F, 72); sub_80AC0AC(sContest.playerMoveChoice); sub_80AEBEC(gContestMons[gContestPlayerMonIndex].moves[sContest.playerMoveChoice]); gTasks[taskId].func = sub_80ABEA0; @@ -757,7 +757,7 @@ void sub_80ABEA0(u8 taskId) sub_814A904(); PlaySE(SE_SELECT); sub_80AFFE0(FALSE); - FillWindowRect_DefaultPalette( + Text_FillWindowRectDefPalette( &gUnknown_03004210, 0, gUnknown_083CA340[0][0], @@ -771,7 +771,7 @@ void sub_80ABEA0(u8 taskId) InsertStringDigit(gDisplayedStringBattle, sContest.turnNumber + 1); sub_80AF138(); StringExpandPlaceholders(gStringVar4, gDisplayedStringBattle); - sub_8003460(&gMenuWindow, gStringVar4, 776, 1, 15); + Text_InitWindowAndPrintText(&gMenuWindow, gStringVar4, 776, 1, 15); gBattle_BG0_Y = 0; gBattle_BG2_Y = 0; gTasks[taskId].func = sub_80ABC70; @@ -809,7 +809,7 @@ void sub_80ABEA0(u8 taskId) void sub_80AC0AC(s8 a) { - sub_814A880(4, 88 + a * 16); + MenuCursor_SetPos814A880(4, 88 + a * 16); } void nullsub_17(s8 a) @@ -976,12 +976,12 @@ void sub_80AC2CC(u8 taskId) else StringCopy(gStringVar2, gUnknown_083CC330[sContestantStatus[r7].moveCategory]); StringExpandPlaceholders(gStringVar4, gUnknown_083CAFD7); - sub_8002EB0(&gMenuWindow, gStringVar4, 776, 1, 15); + Text_InitWindow8002EB0(&gMenuWindow, gStringVar4, 776, 1, 15); gTasks[taskId].data[0] = 6; } return; case 6: - if (sub_80037A0(&gMenuWindow) != 0) + if (Text_UpdateWindowInContest(&gMenuWindow) != 0) { sContest.unk1925E = 0; gTasks[taskId].data[0] = 7; @@ -1059,7 +1059,7 @@ void sub_80AC2CC(u8 taskId) } return; case 24: - if (sub_80037A0(&gMenuWindow) != 0) + if (Text_UpdateWindowInContest(&gMenuWindow) != 0) gTasks[taskId].data[0] = 23; return; case 48: @@ -1171,7 +1171,7 @@ void sub_80AC2CC(u8 taskId) } return; case 27: - if (sub_80037A0(&gMenuWindow) != 0) + if (Text_UpdateWindowInContest(&gMenuWindow) != 0) gTasks[taskId].data[0] = 28; return; case 28: @@ -1234,13 +1234,13 @@ void sub_80AC2CC(u8 taskId) sub_80AF138(); StringCopy(gStringVar1, gContestMons[r7].nickname); StringExpandPlaceholders(gStringVar4, ContestString_CantAppealNextTurn); - sub_8002EB0(&gMenuWindow, gStringVar4, 776, 1, 15); + Text_InitWindow8002EB0(&gMenuWindow, gStringVar4, 776, 1, 15); } gTasks[taskId].data[0] = 52; } return; case 52: - if (sub_80037A0(&gMenuWindow) != 0) + if (Text_UpdateWindowInContest(&gMenuWindow) != 0) { if (!sContestantStatus[r7].unk15_6) gTasks[taskId].data[0] = 17; @@ -1254,11 +1254,11 @@ void sub_80AC2CC(u8 taskId) { sub_80AF138(); if (r4 == 1) - sub_8002EB0(&gMenuWindow, ContestString_WentOverWell, 776, 1, 15); + Text_InitWindow8002EB0(&gMenuWindow, ContestString_WentOverWell, 776, 1, 15); else if (r4 == 2) - sub_8002EB0(&gMenuWindow, ContestString_WentOverVeryWell, 776, 1, 15); + Text_InitWindow8002EB0(&gMenuWindow, ContestString_WentOverVeryWell, 776, 1, 15); else - sub_8002EB0(&gMenuWindow, ContestString_AppealComboExcellently, 776, 1, 15); + Text_InitWindow8002EB0(&gMenuWindow, ContestString_AppealComboExcellently, 776, 1, 15); sub_80B1710(3); gTasks[taskId].data[10] = 0; gTasks[taskId].data[0] = 45; @@ -1268,7 +1268,7 @@ void sub_80AC2CC(u8 taskId) sub_80AF138(); StringCopy(gStringVar1, gContestMons[r7].nickname); StringExpandPlaceholders(gStringVar4, ContestString_JudgeExpectantly2); - sub_8002EB0(&gMenuWindow, gStringVar4, 776, 1, 15); + Text_InitWindow8002EB0(&gMenuWindow, gStringVar4, 776, 1, 15); sub_80B1710(2); gTasks[taskId].data[10] = 0; gTasks[taskId].data[0] = 45; @@ -1282,7 +1282,7 @@ void sub_80AC2CC(u8 taskId) } return; case 15: - if (sub_80037A0(&gMenuWindow) != 0) + if (Text_UpdateWindowInContest(&gMenuWindow) != 0) { if (++gTasks[taskId].data[10] > 50) { @@ -1311,7 +1311,7 @@ void sub_80AC2CC(u8 taskId) sub_80AF138(); StringCopy(gStringVar1, gContestMons[r7].nickname); StringExpandPlaceholders(gStringVar4, ContestString_DissapointedRepeat); - sub_8002EB0(&gMenuWindow, gStringVar4, 776, 1, 15); + Text_InitWindow8002EB0(&gMenuWindow, gStringVar4, 776, 1, 15); gTasks[taskId].data[10] = 0; sub_80B1710(0); gTasks[taskId].data[0] = 46; @@ -1326,7 +1326,7 @@ void sub_80AC2CC(u8 taskId) gTasks[taskId].data[0] = 19; return; case 19: - if (sub_80037A0(&gMenuWindow) != 0) + if (Text_UpdateWindowInContest(&gMenuWindow) != 0) { sub_80AFBA0(sContestantStatus[r7].appeal2, -sContestantStatus[r7].unk18, r7); sContestantStatus[r7].appeal2 -= sContestantStatus[r7].unk18; @@ -1381,7 +1381,7 @@ void sub_80AC2CC(u8 taskId) StringExpandPlaceholders(gStringVar4, ContestString_WentOverGreat); else StringExpandPlaceholders(gStringVar4, ContestString_GotCrowdGoing); - sub_8002EB0(&gMenuWindow, gStringVar4, 776, 1, 15); + Text_InitWindow8002EB0(&gMenuWindow, gStringVar4, 776, 1, 15); gTasks[taskId].data[10] = 0; gTasks[taskId].data[11] = 0; if (r4 < 0) @@ -1400,7 +1400,7 @@ void sub_80AC2CC(u8 taskId) gTasks[taskId].data[10]++; break; case 1: - if (!sContest.unk1920B_0 && sub_80037A0(&gMenuWindow) != 0) + if (!sContest.unk1920B_0 && Text_UpdateWindowInContest(&gMenuWindow) != 0) { sub_80B1CBC(-1); gTasks[taskId].data[10]++; @@ -1431,7 +1431,7 @@ void sub_80AC2CC(u8 taskId) switch (gTasks[taskId].data[10]) { case 0: - if (sub_80037A0(&gMenuWindow) != 0) + if (Text_UpdateWindowInContest(&gMenuWindow) != 0) { sub_80B1EA8(1, 1); gTasks[taskId].data[10]++; @@ -1491,20 +1491,20 @@ void sub_80AC2CC(u8 taskId) StringCopy(gStringVar1, gContestMons[r7].nickname); StringCopy(gStringVar2, gMoveNames[sContestantStatus[r7].currMove]); StringExpandPlaceholders(gStringVar4, ContestString_CrowdWatches); - sub_8002EB0(&gMenuWindow, gStringVar4, 776, 1, 15); + Text_InitWindow8002EB0(&gMenuWindow, gStringVar4, 776, 1, 15); gTasks[taskId].data[0] = 58; return; case 58: - if (sub_80037A0(&gMenuWindow) != 0) + if (Text_UpdateWindowInContest(&gMenuWindow) != 0) { sub_80AF138(); StringExpandPlaceholders(gStringVar4, ContestString_Ignored2); - sub_8002EB0(&gMenuWindow, gStringVar4, 776, 1, 15); + Text_InitWindow8002EB0(&gMenuWindow, gStringVar4, 776, 1, 15); gTasks[taskId].data[0] = 59; } return; case 59: - if (sub_80037A0(&gMenuWindow) != 0) + if (Text_UpdateWindowInContest(&gMenuWindow) != 0) { sub_80AF138(); gTasks[taskId].data[0] = 55; @@ -1517,11 +1517,11 @@ void sub_80AC2CC(u8 taskId) StringCopy(gStringVar1, gContestMons[r7].nickname); StringCopy(gStringVar2, gMoveNames[sContestantStatus[r7].currMove]); StringExpandPlaceholders(gStringVar4, gUnknown_083CBF60); - sub_8002EB0(&gMenuWindow, gStringVar4, 776, 1, 15); + Text_InitWindow8002EB0(&gMenuWindow, gStringVar4, 776, 1, 15); gTasks[taskId].data[0] = 34; return; case 34: - if (sub_80037A0(&gMenuWindow) != 0) + if (Text_UpdateWindowInContest(&gMenuWindow) != 0) gTasks[taskId].data[0] = 55; return; case 55: @@ -1563,11 +1563,11 @@ void sub_80AC2CC(u8 taskId) sub_80AF138(); StringCopy(gStringVar1, gContestMons[r7].nickname); StringExpandPlaceholders(gStringVar4, gUnknown_083CB00D); - sub_8002EB0(&gMenuWindow, gStringVar4, 776, 1, 15); + Text_InitWindow8002EB0(&gMenuWindow, gStringVar4, 776, 1, 15); gTasks[taskId].data[0] = 32; return; case 32: - if (sub_80037A0(&gMenuWindow) != 0) + if (Text_UpdateWindowInContest(&gMenuWindow) != 0) gTasks[taskId].data[0] = 21; return; case 21: @@ -1734,13 +1734,13 @@ void sub_80ADB88(u8 taskId) sub_80AF138(); StringCopy(gStringVar1, gContestMons[gContestPlayerMonIndex].nickname); StringExpandPlaceholders(gStringVar4, gContestStandOutStrings[r4]); - sub_8002EB0(&gMenuWindow, gStringVar4, 776, 1, 15); + Text_InitWindow8002EB0(&gMenuWindow, gStringVar4, 776, 1, 15); gTasks[taskId].func = sub_80ADC10; } void sub_80ADC10(u8 taskId) { - if (sub_80037A0(&gMenuWindow) == 1) + if (Text_UpdateWindowInContest(&gMenuWindow) == 1) { gTasks[taskId].data[0] = 0; gTasks[taskId].func = sub_80ADC4C; @@ -1813,14 +1813,14 @@ void sub_80ADDA4(u8 taskId) sub_80BE23C(sContestantStatus[gContestPlayerMonIndex].prevMove); gUnknown_03005D28 = gRngValue; StringExpandPlaceholders(gStringVar4, gUnknown_083CB02C); - sub_8002EB0(&gMenuWindow, gStringVar4, 776, 1, 15); + Text_InitWindow8002EB0(&gMenuWindow, gStringVar4, 776, 1, 15); gTasks[taskId].data[2] = 0; gTasks[taskId].func = sub_80ADE54; } void sub_80ADE54(u8 taskId) { - if (sub_80037A0(&gMenuWindow) == 1) + if (Text_UpdateWindowInContest(&gMenuWindow) == 1) { sub_80B2184(); gBattle_BG1_X = 0; @@ -1940,7 +1940,7 @@ void Contest_CreatePlayerMon(u8 partyIndex) s16 tough; StringCopy(name, gSaveBlock2.playerName); - StripExtCtrlCodes(name); + Text_StripExtCtrlCodes(name); if (gIsLinkContest & 1) { u8 temp = name[5]; @@ -1960,7 +1960,7 @@ void Contest_CreatePlayerMon(u8 partyIndex) StringGetEnd10(name); if (gIsLinkContest & 1) { - StripExtCtrlCodes(name); + Text_StripExtCtrlCodes(name); if (GetMonData(&gPlayerParty[partyIndex], MON_DATA_LANGUAGE) == LANGUAGE_JAPANESE) { name[5] = EOS; @@ -2121,7 +2121,7 @@ void sub_80AE514(void) for (i = 0; i < 4; i++) { - FillWindowRect_DefaultPalette( + Text_FillWindowRectDefPalette( &gUnknown_03004210, 0, gUnknown_083CA308[gUnknown_02038696[i]][0], @@ -2161,7 +2161,7 @@ void sub_80AE5D4(u8 p, u8 b) if ((gIsLinkContest & 1) && gLinkPlayers[p].language == LANGUAGE_JAPANESE) { StringCopy(str, gLinkPlayers[p].name); - sub_8004D04( + Text_InitWindow8004D04( &gUnknown_03004210, gDisplayedStringBattle, 592 + gUnknown_02038696[p] * 22, @@ -2172,7 +2172,7 @@ void sub_80AE5D4(u8 p, u8 b) else { StringCopy(str, gContestMons[p].trainerName); - sub_8003460( + Text_InitWindowAndPrintText( &gUnknown_03004210, gDisplayedStringBattle, 592 + gUnknown_02038696[p] * 22, @@ -2198,7 +2198,7 @@ void sub_80AE6E4(u8 a, u8 b) str = sub_80AE598(str, gContestMons[a].nickname, b); *str = EOS; - sub_8004D04( + Text_InitWindow8004D04( &gUnknown_03004210, gDisplayedStringBattle, 512 + gUnknown_02038696[a] * 20, @@ -2383,7 +2383,7 @@ void sub_80AEBEC(u16 a) s32 i; u8 numHearts; - FillWindowRect_DefaultPalette(&gUnknown_03004210, 0, 11, 31, 16, 34); + Text_FillWindowRectDefPalette(&gUnknown_03004210, 0, 11, 31, 16, 34); category = gContestMoves[a].contestCategory; if (category == CONTEST_CATEGORY_COOL) @@ -2432,13 +2432,13 @@ void sub_80AEBEC(u16 a) *(u16 *)(VRAM + 0xC82A + i * 2) = 0x5036; } - sub_8003460(&gUnknown_03004210, gContestEffectStrings[gContestMoves[a].effect], 868, 11, 35); - sub_8003460(&gUnknown_03004210, gUnknown_083CC5A2, 866, 16, 31); + Text_InitWindowAndPrintText(&gUnknown_03004210, gContestEffectStrings[gContestMoves[a].effect], 868, 11, 35); + Text_InitWindowAndPrintText(&gUnknown_03004210, gUnknown_083CC5A2, 866, 16, 31); } void sub_80AED58(void) { - FillWindowRect_DefaultPalette(&gUnknown_03004210, 0, 11, 35, 28, 40); + Text_FillWindowRectDefPalette(&gUnknown_03004210, 0, 11, 35, 28, 40); } // unused @@ -2614,7 +2614,7 @@ void sub_80AF120(void) void sub_80AF138(void) { - FillWindowRect_DefaultPalette(&gUnknown_03004210, 0, 1, 15, 17, 18); + Text_FillWindowRectDefPalette(&gUnknown_03004210, 0, 1, 15, 17, 18); } u16 GetChosenMove(u8 a) @@ -2656,7 +2656,7 @@ void sub_80AF1E4(u8 a, u8 b) else sub_80AE598(gDisplayedStringBattle, gMoveNames[sContestantStatus[a].currMove], r3); sub_80AF2A0(a); - sub_8003460( + Text_InitWindowAndPrintText( &gUnknown_03004210, gDisplayedStringBattle, 696 + a * 20, @@ -2674,7 +2674,7 @@ void unref_sub_80AF280(u8 a) void sub_80AF2A0(u8 a) { - FillWindowRect_DefaultPalette( + Text_FillWindowRectDefPalette( &gUnknown_03004210, 0, gUnknown_083CA318[a][0], @@ -2953,7 +2953,7 @@ void sub_80AF860(void) gBattle_BG0_Y = 0; gBattle_BG2_Y = 0; sub_80AF138(); - sub_8003460(&gMenuWindow, gUnknownText_LinkStandbyAndWinner, 776, 1, 15); + Text_InitWindowAndPrintText(&gMenuWindow, gUnknownText_LinkStandbyAndWinner, 776, 1, 15); } u8 unref_sub_80AF89C(s16 a, s16 b, u8 c, u8 d) @@ -4146,7 +4146,7 @@ void unref_sub_80B0CF4(void) for (i = 0; i < 4; i++) { - FillWindowRect_DefaultPalette( + Text_FillWindowRectDefPalette( &gUnknown_03004210, 0, gUnknown_083CA308[i][0], @@ -4175,7 +4175,7 @@ void sub_80B0D7C(void) for (i = 0; i < 4; i++) { - FillWindowRect_DefaultPalette( + Text_FillWindowRectDefPalette( &gUnknown_03004210, 0, gUnknown_083CA308[i][0], @@ -4193,7 +4193,7 @@ void sub_80B0D7C(void) r5++; } ConvertIntToDecimalStringN(sp8 + r5, r2, 0, 4); - sub_8003460( + Text_InitWindowAndPrintText( &gUnknown_03004210, sp8, 592 + gUnknown_02038696[i] * 22, @@ -4211,7 +4211,7 @@ void sub_80B0D7C(void) r5++; } ConvertIntToDecimalStringN(sp8 + r5, r2, 0, 4); - sub_8003460( + Text_InitWindowAndPrintText( &gUnknown_03004210, sp8, 512 + gUnknown_02038696[i] * 20, @@ -4484,7 +4484,7 @@ void sub_80B146C(u8 a, u8 b) StringCopy(gStringVar3, gText_Contest_Fear); StringExpandPlaceholders(gStringVar4, gUnknown_083CC188[b]); sub_80AF138(); - sub_8002EB0(&gMenuWindow, gStringVar4, 776, 1, 15); + Text_InitWindow8002EB0(&gMenuWindow, gStringVar4, 776, 1, 15); } void sub_80B157C(u8 p) @@ -4631,7 +4631,7 @@ void unref_sub_80B19D0(void) { u8 str[20]; StringCopy(str, gUnknown_083CC2EC); - sub_8003460(&gUnknown_03004210, str, 680, 0, 0); + Text_InitWindowAndPrintText(&gUnknown_03004210, str, 680, 0, 0); } s8 Contest_GetMoveExcitement(u16 move) diff --git a/src/debug/matsuda_debug_menu.c b/src/debug/matsuda_debug_menu.c index 49fe6864b..0585c4e00 100644 --- a/src/debug/matsuda_debug_menu.c +++ b/src/debug/matsuda_debug_menu.c @@ -247,9 +247,9 @@ static const struct OamData gUnknown_083C9400 = u8 unref_sub_80A9B28(void) { - MenuZeroFillScreen(); - MenuDrawTextWindow(0, 0, 17, 18); - PrintMenuItems(1, 1, 7, gMatsudaDebugMenuActions); + Menu_EraseScreen(); + Menu_DrawStdWindowFrame(0, 0, 17, 18); + Menu_PrintItems(1, 1, 7, gMatsudaDebugMenuActions); InitMenu(0, 1, 1, 7, 0, 16); gCallback_03004AE8 = sub_80A9B78; return 0; @@ -257,7 +257,7 @@ u8 unref_sub_80A9B28(void) static bool8 sub_80A9B78(void) { - s8 choice = ProcessMenuInput(); + s8 choice = Menu_ProcessInput(); switch (choice) { @@ -449,8 +449,8 @@ static void sub_80A9F50(void) { REG_DISPCNT = DISPCNT_MODE_0 | DISPCNT_OBJ_1D_MAP; REG_DISPCNT |= DISPCNT_OBJ_ON | DISPCNT_BG0_ON; - SetUpWindowConfig(&gWindowConfig_81E6C3C); - InitWindowFromConfig(&gMenuWindow, &gWindowConfig_81E6C3C); + Text_LoadWindowTemplate(&gWindowTemplate_81E6C3C); + Text_InitWindowWithTemplate(&gMenuWindow, &gWindowTemplate_81E6C3C); REG_MOSAIC = 0; REG_BLDCNT = 0; REG_BLDALPHA = 0; @@ -490,7 +490,7 @@ static void sub_80A9FE4(void) } } sub_80034D4((void *)VRAM, ptr); - LoadFontDefaultPalette(&gWindowConfig_81E6C3C); + LoadFontDefaultPalette(&gWindowTemplate_81E6C3C); } static void sub_80AA064(void) @@ -546,7 +546,7 @@ static void sub_80AA10C(void) for (i = 0; i < 6; i++) { - sub_8003460(&gMenuWindow, gMatsudaDebugMenuTextList1[i], + Text_InitWindowAndPrintText(&gMenuWindow, gMatsudaDebugMenuTextList1[i], (0xA * i + 0x2A), gMatsudaDebugMenuContestTopLeft[i][0], gMatsudaDebugMenuContestTopLeft[i][1]); } @@ -555,8 +555,8 @@ static void sub_80AA10C(void) zero = 0; // it's possible this was some assignment that matsuda used to quickly edit and test things without changing whats passed to the later functions. sub_80AA5BC(zero); sub_80AA5E8(gSpecialVar_ContestRank); - sub_8003460(&gMenuWindow, gMatsudaDebugMenu_GoBackText, 0xD6, 0x12, 0x12); - sub_8003460(&gMenuWindow, gMatsudaDebugMenu_BattlePointsText, 0xDC, zero, 0xC); + Text_InitWindowAndPrintText(&gMenuWindow, gMatsudaDebugMenu_GoBackText, 0xD6, 0x12, 0x12); + Text_InitWindowAndPrintText(&gMenuWindow, gMatsudaDebugMenu_BattlePointsText, 0xDC, zero, 0xC); LoadSpriteSheet(gUnknown_083C92B4); LoadSpritePalette(gUnknown_083C92BC); sub_80AA280(3); @@ -573,71 +573,71 @@ void sub_80AA280(u8 var) // no? { u8 i; - FillWindowRect_DefaultPalette(&gMenuWindow, 0, 0, 0, 0x1E, 3); + Text_FillWindowRectDefPalette(&gMenuWindow, 0, 0, 0, 0x1E, 3); StringCopy(gSharedMem, gMatsudaDebugMenu_StartText); StringAppend(gSharedMem, gContestMons[var].trainerName); for (i = 0; i < 4; i++) { if (var == i) - sub_8003460(&gMenuWindow, gSharedMem, 10 * i + 2, gUnknown_083C926E[i][0], gUnknown_083C926E[i][1]); + Text_InitWindowAndPrintText(&gMenuWindow, gSharedMem, 10 * i + 2, gUnknown_083C926E[i][0], gUnknown_083C926E[i][1]); else - sub_8003460(&gMenuWindow, gContestMons[i].trainerName, 10 * i + 2, gUnknown_083C926E[i][0], gUnknown_083C926E[i][1]); + Text_InitWindowAndPrintText(&gMenuWindow, gContestMons[i].trainerName, 10 * i + 2, gUnknown_083C926E[i][0], gUnknown_083C926E[i][1]); } } static void sub_80AA340(u8 var) { ConvertIntToDecimalStringN(gSharedMem, gContestMons[var].cool, STR_CONV_MODE_RIGHT_ALIGN, 3); - sub_8003460(&gMenuWindow, gSharedMem, 0x66, gUnknown_083C9282[0], gUnknown_083C9282[1]); + Text_InitWindowAndPrintText(&gMenuWindow, gSharedMem, 0x66, gUnknown_083C9282[0], gUnknown_083C9282[1]); } static void sub_80AA388(u8 var) { ConvertIntToDecimalStringN(gSharedMem, gContestMons[var].cute, STR_CONV_MODE_RIGHT_ALIGN, 3); - sub_8003460(&gMenuWindow, gSharedMem, 0x6C, gUnknown_083C9282[2], gUnknown_083C9282[3]); + Text_InitWindowAndPrintText(&gMenuWindow, gSharedMem, 0x6C, gUnknown_083C9282[2], gUnknown_083C9282[3]); } static void sub_80AA3D0(u8 var) { ConvertIntToDecimalStringN(gSharedMem, gContestMons[var].beauty, STR_CONV_MODE_RIGHT_ALIGN, 3); - sub_8003460(&gMenuWindow, gSharedMem, 0x72, gUnknown_083C9282[4], gUnknown_083C9282[5]); + Text_InitWindowAndPrintText(&gMenuWindow, gSharedMem, 0x72, gUnknown_083C9282[4], gUnknown_083C9282[5]); } static void sub_80AA418(u8 var) { ConvertIntToDecimalStringN(gSharedMem, gContestMons[var].smart, STR_CONV_MODE_RIGHT_ALIGN, 3); - sub_8003460(&gMenuWindow, gSharedMem, 0x78, gUnknown_083C9282[6], gUnknown_083C9282[7]); + Text_InitWindowAndPrintText(&gMenuWindow, gSharedMem, 0x78, gUnknown_083C9282[6], gUnknown_083C9282[7]); } static void sub_80AA460(u8 var) { ConvertIntToDecimalStringN(gSharedMem, gContestMons[var].tough, STR_CONV_MODE_RIGHT_ALIGN, 3); - sub_8003460(&gMenuWindow, gSharedMem, 0x7E, gUnknown_083C9282[8], gUnknown_083C9282[9]); + Text_InitWindowAndPrintText(&gMenuWindow, gSharedMem, 0x7E, gUnknown_083C9282[8], gUnknown_083C9282[9]); } static void sub_80AA4A8(u8 var) { ConvertIntToDecimalStringN(gSharedMem, gContestMons[var].sheen, STR_CONV_MODE_RIGHT_ALIGN, 3); - sub_8003460(&gMenuWindow, gSharedMem, 0x84, gUnknown_083C9282[10], gUnknown_083C9282[11]); + Text_InitWindowAndPrintText(&gMenuWindow, gSharedMem, 0x84, gUnknown_083C9282[10], gUnknown_083C9282[11]); } static void sub_80AA4F0(u8 var1, u8 var2) { - FillWindowRect_DefaultPalette(&gMenuWindow, 0, gUnknown_083C928E[var2][0], gUnknown_083C928E[var2][1], gUnknown_083C928E[var2][0] + 7, gUnknown_083C928E[var2][1] + 1); - sub_8003460(&gMenuWindow, gMoveNames[gContestMons[var1].moves[var2]], 0x8A + var2 * 14, gUnknown_083C928E[var2][0], gUnknown_083C928E[var2][1]); + Text_FillWindowRectDefPalette(&gMenuWindow, 0, gUnknown_083C928E[var2][0], gUnknown_083C928E[var2][1], gUnknown_083C928E[var2][0] + 7, gUnknown_083C928E[var2][1] + 1); + Text_InitWindowAndPrintText(&gMenuWindow, gMoveNames[gContestMons[var1].moves[var2]], 0x8A + var2 * 14, gUnknown_083C928E[var2][0], gUnknown_083C928E[var2][1]); ConvertIntToDecimalStringN(gStringVar1, gContestMons[var1].moves[var2], STR_CONV_MODE_LEADING_ZEROS, 3); - sub_8003460(&gMenuWindow, gStringVar1, 0xFA + var2 * 6, gUnknown_083C928E[var2][0] + 7, gUnknown_083C928E[var2][1]); + Text_InitWindowAndPrintText(&gMenuWindow, gStringVar1, 0xFA + var2 * 6, gUnknown_083C928E[var2][0] + 7, gUnknown_083C928E[var2][1]); } static void sub_80AA5BC(u8 var) { - sub_8003460(&gMenuWindow, gMatsudaDebugMenuTextList2[var], 0xC2, 3, 0x12); + Text_InitWindowAndPrintText(&gMenuWindow, gMatsudaDebugMenuTextList2[var], 0xC2, 3, 0x12); } void sub_80AA5E8(u8 var) { - sub_8003460(&gMenuWindow, gMatsudaDebugMenuTextList3[var], 0xE8, 3, 4); + Text_InitWindowAndPrintText(&gMenuWindow, gMatsudaDebugMenuTextList3[var], 0xE8, 3, 4); } static void sub_80AA614(u8 var1, u8 var2) @@ -645,7 +645,7 @@ static void sub_80AA614(u8 var1, u8 var2) u16 var = sub_80AE770(var1, var2); ConvertIntToDecimalStringN(gSharedMem, var, STR_CONV_MODE_RIGHT_ALIGN, 3); - sub_8003460(&gMenuWindow, gSharedMem, 0xE2, 3, 0xC); + Text_InitWindowAndPrintText(&gMenuWindow, gSharedMem, 0xE2, 3, 0xC); } void sub_80AA658(u8 var) @@ -1075,10 +1075,10 @@ void unref_sub_80AB084(u8 *text) break; } } - SetUpWindowConfig(&gWindowConfig_81E6FD8); - InitWindowFromConfig(&gUnknown_03004210, &gWindowConfig_81E6FD8); - LoadFontDefaultPalette(&gWindowConfig_81E6FD8); - sub_8003460(&gUnknown_03004210, text, 1, 9, 7); + Text_LoadWindowTemplate(&gWindowTemplate_81E6FD8); + Text_InitWindowWithTemplate(&gUnknown_03004210, &gWindowTemplate_81E6FD8); + LoadFontDefaultPalette(&gWindowTemplate_81E6FD8); + Text_InitWindowAndPrintText(&gUnknown_03004210, text, 1, 9, 7); } void sub_80AB184(void) diff --git a/src/debug/mori_debug_menu.c b/src/debug/mori_debug_menu.c index 83dba8b73..7b9a579a7 100644 --- a/src/debug/mori_debug_menu.c +++ b/src/debug/mori_debug_menu.c @@ -95,9 +95,9 @@ u8 MoriDebugMenu_SearchChild(u8 a1, u8 a2, u8 *ptr) StringAppend(localPtr, gUnknown_0839B24D); StringAppend(localPtr, gSpeciesNames[eggSpecies]); StringAppend(localPtr, gUnknown_0839B255); - MenuZeroFillScreen(); - MenuDrawTextWindow(0, 14, 30, 19); - MenuPrint(localPtr, 1, 15); + Menu_EraseScreen(); + Menu_DrawStdWindowFrame(0, 14, 30, 19); + Menu_PrintText(localPtr, 1, 15); gCallback_03004AE8 = sub_8083D4C; return 0; } @@ -179,7 +179,7 @@ u8 MoriDebugMenu_PokeblockCase(void) bool8 MoriDebugMenuProcessInput(void) { - s8 choice = ProcessMenuInput(); + s8 choice = Menu_ProcessInput(); switch (choice) { @@ -196,9 +196,9 @@ bool8 MoriDebugMenuProcessInput(void) s8 InitMoriDebugMenu(void) { - MenuZeroFillScreen(); - MenuDrawTextWindow(0, 0, 10, 19); - PrintMenuItems(1, 1, 9, gMoriDebugMenuActions); + Menu_EraseScreen(); + Menu_DrawStdWindowFrame(0, 0, 10, 19); + Menu_PrintItems(1, 1, 9, gMoriDebugMenuActions); InitMenu(0, 1, 1, 9, 0, 9); gCallback_03004AE8 = MoriDebugMenuProcessInput; return 0; diff --git a/src/debug/sound_check_menu.c b/src/debug/sound_check_menu.c index 968b047d9..05cbfc8f7 100644 --- a/src/debug/sound_check_menu.c +++ b/src/debug/sound_check_menu.c @@ -132,8 +132,8 @@ void CB2_StartSoundCheckMenu(void) ResetPaletteFade(); ResetTasks(); ResetSpriteData(); - SetUpWindowConfig(&gWindowConfig_81E6C3C); - InitMenuWindow(&gWindowConfig_81E6CE4); + Text_LoadWindowTemplate(&gWindowTemplate_81E6C3C); + InitMenuWindow(&gWindowTemplate_81E6CE4); BeginNormalPaletteFade(0xFFFFFFFF, 0, 16, 0, 0); REG_WIN0H = WIN_RANGE(0, 0); REG_WIN0V = WIN_RANGE(0, 0); @@ -171,16 +171,16 @@ void Task_InitSoundCheckMenu(u8 taskId) if (!gPaletteFade.active) { - MenuDrawTextWindow(2, 0, 27, 3); - MenuDrawTextWindow(2, 5, 27, 10); - MenuDrawTextWindow(2, 12, 27, 17); - MenuPrint(soundcheckStr, 4, 1); - MenuPrint(abDescStr, 14, 1); - MenuPrint(bgmStr, 4, 6); - MenuPrint(upDownStr, 14, 6); - MenuPrint(seStr, 4, 13); - MenuPrint(upDownStr, 14, 13); - MenuPrint(driverStr, 14, 18); + Menu_DrawStdWindowFrame(2, 0, 27, 3); + Menu_DrawStdWindowFrame(2, 5, 27, 10); + Menu_DrawStdWindowFrame(2, 12, 27, 17); + Menu_PrintText(soundcheckStr, 4, 1); + Menu_PrintText(abDescStr, 14, 1); + Menu_PrintText(bgmStr, 4, 6); + Menu_PrintText(upDownStr, 14, 6); + Menu_PrintText(seStr, 4, 13); + Menu_PrintText(upDownStr, 14, 13); + Menu_PrintText(driverStr, 14, 18); gTasks[taskId].func = sub_80BA384; REG_WIN0H = WIN_RANGE(17, 223); REG_WIN0V = WIN_RANGE(1, 31); @@ -384,7 +384,7 @@ void PrintSoundNumber(u16 soundIndex, u16 x, u16 y) // PrintSoundNumber ? str[1] = divisorValue + CHAR_0; str[2] = ((soundIndex % 100) % 10) + CHAR_0; - MenuPrint(str, x, y); + Menu_PrintText(str, x, y); } void sub_80BA79C(const u8 *const string, u16 x, u16 y) @@ -400,7 +400,7 @@ void sub_80BA79C(const u8 *const string, u16 x, u16 y) for (i = 0; string[i] != EOS && i < 10; i++) str[i] = string[i]; - MenuPrint(str, x, y); + Menu_PrintText(str, x, y); } void Task_DrawDriverTestMenu(u8 taskId) // Task_DrawDriverTestMenu @@ -421,21 +421,21 @@ void Task_DrawDriverTestMenu(u8 taskId) // Task_DrawDriverTestMenu u8 stereoStr[] = _("すてれお‥‥‥‥"); // stereo REG_DISPCNT = 0x3140; - MenuDrawTextWindow(0, 0, 29, 19); - MenuPrint(bbackStr, 19, 4); - MenuPrint(aplayStr, 19, 2); - MenuPrint(voiceStr, 2, 1); - MenuPrint(volumeStr, 2, 3); - MenuPrint(panpotStr, 2, 5); - MenuPrint(pitchStr, 2, 7); - MenuPrint(lengthStr, 2, 9); - MenuPrint(releaseStr, 2, 11); - MenuPrint(progressStr, 2, 13); - MenuPrint(chorusStr, 2, 15); - MenuPrint(priorityStr, 2, 17); - MenuPrint(playingStr, 19, 16); - MenuPrint(reverseStr, 19, 14); - MenuPrint(stereoStr, 19, 12); + Menu_DrawStdWindowFrame(0, 0, 29, 19); + Menu_PrintText(bbackStr, 19, 4); + Menu_PrintText(aplayStr, 19, 2); + Menu_PrintText(voiceStr, 2, 1); + Menu_PrintText(volumeStr, 2, 3); + Menu_PrintText(panpotStr, 2, 5); + Menu_PrintText(pitchStr, 2, 7); + Menu_PrintText(lengthStr, 2, 9); + Menu_PrintText(releaseStr, 2, 11); + Menu_PrintText(progressStr, 2, 13); + Menu_PrintText(chorusStr, 2, 15); + Menu_PrintText(priorityStr, 2, 17); + Menu_PrintText(playingStr, 19, 16); + Menu_PrintText(reverseStr, 19, 14); + Menu_PrintText(stereoStr, 19, 12); REG_WIN0H = WIN_RANGE(0, DISPLAY_WIDTH); REG_WIN0V = WIN_RANGE(0, DISPLAY_HEIGHT); sDriverTestSelection = 0; @@ -465,7 +465,7 @@ void Task_ProcessDriverTestInput(u8 taskId) REG_DISPCNT = 0x7140; REG_WIN0H = WIN_RANGE(17, 223); REG_WIN0V = WIN_RANGE(1, 31); - MenuZeroFillWindowRect(0, 0, 29, 19); + Menu_EraseWindowRect(0, 0, 29, 19); gTasks[taskId].func = Task_InitSoundCheckMenu; return; } @@ -627,8 +627,8 @@ void sub_80BAE10(u8 var1, u8 var2) u8 str1[] = _("▶"); u8 str2[] = _(" "); - MenuPrint(str2, gUnknown_083D0300[MULTI_DIM_ARR(var1, B_16, 0)], gUnknown_083D0300[MULTI_DIM_ARR(var1, B_16, 1)]); - MenuPrint(str1, gUnknown_083D0300[MULTI_DIM_ARR(var2, B_16, 0)], gUnknown_083D0300[MULTI_DIM_ARR(var2, B_16, 1)]); + Menu_PrintText(str2, gUnknown_083D0300[MULTI_DIM_ARR(var1, B_16, 0)], gUnknown_083D0300[MULTI_DIM_ARR(var1, B_16, 1)]); + Menu_PrintText(str1, gUnknown_083D0300[MULTI_DIM_ARR(var2, B_16, 0)], gUnknown_083D0300[MULTI_DIM_ARR(var2, B_16, 1)]); } void PrintSignedNumber(int n, u16 x, u16 y, u8 digits) @@ -677,7 +677,7 @@ void PrintSignedNumber(int n, u16 x, u16 y, u8 digits) n %= powersOfTen[i]; } - MenuPrint(str, x, y); + Menu_PrintText(str, x, y); } static const s8 gUnknown_083D03F8[5] = { 0x3F, 0x00, 0xC0, 0x7F, 0x80 }; @@ -689,10 +689,10 @@ void sub_80BAF84(u8 taskId) u8 playingStr[] = _("さいせいちゆう‥"); REG_DISPCNT = 0x3140; - MenuDrawTextWindow(0, 0, 29, 19); - MenuPrint(seStr, 3, 2); - MenuPrint(panStr, 3, 4); - MenuPrint(playingStr, 3, 8); + Menu_DrawStdWindowFrame(0, 0, 29, 19); + Menu_PrintText(seStr, 3, 2); + Menu_PrintText(panStr, 3, 4); + Menu_PrintText(playingStr, 3, 8); REG_WIN0H = WIN_RANGE(0, DISPLAY_WIDTH); REG_WIN0V = WIN_RANGE(0, DISPLAY_HEIGHT); sSoundTestParams[CRY_TEST_VOICE] = 1; @@ -739,7 +739,7 @@ void sub_80BB038(u8 taskId) REG_DISPCNT = 0x7140; REG_WIN0H = WIN_RANGE(17, 223); REG_WIN0V = WIN_RANGE(1, 31); - MenuZeroFillWindowRect(0, 0, 29, 19); + Menu_EraseWindowRect(0, 0, 29, 19); gTasks[taskId].func = Task_InitSoundCheckMenu; return; } @@ -806,10 +806,10 @@ void sub_80BB1D4(void) switch (gUnknown_083D03F8[sSoundTestParams[CRY_TEST_PANPOT]]) { case 127: - MenuPrint(lrStr, 7, 4); + Menu_PrintText(lrStr, 7, 4); break; case -128: - MenuPrint(rlStr, 7, 4); + Menu_PrintText(rlStr, 7, 4); break; default: PrintSignedNumber(gUnknown_083D03F8[sSoundTestParams[CRY_TEST_PANPOT]], 7, 4, 3); @@ -1217,8 +1217,8 @@ void Task_InitCryTest(u8 taskId) struct CryRelatedStruct cryStruct, cryStruct2; u8 zero; - SetUpWindowConfig(&gWindowConfig_81E6C3C); - InitMenuWindow(&gWindowConfig_81E6CE4); + Text_LoadWindowTemplate(&gWindowTemplate_81E6C3C); + InitMenuWindow(&gWindowTemplate_81E6CE4); gSoundTestCryNum = 1; ResetSpriteData(); FreeAllSpritePalettes(); @@ -1247,7 +1247,7 @@ void Task_InitCryTest(u8 taskId) while (ShowPokedexCryScreen(&cryStruct2, 2) == FALSE) ; - MenuDrawTextWindow(0, 16, 5, 19); + Menu_DrawStdWindowFrame(0, 16, 5, 19); PrintCryNumber(); BeginNormalPaletteFade(0xFFFFFFFF, 0, 16, 0, 0); REG_BG2HOFS = 0; @@ -1288,7 +1288,7 @@ void Task_ProcessCryTestInput(u8 taskId) REG_DISPCNT = 0x7140; REG_WIN0H = WIN_RANGE(17, 223); REG_WIN0V = WIN_RANGE(1, 31); - MenuZeroFillWindowRect(0, 0, 29, 19); + Menu_EraseWindowRect(0, 0, 29, 19); gTasks[taskId].func = Task_InitSoundCheckMenu; DestroyCryMeterNeedleSprite(); } diff --git a/src/debug/unknown_debug_menu.c b/src/debug/unknown_debug_menu.c index a8c3ad16b..9cece924d 100644 --- a/src/debug/unknown_debug_menu.c +++ b/src/debug/unknown_debug_menu.c @@ -32,9 +32,9 @@ const struct MenuAction gUnknown_0842C29C[] = { int unref_sub_814A414(void) { - MenuZeroFillScreen(); - MenuDrawTextWindow(0, 0, 16, 18); - PrintMenuItems(2, 1, 8, gUnknown_0842C29C); + Menu_EraseScreen(); + Menu_DrawStdWindowFrame(0, 0, 16, 18); + Menu_PrintItems(2, 1, 8, gUnknown_0842C29C); InitMenu(0, 1, 1, 8, 0, 15); gCallback_03004AE8 = sub_814A464; return 0; @@ -42,7 +42,7 @@ int unref_sub_814A414(void) static u8 sub_814A464(void) { - s8 result = ProcessMenuInput(); + s8 result = Menu_ProcessInput(); if (result == -2) { return 0; diff --git a/src/easy_chat_1.c b/src/easy_chat_1.c index e5b6cf7c3..cb0e98b71 100644 --- a/src/easy_chat_1.c +++ b/src/easy_chat_1.c @@ -16,8 +16,8 @@ #include "strings.h" #include "unknown_task.h" -extern const struct WindowConfig gWindowConfig_81E6D54; -extern const struct WindowConfig gWindowConfig_81E6DA8; +extern const struct WindowTemplate gWindowTemplate_81E6D54; +extern const struct WindowTemplate gWindowTemplate_81E6DA8; extern void sub_80546B8(void); @@ -305,12 +305,12 @@ void sub_80E62F8(void) FreeAllSpritePalettes(); break; case 1: - SetUpWindowConfig(&gWindowConfig_81E6DA8); + Text_LoadWindowTemplate(&gWindowTemplate_81E6DA8); break; case 2: - InitMenuWindow(&gWindowConfig_81E6D54); - InitMenuWindow(&gWindowConfig_81E6DA8); - MenuZeroFillScreen(); + InitMenuWindow(&gWindowTemplate_81E6D54); + InitMenuWindow(&gWindowTemplate_81E6DA8); + Menu_EraseScreen(); break; case 3: sub_80E6424(); @@ -732,12 +732,12 @@ void sub_80E6BC0(void) { sub_80E91D4(2); DisplayYesNoMenu(23, 8, 1); - MoveMenuCursor(1); + Menu_MoveCursor(1); gEasyChatStruct->unk24++; } break; case 1: - switch (ProcessMenuInputNoWrap_()) + switch (Menu_ProcessInputNoWrap_()) { case 0: sub_80E7D6C(); @@ -770,7 +770,7 @@ void sub_80E6C84(void) sub_80E8398(2); sub_80E91D4(3); DisplayYesNoMenu(23, 8, 0); - MoveMenuCursor(1); + Menu_MoveCursor(1); if (gEasyChatStruct->unk8 == 9 || gEasyChatStruct->unk8 == 4 || gEasyChatStruct->unk8 == 7 @@ -785,12 +785,12 @@ void sub_80E6C84(void) gEasyChatStruct->unk24++; break; case 1: - switch (ProcessMenuInputNoWrap_()) + switch (Menu_ProcessInputNoWrap_()) { case 0: sub_80E91D4(4); DisplayYesNoMenu(23, 8, 0); - MoveMenuCursor(1); + Menu_MoveCursor(1); gEasyChatStruct->unk24++; break; case -1: @@ -800,7 +800,7 @@ void sub_80E6C84(void) } break; case 2: - switch (ProcessMenuInputNoWrap_()) + switch (Menu_ProcessInputNoWrap_()) { case 0: gSpecialVar_Result = 0; @@ -813,7 +813,7 @@ void sub_80E6C84(void) } break; case 0xFF: - HandleDestroyMenuCursors(); + Menu_DestroyCursor(); sub_80E81FC(); sub_80E682C(sub_80E6AC4); break; @@ -856,12 +856,12 @@ void sub_80E6D7C(void) sub_80E91D4(1); sub_80E9744(); DisplayYesNoMenu(23, 8, 0); - MoveMenuCursor(0); + Menu_MoveCursor(0); gEasyChatStruct->unk24++; } break; case 1: - switch (ProcessMenuInputNoWrap_()) + switch (Menu_ProcessInputNoWrap_()) { case 0: gSpecialVar_Result = (sub_80E7FA8() != 0); @@ -883,7 +883,7 @@ void sub_80E6D7C(void) break; case -1: case 1: - HandleDestroyMenuCursors(); + Menu_DestroyCursor(); sub_80E81FC(); if (gEasyChatStruct->unk8 == 6 && sub_80E7FA8() != 0) { @@ -1738,5 +1738,5 @@ void sub_80E81FC(void) { PlaySE(SE_SELECT); sub_80E95A4(); - MenuZeroFillWindowRect(0, 0, 29, 13); + Menu_EraseWindowRect(0, 0, 29, 13); } diff --git a/src/easy_chat_2.c b/src/easy_chat_2.c index fe3aa7cc9..66af7fc04 100644 --- a/src/easy_chat_2.c +++ b/src/easy_chat_2.c @@ -1064,17 +1064,17 @@ void sub_80E91B0(const u8 *a, u8 b, u8 c, u8 d) void sub_80E91D4(u8 a) { - BasicInitMenuWindow(&gWindowConfig_81E6DA8); + BasicInitMenuWindow(&gWindowTemplate_81E6DA8); if (a == 10) { - MenuZeroFillWindowRect(3, 14, 26, 19); + Menu_EraseWindowRect(3, 14, 26, 19); sub_80E9198(10); return; } if (sub_80E91A4() == 10) - MenuDrawTextWindow(3, 14, 26, 19); + Menu_DrawStdWindowFrame(3, 14, 26, 19); sub_80E9198(a); switch (a) @@ -1168,14 +1168,14 @@ void sub_80E9368(u8 a) break; } - BasicInitMenuWindow(&gWindowConfig_81E6D8C); + BasicInitMenuWindow(&gWindowTemplate_81E6D8C); gEasyChatStruct->unk9F8E[0] = EXT_CTRL_CODE_BEGIN; gEasyChatStruct->unk9F8E[1] = 5; gEasyChatStruct->unk9F8E[2] = 1; if (r4 != NULL) { sub_8072C74(gEasyChatStruct->unk9F8E + 3, r4, 240, 2); - MenuPrint(gEasyChatStruct->unk9F8E, 0, 0); + Menu_PrintText(gEasyChatStruct->unk9F8E, 0, 0); } else { @@ -1186,10 +1186,10 @@ void sub_80E9368(u8 a) str[2] = 0x10; str[3] = EOS; - MenuPrint(gEasyChatStruct->unk9F8E, 0, 0); - MenuPrint(gEasyChatStruct->unk9F8E, 28, 0); + Menu_PrintText(gEasyChatStruct->unk9F8E, 0, 0); + Menu_PrintText(gEasyChatStruct->unk9F8E, 28, 0); } - BasicInitMenuWindow(&gWindowConfig_81E6DA8); + BasicInitMenuWindow(&gWindowTemplate_81E6DA8); } void sub_80E948C(void) @@ -1219,7 +1219,7 @@ void sub_80E948C(void) void sub_80E95A4(void) { - BasicInitMenuWindow(&gWindowConfig_81E6D8C); + BasicInitMenuWindow(&gWindowTemplate_81E6D8C); switch (gEasyChatStruct->unk9) { case 4: @@ -1241,7 +1241,7 @@ void sub_80E95A4(void) sub_80E9620(3, 6); break; } - BasicInitMenuWindow(&gWindowConfig_81E6DA8); + BasicInitMenuWindow(&gWindowTemplate_81E6DA8); } void sub_80E9620(u16 a, u16 b) @@ -1259,7 +1259,7 @@ void sub_80E9620(u16 a, u16 b) { if (r10 >= gEasyChatStruct->unkA) { - MenuPrint(gUnknown_083DBEA8, r6, r7); + Menu_PrintText(gUnknown_083DBEA8, r6, r7); break; } if (gEasyChatStruct->unkC[r10] == 0xFFFF) @@ -1270,7 +1270,7 @@ void sub_80E9620(u16 a, u16 b) else { sub_80EB218(gEasyChatStruct->unk9E14, gEasyChatStruct->unkC[r10], 11); - MenuPrint(gEasyChatStruct->unk9E14, r6, r7); + Menu_PrintText(gEasyChatStruct->unk9E14, r6, r7); r6 += gEasyChatStruct->unk8C[i][j] + 11; } r10++; @@ -1281,7 +1281,7 @@ void sub_80E9620(u16 a, u16 b) void sub_80E9744(void) { - BasicInitMenuWindow(&gWindowConfig_81E6D8C); + BasicInitMenuWindow(&gWindowTemplate_81E6D8C); switch (gEasyChatStruct->unk9) { case 4: @@ -1303,7 +1303,7 @@ void sub_80E9744(void) sub_80E97C0(3, 6); break; } - BasicInitMenuWindow(&gWindowConfig_81E6DA8); + BasicInitMenuWindow(&gWindowTemplate_81E6DA8); } void sub_80E97C0(u16 a, u16 b) @@ -1337,7 +1337,7 @@ void sub_80E97C0(u16 a, u16 b) r2[2] = r1 * 8; r2[3] = EOS; - MenuPrint(gEasyChatStruct->unk9E6E, b, a); + Menu_PrintText(gEasyChatStruct->unk9E6E, b, a); a += 2; } @@ -1348,7 +1348,7 @@ void sub_80E98C4(void) u8 r1; u8 r3; - BasicInitMenuWindow(&gWindowConfig_81E6D8C); + BasicInitMenuWindow(&gWindowTemplate_81E6D8C); switch (gEasyChatStruct->unk9) { case 4: @@ -1378,15 +1378,15 @@ void sub_80E98C4(void) default: return; } - MenuFillWindowRectWithBlankTile(2, r1, 27, r3 * 2 + r1 - 1); - BasicInitMenuWindow(&gWindowConfig_81E6DA8); + Menu_BlankWindowRect(2, r1, 27, r3 * 2 + r1 - 1); + BasicInitMenuWindow(&gWindowTemplate_81E6DA8); } void sub_80E9940(u8 *a, u8 b) { u8 r4 = (b & 7); - MenuFillWindowRectWithBlankTile(2, r4 * 2, 31, r4 * 2 + 1); + Menu_BlankWindowRect(2, r4 * 2, 31, r4 * 2 + 1); sub_80E9A7C(a, b); sub_80E9A60(a, 2, r4 * 2); } @@ -1420,7 +1420,7 @@ const u8 *const gUnknown_083DBEAC[] = void sub_80E9974(void) { - BasicInitMenuWindow(&gWindowConfig_81E6D54); + BasicInitMenuWindow(&gWindowTemplate_81E6D54); if (gEasyChatStruct->unk26 == 0) { u16 i; @@ -1453,7 +1453,7 @@ void sub_80E9A4C(void) void sub_80E9A60(const u8 *a, u16 b, u16 c) { c &= 0xF; - MenuPrint(a, b, c); + Menu_PrintText(a, b, c); } void sub_80E9A7C(u8 *dest, u16 b) @@ -1479,7 +1479,7 @@ void sub_80E9AD4(void) { u16 i; - BasicInitMenuWindow(&gWindowConfig_81E6D54); + BasicInitMenuWindow(&gWindowTemplate_81E6D54); for (i = 0; i < 16; i++) sub_80E9C74(i); } @@ -1502,16 +1502,16 @@ void sub_80E9AF8(u16 a) for (i = 0; i < gEasyChatStruct->unk99A6[a]; i++) { if (sub_80EB2D4(gEasyChatStruct->unk9A2A[a][i]) == 7) - BasicInitMenuWindow(&gWindowConfig_81E6D70); + BasicInitMenuWindow(&gWindowTemplate_81E6D70); else - BasicInitMenuWindow(&gWindowConfig_81E6D54); + BasicInitMenuWindow(&gWindowTemplate_81E6D54); sub_80EB218(r8, gEasyChatStruct->unk9A2A[a][i], 9); sub_80E9A60(gEasyChatStruct->unk9E14, i * 11 + 4, a * 2); } } else { - BasicInitMenuWindow(&gWindowConfig_81E6D54); + BasicInitMenuWindow(&gWindowTemplate_81E6D54); for (i = 0; i < gEasyChatStruct->unk99A6[a]; i++) { sub_80EB218(r8, gEasyChatStruct->unk9A2A[a][i], 9); @@ -1523,7 +1523,7 @@ void sub_80E9AF8(u16 a) void sub_80E9C74(u16 a) { a &= 7; - MenuFillWindowRectWithBlankTile(0, a * 2, 29, a * 2 + 1); + Menu_BlankWindowRect(0, a * 2, 29, a * 2 + 1); } void sub_80E9C94(void) @@ -1562,7 +1562,7 @@ void sub_80E9D7C(void) u16 r4; u16 i; - BasicInitMenuWindow(&gWindowConfig_81E6D54); + BasicInitMenuWindow(&gWindowTemplate_81E6D54); if (gEasyChatStruct->unk1C0 < 0) { r6 = -gEasyChatStruct->unk1C0; diff --git a/src/engine/cable_club.c b/src/engine/cable_club.c index 3187de7ed..b12ee38ce 100644 --- a/src/engine/cable_club.c +++ b/src/engine/cable_club.c @@ -109,13 +109,13 @@ static void sub_8082CD4(u8 arg0, u8 arg1) static void sub_8082D18(u32 value) { ConvertIntToDecimalStringN(gStringVar1, value, STR_CONV_MODE_LEFT_ALIGN, 1); - MenuDrawTextWindow(18, 10, 28, 13); + Menu_DrawStdWindowFrame(18, 10, 28, 13); sub_8072BD8(gOtherText_PLink, 19, 11, 72); } static void sub_8082D4C() { - MenuZeroFillWindowRect(18, 10, 28, 13); + Menu_EraseWindowRect(18, 10, 28, 13); } static void sub_8082D60(u8 taskId, u8 arg1) @@ -790,7 +790,7 @@ static void sub_80839DC(u8 taskId) case 3: sub_8055588(); HideFieldMessageBox(); - MenuZeroFillScreen(); + Menu_EraseScreen(); DestroyTask(taskId); EnableBothScriptContexts(); break; diff --git a/src/engine/clear_save_data_menu.c b/src/engine/clear_save_data_menu.c index 12cde22a7..08fd5cd18 100644 --- a/src/engine/clear_save_data_menu.c +++ b/src/engine/clear_save_data_menu.c @@ -41,11 +41,11 @@ static void Task_InitMenu(u8 taskId) REG_DISPCNT = DISPCNT_MODE_0 | DISPCNT_OBJ_1D_MAP | DISPCNT_BG0_ON | DISPCNT_BG3_ON | DISPCNT_OBJ_ON; SetVBlankCallback(VBlankCB_ClearSaveDataScreen); - MenuDrawTextWindow(2, 14, 27, 19); - MenuPrint(gSystemText_ClearAllSaveDataPrompt, 3, 15); + Menu_DrawStdWindowFrame(2, 14, 27, 19); + Menu_PrintText(gSystemText_ClearAllSaveDataPrompt, 3, 15); - MenuDrawTextWindow(2, 1, 8, 6); - PrintMenuItems(3, 2, 2, gMenuYesNoItems); + Menu_DrawStdWindowFrame(2, 1, 8, 6); + Menu_PrintItems(3, 2, 2, gMenuYesNoItems); InitMenu(0, 3, 2, 2, 1, 5); gTasks[taskId].func = Task_ProcessMenuInput; @@ -53,7 +53,7 @@ static void Task_InitMenu(u8 taskId) static void Task_ProcessMenuInput(u8 taskId) { - switch (ProcessMenuInputNoWrap_()) + switch (Menu_ProcessInputNoWrap_()) { case 0: PlaySE(SE_SELECT); @@ -133,8 +133,8 @@ static u8 InitClearSaveDataScreen(void) ResetTasks(); ResetSpriteData(); - SetUpWindowConfig(&gWindowConfig_81E6C3C); - InitMenuWindow(&gWindowConfig_81E6CE4); + Text_LoadWindowTemplate(&gWindowTemplate_81E6C3C); + InitMenuWindow(&gWindowTemplate_81E6CE4); BeginNormalPaletteFade(-1, 0, 0x10, 0, 0xffff); ime = REG_IME; diff --git a/src/engine/link.c b/src/engine/link.c index 28323207c..34016d607 100644 --- a/src/engine/link.c +++ b/src/engine/link.c @@ -238,8 +238,8 @@ void LinkTestScreen(void) FreeAllSpritePalettes(); ResetTasks(); SetVBlankCallback(VBlankCB_LinkTest); - SetUpWindowConfig(&gWindowConfig_81E6CE4); - InitMenuWindow((struct WindowConfig *)&gWindowConfig_81E6CE4); + Text_LoadWindowTemplate(&gWindowTemplate_81E6CE4); + InitMenuWindow((struct WindowTemplate *)&gWindowTemplate_81E6CE4); ResetBlockSend(); gLinkType = 0x1111; OpenLink(); @@ -1236,9 +1236,9 @@ void CB2_LinkError(void) FillPalette(0, 0, 2); ResetTasks(); SetVBlankCallback(VBlankCB_LinkTest); - SetUpWindowConfig(&gWindowConfig_81E7198); - InitMenuWindow((struct WindowConfig *)&gWindowConfig_81E7198); - MenuZeroFillScreen(); + Text_LoadWindowTemplate(&gWindowTemplate_81E7198); + InitMenuWindow((struct WindowTemplate *)&gWindowTemplate_81E7198); + Menu_EraseScreen(); REG_BLDALPHA = 0; REG_BG0VOFS = 0; REG_BG0HOFS = 0; @@ -1260,7 +1260,7 @@ static void CB2_PrintErrorMessage(void) switch (gMain.state) { case 0: - MenuPrint_PixelCoords(gMultiText_LinkError, 20, 56, 1); + Menu_PrintTextPixelCoords(gMultiText_LinkError, 20, 56, 1); break; case 30: case 60: diff --git a/src/engine/main_menu.c b/src/engine/main_menu.c index 909b5676b..715570fe0 100644 --- a/src/engine/main_menu.c +++ b/src/engine/main_menu.c @@ -24,7 +24,7 @@ #include "unknown_task.h" #include "ewram.h" -#define BirchSpeechUpdateWindowText() ((u8)MenuUpdateWindowText_OverrideLineLength(24)) +#define BirchSpeechUpdateWindowText() ((u8)Menu_UpdateWindowTextOverrideLineLength(24)) extern struct PaletteFadeControl gPaletteFade; @@ -233,8 +233,8 @@ u32 InitMainMenu(u8 a1) ResetTasks(); ResetSpriteData(); FreeAllSpritePalettes(); - SetUpWindowConfig(&gWindowConfig_81E6C3C); - InitMenuWindow((struct WindowConfig *)&gWindowConfig_81E6CE4); + Text_LoadWindowTemplate(&gWindowTemplate_81E6C3C); + InitMenuWindow((struct WindowTemplate *)&gWindowTemplate_81E6CE4); if (a1) BeginNormalPaletteFade(-1, 0, 0x10, 0, 0x0000); // fade to black @@ -293,7 +293,7 @@ void Task_MainMenuCheckSave(u8 taskId) gTasks[taskId].func = Task_MainMenuCheckRtc; break; case 2: - MenuDrawTextWindow(2, 14, 27, 19); + Menu_DrawStdWindowFrame(2, 14, 27, 19); MenuPrintMessage(gSaveFileDeletedMessage, 3, 15); REG_WIN0H = WIN_RANGE(17, 223); REG_WIN0V = WIN_RANGE(113, 159); @@ -301,7 +301,7 @@ void Task_MainMenuCheckSave(u8 taskId) gTasks[taskId].func = Task_MainMenuWaitForSaveErrorAck; break; case 255: - MenuDrawTextWindow(2, 14, 27, 19); + Menu_DrawStdWindowFrame(2, 14, 27, 19); MenuPrintMessage(gSaveFileCorruptMessage, 3, 15); REG_WIN0H = WIN_RANGE(17, 223); REG_WIN0V = WIN_RANGE(113, 159); @@ -319,7 +319,7 @@ void Task_MainMenuCheckSave(u8 taskId) gTasks[taskId].func = Task_MainMenuCheckRtc; break; case 4: - MenuDrawTextWindow(2, 14, 27, 19); + Menu_DrawStdWindowFrame(2, 14, 27, 19); MenuPrintMessage(gBoardNotInstalledMessage, 3, 15); REG_WIN0H = WIN_RANGE(17, 223); REG_WIN0V = WIN_RANGE(113, 159); @@ -331,11 +331,11 @@ void Task_MainMenuCheckSave(u8 taskId) void Task_MainMenuWaitForSaveErrorAck(u8 taskId) { - if (MenuUpdateWindowText()) + if (Menu_UpdateWindowText()) { if (gMain.newKeys & A_BUTTON) { - MenuZeroFillWindowRect(2, 14, 27, 19); + Menu_EraseWindowRect(2, 14, 27, 19); gTasks[taskId].func = Task_MainMenuCheckRtc; } } @@ -359,7 +359,7 @@ void Task_MainMenuCheckRtc(u8 taskId) } else { - MenuDrawTextWindow(2, 14, 27, 19); + Menu_DrawStdWindowFrame(2, 14, 27, 19); MenuPrintMessage(gBatteryDryMessage, 3, 15); REG_WIN0H = WIN_RANGE(17, 223); REG_WIN0V = WIN_RANGE(113, 159); @@ -370,11 +370,11 @@ void Task_MainMenuCheckRtc(u8 taskId) void Task_MainMenuWaitForRtcErrorAck(u8 taskId) { - if (MenuUpdateWindowText()) + if (Menu_UpdateWindowText()) { if ( gMain.newKeys & 1 ) { - MenuZeroFillWindowRect(2, 14, 27, 19); + Menu_EraseWindowRect(2, 14, 27, 19); gTasks[taskId].func = Task_MainMenuDraw; } } @@ -412,28 +412,28 @@ void Task_MainMenuDraw(u8 taskId) { case HAS_NO_SAVED_GAME: default: - MenuDrawTextWindow(1, 0, 28, 3); + Menu_DrawStdWindowFrame(1, 0, 28, 3); PrintMainMenuItem(gMainMenuString_NewGame, 2, 1); - MenuDrawTextWindow(1, 4, 28, 7); + Menu_DrawStdWindowFrame(1, 4, 28, 7); PrintMainMenuItem(gMainMenuString_Option, 2, 5); break; case HAS_SAVED_GAME: - MenuDrawTextWindow(1, 0, 28, 7); + Menu_DrawStdWindowFrame(1, 0, 28, 7); PrintMainMenuItem(gMainMenuString_Continue, 2, 1); - MenuDrawTextWindow(1, 8, 28, 11); + Menu_DrawStdWindowFrame(1, 8, 28, 11); PrintMainMenuItem(gMainMenuString_NewGame, 2, 9); - MenuDrawTextWindow(1, 12, 28, 15); + Menu_DrawStdWindowFrame(1, 12, 28, 15); PrintMainMenuItem(gMainMenuString_Option, 2, 13); PrintSaveFileInfo(); break; case HAS_MYSTERY_GIFT: - MenuDrawTextWindow(1, 0, 28, 7); + Menu_DrawStdWindowFrame(1, 0, 28, 7); PrintMainMenuItem(gMainMenuString_Continue, 2, 1); - MenuDrawTextWindow(1, 8, 28, 11); + Menu_DrawStdWindowFrame(1, 8, 28, 11); PrintMainMenuItem(gMainMenuString_NewGame, 2, 9); - MenuDrawTextWindow(1, 12, 28, 15); + Menu_DrawStdWindowFrame(1, 12, 28, 15); PrintMainMenuItem(gMainMenuString_MysteryEvents, 2, 13); - MenuDrawTextWindow(1, 16, 28, 19); + Menu_DrawStdWindowFrame(1, 16, 28, 19); PrintMainMenuItem(gMainMenuString_Option, 2, 0x11); PrintSaveFileInfo(); break; @@ -681,7 +681,7 @@ void PrintMainMenuItem(const u8 *text, u8 left, u8 top) buffer[29] = EOS; - MenuPrint(buffer, left, top); + Menu_PrintText(buffer, left, top); } void PrintSaveFileInfo(void) @@ -694,8 +694,8 @@ void PrintSaveFileInfo(void) void PrintPlayerName(void) { - MenuPrint(gMainMenuString_Player, 2, 3); - MenuPrint(gSaveBlock2.playerName, 9, 3); + Menu_PrintText(gMainMenuString_Player, 2, 3); + Menu_PrintText(gSaveBlock2.playerName, 9, 3); } void PrintPlayTime(void) @@ -704,15 +704,15 @@ void PrintPlayTime(void) u8 alignedPlayTime[32]; #if defined(ENGLISH) - MenuPrint(gMainMenuString_Time, 16, 3); + Menu_PrintText(gMainMenuString_Time, 16, 3); FormatPlayTime(playTime, gSaveBlock2.playTimeHours, gSaveBlock2.playTimeMinutes, 1); sub_8072C74(alignedPlayTime, playTime, 48, 1); - MenuPrint(alignedPlayTime, 22, 3); + Menu_PrintText(alignedPlayTime, 22, 3); #elif defined(GERMAN) - MenuPrint_PixelCoords(gMainMenuString_Time, 124, 24, TRUE); + Menu_PrintTextPixelCoords(gMainMenuString_Time, 124, 24, TRUE); FormatPlayTime(playTime, gSaveBlock2.playTimeHours, gSaveBlock2.playTimeMinutes, 1); sub_8072C74(alignedPlayTime, playTime, 40, 1); - MenuPrint(alignedPlayTime, 23, 3); + Menu_PrintText(alignedPlayTime, 23, 3); #endif } @@ -720,9 +720,9 @@ void PrintPokedexCount(void) { u8 buffer[16]; - MenuPrint(gMainMenuString_Pokedex, 2, 5); + Menu_PrintText(gMainMenuString_Pokedex, 2, 5); sub_8072C14(buffer, GetPokedexSeenCount(), 18, 0); - MenuPrint(buffer, 9, 5); + Menu_PrintText(buffer, 9, 5); } void PrintBadgeCount(void) @@ -730,12 +730,12 @@ void PrintBadgeCount(void) u8 buffer[16]; #if defined(ENGLISH) - MenuPrint(gMainMenuString_Badges, 16, 5); + Menu_PrintText(gMainMenuString_Badges, 16, 5); #elif defined(GERMAN) - MenuPrint_PixelCoords(gMainMenuString_Badges, 124, 40, TRUE); + Menu_PrintTextPixelCoords(gMainMenuString_Badges, 124, 40, TRUE); #endif ConvertIntToDecimalString(buffer, GetBadgeCount()); - MenuPrint_PixelCoords(buffer, 205, 40, 1); + Menu_PrintTextPixelCoords(buffer, 205, 40, 1); } #define tTrainerSpriteId data[2] @@ -750,8 +750,8 @@ void PrintBadgeCount(void) static void Task_NewGameSpeech1(u8 taskId) { - SetUpWindowConfig(&gWindowConfig_81E6C3C); - InitMenuWindow((struct WindowConfig *)&gWindowConfig_81E6CE4); + Text_LoadWindowTemplate(&gWindowTemplate_81E6C3C); + InitMenuWindow((struct WindowTemplate *)&gWindowTemplate_81E6CE4); REG_WIN0H = 0; REG_WIN0V = 0; REG_WININ = 0; @@ -812,7 +812,7 @@ static void Task_NewGameSpeech3(u8 taskId) } else { - MenuDrawTextWindow(2, 13, 27, 18); + Menu_DrawStdWindowFrame(2, 13, 27, 18); //"Hi! Sorry to keep you waiting... //...But everyone calls me the POKEMON PROFESSOR." MenuPrintMessage(gBirchSpeech_Welcome, 3, 14); @@ -857,7 +857,7 @@ static void Task_NewGameSpeech7(u8 taskId) //Go on to next sentence after frame 95 if (gTasks[taskId].tFrameCounter > 95) { - MenuSetText(gSystemText_NewPara); + Menu_SetText(gSystemText_NewPara); gTasks[taskId].func = Task_NewGameSpeech8; } } @@ -886,7 +886,7 @@ static void Task_NewGameSpeech9(u8 taskId) { if (BirchSpeechUpdateWindowText()) { - MenuDrawTextWindow(2, 13, 27, 18); + Menu_DrawStdWindowFrame(2, 13, 27, 18); //"And you are?" MenuPrintMessage(gBirchSpeech_AndYouAre, 3, 14); gTasks[taskId].func = Task_NewGameSpeech10; @@ -962,7 +962,7 @@ static void Task_NewGameSpeech13(u8 taskId) static void Task_NewGameSpeech14(u8 taskId) { - MenuDrawTextWindow(2, 13, 27, 18); + Menu_DrawStdWindowFrame(2, 13, 27, 18); //"Are you a boy? Or are you a girl?" MenuPrintMessage(gBirchSpeech_AreYouBoyOrGirl, 3, 14); gTasks[taskId].func = Task_NewGameSpeech15; @@ -985,22 +985,22 @@ static void Task_NewGameSpeech16(u8 taskId) switch (GenderMenuProcessInput()) { case MALE: - HandleDestroyMenuCursors(); + Menu_DestroyCursor(); PlaySE(SE_SELECT); gSaveBlock2.playerGender = MALE; - MenuZeroFillWindowRect(2, 4, 8, 9); + Menu_EraseWindowRect(2, 4, 8, 9); gTasks[taskId].func = Task_NewGameSpeech19; break; case FEMALE: - HandleDestroyMenuCursors(); + Menu_DestroyCursor(); PlaySE(SE_SELECT); gSaveBlock2.playerGender = FEMALE; - MenuZeroFillWindowRect(2, 4, 8, 9); + Menu_EraseWindowRect(2, 4, 8, 9); gTasks[taskId].func = Task_NewGameSpeech19; break; } - cursorPos = GetMenuCursorPos(); + cursorPos = Menu_GetCursorPos(); if (cursorPos != gTasks[taskId].tGenderSelection) { @@ -1062,7 +1062,7 @@ static void Task_NewGameSpeech18(u8 taskId) static void Task_NewGameSpeech19(u8 taskId) { - MenuDrawTextWindow(2, 13, 27, 18); + Menu_DrawStdWindowFrame(2, 13, 27, 18); //"All right. What's your name?" MenuPrintMessage(gBirchSpeech_WhatsYourName, 3, 14); gTasks[taskId].func = Task_NewGameSpeech20; @@ -1088,9 +1088,9 @@ static void Task_NewGameSpeech21(u8 taskId) case 2: case 3: case 4: - HandleDestroyMenuCursors(); + Menu_DestroyCursor(); PlaySE(SE_SELECT); - MenuZeroFillWindowRect(2, 1, 22, 12); + Menu_EraseWindowRect(2, 1, 22, 12); SetPresetPlayerName(selection); gTasks[taskId].func = Task_NewGameSpeech23; break; @@ -1100,9 +1100,9 @@ static void Task_NewGameSpeech21(u8 taskId) gTasks[taskId].func = Task_NewGameSpeech22; break; case -1: //B button - HandleDestroyMenuCursors(); + Menu_DestroyCursor(); PlaySE(SE_SELECT); - MenuZeroFillWindowRect(2, 1, 22, 12); + Menu_EraseWindowRect(2, 1, 22, 12); gTasks[taskId].func = Task_NewGameSpeech14; //Go back to gender menu break; } @@ -1120,7 +1120,7 @@ static void Task_NewGameSpeech22(u8 taskId) static void Task_NewGameSpeech23(u8 taskId) { - MenuDrawTextWindow(2, 13, 27, 18); + Menu_DrawStdWindowFrame(2, 13, 27, 18); //"So it's (PLAYER)?" StringExpandPlaceholders(gStringVar4, gBirchSpeech_SoItsPlayer); MenuPrintMessage(gStringVar4, 3, 14); @@ -1139,11 +1139,11 @@ static void Task_NewGameSpeech24(u8 taskId) //Handle yes/no menu selection static void Task_NewGameSpeech25(u8 taskId) { - switch (ProcessMenuInputNoWrap_()) + switch (Menu_ProcessInputNoWrap_()) { case 0: //YES PlaySE(SE_SELECT); - MenuZeroFillWindowRect(2, 1, 8, 7); + Menu_EraseWindowRect(2, 1, 8, 7); gSprites[gTasks[taskId].tTrainerSpriteId].oam.objMode = ST_OAM_OBJ_BLEND; StartSpriteFadeOut(taskId, 2); StartBackgroundFadeOut(taskId, 1); @@ -1152,7 +1152,7 @@ static void Task_NewGameSpeech25(u8 taskId) case -1: //B button case 1: //NO PlaySE(SE_SELECT); - MenuZeroFillWindowRect(2, 1, 8, 7); + Menu_EraseWindowRect(2, 1, 8, 7); gTasks[taskId].func = Task_NewGameSpeech14; //Go back to gender menu break; } @@ -1197,7 +1197,7 @@ static void Task_NewGameSpeech27(u8 taskId) StartSpriteFadeIn(taskId, 2); StartBackgroundFadeIn(taskId, 1); - MenuDrawTextWindow(2, 13, 27, 18); + Menu_DrawStdWindowFrame(2, 13, 27, 18); StringExpandPlaceholders(gStringVar4, gBirchSpeech_AhOkayYouArePlayer); //"Ah, okay! You're (PLAYER) who's moving... //...I get it now!" @@ -1267,7 +1267,7 @@ static void Task_NewGameSpeech29(u8 taskId) StartSpriteFadeIn(taskId, 2); StartBackgroundFadeIn(taskId, 1); - MenuDrawTextWindow(2, 13, 27, 18); + Menu_DrawStdWindowFrame(2, 13, 27, 18); MenuPrintMessage(gBirchSpeech_AreYouReady, 3, 14); gTasks[taskId].func = Task_NewGameSpeech30; } @@ -1373,8 +1373,8 @@ void CB_ContinueNewGameSpeechPart2() FreeAllSpritePalettes(); AddBirchSpeechObjects(taskId); - SetUpWindowConfig(&gWindowConfig_81E6C3C); - InitMenuWindow((struct WindowConfig *)&gWindowConfig_81E6CE4); + Text_LoadWindowTemplate(&gWindowTemplate_81E6C3C); + InitMenuWindow((struct WindowTemplate *)&gWindowTemplate_81E6CE4); if (gSaveBlock2.playerGender != MALE) { @@ -1661,33 +1661,33 @@ static void StartBackgroundFadeIn(u8 taskId, u8 interval) static void CreateGenderMenu(u8 left, u8 top) { u8 menuLeft, menuTop; - MenuDrawTextWindow(left, top, left + 6, top + 5); + Menu_DrawStdWindowFrame(left, top, left + 6, top + 5); menuLeft = left + 1; menuTop = top + 1; - PrintMenuItems(menuLeft, menuTop, 2, gUnknown_081E79B0); + Menu_PrintItems(menuLeft, menuTop, 2, gUnknown_081E79B0); InitMenu(0, menuLeft, menuTop, 2, 0, 5); } static s8 GenderMenuProcessInput(void) { - return ProcessMenuInputNoWrap(); + return Menu_ProcessInputNoWrap(); } static void CreateNameMenu(u8 left, u8 top) { - MenuDrawTextWindow(left, top, left + 10, top + 11); + Menu_DrawStdWindowFrame(left, top, left + 10, top + 11); if (gSaveBlock2.playerGender == MALE) - PrintMenuItems(left + 1, top + 1, 5, gMalePresetNames); + Menu_PrintItems(left + 1, top + 1, 5, gMalePresetNames); else - PrintMenuItems(left + 1, top + 1, 5, gFemalePresetNames); + Menu_PrintItems(left + 1, top + 1, 5, gFemalePresetNames); InitMenu(0, left + 1, top + 1, 5, 0, 9); } static s8 NameMenuProcessInput(void) { - return ProcessMenuInput(); + return Menu_ProcessInput(); } static void SetPresetPlayerName(u8 index) diff --git a/src/engine/menu.c b/src/engine/menu.c index 10988c1d7..86e20d0eb 100644 --- a/src/engine/menu.c +++ b/src/engine/menu.c @@ -24,13 +24,14 @@ struct Menu u8 columnXCoords[8]; }; -static void MultistepInitMenuWindowInternal(const struct WindowConfig *, u16); -static void InitMenuWindowInternal(const struct WindowConfig *, u16); -static bool8 sub_80723D4(void); +static void MultistepInitMenuWindowInternal(const struct WindowTemplate *, u16); +static void InitMenuWindowInternal(const struct WindowTemplate *, u16); +static bool8 IsGridCursorMovementClamped(void); static u8 sub_8072484(u8, u8, u8, u8, u8, u8, u32); static u8 sub_80724F4(u8, u8, u8, const struct MenuAction[], u8); static void sub_8072620(u8, u8, u8, const struct MenuAction[], u8); static void sub_8072D18(u8, u8); +static void RedrawMenuCursor(u8, u8); static struct Menu gMenu; @@ -52,10 +53,10 @@ const struct MenuAction gMenuYesNoItems[] = void CloseMenu(void) { PlaySE(SE_SELECT); - MenuZeroFillScreen(); + Menu_EraseScreen(); sub_8064E2C(); ScriptContext2_Disable(); - HandleDestroyMenuCursors(); + Menu_DestroyCursor(); } void AppendToList(u8 *list, u8 *pindex, u32 value) @@ -64,22 +65,22 @@ void AppendToList(u8 *list, u8 *pindex, u32 value) (*pindex)++; } -void InitMenuWindow(const struct WindowConfig *winConfig) +void InitMenuWindow(const struct WindowTemplate *winTemplate) { - InitMenuWindowInternal(winConfig, 1); + InitMenuWindowInternal(winTemplate, 1); } -void MultistepInitMenuWindowBegin(const struct WindowConfig *winConfig) +void MultistepInitMenuWindowBegin(const struct WindowTemplate *winTemplate) { - MultistepInitMenuWindowInternal(winConfig, 1); + MultistepInitMenuWindowInternal(winTemplate, 1); } -static void MultistepInitMenuWindowInternal(const struct WindowConfig *winConfig, u16 tileOffset) +static void MultistepInitMenuWindowInternal(const struct WindowTemplate *winTemplate, u16 tileOffset) { gMenuMultistepInitState = 0; gMenuTextTileOffset = tileOffset; gMenuWindowPtr = &gMenuWindow; - InitWindowFromConfig(&gMenuWindow, winConfig); + Text_InitWindowWithTemplate(&gMenuWindow, winTemplate); } bool32 MultistepInitMenuWindowContinue(void) @@ -97,13 +98,13 @@ bool32 MultistepInitMenuWindowContinue(void) goto fail; goto next; case 3: - gMenuTextWindowContentTileOffset = SetTextWindowBaseTileNum(gMenuTextWindowTileOffset); + gMenuTextWindowContentTileOffset = TextWindow_SetBaseTileNum(gMenuTextWindowTileOffset); next: gMenuMultistepInitState++; return 0; case 4: - LoadTextWindowGraphics(gMenuWindowPtr); - gMenuMessageBoxContentTileOffset = SetMessageBoxBaseTileNum(gMenuTextWindowContentTileOffset); + TextWindow_LoadStdFrameGraphics(gMenuWindowPtr); + gMenuMessageBoxContentTileOffset = TextWindow_SetDlgFrameBaseTileNum(gMenuTextWindowContentTileOffset); return 1; default: fail: @@ -111,73 +112,74 @@ bool32 MultistepInitMenuWindowContinue(void) } } -static void InitMenuWindowInternal(const struct WindowConfig *winConfig, u16 tileOffset) +static void InitMenuWindowInternal(const struct WindowTemplate *winTemplate, u16 tileOffset) { gMenuWindowPtr = &gMenuWindow; - InitWindowFromConfig(&gMenuWindow, winConfig); + Text_InitWindowWithTemplate(&gMenuWindow, winTemplate); gMenuTextTileOffset = tileOffset; gMenuTextWindowTileOffset = InitWindowTileData(gMenuWindowPtr, gMenuTextTileOffset); - gMenuTextWindowContentTileOffset = SetTextWindowBaseTileNum(gMenuTextWindowTileOffset); - LoadTextWindowGraphics(gMenuWindowPtr); - gMenuMessageBoxContentTileOffset = SetMessageBoxBaseTileNum(gMenuTextWindowContentTileOffset); + gMenuTextWindowContentTileOffset = TextWindow_SetBaseTileNum(gMenuTextWindowTileOffset); + TextWindow_LoadStdFrameGraphics(gMenuWindowPtr); + gMenuMessageBoxContentTileOffset = TextWindow_SetDlgFrameBaseTileNum(gMenuTextWindowContentTileOffset); } -void unref_sub_8071DA4(struct WindowConfig *winConfig, u16 tileOffset) +void unref_sub_8071DA4(struct WindowTemplate *winTemplate, u16 tileOffset) { gMenuWindowPtr = &gMenuWindow; - InitWindowFromConfig(&gMenuWindow, winConfig); + Text_InitWindowWithTemplate(&gMenuWindow, winTemplate); gMenuTextWindowTileOffset = tileOffset; - gMenuTextWindowContentTileOffset = SetTextWindowBaseTileNum(gMenuTextWindowTileOffset); - LoadTextWindowGraphics(gMenuWindowPtr); - gMenuTextTileOffset = SetMessageBoxBaseTileNum(gMenuTextWindowContentTileOffset); + gMenuTextWindowContentTileOffset = TextWindow_SetBaseTileNum(gMenuTextWindowTileOffset); + TextWindow_LoadStdFrameGraphics(gMenuWindowPtr); + gMenuTextTileOffset = TextWindow_SetDlgFrameBaseTileNum(gMenuTextWindowContentTileOffset); gMenuMessageBoxContentTileOffset = InitWindowTileData(gMenuWindowPtr, gMenuTextTileOffset); } -void MenuLoadTextWindowGraphics_OverrideFrameType(u8 frameType) +void Menu_LoadStdFrameGraphicsOverrideStyle(u8 frameType) { - LoadTextWindowGraphics_OverrideFrameType(gMenuWindowPtr, frameType); + TextWindow_LoadStdFrameGraphicsOverrideStyle(gMenuWindowPtr, frameType); } -void MenuLoadTextWindowGraphics(void) +void Menu_LoadStdFrameGraphics(void) { - LoadTextWindowGraphics(gMenuWindowPtr); + TextWindow_LoadStdFrameGraphics(gMenuWindowPtr); } -void BasicInitMenuWindow(const struct WindowConfig *winConfig) +void BasicInitMenuWindow(const struct WindowTemplate *winTemplate) { - InitWindowFromConfig(gMenuWindowPtr, winConfig); + Text_InitWindowWithTemplate(gMenuWindowPtr, winTemplate); gMenuWindowPtr->tileDataStartOffset = gMenuTextTileOffset; } -void MenuPrint(const u8 *str, u8 left, u8 top) +// Prints +void Menu_PrintText(const u8 *str, u8 left, u8 top) { - sub_8003460(gMenuWindowPtr, str, gMenuTextTileOffset, left, top); + Text_InitWindowAndPrintText(gMenuWindowPtr, str, gMenuTextTileOffset, left, top); } -void MenuZeroFillWindowRect(u8 left, u8 top, u8 right, u8 bottom) +void Menu_EraseWindowRect(u8 left, u8 top, u8 right, u8 bottom) { - ZeroFillWindowRect(gMenuWindowPtr, left, top, right, bottom); + Text_EraseWindowRect(gMenuWindowPtr, left, top, right, bottom); } -void MenuFillWindowRectWithBlankTile(u8 left, u8 top, u8 right, u8 bottom) +void Menu_BlankWindowRect(u8 left, u8 top, u8 right, u8 bottom) { - FillWindowRectWithBlankTile(gMenuWindowPtr, left, top, right, bottom); + Text_BlankWindowRect(gMenuWindowPtr, left, top, right, bottom); } -void MenuZeroFillScreen(void) +void Menu_EraseScreen(void) { - MenuZeroFillWindowRect(0, 0, 29, 19); + Menu_EraseWindowRect(0, 0, 29, 19); } -void MenuDrawTextWindow(u8 left, u8 top, u8 right, u8 bottom) +void Menu_DrawStdWindowFrame(u8 left, u8 top, u8 right, u8 bottom) { - DrawTextWindow(gMenuWindowPtr, left, top, right, bottom); + TextWindow_DrawStdFrame(gMenuWindowPtr, left, top, right, bottom); } void sub_8071F40(const u8 *str) { - MenuDrawTextWindow(2, 14, 28, 19); - MenuPrint(str, 3, 15); + Menu_DrawStdWindowFrame(2, 14, 28, 19); + Menu_PrintText(str, 3, 15); } void sub_8071F60(u8 a1, u8 a2, u8 a3) @@ -187,50 +189,50 @@ void sub_8071F60(u8 a1, u8 a2, u8 a3) u16 unref_sub_8071F98(u8 x, u8 y) { - return GetWindowTilemapEntry(gMenuWindowPtr, x, y); + return Text_GetWindowTilemapEntry(gMenuWindowPtr, x, y); } void unref_sub_8071FBC(u16 a1, u8 a2, u8 a3, u8 a4, u8 a5) { - DrawWindowRect(gMenuWindowPtr, a1, a2, a3, a4, a5); + Text_FillWindowBorder(gMenuWindowPtr, a1, a2, a3, a4, a5); } -void MenuDisplayMessageBox(void) +void Menu_DisplayDialogueFrame(void) { - DisplayMessageBox(gMenuWindowPtr); + TextWindow_DisplayDialogueFrame(gMenuWindowPtr); } void MenuPrintMessage(const u8 *str, u8 left, u8 top) { - sub_8002EB0(gMenuWindowPtr, str, gMenuTextTileOffset, left, top); + Text_InitWindow8002EB0(gMenuWindowPtr, str, gMenuTextTileOffset, left, top); } void MenuPrintMessageDefaultCoords(const u8 *str) { - sub_8002EB0(gMenuWindowPtr, str, gMenuTextTileOffset, 2, 15); + Text_InitWindow8002EB0(gMenuWindowPtr, str, gMenuTextTileOffset, 2, 15); } -void MenuSetText(const u8 *str) +void Menu_SetText(const u8 *str) { - sub_8002E90(gMenuWindowPtr, str); + Text_SetWindowText(gMenuWindowPtr, str); } -u8 MenuUpdateWindowText(void) +u8 Menu_UpdateWindowText(void) { - return sub_80035AC(gMenuWindowPtr); + return Text_UpdateWindow(gMenuWindowPtr); } u8 unref_sub_8072098(void) { - return sub_8003418(gMenuWindowPtr); + return Text_PrintWindowSimple(gMenuWindowPtr); } -void sub_80720B0(void) +void Menu_ClearWindowText(void) { - ClearWindowTextLines(gMenuWindowPtr); + Text_ClearWindow(gMenuWindowPtr); } -u8 MoveMenuCursor(s8 delta) +u8 Menu_MoveCursor(s8 delta) { s32 newPos = gMenu.cursorPos + delta; @@ -245,7 +247,7 @@ u8 MoveMenuCursor(s8 delta) return gMenu.cursorPos; } -u8 MoveMenuCursorNoWrap(s8 delta) +u8 Menu_MoveCursorNoWrap(s8 delta) { s32 newPos = gMenu.cursorPos + delta; @@ -260,45 +262,45 @@ u8 MoveMenuCursorNoWrap(s8 delta) return gMenu.cursorPos; } -u8 GetMenuCursorPos(void) +u8 Menu_GetCursorPos(void) { return gMenu.cursorPos; } -s8 ProcessMenuInput(void) +s8 Menu_ProcessInput(void) { if (gMain.newKeys & A_BUTTON) { PlaySE(SE_SELECT); if (gMenu.menu_field_7) - HandleDestroyMenuCursors(); + Menu_DestroyCursor(); return gMenu.cursorPos; } if (gMain.newKeys & B_BUTTON) { if (gMenu.menu_field_7) - HandleDestroyMenuCursors(); + Menu_DestroyCursor(); return -1; } if (gMain.newKeys & DPAD_UP) { PlaySE(SE_SELECT); - MoveMenuCursor(-1); + Menu_MoveCursor(-1); return -2; } else if (gMain.newKeys & DPAD_DOWN) { PlaySE(SE_SELECT); - MoveMenuCursor(1); + Menu_MoveCursor(1); return -2; } return -2; } -s8 ProcessMenuInputNoWrap(void) +s8 Menu_ProcessInputNoWrap(void) { u8 cursorPos = gMenu.cursorPos; @@ -306,31 +308,31 @@ s8 ProcessMenuInputNoWrap(void) { PlaySE(SE_SELECT); if (gMenu.menu_field_7) - HandleDestroyMenuCursors(); + Menu_DestroyCursor(); return gMenu.cursorPos; } if (gMain.newKeys & B_BUTTON) { if (gMenu.menu_field_7) - HandleDestroyMenuCursors(); + Menu_DestroyCursor(); return -1; } if (gMain.newKeys & DPAD_UP) { - if (cursorPos != MoveMenuCursorNoWrap(-1)) + if (cursorPos != Menu_MoveCursorNoWrap(-1)) PlaySE(SE_SELECT); return -2; } else if (gMain.newKeys & DPAD_DOWN) { - if (cursorPos != MoveMenuCursorNoWrap(1)) + if (cursorPos != Menu_MoveCursorNoWrap(1)) PlaySE(SE_SELECT); return -2; } - MoveMenuCursorNoWrap(0); + Menu_MoveCursorNoWrap(0); return -2; } @@ -353,11 +355,12 @@ u8 MoveMenuCursor3(s8 delta) return gMenu.cursorPos; } -u8 MoveMenuCursor4(s8 delta) +static u8 MoveMenuCursorGridLayout(s8 delta) { + // Don't move cursor if it is clamped if (gMenu.cursorPos + delta <= gMenu.maxCursorPos) { - if (sub_80723D4() == TRUE) + if (IsGridCursorMovementClamped() == TRUE) return gMenu.cursorPos; } else @@ -379,22 +382,35 @@ u8 MoveMenuCursor4(s8 delta) return gMenu.cursorPos; } -static bool8 sub_80723D4(void) +// Returns TRUE if the cursor is on an edge and cannot move in the pressed direction +static bool8 IsGridCursorMovementClamped(void) { - if ((gMain.newKeys & DPAD_UP) && gMenu.cursorPos < gMenu.width) - return TRUE; - - if ((gMain.newKeys & DPAD_DOWN) && gMenu.cursorPos >= (gMenu.maxCursorPos + 1) - gMenu.width) - return TRUE; - - if ((gMain.newKeys & DPAD_LEFT) - && ((gMenu.cursorPos - (gMenu.cursorPos % gMenu.width)) % gMenu.width == 1 // always false - || gMenu.cursorPos == 0 - || gMenu.cursorPos % gMenu.width == 0)) - return TRUE; - - if ((gMain.newKeys & DPAD_RIGHT) && gMenu.cursorPos % gMenu.width == gMenu.width - 1) - return TRUE; + if (gMain.newKeys & DPAD_UP) + { + // is cursor on first row? + if (gMenu.cursorPos < gMenu.width) + return TRUE; + } + if (gMain.newKeys & DPAD_DOWN) + { + // is cursor on last row? + if (gMenu.cursorPos >= gMenu.maxCursorPos + 1 - gMenu.width) + return TRUE; + } + if (gMain.newKeys & DPAD_LEFT) + { + // is cursor on first column? + if ((gMenu.cursorPos - gMenu.cursorPos % gMenu.width) % gMenu.width == 1 // always false + || gMenu.cursorPos == 0 // redundant + || gMenu.cursorPos % gMenu.width == 0) + return TRUE; + } + if (gMain.newKeys & DPAD_RIGHT) + { + // is cursor on last column? + if (gMenu.cursorPos % gMenu.width == gMenu.width - 1) + return TRUE; + } return FALSE; } @@ -465,7 +481,7 @@ static u8 sub_80724F4(u8 left, u8 top, u8 menuItemCount, const struct MenuAction totalWidth = (gMenu.columnXCoords[columnCount] + 1); right = left + totalWidth; - MenuDrawTextWindow(left, top, right, bottom); + Menu_DrawStdWindowFrame(left, top, right, bottom); } return maxWidth; @@ -501,7 +517,7 @@ static void sub_8072620(u8 left, u8 top, u8 menuItemCount, const struct MenuActi u8 row = 0; u8 j; for (j = 0; i + j < menuItemCount; j += columnCount, row++) - MenuPrint(menuItems[i + j].text, left + gMenu.columnXCoords[i % columnCount], top + 2 * row); + Menu_PrintText(menuItems[i + j].text, left + gMenu.columnXCoords[i % columnCount], top + 2 * row); } } @@ -513,93 +529,95 @@ void sub_807274C(u8 left, u8 top, u8 menuItemCount, u8 a4, const struct MenuActi sub_8072620(left + 1, top + 1, menuItemCount, menuItems, columnCount); } -s8 sub_80727CC(void) +s8 Menu_ProcessInputGridLayout(void) { if (gMain.newKeys & A_BUTTON) { if (gMenu.menu_field_7) - HandleDestroyMenuCursors(); + Menu_DestroyCursor(); PlaySE(SE_SELECT); - return GetMenuCursorPos(); + return Menu_GetCursorPos(); } if (gMain.newKeys & B_BUTTON) { if (gMenu.menu_field_7) - HandleDestroyMenuCursors(); + Menu_DestroyCursor(); return -1; } if (gMain.newKeys & DPAD_UP) { PlaySE(SE_SELECT); - MoveMenuCursor4(-gMenu.width); + // Move up one whole row + MoveMenuCursorGridLayout(-gMenu.width); return -2; } else if (gMain.newKeys & DPAD_DOWN) { PlaySE(SE_SELECT); - MoveMenuCursor4(gMenu.width); + // Move down one whole column + MoveMenuCursorGridLayout(gMenu.width); return -2; } else if (gMain.newKeys & DPAD_LEFT) { PlaySE(SE_SELECT); - MoveMenuCursor4(-1); + MoveMenuCursorGridLayout(-1); return -2; } else if (gMain.newKeys & DPAD_RIGHT) { PlaySE(SE_SELECT); - MoveMenuCursor4(1); + MoveMenuCursorGridLayout(1); return -2; } return -2; } -u8 sub_807288C(u8 column) +u8 Menu_GetColumnXCoord(u8 column) { return gMenu.columnXCoords[column]; } -void PrintMenuItems(u8 left, u8 top, u8 menuItemCount, const struct MenuAction menuItems[]) +void Menu_PrintItems(u8 left, u8 top, u8 menuItemCount, const struct MenuAction menuItems[]) { u8 i; for (i = 0; i < menuItemCount; i++) - MenuPrint(menuItems[i].text, left, top + 2 * i); + Menu_PrintText(menuItems[i].text, left, top + 2 * i); } -void PrintMenuItemsReordered(u8 left, u8 top, u8 menuItemCount, const struct MenuAction2 menuItems[], const u8 *order) +void Menu_PrintItemsReordered(u8 left, u8 top, u8 menuItemCount, const struct MenuAction2 menuItems[], const u8 *order) { u8 i; for (i = 0; i < menuItemCount; i++) - MenuPrint(menuItems[order[i]].text, left, top + 2 * i); + Menu_PrintText(menuItems[order[i]].text, left, top + 2 * i); } void InitYesNoMenu(u8 left, u8 top, u8 a3) { - PrintMenuItems(left + 1, top + 1, 2, gMenuYesNoItems); + Menu_PrintItems(left + 1, top + 1, 2, gMenuYesNoItems); InitMenu(0, left + 1, top + 1, 2, 0, a3); } void DisplayYesNoMenu(u8 left, u8 top, u32 a3) { - MenuDrawTextWindow(left, top, left + 6, top + 5); + Menu_DrawStdWindowFrame(left, top, left + 6, top + 5); InitYesNoMenu(left, top, 5); gMenu.menu_field_7 = a3 ? -1 : 0; } -s8 ProcessMenuInputNoWrap_(void) +s8 Menu_ProcessInputNoWrap_(void) { - return ProcessMenuInputNoWrap(); + return Menu_ProcessInputNoWrap(); } -u8 MenuPrint_PixelCoords(const u8 *text, u8 left, u16 top, u8 a4) +u8 Menu_PrintTextPixelCoords(const u8 *text, u8 left, u16 top, u8 a4) { - return sub_8004D04(gMenuWindowPtr, text, gMenuTextTileOffset, left, top, a4); + return Text_InitWindow8004D04(gMenuWindowPtr, text, gMenuTextTileOffset, left, top, a4); } u8 sub_8072A18(const u8 *text, u8 left, u16 top, u8 width, u32 a5) @@ -623,7 +641,7 @@ int sub_8072AB0(const u8 *str, u8 left, u16 top, u8 width, u8 height, u32 a6) height = (height + 7) / 8; if (newlineCount < height) - MenuFillWindowRectWithBlankTile(left, top + 2 * newlineCount, left + width - 1, height + top - 1); + Menu_BlankWindowRect(left, top + 2 * newlineCount, left + width - 1, height + top - 1); } #elif GERMAN __attribute__((naked)) @@ -700,7 +718,7 @@ _08072B0C:\n\ lsls r3, 24\n\ lsrs r3, 24\n\ adds r0, r5, 0\n\ - bl MenuFillWindowRectWithBlankTile\n\ + bl Menu_BlankWindowRect\n\ _08072B3E:\n\ add sp, 0x10\n\ pop {r4-r7}\n\ @@ -712,7 +730,7 @@ _08072B3E:\n\ void MenuPrint_RightAligned(const u8 *str, u8 left, u8 top) { - sub_8004D38(gMenuWindowPtr, str, gMenuTextTileOffset, left, top); + Text_InitWindow8004D38(gMenuWindowPtr, str, gMenuTextTileOffset, left, top); } void sub_8072B80(const u8 *a1, u8 a2, u8 a3, const u8 *a4) @@ -720,12 +738,12 @@ void sub_8072B80(const u8 *a1, u8 a2, u8 a3, const u8 *a4) u8 buffer[64]; u8 width = GetStringWidth(gMenuWindowPtr, a4); AlignString(gMenuWindowPtr, buffer, a1, width, 1); - sub_8003460(gMenuWindowPtr, buffer, gMenuTextTileOffset, a2, a3); + Text_InitWindowAndPrintText(gMenuWindowPtr, buffer, gMenuTextTileOffset, a2, a3); } void sub_8072BD8(const u8 *a1, u8 a2, u8 a3, u16 a4) { - sub_8004DB0(gMenuWindowPtr, a1, gMenuTextTileOffset, a2, a3, a4); + Text_InitWindow8004DB0(gMenuWindowPtr, a1, gMenuTextTileOffset, a2, a3, a4); } u8 *sub_8072C14(u8 *a1, s32 a2, u8 a3, u8 a4) @@ -748,19 +766,19 @@ u8 sub_8072CA4(const u8 *str) return GetStringWidth(gMenuWindowPtr, str); } -u8 sub_8072CBC() +u8 Menu_GetTextWindowPaletteNum(void) { - return sub_8004E24(gMenuWindowPtr); + return Text_GetWindowPaletteNum(gMenuWindowPtr); } -void sub_8072CD4(u8 *a1, u8 *a2, u8 *a3) +void Menu_GetTextColors(u8 *a1, u8 *a2, u8 *a3) { - sub_8004E28(gMenuWindowPtr, a1, a2, a3); + Text_GetTextColors(gMenuWindowPtr, a1, a2, a3); } -u32 MenuUpdateWindowText_OverrideLineLength(u8 lineLength) +u32 Menu_UpdateWindowTextOverrideLineLength(u8 lineLength) { - return sub_80037C8(gMenuWindowPtr, lineLength); + return Text_UpdateWindowOverrideLineLength(gMenuWindowPtr, lineLength); } struct Window *unref_sub_8072D0C(void) @@ -770,7 +788,7 @@ struct Window *unref_sub_8072D0C(void) static void sub_8072D18(u8 a1, u8 a2) { - sub_814A5C0(a1, 0xFFFF, 12, 11679, 8 * a2); + MenuCursor_Create814A5C0(a1, 0xFFFF, 12, 11679, 8 * a2); } u8 InitMenu(u8 cursorSubpriority, u8 left, u8 top, u8 numChoices, u8 cursorPos, u8 cursorWidth) @@ -792,14 +810,14 @@ u8 InitMenu(u8 cursorSubpriority, u8 left, u8 top, u8 numChoices, u8 cursorPos, pos = 0; gMenu.cursorPos = pos; - MoveMenuCursor(0); + Menu_MoveCursor(0); return pos; } -void RedrawMenuCursor(u8 a1, u8 a2) +static void RedrawMenuCursor(u8 x, u8 y) { - sub_814A880((a1 + 1) * 8, 8 * a2); + MenuCursor_SetPos814A880((x + 1) * 8, 8 * y); } void unref_sub_8072DC0() @@ -817,7 +835,7 @@ void sub_8072DDC(u8 a1) sub_8072DCC(8 * a1); } -void HandleDestroyMenuCursors(void) +void Menu_DestroyCursor(void) { DestroyMenuCursor(); } diff --git a/src/engine/menu_cursor.c b/src/engine/menu_cursor.c index 960d3cc87..35116d40b 100644 --- a/src/engine/menu_cursor.c +++ b/src/engine/menu_cursor.c @@ -3,13 +3,13 @@ #include "palette.h" #include "sprite.h" -EWRAM_DATA u16 gUnknown_0203A360[0x10] = {}; -EWRAM_DATA struct Subsprite gMenuCursorSubsprites[10] = {0}; -EWRAM_DATA u8 gUnknown_0203A3D0 = 0; -EWRAM_DATA u8 gUnknown_0203A3D1 = 0; -EWRAM_DATA u8 gUnknown_0203A3D2 = 0; -EWRAM_DATA u8 gUnknown_0203A3D3 = 0; -EWRAM_DATA u8 gUnknown_0203A3D4 = 0; +EWRAM_DATA static u16 gUnknown_0203A360[0x10] = {}; +EWRAM_DATA static struct Subsprite gMenuCursorSubsprites[10] = {0}; +EWRAM_DATA static u8 gUnknown_0203A3D0 = 0; +EWRAM_DATA static u8 gUnknown_0203A3D1 = 0; +EWRAM_DATA static u8 gUnknown_0203A3D2 = 0; +EWRAM_DATA static u8 gUnknown_0203A3D3 = 0; +EWRAM_DATA static u8 gUnknown_0203A3D4 = 0; #if ENGLISH #include "../src/data/menu_cursor_en.h" @@ -26,7 +26,7 @@ void sub_814A590(void) gUnknown_0203A3D4 = 0; } -u8 sub_814A5C0(u8 a1, u16 a2, u8 a3, u16 a4, u8 a5) +u8 MenuCursor_Create814A5C0(u8 subpriority, u16 paletteTag, u8 a3, u16 a4, u8 a5) { int v9; struct Sprite *v10; @@ -35,34 +35,34 @@ u8 sub_814A5C0(u8 a1, u16 a2, u8 a3, u16 a4, u8 a5) DestroyMenuCursor(); v9 = 1; - if (a2 == 0xFFFF) + if (paletteTag == 0xFFFF) { gUnknown_0203A360[a3 & 0xF] = a4; if (LoadSpritePalette(&gUnknown_0842F240) != 0xFF) { - a2 = 0xFFF0; + paletteTag = 0xFFF0; v9 = 0; } } LoadSpriteSheetDeferred(&gUnknown_0842F140[a3 & 0xF]); - gUnknown_0203A3D0 = CreateSprite(&gSpriteTemplate_842F250[v9], 0, 0xA0, a1); - gUnknown_0203A3D1 = CreateSprite(&gSpriteTemplate_842F250[2], 0, 0xA0, a1); + gUnknown_0203A3D0 = CreateSprite(&gSpriteTemplate_842F250[v9], 0, 160, subpriority); + gUnknown_0203A3D1 = CreateSprite(&gSpriteTemplate_842F250[2], 0, 160, subpriority); if (gUnknown_0203A3D0 != 0x40) { v10 = &gSprites[gUnknown_0203A3D0]; - if (a2 == 0xFFFF) + if (paletteTag == 0xFFFF) v10->oam.paletteNum = 0; else - v10->oam.paletteNum = IndexOfSpritePaletteTag(a2); + v10->oam.paletteNum = IndexOfSpritePaletteTag(paletteTag); } if (gUnknown_0203A3D1 != 0x40) { v10 = &gSprites[gUnknown_0203A3D1]; - if (a2 == 0xFFFF) + if (paletteTag == 0xFFFF) v10->oam.paletteNum = 0; else - v10->oam.paletteNum = IndexOfSpritePaletteTag(a2); + v10->oam.paletteNum = IndexOfSpritePaletteTag(paletteTag); if (!(REG_DISPCNT & (DISPCNT_WIN0_ON | DISPCNT_WIN1_ON))) *(u8 *)(REG_ADDR_WINOUT) |= 0x1F; @@ -75,12 +75,13 @@ u8 sub_814A5C0(u8 a1, u16 a2, u8 a3, u16 a4, u8 a5) return gUnknown_0203A3D0; } -u8 sub_814A758(u8 a1, u8 a2, u8 a3, u8 a4) +// unused +u8 sub_814A758(u8 subpriority, u8 a2, u8 a3, u8 a4) { u8 result; struct Sprite *spr; - result = sub_814A5C0(a1, 0, a3, 0, a4); + result = MenuCursor_Create814A5C0(subpriority, 0, a3, 0, a4); if (result != 0x40) { spr = &gSprites[gUnknown_0203A3D0]; @@ -128,7 +129,7 @@ void DestroyMenuCursor(void) return; } -void sub_814A880(u8 a1, u8 a2) +void MenuCursor_SetPos814A880(u8 a1, u8 a2) { struct Sprite *spr; @@ -685,49 +686,48 @@ void unref_sub_814ABE4(int a1) return; } -u8 CreateBlendedOutlineCursor(u8 a1, u16 a2, u8 a3, u16 a4, u8 a5) +u8 CreateBlendedOutlineCursor(u8 subpriority, u16 paletteTag, u8 a3, u16 a4, u8 a5) { int v8; struct Sprite *spr; - u8 var1 = gUnknown_0203A3D2; - if (var1 != 0x40) - sub_814AD44(); + if (gUnknown_0203A3D2 != 0x40) + MenuCursor_Destroy814AD44(); v8 = 1; - if (a2 == 0xFFFF) + if (paletteTag == 0xFFFF) { gUnknown_0203A360[a3 & 0xF] = a4; if (LoadSpritePalette(&gUnknown_0842F248) != 0xFF ) { - a2 = 0xFFF1; + paletteTag = 0xFFF1; v8 = 0; } } LoadSpriteSheetDeferred(&gUnknown_0842F1C0[a3 & 0xF]); #if ENGLISH - gUnknown_0203A3D2 = CreateSprite(&gSpriteTemplate_842F298[v8], 0, 160, a1); + gUnknown_0203A3D2 = CreateSprite(&gSpriteTemplate_842F298[v8], 0, 160, subpriority); #elif GERMAN - gUnknown_0203A3D2 = CreateSprite(&gSpriteTemplate_842F298[v8], 0, 161, a1); + gUnknown_0203A3D2 = CreateSprite(&gSpriteTemplate_842F298[v8], 0, 161, subpriority); #endif if (gUnknown_0203A3D2 != 0x40) { spr = &gSprites[gUnknown_0203A3D2]; - if (a2 == 0xFFFF) + if (paletteTag == 0xFFFF) spr->oam.paletteNum = 0; else - spr->oam.paletteNum = IndexOfSpritePaletteTag(a2); + spr->oam.paletteNum = IndexOfSpritePaletteTag(paletteTag); } sub_814ADF4(a5); return gUnknown_0203A3D2; } -void sub_814AD44(void) +void MenuCursor_Destroy814AD44(void) { if (gUnknown_0203A3D2 != 0x40) { @@ -738,7 +738,7 @@ void sub_814AD44(void) return; } -void sub_814AD7C(u8 a1, u8 a2) +void MenuCursor_SetPos814AD7C(u8 a1, u8 a2) { struct Sprite *spr; if (gUnknown_0203A3D2 != 0x40) diff --git a/src/engine/mystery_event_menu.c b/src/engine/mystery_event_menu.c index b9c3d5ad8..b7b7c047e 100644 --- a/src/engine/mystery_event_menu.c +++ b/src/engine/mystery_event_menu.c @@ -45,9 +45,9 @@ void CB2_InitMysteryEventMenu(void) FreeAllSpritePalettes(); ResetTasks(); SetVBlankCallback(VBlankCB); - SetUpWindowConfig(&gWindowConfig_81E6CE4); - InitMenuWindow(&gWindowConfig_81E6CE4); - MenuZeroFillScreen(); + Text_LoadWindowTemplate(&gWindowTemplate_81E6CE4); + InitMenuWindow(&gWindowTemplate_81E6CE4); + Menu_EraseScreen(); REG_DISPCNT = DISPCNT_MODE_0 | DISPCNT_OBJ_1D_MAP | DISPCNT_BG0_ON; REG_BLDCNT = 0; CreateTask(Task_DestroySelf, 0); @@ -86,7 +86,7 @@ static void CB2_MysteryEventMenu(void) switch (gMain.state) { case 0: - MenuDrawTextWindow(0, 14, 29, 19); + Menu_DrawStdWindowFrame(0, 14, 29, 19); BeginNormalPaletteFade(0xFFFFFFFF, 0, 0x10, 0, 0); gMain.state++; break; @@ -97,7 +97,7 @@ static void CB2_MysteryEventMenu(void) gMain.state++; break; case 2: - if (MenuUpdateWindowText()) + if (Menu_UpdateWindowText()) { gMain.state++; gLinkType = 21761; @@ -119,7 +119,7 @@ static void CB2_MysteryEventMenu(void) } break; case 4: - if (MenuUpdateWindowText()) + if (Menu_UpdateWindowText()) gMain.state++; break; #ifdef NONMATCHING @@ -135,8 +135,8 @@ static void CB2_MysteryEventMenu(void) { PlaySE(SE_SELECT); sub_8007F4C(); - MenuDrawTextWindow(6, 5, 23, 8); - MenuPrint(gSystemText_LoadingEvent, 7, 6); + Menu_DrawStdWindowFrame(6, 5, 23, 8); + Menu_PrintText(gSystemText_LoadingEvent, 7, 6); gMain.state++; } else if (gMain.newKeys & B_BUTTON) @@ -155,7 +155,7 @@ static void CB2_MysteryEventMenu(void) if (GetLinkPlayerDataExchangeStatusTimed() == 3) { sub_800832C(); - MenuZeroFillWindowRect(6, 5, 23, 8); + Menu_EraseWindowRect(6, 5, 23, 8); GetEventLoadMessage(gStringVar4, 1); MenuPrintMessageDefaultCoords(gStringVar4); gMain.state = 13; @@ -170,7 +170,7 @@ static void CB2_MysteryEventMenu(void) else { CloseLink(); - MenuZeroFillWindowRect(6, 5, 23, 8); + Menu_EraseWindowRect(6, 5, 23, 8); GetEventLoadMessage(gStringVar4, 1); MenuPrintMessageDefaultCoords(gStringVar4); gMain.state = 13; @@ -195,8 +195,8 @@ static void CB2_MysteryEventMenu(void) { PlaySE(SE_SELECT); sub_8007F4C(); - MenuDrawTextWindow(6, 5, 23, 8); - MenuPrint(gSystemText_LoadingEvent, 7, 6); + Menu_DrawStdWindowFrame(6, 5, 23, 8); + Menu_PrintText(gSystemText_LoadingEvent, 7, 6); gMain.state++; } else if (gMain.newKeys & B_BUTTON) @@ -219,7 +219,7 @@ static void CB2_MysteryEventMenu(void) if (GetLinkPlayerDataExchangeStatusTimed() == 3) { sub_800832C(); - MenuZeroFillWindowRect(6, 5, 23, 8); + Menu_EraseWindowRect(6, 5, 23, 8); GetEventLoadMessage(gStringVar4, 1); MenuPrintMessageDefaultCoords(gStringVar4); ptr = (u8 *)&gMain; @@ -245,7 +245,7 @@ static void CB2_MysteryEventMenu(void) else { CloseLink(); - MenuZeroFillWindowRect(6, 5, 23, 8); + Menu_EraseWindowRect(6, 5, 23, 8); label: GetEventLoadMessage(gStringVar4, 1); MenuPrintMessageDefaultCoords(gStringVar4); @@ -266,7 +266,7 @@ static void CB2_MysteryEventMenu(void) break; #endif case 7: - if (MenuUpdateWindowText()) + if (Menu_UpdateWindowText()) gMain.state++; break; case 8: @@ -297,8 +297,8 @@ static void CB2_MysteryEventMenu(void) gMain.state++; break; case 13: - MenuZeroFillWindowRect(6, 5, 23, 8); - if (MenuUpdateWindowText()) + Menu_EraseWindowRect(6, 5, 23, 8); + if (Menu_UpdateWindowText()) { gMain.state++; gUnknown_02039338 = 0; @@ -326,7 +326,7 @@ static void CB2_MysteryEventMenu(void) if (!IsLinkMaster()) { CloseLink(); - MenuZeroFillWindowRect(6, 5, 23, 8); + Menu_EraseWindowRect(6, 5, 23, 8); GetEventLoadMessage(gStringVar4, 1); MenuPrintMessageDefaultCoords(gStringVar4); gMain.state = 13; diff --git a/src/engine/name_string_util.c b/src/engine/name_string_util.c index f1a935453..32e9358e1 100644 --- a/src/engine/name_string_util.c +++ b/src/engine/name_string_util.c @@ -7,7 +7,7 @@ void PadNameString(u8 *a1, u8 a2) { u8 i; - StripExtCtrlCodes(a1); + Text_StripExtCtrlCodes(a1); i = StringLength(a1); if (a2 == 0xFC) @@ -36,5 +36,5 @@ void SanitizeNameString(u8 *a1) if (StringLength(a1) < 6) ConvertInternationalString(a1, 1); else - StripExtCtrlCodes(a1); + Text_StripExtCtrlCodes(a1); } diff --git a/src/engine/naming_screen.c b/src/engine/naming_screen.c index 440504d5a..eddfdeda5 100644 --- a/src/engine/naming_screen.c +++ b/src/engine/naming_screen.c @@ -325,8 +325,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 +503,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 +1610,8 @@ static void DisplaySentToPCMessage(void) { StringCopy(gStringVar1, namingScreenDataPtr->destBuffer); StringExpandPlaceholders(gStringVar4, gOtherText_SentToPC); - BasicInitMenuWindow(&gWindowConfig_81E6E88); - MenuDisplayMessageBox(); + BasicInitMenuWindow(&gWindowTemplate_81E6E88); + Menu_DisplayDialogueFrame(); MenuPrintMessageDefaultCoords(gStringVar4); } @@ -1757,19 +1757,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 +1838,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 +1870,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 +1886,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); } //-------------------------------------------------- diff --git a/src/engine/option_menu.c b/src/engine/option_menu.c index dfc49b035..868830880 100644 --- a/src/engine/option_menu.c +++ b/src/engine/option_menu.c @@ -116,11 +116,11 @@ void CB2_InitOptionMenu(void) gMain.state++; break; case 2: - SetUpWindowConfig(&gWindowConfig_81E71B4); + Text_LoadWindowTemplate(&gWindowTemplate_81E71B4); gMain.state++; break; case 3: - MultistepInitMenuWindowBegin(&gWindowConfig_81E71B4); + MultistepInitMenuWindowBegin(&gWindowTemplate_81E71B4); gMain.state++; break; case 4: @@ -173,17 +173,17 @@ void CB2_InitOptionMenu(void) gTasks[taskId].data[TD_BUTTONMODE] = gSaveBlock2.optionsButtonMode; gTasks[taskId].data[TD_FRAMETYPE] = gSaveBlock2.optionsWindowFrameType; - MenuDrawTextWindow(2, 0, 27, 3); - MenuDrawTextWindow(2, 4, 27, 19); + Menu_DrawStdWindowFrame(2, 0, 27, 3); + Menu_DrawStdWindowFrame(2, 4, 27, 19); - MenuPrint(gSystemText_OptionMenu, 4, 1); - MenuPrint(gSystemText_TextSpeed, 4, 5); - MenuPrint(gSystemText_BattleScene, 4, 7); - MenuPrint(gSystemText_BattleStyle, 4, 9); - MenuPrint(gSystemText_Sound, 4, 11); - MenuPrint(gSystemText_ButtonMode, 4, 13); - MenuPrint(gSystemText_Frame, 4, 15); - MenuPrint(gSystemText_Cancel, 4, 17); + Menu_PrintText(gSystemText_OptionMenu, 4, 1); + Menu_PrintText(gSystemText_TextSpeed, 4, 5); + Menu_PrintText(gSystemText_BattleScene, 4, 7); + Menu_PrintText(gSystemText_BattleStyle, 4, 9); + Menu_PrintText(gSystemText_Sound, 4, 11); + Menu_PrintText(gSystemText_ButtonMode, 4, 13); + Menu_PrintText(gSystemText_Frame, 4, 15); + Menu_PrintText(gSystemText_Cancel, 4, 17); TextSpeed_DrawChoices(gTasks[taskId].data[TD_TEXTSPEED]); BattleScene_DrawChoices(gTasks[taskId].data[TD_BATTLESCENE]); @@ -313,7 +313,7 @@ static void DrawOptionMenuChoice(const u8 *text, u8 x, u8 y, u8 style) dst[2] = style; dst[i] = EOS; - MenuPrint_PixelCoords(dst, x, y, 1); + Menu_PrintTextPixelCoords(dst, x, y, 1); } static u8 TextSpeed_ProcessInput(u8 selection) @@ -432,11 +432,11 @@ static u8 FrameType_ProcessInput(u8 selection) { if (gMain.newKeys & DPAD_RIGHT) { - if (selection <= 18) + if (selection < 19) selection++; else selection = 0; - MenuLoadTextWindowGraphics_OverrideFrameType(selection); + Menu_LoadStdFrameGraphicsOverrideStyle(selection); } if (gMain.newKeys & DPAD_LEFT) { @@ -444,7 +444,7 @@ static u8 FrameType_ProcessInput(u8 selection) selection--; else selection = 19; - MenuLoadTextWindowGraphics_OverrideFrameType(selection); + Menu_LoadStdFrameGraphicsOverrideStyle(selection); } return selection; } @@ -478,8 +478,8 @@ static void FrameType_DrawChoices(u8 selection) } text[i] = EOS; - MenuPrint(gSystemText_Type, 15, 15); - MenuPrint(text, 18, 15); + Menu_PrintText(gSystemText_Type, 15, 15); + Menu_PrintText(text, 18, 15); } #elif GERMAN __attribute__((naked)) @@ -536,7 +536,7 @@ _0808C380:\n\ mov r0, sp\n\ movs r1, 0xF\n\ movs r2, 0xF\n\ - bl MenuPrint\n\ + bl Menu_PrintText\n\ add sp, 0x10\n\ pop {r4-r6}\n\ pop {r0}\n\ diff --git a/src/engine/record_mixing.c b/src/engine/record_mixing.c index c8e2e34d5..75ca92e6a 100644 --- a/src/engine/record_mixing.c +++ b/src/engine/record_mixing.c @@ -146,8 +146,8 @@ void Task_RecordMixing_Main(u8 taskId) { tState = 4; data[10] = sub_8083664(); - sub_80720B0(); - MenuPrint(gOtherText_MixingComplete, 2, 15); + Menu_ClearWindowText(); + Menu_PrintText(gOtherText_MixingComplete, 2, 15); data[8] = 0; } break; @@ -160,7 +160,7 @@ void Task_RecordMixing_Main(u8 taskId) if (!gTasks[data[10]].isActive) { sub_8055588(); - MenuZeroFillScreen(); + Menu_EraseScreen(); DestroyTask(taskId); EnableBothScriptContexts(); } @@ -176,8 +176,8 @@ void sub_80B95F0(u8 taskId) { case 0: sub_80B9A78(); - MenuDisplayMessageBox(); - MenuPrint(gOtherText_MixingRecordsWithFriend, 2, 15); + Menu_DisplayDialogueFrame(); + Menu_PrintText(gOtherText_MixingRecordsWithFriend, 2, 15); task->data[8] = 0x708; task->tState = 400; ClearLinkCallback_2(); diff --git a/src/engine/reset_rtc_screen.c b/src/engine/reset_rtc_screen.c index 67e146899..6e9efd342 100644 --- a/src/engine/reset_rtc_screen.c +++ b/src/engine/reset_rtc_screen.c @@ -267,7 +267,7 @@ void ResetRtcScreen_FreeCursorPalette(void) void ResetRtcScreen_HideChooseTimeWindow(void) { - MenuZeroFillWindowRect(3, 8, 25, 11); + Menu_EraseWindowRect(3, 8, 25, 11); } void ResetRtcScreen_PrintTime(u8 x, u8 y, u16 days, u8 hours, u8 minutes, u8 seconds) @@ -286,13 +286,13 @@ void ResetRtcScreen_PrintTime(u8 x, u8 y, u16 days, u8 hours, u8 minutes, u8 sec dest = ConvertIntToDecimalStringN(dest, minutes, STR_CONV_MODE_LEADING_ZEROS, 2); dest = StringCopy(dest, gUnknown_08376500); ConvertIntToDecimalStringN(dest, seconds, STR_CONV_MODE_LEADING_ZEROS, 2); - MenuPrint(gStringVar4, x, y); + Menu_PrintText(gStringVar4, x, y); } void ResetRtcScreen_ShowChooseTimeWindow(u16 days, u8 hours, u8 minutes, u8 seconds) { - MenuDrawTextWindow(3, 8, 25, 11); - MenuPrint(gOtherText_OK, 20, 9); + Menu_DrawStdWindowFrame(3, 8, 25, 11); + Menu_PrintText(gOtherText_OK, 20, 9); ResetRtcScreen_PrintTime(4, 9, days, hours, minutes, seconds); } @@ -443,8 +443,8 @@ void CB2_InitResetRtcScreen(void) ResetSpriteData(); ResetTasks(); ResetPaletteFade(); - SetUpWindowConfig(&gWindowConfig_81E6CE4); - InitMenuWindow(&gWindowConfig_81E6CE4); + Text_LoadWindowTemplate(&gWindowTemplate_81E6CE4); + InitMenuWindow(&gWindowTemplate_81E6CE4); REG_DISPCNT = 4352; SetVBlankCallback(VBlankCB_ResetRtcScreen); SetMainCallback2(CB2_ResetRtcScreen); @@ -468,8 +468,8 @@ void VBlankCB_ResetRtcScreen(void) void ResetRtcScreen_ShowMessage(const u8 *str) { - MenuDisplayMessageBox(); - MenuPrint(str, 2, 15); + Menu_DisplayDialogueFrame(); + Menu_PrintText(str, 2, 15); } void Task_ShowResetRtcPrompt(u8 taskId) @@ -479,9 +479,9 @@ void Task_ShowResetRtcPrompt(u8 taskId) switch (data[0]) { case 0: - MenuZeroFillScreen(); - MenuDrawTextWindow(0, 0, 20, 10); - MenuPrint(gSystemText_PresentTime, 1, 1); + Menu_EraseScreen(); + Menu_DrawStdWindowFrame(0, 0, 20, 10); + Menu_PrintText(gSystemText_PresentTime, 1, 1); ResetRtcScreen_PrintTime( 1, 3, @@ -489,7 +489,7 @@ void Task_ShowResetRtcPrompt(u8 taskId) gLocalTime.hours, gLocalTime.minutes, gLocalTime.seconds); - MenuPrint(gSystemText_PreviousTime, 1, 5); + Menu_PrintText(gSystemText_PreviousTime, 1, 5); ResetRtcScreen_PrintTime( 1, 7, @@ -543,7 +543,7 @@ void Task_ResetRtcScreen(u8 taskId) case 2: if (gTasks[data[1]].isActive != TRUE) { - MenuZeroFillScreen(); + Menu_EraseScreen(); ResetRtcScreen_ShowMessage(gSystemText_PleaseResetTime); gLocalTime = gSaveBlock2.lastBerryTreeUpdate; data[1] = CreateTask(Task_ResetRtc_0, 80); diff --git a/src/engine/save_failed_screen.c b/src/engine/save_failed_screen.c index ba2d46546..64b84a2f7 100644 --- a/src/engine/save_failed_screen.c +++ b/src/engine/save_failed_screen.c @@ -120,11 +120,11 @@ static void CB2_SaveFailedScreen(void) ResetPaletteFade(); LoadPalette(&gBirchBagGrassPal, 0, sizeof(gBirchBagGrassPal)); LoadPalette(&gSaveFailedClockPal, 0x100, sizeof(gSaveFailedClockPal)); - SetUpWindowConfig(&gWindowConfig_81E6C3C); - InitMenuWindow(&gWindowConfig_81E6CE4); - MenuDrawTextWindow(13, CLOCK_WIN_TOP, 16, CLOCK_WIN_TOP + 3); // clock window - MenuDrawTextWindow(1, MSG_WIN_TOP, 28, 19); // message window - MenuPrint(gSystemText_SaveFailedBackupCheck, 2, MSG_WIN_TOP + 1); + Text_LoadWindowTemplate(&gWindowTemplate_81E6C3C); + InitMenuWindow(&gWindowTemplate_81E6CE4); + Menu_DrawStdWindowFrame(13, CLOCK_WIN_TOP, 16, CLOCK_WIN_TOP + 3); // clock window + Menu_DrawStdWindowFrame(1, MSG_WIN_TOP, 28, 19); // message window + Menu_PrintText(gSystemText_SaveFailedBackupCheck, 2, MSG_WIN_TOP + 1); BeginNormalPaletteFade(0xFFFFFFFF, 0, 16, 0, 0); ime = REG_IME; REG_IME = 0; @@ -158,22 +158,22 @@ static void CB2_WipeSave(void) { if (WipeSectors(gDamagedSaveSectors) != FALSE) { - MenuDrawTextWindow(1, MSG_WIN_TOP, 28, 19); - MenuPrint(gSystemText_BackupDamagedGameContinue, 2, MSG_WIN_TOP + 1); + Menu_DrawStdWindowFrame(1, MSG_WIN_TOP, 28, 19); + Menu_PrintText(gSystemText_BackupDamagedGameContinue, 2, MSG_WIN_TOP + 1); SetMainCallback2(CB2_GameplayCannotBeContinued); return; } - MenuDrawTextWindow(1, MSG_WIN_TOP, 28, 19); - MenuPrint(gSystemText_CheckCompleteSaveAttempt, 2, MSG_WIN_TOP + 1); + Menu_DrawStdWindowFrame(1, MSG_WIN_TOP, 28, 19); + Menu_PrintText(gSystemText_CheckCompleteSaveAttempt, 2, MSG_WIN_TOP + 1); HandleSavingData(gSaveFailedType); if (gDamagedSaveSectors != 0) { #ifdef BUGFIX_SAVEFAILEDSCREEN2 - MenuDrawTextWindow(1, MSG_WIN_TOP, 28, 19); + Menu_DrawStdWindowFrame(1, MSG_WIN_TOP, 28, 19); #endif - MenuPrint(gSystemText_SaveFailedBackupCheck, 2, MSG_WIN_TOP + 1); + Menu_PrintText(gSystemText_SaveFailedBackupCheck, 2, MSG_WIN_TOP + 1); } wipeTries++; @@ -181,19 +181,19 @@ static void CB2_WipeSave(void) if (wipeTries == 3) { - MenuDrawTextWindow(1, MSG_WIN_TOP, 28, 19); - MenuPrint(gSystemText_BackupDamagedGameContinue, 2, MSG_WIN_TOP + 1); + Menu_DrawStdWindowFrame(1, MSG_WIN_TOP, 28, 19); + Menu_PrintText(gSystemText_BackupDamagedGameContinue, 2, MSG_WIN_TOP + 1); SetMainCallback2(CB2_FadeAndReturnToTitleScreen); // called again below } else { - MenuDrawTextWindow(1, MSG_WIN_TOP, 28, 19); + Menu_DrawStdWindowFrame(1, MSG_WIN_TOP, 28, 19); // no callback exists, so the game cannot continue. if (gGameContinueCallback == 0) - MenuPrint(gSystemText_SaveCompletedGameEnd, 2, MSG_WIN_TOP + 1); + Menu_PrintText(gSystemText_SaveCompletedGameEnd, 2, MSG_WIN_TOP + 1); else // callback exists, so continue - MenuPrint(gSystemText_SaveCompletedPressA, 2, MSG_WIN_TOP + 1); + Menu_PrintText(gSystemText_SaveCompletedPressA, 2, MSG_WIN_TOP + 1); } SetMainCallback2(CB2_FadeAndReturnToTitleScreen); @@ -205,8 +205,8 @@ static void CB2_GameplayCannotBeContinued(void) if (gMain.newKeys & A_BUTTON) { - MenuDrawTextWindow(1, MSG_WIN_TOP, 28, 19); - MenuPrint(gSystemText_GameplayEnded, 2, MSG_WIN_TOP + 1); + Menu_DrawStdWindowFrame(1, MSG_WIN_TOP, 28, 19); + Menu_PrintText(gSystemText_GameplayEnded, 2, MSG_WIN_TOP + 1); SetVBlankCallback(VBlankCB); SetMainCallback2(CB2_FadeAndReturnToTitleScreen); } diff --git a/src/engine/save_menu_util.c b/src/engine/save_menu_util.c index 771cb72c7..2c5eb6afe 100644 --- a/src/engine/save_menu_util.c +++ b/src/engine/save_menu_util.c @@ -18,7 +18,7 @@ void HandleDrawSaveWindowInfo(s16 left, s16 top) if (FlagGet(FLAG_SYS_POKEDEX_GET)) { // print info + dex information. - MenuDrawTextWindow(left, top, left + width, top + 11); + Menu_DrawStdWindowFrame(left, top, left + width, top + 11); PrintSaveMapName(++left, ++top); // MAP NAME PrintSavePlayerName(left, top + 2); // PLAYER PrintSaveBadges(left, top + 4); // BADGES @@ -28,7 +28,7 @@ void HandleDrawSaveWindowInfo(s16 left, s16 top) else { // print everything besides dex. - MenuDrawTextWindow(left, top, left + width, top + 9); + Menu_DrawStdWindowFrame(left, top, left + width, top + 9); PrintSaveMapName(++left, ++top); // MAP NAME PrintSavePlayerName(left, top + 2); // PLAYER PrintSaveBadges(left, top + 4); // BADGES @@ -45,9 +45,9 @@ void HandleCloseSaveWindow(u16 left, u16 top) width = 13; if (FlagGet(FLAG_SYS_POKEDEX_GET)) - MenuZeroFillWindowRect(left, top, left + width, top + 11); + Menu_EraseWindowRect(left, top, left + width, top + 11); else - MenuZeroFillWindowRect(left, top, left + width, top + 9); + Menu_EraseWindowRect(left, top, left + width, top + 9); } /* @@ -62,7 +62,7 @@ u8 IsResizeSaveWindowEnabled(void) // i don't know what else to name it.. void PrintSavePlayerName(s16 x, s16 y) { - MenuPrint(gOtherText_Player, x, y); + Menu_PrintText(gOtherText_Player, x, y); MenuPrint_RightAligned(gSaveBlock2.playerName, x + 12, y); } @@ -71,14 +71,14 @@ void PrintSaveMapName(s16 x, s16 y) char name[32]; CopyMapName(name, gMapHeader.regionMapSectionId); - MenuPrint(name, x, y); + Menu_PrintText(name, x, y); } void PrintSaveBadges(s16 x, s16 y) { char badges[16]; - MenuPrint(gOtherText_Badges, x, y); + Menu_PrintText(gOtherText_Badges, x, y); ConvertIntToDecimalString(badges, GetBadgeCount()); MenuPrint_RightAligned(badges, x + 12, y); } @@ -87,7 +87,7 @@ void PrintSavePokedexCount(s16 x, s16 y) { char pokedex[16]; - MenuPrint(gOtherText_Pokedex, x, y); + Menu_PrintText(gOtherText_Pokedex, x, y); ConvertIntToDecimalStringN(pokedex, GetPokedexSeenCount(), 1, 3); MenuPrint_RightAligned(pokedex, x + 12, y); } @@ -96,7 +96,7 @@ void PrintSavePlayTime(s16 x, s16 y) { char playtime[16]; - MenuPrint(gOtherText_PlayTime, x, y); + Menu_PrintText(gOtherText_PlayTime, x, y); FormatPlayTime(playtime, gSaveBlock2.playTimeHours, gSaveBlock2.playTimeMinutes, 1); MenuPrint_RightAligned(playtime, x + 12, y); } diff --git a/src/engine/text.c b/src/engine/text.c index 1b158d979..fe18a6d79 100644 --- a/src/engine/text.c +++ b/src/engine/text.c @@ -12,16 +12,31 @@ enum WIN_STATE_END, WIN_STATE_BEGIN, WIN_STATE_NORMAL, - WIN_STATE_INTERRUPTIBLE_PAUSE, + WIN_STATE_CHAR_DELAY, WIN_STATE_PAUSE, WIN_STATE_WAIT_BUTTON, WIN_STATE_NEWLINE, WIN_STATE_PLACEHOLDER, - WIN_STATE_PARAGRAPH, - WIN_STATE_NEWLINE_WAIT, + WIN_STATE_WAIT_CLEAR, + WIN_STATE_WAIT_SCROLL, WIN_STATE_WAIT_SOUND, }; +enum +{ + TEXT_MODE_UNKNOWN0, + TEXT_MODE_MONOSPACE, + TEXT_MODE_UNKNOWN2, // variable width? +}; + +enum +{ + WAIT_TYPE_NORMAL, // allows the player to interrupt the text delay with A or B + WAIT_TYPE_BATTLE, // disables interrupting the text delay if in a link battle + WAIT_TYPE_AUTOSCROLL, // disables interrupting the text delay + WAIT_TYPE_CONTEST, // disables interrupting the text delay if in a link contest +}; + struct Font { u32 type; @@ -66,7 +81,7 @@ static u16 LoadFixedWidthFont_Font4Latin(struct Window *, u16); static u16 LoadFixedWidthFont_Braille(struct Window *, u16); static void MultistepLoadFont_LoadGlyph(struct Window *, u16, u8); static u8 sub_8002FA0(struct Window *, const u8 *); -static u8 InterpretText(struct Window *); +static u8 PrintNextChar(struct Window *); static u8 HandleExtCtrlCode(struct Window *); static u8 UpdateWindowText(struct Window *); static u8 DrawGlyph_TextMode0(struct Window *, u32); @@ -82,27 +97,27 @@ static void AddToCursorX(struct Window *, u8); static void AddToCursorY(struct Window *, u8); static void ClipLeft(struct Window *); static void ClipRight(struct Window *); -static void InitColors(struct Window *); -static void SetBackgroundColor(struct Window *, u8); -static void SetShadowColor(struct Window *, u8); -static void SetForegroundColor(struct Window *, u8); +static void SetWindowDefaultColors(struct Window *); +static void SetWindowBackgroundColor(struct Window *, u8); +static void SetWindowShadowColor(struct Window *, u8); +static void SetWindowForegroundColor(struct Window *, u8); static u8 GetTextDelay(struct Window *); -static bool8 PlayerCanInterruptWait(struct Window *); +static bool8 PlayerCanInterruptDelay(struct Window *); static void ScrollWindowTextLines(struct Window *); static void ScrollWindowTextLines_TextMode0(struct Window *); static void DoScroll_TextMode0(struct Window *, u16); -static void ScrollWindowTextLines_TextMode1(struct Window *); -static void DoScroll_TextMode1(struct Window *, u16); +static void ScrollWindowTextLines_TextModeMonospace(struct Window *); +static void DoScroll_TextModeMonospace(struct Window *, u16); static void ScrollWindowTextLines_TextMode2(struct Window *); static void DoScroll_TextMode2(struct Window *, u8); -void ClearWindowTextLines(struct Window *); +void Text_ClearWindow(struct Window *); static void ClearWindowTextLines_TextMode0_TextMode1(struct Window *, u8); static void ClearWindowTextLines_TextMode2(struct Window *, u8); static void TryEraseDownArrow(struct Window *); static u16 GetBlankTileNum(struct Window *); static u8 WaitWithDownArrow(struct Window *); static void DrawInitialDownArrow(struct Window *); -static void DrawMovingDownArrow(struct Window *); +static void UpdateDownArrowAnimation(struct Window *); static u16 GetCursorTileNum(struct Window *, u32, u32); static s32 DrawGlyphTiles(struct Window *, u32, u32); static void UpdateTilemap(struct Window *, u32); @@ -477,7 +492,7 @@ static const ShiftGlyphTileShadowedFunc sShiftGlyphTileShadowedFuncs[] = ShiftGlyphTile_ShadowedFont_Width8, }; -const struct WindowConfig gWindowConfig_81E6C3C = +const struct WindowTemplate gWindowTemplate_81E6C3C = { 0, // BG number 2, // BG character base block @@ -498,7 +513,7 @@ const struct WindowConfig gWindowConfig_81E6C3C = BG_SCREEN_ADDR(31), // tilemap }; -const struct WindowConfig gWindowConfig_81E6C58 = +const struct WindowTemplate gWindowTemplate_81E6C58 = { 0, // BG number 0, // BG character base block @@ -519,7 +534,7 @@ const struct WindowConfig gWindowConfig_81E6C58 = BG_SCREEN_ADDR(24), // tilemap }; -const struct WindowConfig gWindowConfig_81E6C74 = +const struct WindowTemplate gWindowTemplate_81E6C74 = { 0, // BG number 0, // BG character base block @@ -540,7 +555,7 @@ const struct WindowConfig gWindowConfig_81E6C74 = NULL, // tilemap }; -const struct WindowConfig gWindowConfig_81E6C90 = +const struct WindowTemplate gWindowTemplate_81E6C90 = { 0, // BG number 1, // BG character base block @@ -561,7 +576,7 @@ const struct WindowConfig gWindowConfig_81E6C90 = BG_SCREEN_ADDR(30), // tilemap }; -const struct WindowConfig gWindowConfig_81E6CAC = +const struct WindowTemplate gWindowTemplate_81E6CAC = { 0, // BG number 0, // BG character base block @@ -582,7 +597,7 @@ const struct WindowConfig gWindowConfig_81E6CAC = NULL, // tilemap }; -const struct WindowConfig gWindowConfig_81E6CC8 = +const struct WindowTemplate gWindowTemplate_81E6CC8 = { 2, // BG number 2, // BG character base block @@ -603,7 +618,7 @@ const struct WindowConfig gWindowConfig_81E6CC8 = BG_SCREEN_ADDR(15), // tilemap }; -const struct WindowConfig gWindowConfig_81E6CE4 = +const struct WindowTemplate gWindowTemplate_81E6CE4 = { 0, // BG number 2, // BG character base block @@ -624,7 +639,7 @@ const struct WindowConfig gWindowConfig_81E6CE4 = BG_SCREEN_ADDR(31), // tilemap }; -const struct WindowConfig gWindowConfig_81E6D00 = +const struct WindowTemplate gWindowTemplate_81E6D00 = { 0, // BG number 0, // BG character base block @@ -645,7 +660,7 @@ const struct WindowConfig gWindowConfig_81E6D00 = BG_SCREEN_ADDR(31), // tilemap }; -const struct WindowConfig gWindowConfig_81E6D1C = +const struct WindowTemplate gWindowTemplate_81E6D1C = { 1, // BG number 0, // BG character base block @@ -666,7 +681,7 @@ const struct WindowConfig gWindowConfig_81E6D1C = BG_SCREEN_ADDR(31), // tilemap }; -const struct WindowConfig gWindowConfig_81E6D38 = +const struct WindowTemplate gWindowTemplate_81E6D38 = { 0, // BG number 0, // BG character base block @@ -687,7 +702,7 @@ const struct WindowConfig gWindowConfig_81E6D38 = NULL, // tilemap }; -const struct WindowConfig gWindowConfig_81E6D54 = +const struct WindowTemplate gWindowTemplate_81E6D54 = { 3, // BG number 3, // BG character base block @@ -708,7 +723,7 @@ const struct WindowConfig gWindowConfig_81E6D54 = BG_SCREEN_ADDR(15), // tilemap }; -const struct WindowConfig gWindowConfig_81E6D70 = +const struct WindowTemplate gWindowTemplate_81E6D70 = { 3, // BG number 3, // BG character base block @@ -729,7 +744,7 @@ const struct WindowConfig gWindowConfig_81E6D70 = BG_SCREEN_ADDR(15), // tilemap }; -const struct WindowConfig gWindowConfig_81E6D8C = +const struct WindowTemplate gWindowTemplate_81E6D8C = { 1, // BG number 0, // BG character base block @@ -750,7 +765,7 @@ const struct WindowConfig gWindowConfig_81E6D8C = BG_SCREEN_ADDR(14), // tilemap }; -const struct WindowConfig gWindowConfig_81E6DA8 = +const struct WindowTemplate gWindowTemplate_81E6DA8 = { 0, // BG number 0, // BG character base block @@ -771,7 +786,7 @@ const struct WindowConfig gWindowConfig_81E6DA8 = BG_SCREEN_ADDR(11), // tilemap }; -const struct WindowConfig WindowConfig_TrainerCard_Back_Values = +const struct WindowTemplate gWindowTemplate_TrainerCard_Back_Values = { 0, // BG number 2, // BG character base block @@ -792,7 +807,7 @@ const struct WindowConfig WindowConfig_TrainerCard_Back_Values = BG_SCREEN_ADDR(30), // tilemap }; -const struct WindowConfig WindowConfig_TrainerCard_Back_Labels = +const struct WindowTemplate gWindowTemplate_TrainerCard_Back_Labels = { 0, // BG number 2, // BG character base block @@ -813,7 +828,7 @@ const struct WindowConfig WindowConfig_TrainerCard_Back_Labels = BG_SCREEN_ADDR(30), // tilemap }; -const struct WindowConfig gWindowConfig_81E6DFC = +const struct WindowTemplate gWindowTemplate_81E6DFC = { 0, // BG number 2, // BG character base block @@ -834,7 +849,7 @@ const struct WindowConfig gWindowConfig_81E6DFC = BG_SCREEN_ADDR(31), // tilemap }; -const struct WindowConfig gWindowConfig_81E6E18 = +const struct WindowTemplate gWindowTemplate_81E6E18 = { 0, // BG number 2, // BG character base block @@ -855,7 +870,7 @@ const struct WindowConfig gWindowConfig_81E6E18 = BG_SCREEN_ADDR(31), // tilemap }; -const struct WindowConfig gWindowConfig_81E6E34 = +const struct WindowTemplate gWindowTemplate_81E6E34 = { 1, // BG number 0, // BG character base block @@ -876,7 +891,7 @@ const struct WindowConfig gWindowConfig_81E6E34 = BG_SCREEN_ADDR(31), // tilemap }; -const struct WindowConfig gWindowConfig_81E6E50 = +const struct WindowTemplate gWindowTemplate_81E6E50 = { 0, // BG number 2, // BG character base block @@ -897,7 +912,7 @@ const struct WindowConfig gWindowConfig_81E6E50 = BG_SCREEN_ADDR(28), // tilemap }; -const struct WindowConfig gWindowConfig_81E6E6C = +const struct WindowTemplate gWindowTemplate_81E6E6C = { 0, // BG number 2, // BG character base block @@ -918,7 +933,7 @@ const struct WindowConfig gWindowConfig_81E6E6C = BG_SCREEN_ADDR(30), // tilemap }; -const struct WindowConfig gWindowConfig_81E6E88 = +const struct WindowTemplate gWindowTemplate_81E6E88 = { 0, // BG number 0, // BG character base block @@ -939,7 +954,7 @@ const struct WindowConfig gWindowConfig_81E6E88 = BG_SCREEN_ADDR(31), // tilemap }; -const struct WindowConfig gWindowConfig_81E6EA4 = +const struct WindowTemplate gWindowTemplate_81E6EA4 = { 1, // BG number 0, // BG character base block @@ -960,7 +975,7 @@ const struct WindowConfig gWindowConfig_81E6EA4 = BG_SCREEN_ADDR(28), // tilemap }; -const struct WindowConfig gWindowConfig_81E6EC0 = +const struct WindowTemplate gWindowTemplate_81E6EC0 = { 2, // BG number 2, // BG character base block @@ -981,7 +996,7 @@ const struct WindowConfig gWindowConfig_81E6EC0 = BG_SCREEN_ADDR(29), // tilemap }; -const struct WindowConfig gWindowConfig_81E6EDC = +const struct WindowTemplate gWindowTemplate_81E6EDC = { 1, // BG number 0, // BG character base block @@ -1002,7 +1017,7 @@ const struct WindowConfig gWindowConfig_81E6EDC = BG_SCREEN_ADDR(28), // tilemap }; -const struct WindowConfig gWindowConfig_81E6EF8 = +const struct WindowTemplate gWindowTemplate_81E6EF8 = { 2, // BG number 2, // BG character base block @@ -1023,7 +1038,7 @@ const struct WindowConfig gWindowConfig_81E6EF8 = BG_SCREEN_ADDR(29), // tilemap }; -const struct WindowConfig gWindowConfig_81E6F14 = +const struct WindowTemplate gWindowTemplate_81E6F14 = { 1, // BG number 0, // BG character base block @@ -1044,7 +1059,7 @@ const struct WindowConfig gWindowConfig_81E6F14 = BG_SCREEN_ADDR(28), // tilemap }; -const struct WindowConfig gWindowConfig_81E6F30 = +const struct WindowTemplate gWindowTemplate_81E6F30 = { 2, // BG number 2, // BG character base block @@ -1065,7 +1080,7 @@ const struct WindowConfig gWindowConfig_81E6F30 = BG_SCREEN_ADDR(29), // tilemap }; -const struct WindowConfig gWindowConfig_81E6F4C = +const struct WindowTemplate gWindowTemplate_81E6F4C = { 3, // BG number 0, // BG character base block @@ -1086,7 +1101,7 @@ const struct WindowConfig gWindowConfig_81E6F4C = BG_SCREEN_ADDR(30), // tilemap }; -const struct WindowConfig gWindowConfig_81E6F68 = +const struct WindowTemplate gWindowTemplate_81E6F68 = { 0, // BG number 2, // BG character base block @@ -1107,7 +1122,7 @@ const struct WindowConfig gWindowConfig_81E6F68 = BG_SCREEN_ADDR(13), // tilemap }; -const struct WindowConfig gWindowConfig_81E6F84 = +const struct WindowTemplate gWindowTemplate_81E6F84 = { 0, // BG number 2, // BG character base block @@ -1128,7 +1143,7 @@ const struct WindowConfig gWindowConfig_81E6F84 = BG_SCREEN_ADDR(31), // tilemap }; -const struct WindowConfig gWindowConfig_81E6FA0 = +const struct WindowTemplate gWindowTemplate_81E6FA0 = { 1, // BG number 0, // BG character base block @@ -1149,7 +1164,7 @@ const struct WindowConfig gWindowConfig_81E6FA0 = BG_SCREEN_ADDR(24), // tilemap }; -const struct WindowConfig gWindowConfig_81E6FBC = +const struct WindowTemplate gWindowTemplate_81E6FBC = { 0, // BG number 0, // BG character base block @@ -1170,7 +1185,7 @@ const struct WindowConfig gWindowConfig_81E6FBC = BG_SCREEN_ADDR(30), // tilemap }; -const struct WindowConfig gWindowConfig_81E6FD8 = +const struct WindowTemplate gWindowTemplate_81E6FD8 = { 0, // BG number 0, // BG character base block @@ -1191,7 +1206,7 @@ const struct WindowConfig gWindowConfig_81E6FD8 = BG_SCREEN_ADDR(24), // tilemap }; -const struct WindowConfig gWindowConfig_81E6FF4 = +const struct WindowTemplate gWindowTemplate_81E6FF4 = { 0, // BG number 0, // BG character base block @@ -1212,7 +1227,7 @@ const struct WindowConfig gWindowConfig_81E6FF4 = BG_SCREEN_ADDR(24), // tilemap }; -const struct WindowConfig gWindowConfig_81E7010 = +const struct WindowTemplate gWindowTemplate_81E7010 = { 0, // BG number 0, // BG character base block @@ -1233,7 +1248,7 @@ const struct WindowConfig gWindowConfig_81E7010 = BG_SCREEN_ADDR(30), // tilemap }; -const struct WindowConfig gWindowConfig_81E702C = +const struct WindowTemplate gWindowTemplate_81E702C = { 3, // BG number 2, // BG character base block @@ -1254,7 +1269,7 @@ const struct WindowConfig gWindowConfig_81E702C = BG_SCREEN_ADDR(15), // tilemap }; -const struct WindowConfig gWindowConfig_81E7048 = +const struct WindowTemplate gWindowTemplate_81E7048 = { 2, // BG number 2, // BG character base block @@ -1275,7 +1290,7 @@ const struct WindowConfig gWindowConfig_81E7048 = BG_SCREEN_ADDR(14), // tilemap }; -const struct WindowConfig gWindowConfig_81E7064 = +const struct WindowTemplate gWindowTemplate_81E7064 = { 2, // BG number 2, // BG character base block @@ -1296,7 +1311,7 @@ const struct WindowConfig gWindowConfig_81E7064 = BG_SCREEN_ADDR(14), // tilemap }; -const struct WindowConfig gWindowConfig_81E7080 = +const struct WindowTemplate gWindowTemplate_81E7080 = { 3, // BG number 0, // BG character base block @@ -1317,7 +1332,7 @@ const struct WindowConfig gWindowConfig_81E7080 = BG_SCREEN_ADDR(30), // tilemap }; -const struct WindowConfig gWindowConfig_81E709C = +const struct WindowTemplate gWindowTemplate_81E709C = { 0, // BG number 0, // BG character base block @@ -1338,7 +1353,7 @@ const struct WindowConfig gWindowConfig_81E709C = BG_SCREEN_ADDR(31), // tilemap }; -const struct WindowConfig gWindowConfig_81E70B8 = +const struct WindowTemplate gWindowTemplate_81E70B8 = { 2, // BG number 0, // BG character base block @@ -1359,7 +1374,7 @@ const struct WindowConfig gWindowConfig_81E70B8 = BG_SCREEN_ADDR(30), // tilemap }; -const struct WindowConfig gWindowConfig_81E70D4 = +const struct WindowTemplate gWindowTemplate_81E70D4 = { 3, // BG number 0, // BG character base block @@ -1380,7 +1395,7 @@ const struct WindowConfig gWindowConfig_81E70D4 = BG_SCREEN_ADDR(30), // tilemap }; -const struct WindowConfig gWindowConfig_81E70F0 = +const struct WindowTemplate gWindowTemplate_81E70F0 = { 0, // BG number 0, // BG character base block @@ -1401,7 +1416,7 @@ const struct WindowConfig gWindowConfig_81E70F0 = NULL, // tilemap }; -const struct WindowConfig gWindowConfig_81E710C = +const struct WindowTemplate gWindowTemplate_81E710C = { 0, // BG number 0, // BG character base block @@ -1422,7 +1437,7 @@ const struct WindowConfig gWindowConfig_81E710C = BG_SCREEN_ADDR(31), // tilemap }; -const struct WindowConfig gWindowConfig_81E7128 = +const struct WindowTemplate gWindowTemplate_81E7128 = { 0, // BG number 2, // BG character base block @@ -1443,7 +1458,7 @@ const struct WindowConfig gWindowConfig_81E7128 = BG_SCREEN_ADDR(31), // tilemap }; -const struct WindowConfig gWindowConfig_81E7144 = +const struct WindowTemplate gWindowTemplate_81E7144 = { 0, // BG number 2, // BG character base block @@ -1464,7 +1479,7 @@ const struct WindowConfig gWindowConfig_81E7144 = BG_SCREEN_ADDR(31), // tilemap }; -const struct WindowConfig gWindowConfig_81E7160 = +const struct WindowTemplate gWindowTemplate_81E7160 = { 1, // BG number 1, // BG character base block @@ -1485,7 +1500,7 @@ const struct WindowConfig gWindowConfig_81E7160 = BG_SCREEN_ADDR(10), // tilemap }; -const struct WindowConfig gWindowConfig_81E717C = +const struct WindowTemplate gWindowTemplate_81E717C = { 0, // BG number 3, // BG character base block @@ -1506,7 +1521,7 @@ const struct WindowConfig gWindowConfig_81E717C = BG_SCREEN_ADDR(31), // tilemap }; -const struct WindowConfig gWindowConfig_81E7198 = +const struct WindowTemplate gWindowTemplate_81E7198 = { 0, // BG number 2, // BG character base block @@ -1527,7 +1542,7 @@ const struct WindowConfig gWindowConfig_81E7198 = BG_SCREEN_ADDR(15), // tilemap }; -const struct WindowConfig gWindowConfig_81E71B4 = +const struct WindowTemplate gWindowTemplate_81E71B4 = { 0, // BG number 2, // BG character base block @@ -1548,7 +1563,7 @@ const struct WindowConfig gWindowConfig_81E71B4 = BG_SCREEN_ADDR(15), // tilemap }; -const struct WindowConfig gWindowConfig_81E71D0 = +const struct WindowTemplate gWindowTemplate_81E71D0 = { 1, // BG number 1, // BG character base block @@ -1569,7 +1584,7 @@ const struct WindowConfig gWindowConfig_81E71D0 = BG_SCREEN_ADDR(28), // tilemap }; -const struct WindowConfig gWindowConfig_81E71EC = +const struct WindowTemplate gWindowTemplate_81E71EC = { 2, // BG number 1, // BG character base block @@ -1590,7 +1605,7 @@ const struct WindowConfig gWindowConfig_81E71EC = BG_SCREEN_ADDR(30), // tilemap }; -const struct WindowConfig gWindowConfig_81E7208 = +const struct WindowTemplate gWindowTemplate_81E7208 = { 0, // BG number 2, // BG character base block @@ -1611,7 +1626,7 @@ const struct WindowConfig gWindowConfig_81E7208 = BG_SCREEN_ADDR(28), // tilemap }; -const struct WindowConfig gWindowConfig_81E7224 = +const struct WindowTemplate gWindowTemplate_81E7224 = { 0, // BG number 0, // BG character base block @@ -1632,7 +1647,7 @@ const struct WindowConfig gWindowConfig_81E7224 = BG_SCREEN_ADDR(31), // tilemap }; -const struct WindowConfig gWindowConfig_81E7240 = +const struct WindowTemplate gWindowTemplate_81E7240 = { 1, // BG number 2, // BG character base block @@ -1653,7 +1668,7 @@ const struct WindowConfig gWindowConfig_81E7240 = BG_SCREEN_ADDR(30), // tilemap }; -const struct WindowConfig gWindowConfig_81E725C = +const struct WindowTemplate gWindowTemplate_81E725C = { 0, // BG number 0, // BG character base block @@ -1674,7 +1689,7 @@ const struct WindowConfig gWindowConfig_81E725C = NULL, // tilemap }; -const struct WindowConfig gWindowConfig_81E7278 = +const struct WindowTemplate gWindowTemplate_81E7278 = { 0, // BG number 0, // BG character base block @@ -1695,7 +1710,7 @@ const struct WindowConfig gWindowConfig_81E7278 = NULL, // tilemap }; -const struct WindowConfig gWindowConfig_81E7294 = +const struct WindowTemplate gWindowTemplate_81E7294 = { 0, // BG number 0, // BG character base block @@ -1716,32 +1731,32 @@ const struct WindowConfig gWindowConfig_81E7294 = NULL, // tilemap }; -static void UpdateBGRegs(const struct WindowConfig *winConfig) +static void UpdateBGRegs(const struct WindowTemplate *winTemplate) { - u8 bgNum = winConfig->bgNum; + u8 bgNum = winTemplate->bgNum; *gBGHOffsetRegs[bgNum] = 0; *gBGVOffsetRegs[bgNum] = 0; - *gBGControlRegs[bgNum] = winConfig->priority | (winConfig->screenBaseBlock << 8) | (winConfig->charBaseBlock << 2); + *gBGControlRegs[bgNum] = winTemplate->priority | (winTemplate->screenBaseBlock << 8) | (winTemplate->charBaseBlock << 2); } -static void ClearBGMem(const struct WindowConfig *winConfig) +static void ClearBGMem(const struct WindowTemplate *winTemplate) { - CpuFastFill(0, winConfig->tileData, 32); + CpuFastFill(0, winTemplate->tileData, 32); - if (winConfig->tilemap) - CpuFastFill(0, winConfig->tilemap, 0x800); + if (winTemplate->tilemap) + CpuFastFill(0, winTemplate->tilemap, 0x800); } -void LoadFontDefaultPalette(const struct WindowConfig *winConfig) +void LoadFontDefaultPalette(const struct WindowTemplate *winTemplate) { - LoadPalette(gFontDefaultPalette, 16 * winConfig->paletteNum, 32); + LoadPalette(gFontDefaultPalette, 16 * winTemplate->paletteNum, 32); } -void SetUpWindowConfig(const struct WindowConfig *winConfig) +void Text_LoadWindowTemplate(const struct WindowTemplate *winTemplate) { - UpdateBGRegs(winConfig); - ClearBGMem(winConfig); - LoadFontDefaultPalette(winConfig); + UpdateBGRegs(winTemplate); + ClearBGMem(winTemplate); + LoadFontDefaultPalette(winTemplate); } u16 InitWindowTileData(struct Window *win, u16 startOffset) @@ -1751,13 +1766,13 @@ u16 InitWindowTileData(struct Window *win, u16 startOffset) win->tileDataStartOffset = startOffset; retVal = 0; - switch (win->config->textMode) + switch (win->template->textMode) { - case 2: + case TEXT_MODE_UNKNOWN2: retVal = InitVariableWidthFontTileData(win, startOffset); break; - case 1: - switch (win->config->fontNum) + case TEXT_MODE_MONOSPACE: + switch (win->template->fontNum) { case 0: case 3: @@ -1789,7 +1804,7 @@ static u16 InitVariableWidthFontTileData(struct Window *win, u16 startOffset) win->tileDataOffset = 2; buffer = win->tileData + 32 * win->tileDataStartOffset; CpuFastFill(0, buffer, 32); - ApplyColors_UnshadowedFont(sBlankTile, (u32 *)(buffer + 32), win->config->foregroundColor, win->config->backgroundColor); + ApplyColors_UnshadowedFont(sBlankTile, (u32 *)(buffer + 32), win->template->foregroundColor, win->template->backgroundColor); return win->tileDataStartOffset + win->tileDataOffset + win->width * win->height; } @@ -1850,15 +1865,15 @@ u32 MultistepInitWindowTileData(struct Window *win, u16 startOffset) win->tileDataStartOffset = startOffset; retVal = 0; - switch (win->config->textMode) + switch (win->template->textMode) { - case 2: + case TEXT_MODE_UNKNOWN2: retVal = InitVariableWidthFontTileData(win, startOffset); break; - case 1: + case TEXT_MODE_MONOSPACE: retVal = 256; - if (win->config->fontNum == 0 - || win->config->fontNum == 3) + if (win->template->fontNum == 0 + || win->template->fontNum == 3) retVal *= 2; break; } @@ -1870,7 +1885,7 @@ bool32 MultistepLoadFont(void) { bool32 retVal = TRUE; - if (sMultistepLoadFont_Window->config->textMode == 1) + if (sMultistepLoadFont_Window->template->textMode == TEXT_MODE_MONOSPACE) { s32 i; @@ -1890,7 +1905,7 @@ static void MultistepLoadFont_LoadGlyph(struct Window *win, u16 startOffset, u8 { u8 *buffer; - switch (win->config->fontNum) + switch (win->template->fontNum) { case 0: case 3: @@ -1923,42 +1938,42 @@ void EmptyFunc(void) { } -void InitWindowFromConfig(struct Window *win, const struct WindowConfig *winConfig) +void Text_InitWindowWithTemplate(struct Window *win, const struct WindowTemplate *winTemplate) { *win = sDefaultWindow; - win->config = (struct WindowConfig *)winConfig; - win->textMode = winConfig->textMode; - win->spacing = winConfig->spacing; - win->fontNum = winConfig->fontNum; - win->paletteNum = winConfig->paletteNum; - win->tilemapLeft = winConfig->tilemapLeft; - win->tilemapTop = winConfig->tilemapTop; - win->width = winConfig->width; - win->height = winConfig->height; - win->tileData = winConfig->tileData; - win->tilemap = winConfig->tilemap; - InitColors(win); - SetBackgroundColor(win, winConfig->backgroundColor); - SetShadowColor(win, winConfig->shadowColor); - SetForegroundColor(win, winConfig->foregroundColor); -} - -void InitWindow(struct Window *win, const u8 *text, u16 tileDataStartOffset, u8 left, u8 top) -{ - const struct WindowConfig *winConfig = win->config; - win->textMode = winConfig->textMode; - win->fontNum = winConfig->fontNum; + win->template = (struct WindowTemplate *)winTemplate; + win->textMode = winTemplate->textMode; + win->spacing = winTemplate->spacing; + win->fontNum = winTemplate->fontNum; + win->paletteNum = winTemplate->paletteNum; + win->tilemapLeft = winTemplate->tilemapLeft; + win->tilemapTop = winTemplate->tilemapTop; + win->width = winTemplate->width; + win->height = winTemplate->height; + win->tileData = winTemplate->tileData; + win->tilemap = winTemplate->tilemap; + SetWindowDefaultColors(win); + SetWindowBackgroundColor(win, winTemplate->backgroundColor); + SetWindowShadowColor(win, winTemplate->shadowColor); + SetWindowForegroundColor(win, winTemplate->foregroundColor); +} + +void Text_InitWindow(struct Window *win, const u8 *text, u16 tileDataStartOffset, u8 left, u8 top) +{ + const struct WindowTemplate *winTemplate = win->template; + win->textMode = winTemplate->textMode; + win->fontNum = winTemplate->fontNum; win->language = GAME_LANGUAGE; - win->paletteNum = winConfig->paletteNum; + win->paletteNum = winTemplate->paletteNum; win->win_field_B = 0; win->win_field_C = 0; win->delayCounter = 0; - win->spacing = winConfig->spacing; + win->spacing = winTemplate->spacing; win->win_field_F = 0; - win->tilemapLeft = winConfig->tilemapLeft; - win->tilemapTop = winConfig->tilemapTop; - win->width = winConfig->width; - win->height = winConfig->height; + win->tilemapLeft = winTemplate->tilemapLeft; + win->tilemapTop = winTemplate->tilemapTop; + win->width = winTemplate->width; + win->height = winTemplate->height; win->text = text; win->textIndex = 0; win->tileDataStartOffset = tileDataStartOffset; @@ -1969,19 +1984,19 @@ void InitWindow(struct Window *win, const u8 *text, u16 tileDataStartOffset, u8 win->cursorY = 0; win->state = WIN_STATE_BEGIN; win->downArrowCounter = 0; - win->tileData = winConfig->tileData; - win->tilemap = winConfig->tilemap; - InitColors(win); - SetBackgroundColor(win, winConfig->backgroundColor); - SetShadowColor(win, winConfig->shadowColor); - SetForegroundColor(win, winConfig->foregroundColor); + win->tileData = winTemplate->tileData; + win->tilemap = winTemplate->tilemap; + SetWindowDefaultColors(win); + SetWindowBackgroundColor(win, winTemplate->backgroundColor); + SetWindowShadowColor(win, winTemplate->shadowColor); + SetWindowForegroundColor(win, winTemplate->foregroundColor); } -void sub_8002E4C(struct Window *win, const u8 *text, u16 tileDataStartOffset, u8 left, u16 top, u32 a6) +void Text_InitWindow8002E4C(struct Window *win, const u8 *text, u16 tileDataStartOffset, u8 left, u16 top, u32 a6) { u8 val; - InitWindow(win, text, tileDataStartOffset, 0, 0); + Text_InitWindow(win, text, tileDataStartOffset, 0, 0); win->left = left; win->top = top; val = 0; @@ -1992,7 +2007,7 @@ void sub_8002E4C(struct Window *win, const u8 *text, u16 tileDataStartOffset, u8 ClipLeft(win); } -void sub_8002E90(struct Window *win, const u8 *text) +void Text_SetWindowText(struct Window *win, const u8 *text) { win->state = WIN_STATE_NORMAL; win->text = text; @@ -2003,15 +2018,15 @@ void sub_8002E90(struct Window *win, const u8 *text) win->delayCounter = 0; } -void sub_8002EB0(struct Window *win, const u8 *text, u16 tileDataStartOffset, u8 left, u8 top) +void Text_InitWindow8002EB0(struct Window *win, const u8 *text, u16 tileDataStartOffset, u8 left, u8 top) { gMain.watchedKeysMask = A_BUTTON | B_BUTTON; gMain.watchedKeysPressed = 0; - sWaitType = 0; + sWaitType = WAIT_TYPE_NORMAL; sLineLength = 26; - InitWindow(win, text, tileDataStartOffset, left, top); + Text_InitWindow(win, text, tileDataStartOffset, left, top); win->win_field_B = -1; - if (win->textMode == 0) + if (win->textMode == TEXT_MODE_UNKNOWN0) { u16 val = GetCursorTileNum(win, 0, 0); u8 *buffer = win->tileData + 32 * val; @@ -2021,9 +2036,9 @@ void sub_8002EB0(struct Window *win, const u8 *text, u16 tileDataStartOffset, u8 } } -u8 sub_8002F44(struct Window *win) +u8 Text_PrintWindow8002F44(struct Window *win) { - while (win->state) + while (win->state != WIN_STATE_END) { if (win->state == WIN_STATE_NEWLINE) { @@ -2038,7 +2053,7 @@ u8 sub_8002F44(struct Window *win) sub_8002FA0(win, GetExpandedPlaceholder(win->text[win->textIndex++])); } - InterpretText(win); + PrintNextChar(win); } return 1; } @@ -2048,11 +2063,12 @@ static u8 sub_8002FA0(struct Window *win, const u8 *text) u8 retVal; u8 savedLanguage = win->language; const u8 *savedText = win->text; + u16 savedTextIndex = win->textIndex; win->text = text; win->textIndex = 0; win->state = WIN_STATE_NORMAL; - retVal = sub_8002F44(win); + retVal = Text_PrintWindow8002F44(win); win->text = savedText; win->textIndex = savedTextIndex; win->state = WIN_STATE_NORMAL; @@ -2060,32 +2076,33 @@ static u8 sub_8002FA0(struct Window *win, const u8 *text) return retVal; } -static u8 InterpretText(struct Window *win) +static u8 PrintNextChar(struct Window *win) { u8 c = win->text[win->textIndex++]; + // Handle special control characters switch (c) { - case 0xFF: + case EOS: ClipRight(win); win->state = WIN_STATE_END; return 0; - case 0xFD: + case PLACEHOLDER_BEGIN: win->state = WIN_STATE_PLACEHOLDER; return 2; - case 0xFE: + case CHAR_NEWLINE: ClipRight(win); win->state = WIN_STATE_NEWLINE; return 2; - case 0xFB: + case CHAR_PROMPT_CLEAR: DrawInitialDownArrow(win); - win->state = WIN_STATE_PARAGRAPH; + win->state = WIN_STATE_WAIT_CLEAR; return 2; - case 0xFA: + case CHAR_PROMPT_SCROLL: DrawInitialDownArrow(win); - win->state = WIN_STATE_NEWLINE_WAIT; + win->state = WIN_STATE_WAIT_SCROLL; return 2; - case 0xFC: + case EXT_CTRL_CODE_BEGIN: return HandleExtCtrlCode(win); } @@ -2093,6 +2110,8 @@ static u8 InterpretText(struct Window *win) return 1; } +// Extended 0xFC control functions + static u8 HandleExtCtrlCode(struct Window *win) { return sExtCtrlCodeFuncs[win->text[win->textIndex++]](win); @@ -2105,27 +2124,27 @@ static u8 ExtCtrlCode_Nop(struct Window *win) static u8 ExtCtrlCode_ForegroundColor(struct Window *win) { - SetForegroundColor(win, win->text[win->textIndex++]); + SetWindowForegroundColor(win, win->text[win->textIndex++]); return 2; } static u8 ExtCtrlCode_BackgroundColor(struct Window *win) { - SetBackgroundColor(win, win->text[win->textIndex++]); + SetWindowBackgroundColor(win, win->text[win->textIndex++]); return 2; } static u8 ExtCtrlCode_ShadowColor(struct Window *win) { - SetShadowColor(win, win->text[win->textIndex++]); + SetWindowShadowColor(win, win->text[win->textIndex++]); return 2; } static u8 ExtCtrlCode_AllColors(struct Window *win) { - SetForegroundColor(win, win->text[win->textIndex++]); - SetBackgroundColor(win, win->text[win->textIndex++]); - SetShadowColor(win, win->text[win->textIndex++]); + SetWindowForegroundColor(win, win->text[win->textIndex++]); + SetWindowBackgroundColor(win, win->text[win->textIndex++]); + SetWindowShadowColor(win, win->text[win->textIndex++]); return 2; } @@ -2143,7 +2162,7 @@ static u8 ExtCtrlCode_Font(struct Window *win) static u8 ExtCtrlCode_DefaultFont(struct Window *win) { - win->fontNum = win->config->fontNum; + win->fontNum = win->template->fontNum; return 2; } @@ -2197,7 +2216,7 @@ static u8 ExtCtrlCode_SetCursorY(struct Window *win) static u8 ExtCtrlCode_ClearWindowTextLines(struct Window *win) { - ClearWindowTextLines(win); + Text_ClearWindow(win); return 2; } @@ -2211,7 +2230,7 @@ static u8 ExtCtrlCode_PlaySE(struct Window *win) static void DrawSpace(struct Window *win) { - if (win->textMode == 1 || (win->left + win->cursorX) & 7 || win->spacing <= 7) + if (win->textMode == TEXT_MODE_MONOSPACE || (win->left + win->cursorX) & 7 || win->spacing <= 7) { sPrintGlyphFuncs[win->textMode](win, 0); } @@ -2302,10 +2321,11 @@ static u8 ExtCtrlCode_Latin(struct Window *win) return 2; } -u8 sub_8003418(struct Window *win) +// Prints the window text without expanding any placeholders +u8 Text_PrintWindowSimple(struct Window *win) { u8 retVal = 1; - while (win->state) + while (win->state != WIN_STATE_END) { if (win->state == WIN_STATE_NEWLINE) { @@ -2315,7 +2335,7 @@ u8 sub_8003418(struct Window *win) ClipLeft(win); win->state = WIN_STATE_NORMAL; } - if (InterpretText(win) == 1) + if (PrintNextChar(win) == 1) { retVal = 0; break; @@ -2324,10 +2344,10 @@ u8 sub_8003418(struct Window *win) return retVal; } -u8 sub_8003460(struct Window *win, const u8 *text, u16 tileDataStartOffset, u8 left, u8 top) +u8 Text_InitWindowAndPrintText(struct Window *win, const u8 *text, u16 tileDataStartOffset, u8 left, u8 top) { - InitWindow(win, text, tileDataStartOffset, left, top); - return sub_8002F44(win); + Text_InitWindow(win, text, tileDataStartOffset, left, top); + return Text_PrintWindow8002F44(win); } u8 sub_8003490(struct Window *win, u8 c, u16 tileDataStartOffset, u8 left, u8 top) @@ -2336,48 +2356,51 @@ u8 sub_8003490(struct Window *win, u8 c, u16 tileDataStartOffset, u8 left, u8 to u8 text[2]; text[0] = c; text[1] = EOS; - InitWindow(win, text, tileDataStartOffset, left, top); - retVal = InterpretText(win); + Text_InitWindow(win, text, tileDataStartOffset, left, top); + retVal = PrintNextChar(win); ClipRight(win); return retVal; } void sub_80034D4(u8 *tileData, const u8 *text) { - sub_8004E3C(&gWindowConfig_81E6C74, tileData, text); + Text_InitWindow8004E3C(&gWindowTemplate_81E6C74, tileData, text); } u8 sub_80034EC(u8 *str) { - return GetStringWidthGivenWindowConfig((struct WindowConfig *)&gWindowConfig_81E6C74, str); + return Text_GetStringWidthFromWindowTemplate((struct WindowTemplate *)&gWindowTemplate_81E6C74, str); } u8 *sub_8003504(u8 *dest, s32 value, u8 alignAmount, u8 alignType) { - sTempWindow.config = (struct WindowConfig *)&gWindowConfig_81E6C74; - InitWindow(&sTempWindow, 0, 0, 0, 0); + sTempWindow.template = (struct WindowTemplate *)&gWindowTemplate_81E6C74; + Text_InitWindow(&sTempWindow, 0, 0, 0, 0); return AlignInt2(&sTempWindow, dest, value, alignAmount, alignType); } u8 *sub_8003558(u8 *dest, const u8 *src, u8 alignAmount, u8 alignType) { - sTempWindow.config = (struct WindowConfig *)&gWindowConfig_81E6C74; - InitWindow(&sTempWindow, src, 0, 0, 0); + sTempWindow.template = (struct WindowTemplate *)&gWindowTemplate_81E6C74; + Text_InitWindow(&sTempWindow, src, 0, 0, 0); return AlignString(&sTempWindow, dest, src, alignAmount, alignType); } -u8 sub_80035AC(struct Window *win) +// Updates the window text +// The text delay can be accelerated by holding the A button +u8 Text_UpdateWindow(struct Window *win) { - sWaitType = 0; + sWaitType = WAIT_TYPE_NORMAL; return UpdateWindowText(win); } +// Returns TRUE when all of the text has been printed. static u8 UpdateWindowText(struct Window *win) { switch (win->state) { case WIN_STATE_WAIT_BUTTON: - if (PlayerCanInterruptWait(win)) + if (PlayerCanInterruptDelay(win)) { if (gMain.newKeys & (A_BUTTON | B_BUTTON)) { @@ -2385,48 +2408,56 @@ static u8 UpdateWindowText(struct Window *win) } else { - return 0; + return FALSE; } } else { win->delayCounter--; if (win->delayCounter) - return 0; + return FALSE; } win->state = WIN_STATE_NORMAL; - return 0; - case WIN_STATE_INTERRUPTIBLE_PAUSE: - if (PlayerCanInterruptWait(win) && (gMain.heldKeys & (A_BUTTON | B_BUTTON)) && gMain.watchedKeysPressed == TRUE) + return FALSE; + case WIN_STATE_CHAR_DELAY: + // Allow the player to speed up text by holding a button + if (PlayerCanInterruptDelay(win) + && (gMain.heldKeys & (A_BUTTON | B_BUTTON)) + && gMain.watchedKeysPressed == TRUE) { win->delayCounter = 0; win->state = WIN_STATE_NORMAL; break; } + // fall through case WIN_STATE_PAUSE: + // Wait for timer to expire, then continue printing if (win->delayCounter) { win->delayCounter--; if (win->delayCounter) - return 0; + return FALSE; } - win->state = WIN_STATE_NORMAL; break; - case WIN_STATE_PARAGRAPH: - if (!WaitWithDownArrow(win)) - return 0; - ClearWindowTextLines(win); - win->state = WIN_STATE_NORMAL; - BLOCK_CROSS_JUMP - return 0; - case WIN_STATE_NEWLINE_WAIT: - if (!WaitWithDownArrow(win)) - return 0; - ScrollWindowTextLines(win); - win->state = WIN_STATE_NORMAL; - BLOCK_CROSS_JUMP - return 0; + case WIN_STATE_WAIT_CLEAR: + // Erase the text once a button is pressed + if (WaitWithDownArrow(win)) + { + Text_ClearWindow(win); + win->state = WIN_STATE_NORMAL; + asm(""); + } + return FALSE; + case WIN_STATE_WAIT_SCROLL: + // Scroll the text once a button is pressed + if (WaitWithDownArrow(win)) + { + ScrollWindowTextLines(win); + win->state = WIN_STATE_NORMAL; + asm(""); + } + return FALSE; case WIN_STATE_PLACEHOLDER: win->textIndex++; win->state = WIN_STATE_NORMAL; @@ -2434,35 +2465,35 @@ static u8 UpdateWindowText(struct Window *win) case WIN_STATE_NEWLINE: ScrollWindowTextLines(win); win->state = WIN_STATE_NORMAL; - BLOCK_CROSS_JUMP - return 0; + asm(""); + return FALSE; case WIN_STATE_BEGIN: - ClearWindowTextLines(win); + Text_ClearWindow(win); break; case WIN_STATE_WAIT_SOUND: if (IsSEPlaying()) - return 0; + return FALSE; win->state = WIN_STATE_NORMAL; break; case WIN_STATE_END: - return 1; + return TRUE; // done printing text case WIN_STATE_NORMAL: break; default: win->state = WIN_STATE_END; - return 1; + return TRUE; } - InterpretText(win); + PrintNextChar(win); switch (win->state) { case WIN_STATE_END: - return 1; + return TRUE; // done printing text case WIN_STATE_WAIT_BUTTON: - case WIN_STATE_PARAGRAPH: - case WIN_STATE_NEWLINE_WAIT: - if (PlayerCanInterruptWait(win)) + case WIN_STATE_WAIT_CLEAR: + case WIN_STATE_WAIT_SCROLL: + if (PlayerCanInterruptDelay(win)) return 0; win->delayCounter = 60; break; @@ -2471,8 +2502,9 @@ static u8 UpdateWindowText(struct Window *win) case WIN_STATE_WAIT_SOUND: break; default: - win->state = WIN_STATE_INTERRUPTIBLE_PAUSE; + win->state = WIN_STATE_CHAR_DELAY; win->delayCounter = GetTextDelay(win); + break; } return 0; @@ -2484,45 +2516,45 @@ static u8 UpdateWindowText(struct Window *win) #define SUB_800374C_LINE_LENGTH 27 #endif -u8 sub_800374C(struct Window *win) +u8 Text_UpdateWindowInBattle(struct Window *win) { u8 retVal; - sWaitType = 1; + sWaitType = WAIT_TYPE_BATTLE; sLineLength = SUB_800374C_LINE_LENGTH; retVal = UpdateWindowText(win); sLineLength = 26; - sWaitType = 0; + sWaitType = WAIT_TYPE_NORMAL; return retVal; } -u8 sub_8003778(struct Window *win) +u8 Text_UpdateWindowAutoscroll(struct Window *win) { u8 retVal; - sWaitType = 2; + sWaitType = WAIT_TYPE_AUTOSCROLL; sLineLength = 26; retVal = UpdateWindowText(win); - sWaitType = 0; + sWaitType = WAIT_TYPE_NORMAL; return retVal; } -u8 sub_80037A0(struct Window *win) +u8 Text_UpdateWindowInContest(struct Window *win) { u8 retVal; - sWaitType = 3; + sWaitType = WAIT_TYPE_CONTEST; sLineLength = 17; retVal = UpdateWindowText(win); sLineLength = 26; return retVal; } -u32 sub_80037C8(struct Window *win, u8 lineLength) +u32 Text_UpdateWindowOverrideLineLength(struct Window *win, u8 lineLength) { u8 retVal; - sWaitType = 0; + sWaitType = WAIT_TYPE_NORMAL; sLineLength = lineLength; retVal = UpdateWindowText(win); sLineLength = 26; @@ -2757,14 +2789,14 @@ static void ApplyColors_ShadowedFont(const void *src, void *dest, u8 foreground, static void SetCursorX(struct Window *win, u8 x) { - if (win->textMode == 0 && ((win->left + win->cursorX) & 7)) + if (win->textMode == TEXT_MODE_UNKNOWN0 && ((win->left + win->cursorX) & 7)) win->tileDataOffset += 2; win->cursorX = x; } static void AddToCursorX(struct Window *win, u8 deltaX) { - if (win->textMode == 0) + if (win->textMode == TEXT_MODE_UNKNOWN0) { u8 x = win->cursorX; win->cursorX += deltaX; @@ -2779,7 +2811,7 @@ static void AddToCursorX(struct Window *win, u8 deltaX) static void AddToCursorY(struct Window *win, u8 deltaY) { - if (win->textMode == 0 && ((win->left + win->cursorX) & 7)) + if (win->textMode == TEXT_MODE_UNKNOWN0 && ((win->left + win->cursorX) & 7)) win->tileDataOffset += 2; win->cursorY += deltaY; } @@ -2788,11 +2820,11 @@ static void EraseAtCursor(struct Window *win) { switch (win->textMode) { - case 0: - case 2: + case TEXT_MODE_UNKNOWN0: + case TEXT_MODE_UNKNOWN2: DrawGlyphTiles(win, 0, 8); break; - case 1: + case TEXT_MODE_MONOSPACE: sWriteGlyphTilemapFuncs[win->fontNum](win, 0); break; } @@ -2801,7 +2833,8 @@ static void EraseAtCursor(struct Window *win) static void ClipLeft(struct Window *win) { u32 pixel = win->left & 7; - if (win->textMode != 1 && pixel) + + if (win->textMode != TEXT_MODE_MONOSPACE && pixel) { const u32 *masks = sGlyphMasks[8][pixel]; u32 outsideMask = masks[0]; @@ -2834,37 +2867,45 @@ static void ClipRight(struct Window *win) { register u8 cursorX asm("r0") = win->cursorX; u8 left = win->left; - u32 pixel = (cursorX + left) & 7; - if (win->textMode != 1 && pixel) + u32 pixelX = (cursorX + left) & 7; + + if (win->textMode != TEXT_MODE_MONOSPACE && pixelX != 0) { - const u32 *masks = sGlyphMasks[8 - pixel][pixel]; + const u32 *masks = sGlyphMasks[8 - pixelX][pixelX]; u32 insideMask = masks[0]; u32 outside = (sGlyphBuffer.background & ~insideMask); - u16 tileNum = GetCursorTileNum(win, 0, 0); - u32 *buffer = (u32 *)(win->tileData + 32 * tileNum); - buffer[0] = (buffer[0] & insideMask) | outside; - buffer[1] = (buffer[1] & insideMask) | outside; - buffer[2] = (buffer[2] & insideMask) | outside; - buffer[3] = (buffer[3] & insideMask) | outside; - buffer[4] = (buffer[4] & insideMask) | outside; - buffer[5] = (buffer[5] & insideMask) | outside; - buffer[6] = (buffer[6] & insideMask) | outside; - buffer[7] = (buffer[7] & insideMask) | outside; + u16 tileNum; + u32 *tileData; + + tileNum = GetCursorTileNum(win, 0, 0); + tileData = (u32 *)(win->tileData + 32 * tileNum); + + tileData[0] = (tileData[0] & insideMask) | outside; + tileData[1] = (tileData[1] & insideMask) | outside; + tileData[2] = (tileData[2] & insideMask) | outside; + tileData[3] = (tileData[3] & insideMask) | outside; + tileData[4] = (tileData[4] & insideMask) | outside; + tileData[5] = (tileData[5] & insideMask) | outside; + tileData[6] = (tileData[6] & insideMask) | outside; + tileData[7] = (tileData[7] & insideMask) | outside; + tileNum = GetCursorTileNum(win, 0, 1); - buffer = (u32 *)(win->tileData + 32 * tileNum); - buffer[0] = (buffer[0] & insideMask) | outside; - buffer[1] = (buffer[1] & insideMask) | outside; - buffer[2] = (buffer[2] & insideMask) | outside; - buffer[3] = (buffer[3] & insideMask) | outside; - buffer[4] = (buffer[4] & insideMask) | outside; - buffer[5] = (buffer[5] & insideMask) | outside; - buffer[6] = (buffer[6] & insideMask) | outside; - buffer[7] = (buffer[7] & insideMask) | outside; + tileData = (u32 *)(win->tileData + 32 * tileNum); + + tileData[0] = (tileData[0] & insideMask) | outside; + tileData[1] = (tileData[1] & insideMask) | outside; + tileData[2] = (tileData[2] & insideMask) | outside; + tileData[3] = (tileData[3] & insideMask) | outside; + tileData[4] = (tileData[4] & insideMask) | outside; + tileData[5] = (tileData[5] & insideMask) | outside; + tileData[6] = (tileData[6] & insideMask) | outside; + tileData[7] = (tileData[7] & insideMask) | outside; + UpdateTilemap(win, 1); } } -static void InitColors(struct Window *win) +static void SetWindowDefaultColors(struct Window *win) { u32 i; @@ -2876,7 +2917,7 @@ static void InitColors(struct Window *win) sGlyphBuffer.colors[i] = i; } -static void SetBackgroundColor(struct Window *win, u8 color) +static void SetWindowBackgroundColor(struct Window *win, u8 color) { u32 val1; u32 val2; @@ -2889,13 +2930,13 @@ static void SetBackgroundColor(struct Window *win, u8 color) sGlyphBuffer.background = val3; } -static void SetShadowColor(struct Window *win, u8 color) +static void SetWindowShadowColor(struct Window *win, u8 color) { win->shadowColor = color; sGlyphBuffer.colors[14] = color; } -static void SetForegroundColor(struct Window *win, u8 color) +static void SetWindowForegroundColor(struct Window *win, u8 color) { win->foregroundColor = color; sGlyphBuffer.colors[15] = color; @@ -2903,25 +2944,25 @@ static void SetForegroundColor(struct Window *win, u8 color) static u8 GetTextDelay(struct Window *win) { - if (!PlayerCanInterruptWait(win)) + if (!PlayerCanInterruptDelay(win)) return 3; return sTextSpeedDelays[gSaveBlock2.optionsTextSpeed]; } -static bool8 PlayerCanInterruptWait(struct Window *win) +static bool8 PlayerCanInterruptDelay(struct Window *win) { bool8 retVal = TRUE; switch (sWaitType) { - case 2: + case WAIT_TYPE_AUTOSCROLL: retVal = FALSE; break; - case 3: + case WAIT_TYPE_CONTEST: retVal = gIsLinkContest ? FALSE : TRUE; break; - case 1: + case WAIT_TYPE_BATTLE: retVal = (gBattleTypeFlags & BATTLE_TYPE_LINK) ? FALSE : TRUE; break; } @@ -2933,13 +2974,13 @@ static void ScrollWindowTextLines(struct Window *win) { switch (win->textMode) { - case 0: + case TEXT_MODE_UNKNOWN0: ScrollWindowTextLines_TextMode0(win); break; - case 1: - ScrollWindowTextLines_TextMode1(win); + case TEXT_MODE_MONOSPACE: + ScrollWindowTextLines_TextModeMonospace(win); break; - case 2: + case TEXT_MODE_UNKNOWN2: ScrollWindowTextLines_TextMode2(win); break; } @@ -2949,6 +2990,7 @@ static void ScrollWindowTextLines_TextMode0(struct Window *win) { if (win->cursorY == 0) { + // Advance to the next line win->tileDataOffset = 2 * sLineLength + 2; win->cursorX = 0; win->cursorY += 16; @@ -2959,7 +3001,7 @@ static void ScrollWindowTextLines_TextMode0(struct Window *win) win->tileDataOffset = 2 * sLineLength + 2; else win->tileDataOffset = 2; - win->win_field_C = win->win_field_C ^ 2; + win->win_field_C ^= 2; win->cursorX = 0; DoScroll_TextMode0(win, sLineLength); } @@ -2973,16 +3015,21 @@ static void DoScroll_TextMode0(struct Window *win, u16 lineLength) u16 fill; buffer += val1 + val2; fill = (win->paletteNum << 12) | GetBlankTileNum(win); + + // Move the bottom line up CpuCopy16(buffer + 64, buffer, lineLength * 2); CpuCopy16(buffer + 96, buffer + 32, lineLength * 2); + + // Clear the bottom line CpuFill16(fill, buffer + 64, lineLength * 2); CpuFill16(fill, buffer + 96, lineLength * 2); } -static void ScrollWindowTextLines_TextMode1(struct Window *win) +static void ScrollWindowTextLines_TextModeMonospace(struct Window *win) { if (win->cursorY == 0) { + // Advance to the next line win->cursorX = 0; win->cursorY += 16; } @@ -2990,17 +3037,21 @@ static void ScrollWindowTextLines_TextMode1(struct Window *win) { win->win_field_C ^= 2; win->cursorX = 0; - DoScroll_TextMode1(win, sLineLength); + DoScroll_TextModeMonospace(win, sLineLength); } } -static void DoScroll_TextMode1(struct Window *win, u16 lineLength) +static void DoScroll_TextModeMonospace(struct Window *win, u16 lineLength) { u16 *buffer = GetCursorTilemapPointer(win); u16 *dest = buffer - 32; u16 fill = (win->paletteNum << 12) | GetBlankTileNum(win); + + // Move the bottom line up CpuCopy16(buffer + 32, dest, lineLength * 2); CpuCopy16(buffer + 64, buffer, lineLength * 2); + + // Clear the bottom line CpuFill16(fill, buffer + 32, lineLength * 2); CpuFill16(fill, buffer + 64, lineLength * 2); } @@ -3009,6 +3060,7 @@ static void ScrollWindowTextLines_TextMode2(struct Window *win) { if (win->cursorY == 0) { + // Advance to the next line win->cursorX = 0; win->cursorY += 16; } @@ -3055,18 +3107,18 @@ static void DoScroll_TextMode2(struct Window *win, u8 lineLength) } } -void ClearWindowTextLines(struct Window *win) +void Text_ClearWindow(struct Window *win) { switch (win->textMode) { - case 0: + case TEXT_MODE_UNKNOWN0: ClearWindowTextLines_TextMode0_TextMode1(win, sLineLength); win->tileDataOffset = 2; break; - case 1: + case TEXT_MODE_MONOSPACE: ClearWindowTextLines_TextMode0_TextMode1(win, sLineLength); break; - case 2: + case TEXT_MODE_UNKNOWN2: ClearWindowTextLines_TextMode2(win, sLineLength); break; } @@ -3074,7 +3126,7 @@ void ClearWindowTextLines(struct Window *win) static void ClearWindowTextLines_TextMode0_TextMode1(struct Window *win, u8 lineLength) { - u8 i; + u8 x, y; u16 *buffer; u16 fill; @@ -3085,11 +3137,10 @@ static void ClearWindowTextLines_TextMode0_TextMode1(struct Window *win, u8 line buffer = GetCursorTilemapPointer(win); fill = GetBlankTileNum(win) | (win->paletteNum << 12); - for (i = 0; i < 4; i++) + for (y = 0; y < 4; y++) { - u8 j; - for (j = 0; j < lineLength; j++) - buffer[j] = fill; + for (x = 0; x < lineLength; x++) + buffer[x] = fill; buffer += 32; } } @@ -3114,13 +3165,13 @@ static void ClearWindowTextLines_TextMode2(struct Window *win, u8 lineLength) static void DrawDownArrow(struct Window *win) { - if (PlayerCanInterruptWait(win)) + if (PlayerCanInterruptDelay(win)) { const u32 *downArrowTiles = &sDownArrowTiles[((win->downArrowCounter & 0x0F00) >> 8) * 16]; switch (win->textMode) { - case 1: + case TEXT_MODE_MONOSPACE: { u8 *buffer; u16 tileNum = win->tileDataStartOffset + 254; @@ -3132,8 +3183,8 @@ static void DrawDownArrow(struct Window *win) WriteGlyphTilemap(win, tileNum, tileNum + 1); break; } - case 0: - case 2: + case TEXT_MODE_UNKNOWN0: + case TEXT_MODE_UNKNOWN2: { struct GlyphTileInfo glyphTileInfo; glyphTileInfo.textMode = win->textMode; @@ -3172,9 +3223,9 @@ static void DrawDownArrow(struct Window *win) static u8 WaitWithDownArrow(struct Window *win) { - u8 retVal = 1; + u8 retVal = TRUE; - if (!PlayerCanInterruptWait(win)) + if (!PlayerCanInterruptDelay(win)) { win->delayCounter--; if (!win->delayCounter) @@ -3183,8 +3234,8 @@ static u8 WaitWithDownArrow(struct Window *win) } else { - DrawMovingDownArrow(win); - retVal = 0; + UpdateDownArrowAnimation(win); + retVal = FALSE; } } else @@ -3196,8 +3247,8 @@ static u8 WaitWithDownArrow(struct Window *win) } else { - DrawMovingDownArrow(win); - retVal = 0; + UpdateDownArrowAnimation(win); + retVal = FALSE; } } @@ -3210,7 +3261,7 @@ static void DrawInitialDownArrow(struct Window *win) DrawDownArrow(win); } -static void DrawMovingDownArrow(struct Window *win) +static void UpdateDownArrowAnimation(struct Window *win) { u16 downArrowPos = (win->downArrowCounter & 0x0F00) >> 8; u16 wait = win->downArrowCounter & 0x000F; @@ -3237,31 +3288,37 @@ static void DrawMovingDownArrow(struct Window *win) static void TryEraseDownArrow(struct Window *win) { win->downArrowCounter = 0; - if (PlayerCanInterruptWait(win) == TRUE) + if (PlayerCanInterruptDelay(win) == TRUE) EraseAtCursor(win); } -u16 GetWindowTilemapEntry(struct Window *win, u8 x, u8 y) +// unused +u16 Text_GetWindowTilemapEntry(struct Window *win, u8 x, u8 y) { u16 *tilemap = win->tilemap; return tilemap[32 * y + x]; } -void DrawWindowRect(struct Window *win, u16 tilemapEntry, u8 left, u8 top, u8 right, u8 bottom) +// unused +void Text_FillWindowBorder(struct Window *win, u16 tilemapEntry, u8 left, u8 top, u8 right, u8 bottom) { u8 i; u16 *buffer = &win->tilemap[top * 32]; + // Fill top border for (i = left; i <= right; i++) buffer[i] = tilemapEntry; for (i = top + 1; i < bottom - 1; i++) { buffer += 32; + // left border buffer[left] = tilemapEntry; + // right border buffer[right] = tilemapEntry; } + // Fill bottom border if (top != bottom) { buffer += 32; @@ -3270,37 +3327,39 @@ void DrawWindowRect(struct Window *win, u16 tilemapEntry, u8 left, u8 top, u8 ri } } +// unused void DrawWindowRect_DefaultPalette(struct Window *win, u16 tileNum, u8 left, u8 top, u8 right, u8 bottom) { - DrawWindowRect(win, (win->paletteNum << 12) | tileNum, left, top, right, bottom); + Text_FillWindowBorder(win, (win->paletteNum << 12) | tileNum, left, top, right, bottom); } -void FillWindowRect(struct Window *win, u16 tilemapEntry, u8 left, u8 top, u8 right, u8 bottom) +// Fills the whole window area with tilemapEntry +void Text_FillWindowRect(struct Window *win, u16 tilemapEntry, u8 left, u8 top, u8 right, u8 bottom) { u16 *buffer = &win->tilemap[top * 32]; while (top++ <= bottom) { - u8 j; - for (j = left; j <= right; j++) - buffer[j] = tilemapEntry; + u8 x; + for (x = left; x <= right; x++) + buffer[x] = tilemapEntry; buffer += 32; } } -void FillWindowRect_DefaultPalette(struct Window *win, u16 tileNum, u8 left, u8 top, u8 right, u8 bottom) +void Text_FillWindowRectDefPalette(struct Window *win, u16 tileNum, u8 left, u8 top, u8 right, u8 bottom) { - FillWindowRect(win, (win->paletteNum << 12) | tileNum, left, top, right, bottom); + Text_FillWindowRect(win, (win->paletteNum << 12) | tileNum, left, top, right, bottom); } -void ZeroFillWindowRect(struct Window *win, u8 left, u8 top, u8 right, u8 bottom) +void Text_EraseWindowRect(struct Window *win, u8 left, u8 top, u8 right, u8 bottom) { - FillWindowRect_DefaultPalette(win, 0, left, top, right, bottom); + Text_FillWindowRectDefPalette(win, 0, left, top, right, bottom); } -void FillWindowRectWithBlankTile(struct Window *win, u8 left, u8 top, u8 right, u8 bottom) +void Text_BlankWindowRect(struct Window *win, u8 left, u8 top, u8 right, u8 bottom) { u16 tileNum = GetBlankTileNum(win); - FillWindowRect_DefaultPalette(win, tileNum, left, top, right, bottom); + Text_FillWindowRectDefPalette(win, tileNum, left, top, right, bottom); } static u16 GetBlankTileNum(struct Window *win) @@ -3309,12 +3368,12 @@ static u16 GetBlankTileNum(struct Window *win) switch (win->textMode) { - case 0: + case TEXT_MODE_UNKNOWN0: break; - case 2: + case TEXT_MODE_UNKNOWN2: retVal++; break; - case 1: + case TEXT_MODE_MONOSPACE: switch (win->fontNum) { case 1: @@ -3451,7 +3510,7 @@ u8 *AlignInt2(struct Window *win, u8 *dest, s32 value, u8 alignAmount, u8 alignT ConvertIntToDecimalString(temp, value); width = GetStringWidth(win, temp); dest = StringCopy(dest, temp); - dest[0] = 0xFC; + dest[0] = EXT_CTRL_CODE_BEGIN; dest[1] = 17; dest[2] = alignAmount - width; dest += 3; @@ -3462,7 +3521,7 @@ u8 *AlignInt2(struct Window *win, u8 *dest, s32 value, u8 alignAmount, u8 alignT width = GetStringWidth(win, temp); if (alignAmount > width) { - dest[0] = 0xFC; + dest[0] = EXT_CTRL_CODE_BEGIN; dest[1] = 17; dest[2] = alignAmount - width; dest += 3; @@ -3474,7 +3533,7 @@ u8 *AlignInt2(struct Window *win, u8 *dest, s32 value, u8 alignAmount, u8 alignT width = GetStringWidth(win, temp); if (alignAmount > width) { - dest[0] = 0xFC; + dest[0] = EXT_CTRL_CODE_BEGIN; dest[1] = 17; dest[2] = (alignAmount - width) / 2; dest += 3; @@ -3482,7 +3541,7 @@ u8 *AlignInt2(struct Window *win, u8 *dest, s32 value, u8 alignAmount, u8 alignT dest = StringCopy(dest, temp); if (alignAmount > width) { - dest[0] = 0xFC; + dest[0] = EXT_CTRL_CODE_BEGIN; dest[1] = 17; dest[2] = (alignAmount - width) / 2; dest += 3; @@ -3500,7 +3559,7 @@ u8 *AlignString(struct Window *win, u8 *dest, const u8 *src, u8 alignAmount, u8 { case 0: dest = StringCopy(dest, src); - dest[0] = 0xFC; + dest[0] = EXT_CTRL_CODE_BEGIN; dest[1] = 19; dest[2] = alignAmount; dest += 3; @@ -3510,7 +3569,7 @@ u8 *AlignString(struct Window *win, u8 *dest, const u8 *src, u8 alignAmount, u8 width = GetStringWidth(win, src); if (alignAmount > width) { - dest[0] = 0xFC; + dest[0] = EXT_CTRL_CODE_BEGIN; dest[1] = 19; dest[2] = alignAmount - width; dest += 3; @@ -3521,7 +3580,7 @@ u8 *AlignString(struct Window *win, u8 *dest, const u8 *src, u8 alignAmount, u8 width = GetStringWidth(win, src); if (alignAmount > width) { - dest[0] = 0xFC; + dest[0] = EXT_CTRL_CODE_BEGIN; dest[1] = 19; dest[2] = (alignAmount - width) / 2; dest += 3; @@ -3529,7 +3588,7 @@ u8 *AlignString(struct Window *win, u8 *dest, const u8 *src, u8 alignAmount, u8 dest = StringCopy(dest, src); if (alignAmount > width) { - dest[0] = 0xFC; + dest[0] = EXT_CTRL_CODE_BEGIN; dest[1] = 19; dest[2] = alignAmount; dest += 3; @@ -3544,16 +3603,16 @@ u8 GetStringWidth(struct Window *win, const u8 *s) { u8 width = 0; u8 savedFontNum = win->fontNum; - u8 savedCharset = win->language; + u8 savedLanguage = win->language; u8 savedSpacing = win->spacing; s32 i = 0; - while (s[i] != 0xFF) + while (s[i] != EOS) { u8 c = s[i]; switch (c) { - case 0xFD: + case PLACEHOLDER_BEGIN: { u8 temp; i++; @@ -3563,7 +3622,7 @@ u8 GetStringWidth(struct Window *win, const u8 *s) i++; break; } - case 0xFC: + case EXT_CTRL_CODE_BEGIN: i++; switch (s[i]) { @@ -3571,7 +3630,7 @@ u8 GetStringWidth(struct Window *win, const u8 *s) win->fontNum = s[i + 1]; break; case 7: - win->fontNum = win->config->fontNum; + win->fontNum = win->template->fontNum; break; case 0x11: width += s[i + 1]; @@ -3601,64 +3660,64 @@ u8 GetStringWidth(struct Window *win, const u8 *s) } win->spacing = savedSpacing; - win->language = savedCharset; + win->language = savedLanguage; win->fontNum = savedFontNum; return width; } -u8 sub_8004D04(struct Window *win, const u8 *text, u16 tileDataStartOffset, u8 left, u16 top, u32 a6) +u8 Text_InitWindow8004D04(struct Window *win, const u8 *text, u16 tileDataStartOffset, u8 left, u16 top, u32 a6) { - sub_8002E4C(win, text, tileDataStartOffset, left, top, a6); - return sub_8002F44(win); + Text_InitWindow8002E4C(win, text, tileDataStartOffset, left, top, a6); + return Text_PrintWindow8002F44(win); } -u8 sub_8004D38(struct Window *win, const u8 *text, u16 tileDataStartOffset, u8 left, u8 top) +u8 Text_InitWindow8004D38(struct Window *win, const u8 *text, u16 tileDataStartOffset, u8 left, u8 top) { u8 width = GetStringWidth(win, text); - InitWindow(win, text, tileDataStartOffset, left - ((u32)(width + 7) >> 3), top); + Text_InitWindow(win, text, tileDataStartOffset, left - ((u32)(width + 7) >> 3), top); EraseAtCursor(win); width &= 7; if (width) width = 8 - width; sub_80048D8(win, width, 0); - return sub_8002F44(win); + return Text_PrintWindow8002F44(win); } -u8 sub_8004DB0(struct Window *win, const u8 *text, u16 tileDataStartOffset, u8 left, u8 top, u16 a6) +u8 Text_InitWindow8004DB0(struct Window *win, const u8 *text, u16 tileDataStartOffset, u8 left, u8 top, u16 a6) { register u32 val asm("r5") = (u8)((a6 >> 1) - (GetStringWidth(win, text) >> 1)); left += (val >> 3); - InitWindow(win, text, tileDataStartOffset, left, top); + Text_InitWindow(win, text, tileDataStartOffset, left, top); EraseAtCursor(win); sub_80048D8(win, val & 7, 0); - return sub_8002F44(win); + return Text_PrintWindow8002F44(win); } -u8 sub_8004E24(struct Window *win) +u8 Text_GetWindowPaletteNum(struct Window *win) { return win->paletteNum; } -void sub_8004E28(struct Window *win, u8 *foreground, u8 *background, u8 *shadow) +void Text_GetTextColors(struct Window *win, u8 *foreground, u8 *background, u8 *shadow) { *foreground = win->foregroundColor; *background = win->backgroundColor; *shadow = win->shadowColor; } -void sub_8004E3C(const struct WindowConfig *winConfig, u8 *tileData, const u8 *text) +void Text_InitWindow8004E3C(const struct WindowTemplate *winTemplate, u8 *tileData, const u8 *text) { - sTempWindow.config = winConfig; - InitWindow(&sTempWindow, text, 0, 0, 0); + sTempWindow.template = winTemplate; + Text_InitWindow(&sTempWindow, text, 0, 0, 0); sTempWindow.tileData = tileData; - sub_8002F44(&sTempWindow); + Text_PrintWindow8002F44(&sTempWindow); } -u8 GetStringWidthGivenWindowConfig(const struct WindowConfig *winConfig, const u8 *s) +u8 Text_GetStringWidthFromWindowTemplate(const struct WindowTemplate *winTemplate, const u8 *s) { - sTempWindow.config = winConfig; - InitWindow(&sTempWindow, s, 0, 0, 0); + sTempWindow.template = winTemplate; + Text_InitWindow(&sTempWindow, s, 0, 0, 0); return GetStringWidth(&sTempWindow, s); } @@ -3668,11 +3727,11 @@ void ConvertInternationalString(u8 *s, u8 language) { u8 i; - StripExtCtrlCodes(s); + Text_StripExtCtrlCodes(s); i = StringLength(s); - s[i++] = 0xFC; + s[i++] = EXT_CTRL_CODE_BEGIN; s[i++] = 22; - s[i++] = 0xFF; + s[i++] = EOS; i--; @@ -3682,18 +3741,18 @@ void ConvertInternationalString(u8 *s, u8 language) i--; } - s[0] = 0xFC; + s[0] = EXT_CTRL_CODE_BEGIN; s[1] = 21; } } -void StripExtCtrlCodes(u8 *str) +void Text_StripExtCtrlCodes(u8 *str) { u16 srcIndex = 0; u16 destIndex = 0; - while (str[srcIndex] != 0xFF) + while (str[srcIndex] != EOS) { - if (str[srcIndex] == 0xFC) + if (str[srcIndex] == EXT_CTRL_CODE_BEGIN) { srcIndex++; srcIndex += GetExtCtrlCodeLength(str[srcIndex]); @@ -3703,12 +3762,12 @@ void StripExtCtrlCodes(u8 *str) str[destIndex++] = str[srcIndex++]; } } - str[destIndex] = 0xFF; + str[destIndex] = EOS; } static const u8 *SkipExtCtrlCode(const u8 *s) { - while (*s == 0xFC) + while (*s == EXT_CTRL_CODE_BEGIN) { s++; s += GetExtCtrlCodeLength(*s); @@ -3801,8 +3860,8 @@ u8 sub_8004FD0(struct Window *win, u8 *dest, const u8 *src, u16 tileDataStartOff if (endsWithoutNewline) newlineCount++; - sub_8002E4C(win, start, tileDataStartOffset, left, top, a8); - sub_8002F44(win); + Text_InitWindow8002E4C(win, start, tileDataStartOffset, left, top, a8); + Text_PrintWindow8002F44(win); return newlineCount; } @@ -3827,7 +3886,7 @@ static s32 DrawGlyphTile_UnshadowedFont(struct GlyphTileInfo *glyphTileInfo) if (glyphTileInfo->startPixel + glyphTileInfo->width > 8) { u32 mask2 = masks[1]; - if (glyphTileInfo->textMode == 2) + if (glyphTileInfo->textMode == TEXT_MODE_UNKNOWN2) { glyphBuffer->pixelRows[8] = buffer[8] & mask2; glyphBuffer->pixelRows[9] = buffer[9] & mask2; @@ -3867,7 +3926,7 @@ static s32 DrawGlyphTile_UnshadowedFont(struct GlyphTileInfo *glyphTileInfo) if (glyphTileInfo->startPixel + glyphTileInfo->width > 8) { - if (glyphTileInfo->textMode != 2) + if (glyphTileInfo->textMode != TEXT_MODE_UNKNOWN2) buffer += 8; buffer[8] = glyphBuffer->pixelRows[8]; buffer[9] = glyphBuffer->pixelRows[9]; @@ -4039,7 +4098,7 @@ static s32 DrawGlyphTile_ShadowedFont(struct GlyphTileInfo *glyphTileInfo) if (glyphTileInfo->startPixel + glyphTileInfo->width > 8) { u32 mask2 = masks[1]; - if (glyphTileInfo->textMode == 2) + if (glyphTileInfo->textMode == TEXT_MODE_UNKNOWN2) { glyphBuffer->pixelRows[8] = buffer[8] & mask2; glyphBuffer->pixelRows[9] = buffer[9] & mask2; @@ -4076,7 +4135,7 @@ static s32 DrawGlyphTile_ShadowedFont(struct GlyphTileInfo *glyphTileInfo) if (glyphTileInfo->startPixel + glyphTileInfo->width > 8) { - if (glyphTileInfo->textMode != 2) + if (glyphTileInfo->textMode != TEXT_MODE_UNKNOWN2) buffer += 8; buffer[8] = glyphBuffer->pixelRows[8]; buffer[9] = glyphBuffer->pixelRows[9]; @@ -4314,7 +4373,7 @@ static u16 GetCursorTileNum(struct Window *win, u32 xOffset, u32 yOffset) { u16 index; - if (win->textMode == 2) + if (win->textMode == TEXT_MODE_UNKNOWN2) index = win->tileDataStartOffset + win->tileDataOffset + (((win->top + win->cursorY) >> 3) + yOffset) * win->width diff --git a/src/engine/text_window.c b/src/engine/text_window.c index c001ddefc..ade349f4e 100644 --- a/src/engine/text_window.c +++ b/src/engine/text_window.c @@ -4,19 +4,22 @@ #include "palette.h" #include "text.h" -#define STD_MSG_BOX_LEFT 0 -#define STD_MSG_BOX_TOP 14 -#define STD_MSG_BOX_WIDTH 26 -#define STD_MSG_BOX_HEIGHT 4 +#define STD_WINDOW_PALETTE_NUM 14 + +// Dimensions (in tiles) of a field dialogue frame +#define STD_DLG_FRAME_LEFT 0 +#define STD_DLG_FRAME_TOP 14 +#define STD_DLG_FRAME_WIDTH 26 +#define STD_DLG_FRAME_HEIGHT 4 static void LoadTextWindowTiles(u8, void *); static void LoadTextWindowPalette(u8, u8); -static void DrawTextWindowInternal(u16 *dest, u16 baseTileNum, u8 left, u8 top, u8 right, u8 bottom); -static u16 GetMessageBoxTilemapEntry(u16 tilemapEntry, u8 x, u8 y, u8 width, u8 height); -static void DrawMessageBox(struct Window *win, u8 left, u8 top, u8 width, u8 height); +static void DrawStandardFrame(u16 *dest, u16 baseTileNum, u8 left, u8 top, u8 right, u8 bottom); +static u16 GetDialogueFrameTilemapEntry(u16 tilemapEntry, u8 x, u8 y, u8 width, u8 height); +static void DrawDialogueFrame(struct Window *win, u8 left, u8 top, u8 width, u8 height); static u16 sTextWindowBaseTileNum; -static u16 sMessageBoxBaseTileNum; +static u16 sDialogueFrameBaseTileNum; extern const u8 gTextWindowFrame1_Gfx[]; extern const u8 gTextWindowFrame2_Gfx[]; @@ -60,9 +63,9 @@ extern const u16 gTextWindowFrame18_Pal[]; extern const u16 gTextWindowFrame19_Pal[]; extern const u16 gTextWindowFrame20_Pal[]; -extern const u8 gMessageBox_Gfx[]; +extern const u8 gDialogueFrame_Gfx[]; -static const struct FrameGraphics gUnknown_083761F0[20] = +static const struct FrameGraphics sTextWindowFrameGraphics[20] = { {gTextWindowFrame1_Gfx, gTextWindowFrame1_Pal}, {gTextWindowFrame2_Gfx, gTextWindowFrame2_Pal}, @@ -86,7 +89,7 @@ static const struct FrameGraphics gUnknown_083761F0[20] = {gTextWindowFrame20_Gfx, gTextWindowFrame20_Pal}, }; -static const u16 gMessageBoxTilemap[5][7] = +static const u16 sDialogueFrameTilemap[5][7] = { {1, 3, 4, 4, 5, 6, 9}, {11, 9, 9, 9, 9, 0x040B, 9}, @@ -95,113 +98,124 @@ static const u16 gMessageBoxTilemap[5][7] = {0x0801, 0x0803, 0x0804, 0x0804, 0x0805, 0x0806, 9}, }; -u16 SetTextWindowBaseTileNum(u16 baseTileNum) +u16 TextWindow_SetBaseTileNum(u16 baseTileNum) { sTextWindowBaseTileNum = baseTileNum; return baseTileNum + 9; } -void LoadTextWindowGraphics(struct Window *win) +// Loads the tiles and palette of the window frame into VRAM using the selected frame type +void TextWindow_LoadStdFrameGraphics(struct Window *win) { - u8 *tileData = win->config->tileData + TILE_SIZE_4BPP * sTextWindowBaseTileNum; + u8 *tileData = win->template->tileData + TILE_SIZE_4BPP * sTextWindowBaseTileNum; LoadTextWindowTiles(gSaveBlock2.optionsWindowFrameType, tileData); - LoadTextWindowPalette(gSaveBlock2.optionsWindowFrameType, 0xE); + LoadTextWindowPalette(gSaveBlock2.optionsWindowFrameType, STD_WINDOW_PALETTE_NUM); } -void LoadTextWindowGraphics_OverridePalSlot(struct Window *win, u8 palSlot) +// Loads the tiles and palette of the window frame into VRAM with an alternate palette +void TextWindow_LoadStdFrameGraphicsOverridePal(struct Window *win, u8 palSlot) { - u8 *tileData = win->config->tileData + TILE_SIZE_4BPP * sTextWindowBaseTileNum; + u8 *tileData = win->template->tileData + TILE_SIZE_4BPP * sTextWindowBaseTileNum; LoadTextWindowTiles(gSaveBlock2.optionsWindowFrameType, tileData); LoadTextWindowPalette(gSaveBlock2.optionsWindowFrameType, palSlot); } -void LoadTextWindowGraphics_OverrideFrameType(struct Window *win, u8 frameType) +// Loads the tiles and palette of the window frame into VRAM with an alternate frame type +void TextWindow_LoadStdFrameGraphicsOverrideStyle(struct Window *win, u8 frameType) { - u8 *tileData = win->config->tileData + TILE_SIZE_4BPP * sTextWindowBaseTileNum; + u8 *tileData = win->template->tileData + TILE_SIZE_4BPP * sTextWindowBaseTileNum; LoadTextWindowTiles(frameType, tileData); - LoadTextWindowPalette(frameType, 0xE); + LoadTextWindowPalette(frameType, STD_WINDOW_PALETTE_NUM); } -void DrawTextWindow(struct Window *win, u8 left, u8 top, u8 right, u8 bottom) +void TextWindow_DrawStdFrame(struct Window *win, u8 left, u8 top, u8 right, u8 bottom) { - DrawTextWindowInternal(win->config->tilemap, sTextWindowBaseTileNum, left, top, right, bottom); + DrawStandardFrame(win->template->tilemap, sTextWindowBaseTileNum, left, top, right, bottom); } -const struct FrameGraphics *GetTextWindowFrameGraphics(u8 frameType) +// Returns the tile data and palette for the specified frame type +const struct FrameGraphics *TextWindow_GetFrameGraphics(u8 frameType) { if (frameType > 19) - return &gUnknown_083761F0[0]; + return &sTextWindowFrameGraphics[0]; else - return &gUnknown_083761F0[frameType]; + return &sTextWindowFrameGraphics[frameType]; } static void LoadTextWindowTiles(u8 frameType, void *dest) { - const struct FrameGraphics *frameGraphics = GetTextWindowFrameGraphics(frameType); + const struct FrameGraphics *frameGraphics = TextWindow_GetFrameGraphics(frameType); CpuFastCopy(frameGraphics->tiles, dest, 9 * TILE_SIZE_4BPP); } static void LoadTextWindowPalette(u8 frameType, u8 palSlot) { - const struct FrameGraphics *frameGraphics = GetTextWindowFrameGraphics(frameType); + const struct FrameGraphics *frameGraphics = TextWindow_GetFrameGraphics(frameType); LoadPalette(frameGraphics->palette, 16 * palSlot, 0x20); } -static void DrawTextWindowInternal(u16 *dest, u16 baseTileNum, u8 left, u8 top, u8 right, u8 bottom) +// Draws a standard window frame +static void DrawStandardFrame(u16 *tilemap, u16 baseTileNum, u8 left, u8 top, u8 right, u8 bottom) { + u8 startX = min(left, right); + u8 endX = max(left, right); + u8 startY = min(top, bottom); + u8 endY = max(top, bottom); u8 x, y; - u8 startX, endX; - u8 startY, endY; - - startX = (left < right) ? left : right; - endX = (right > left) ? right : left; - - startY = (top < bottom) ? top : bottom; - endY = (bottom > top) ? bottom : top; - dest[32 * startY + startX] = baseTileNum | 0xE000; + // top left corner + tilemap[32 * startY + startX] = baseTileNum | (STD_WINDOW_PALETTE_NUM << 12); + // top border for (x = startX + 1; x < endX; x++) - dest[32 * startY + x] = (baseTileNum + 1) | 0xE000; + tilemap[32 * startY + x] = (baseTileNum + 1) | (STD_WINDOW_PALETTE_NUM << 12); - dest[32 * startY + endX] = (baseTileNum + 2) | 0xE000; + // top right corner + tilemap[32 * startY + endX] = (baseTileNum + 2) | (STD_WINDOW_PALETTE_NUM << 12); for (y = startY + 1; y < endY; y++) { - dest[32 * y + startX] = (baseTileNum + 3) | 0xE000; + // left border + tilemap[32 * y + startX] = (baseTileNum + 3) | (STD_WINDOW_PALETTE_NUM << 12); + // middle for (x = startX + 1; x < endX; x++) - dest[32 * y + x] = (baseTileNum + 4) | 0xE000; + tilemap[32 * y + x] = (baseTileNum + 4) | (STD_WINDOW_PALETTE_NUM << 12); - dest[32 * y + endX] = (baseTileNum + 5) | 0xE000; + // right border + tilemap[32 * y + endX] = (baseTileNum + 5) | (STD_WINDOW_PALETTE_NUM << 12); } - dest[32 * endY + startX] = (baseTileNum + 6) | 0xE000; + // bottom left corner + tilemap[32 * endY + startX] = (baseTileNum + 6) | (STD_WINDOW_PALETTE_NUM << 12); + // bottom border for (x = startX + 1; x < endX; x++) - dest[32 * endY + x] = (baseTileNum + 7) | 0xE000; + tilemap[32 * endY + x] = (baseTileNum + 7) | (STD_WINDOW_PALETTE_NUM << 12); - dest[32 * endY + endX] = (baseTileNum + 8) | 0xE000; + // bottom right corner + tilemap[32 * endY + endX] = (baseTileNum + 8) | (STD_WINDOW_PALETTE_NUM << 12); } -u16 SetMessageBoxBaseTileNum(u16 baseTileNum) +u16 TextWindow_SetDlgFrameBaseTileNum(u16 baseTileNum) { - sMessageBoxBaseTileNum = baseTileNum; + sDialogueFrameBaseTileNum = baseTileNum; return baseTileNum + 14; } void unref_sub_80651DC(struct Window *win, u8 *text) { - sub_8002EB0(win, text, sMessageBoxBaseTileNum + 14, 2, 15); + Text_InitWindow8002EB0(win, text, sDialogueFrameBaseTileNum + 14, 2, 15); } -void DisplayMessageBox(struct Window *win) +// Loads and draws a dialogue window frame +void TextWindow_DisplayDialogueFrame(struct Window *win) { - LoadMessageBoxTiles(win); - DrawStandardMessageBox(win); + TextWindow_LoadDialogueFrameTiles(win); + TextWindow_DrawDialogueFrame(win); } -static u16 GetMessageBoxTilemapEntry(u16 baseTilemapEntry, u8 x, u8 y, u8 width, u8 height) +static u16 GetDialogueFrameTilemapEntry(u16 baseTilemapEntry, u8 x, u8 y, u8 width, u8 height) { u16 tilemapEntry = 9; @@ -215,42 +229,47 @@ static u16 GetMessageBoxTilemapEntry(u16 baseTilemapEntry, u8 x, u8 y, u8 width, else if (x > 2) x = 3; - if (x <= 6 && y <= 4) - tilemapEntry = gMessageBoxTilemap[y][x]; + if (x < 7 && y < 5) + tilemapEntry = sDialogueFrameTilemap[y][x]; tilemapEntry += baseTilemapEntry; return tilemapEntry; } -static void DrawMessageBox(struct Window *win, u8 left, u8 top, u8 width, u8 height) +static void DrawDialogueFrame(struct Window *win, u8 left, u8 top, u8 width, u8 height) { - u8 i, j; - u16 tilemapEntry = (win->paletteNum << 12) | sMessageBoxBaseTileNum; - u16 *tilemap = win->config->tilemap; + u8 x, y; + u16 baseTilemapEntry = (win->paletteNum << 12) | sDialogueFrameBaseTileNum; + u16 *tilemap = win->template->tilemap; - for (i = 0; i < height + 2; i++) - for (j = 0; j < width + 6; j++) - tilemap[(left + j) + 32 * (top + i)] = (win->paletteNum << 12) | GetMessageBoxTilemapEntry(tilemapEntry, j, i, width, height); + for (y = 0; y < height + 2; y++) + { + for (x = 0; x < width + 6; x++) + tilemap[(left + x) + 32 * (top + y)] = (win->paletteNum << 12) | GetDialogueFrameTilemapEntry(baseTilemapEntry, x, y, width, height); + } } -void DrawStandardMessageBox(struct Window *win) +// Draws an alternate styled frame used for dialogue windows that appear on the overworld +void TextWindow_DrawDialogueFrame(struct Window *win) { - DrawMessageBox(win, STD_MSG_BOX_LEFT, STD_MSG_BOX_TOP, STD_MSG_BOX_WIDTH, STD_MSG_BOX_HEIGHT); + DrawDialogueFrame(win, STD_DLG_FRAME_LEFT, STD_DLG_FRAME_TOP, STD_DLG_FRAME_WIDTH, STD_DLG_FRAME_HEIGHT); } -void LoadMessageBoxTiles(struct Window *win) +// Loads the dialogue window frame tiles into VRAM +void TextWindow_LoadDialogueFrameTiles(struct Window *win) { - u8 *tileData = win->config->tileData; - CpuFastCopy(gMessageBox_Gfx, tileData + 32 * sMessageBoxBaseTileNum, 14 * TILE_SIZE_4BPP); + u8 *tileData = win->template->tileData; + CpuFastCopy(gDialogueFrame_Gfx, tileData + 32 * sDialogueFrameBaseTileNum, 14 * TILE_SIZE_4BPP); } -void ClearStandardMessageBox(struct Window *win) +// Erases a dialogue window frame +void TextWindow_EraseDialogueFrame(struct Window *win) { u8 i; - u16 *tilemap = win->config->tilemap + (STD_MSG_BOX_TOP * 32); + u16 *tilemap = win->template->tilemap + (STD_DLG_FRAME_TOP * 32); u16 tilemapEntry = win->paletteNum << 12; - for (i = 0; i < ((STD_MSG_BOX_HEIGHT + 2) * 32); i++) + for (i = 0; i < ((STD_DLG_FRAME_HEIGHT + 2) * 32); i++) tilemap[i] = tilemapEntry; } diff --git a/src/engine/trade.c b/src/engine/trade.c index 0bc589ff4..3a14adaca 100644 --- a/src/engine/trade.c +++ b/src/engine/trade.c @@ -141,7 +141,7 @@ struct TradeEwramStruct { }; static void sub_8047EC0(void); -static void sub_804AFB8(const struct WindowConfig *, u8 *, const u8 *, u8); +static void sub_804AFB8(const struct WindowTemplate *, u8 *, const u8 *, u8); static void sub_804ACD8(const u8 *, u8 *, u8); static void nullsub_5(u8, u8); static void sub_804AA88(void); @@ -1016,10 +1016,10 @@ void sub_8047CD8(void) static void sub_8047CE8(void) { u8 mpId; - sub_804AFB8(&gWindowConfig_81E725C, gUnknown_020296CC[0], gSaveBlock2.playerName, 0xC); + sub_804AFB8(&gWindowTemplate_81E725C, gUnknown_020296CC[0], gSaveBlock2.playerName, 0xC); mpId = GetMultiplayerId(); - sub_804AFB8(&gWindowConfig_81E725C, gUnknown_020296CC[3], gLinkPlayers[mpId ^ 1].name, 0xC); - sub_804AFB8(&gWindowConfig_81E725C, gUnknown_020296CC[6], gUnknown_0820C14C[0], 0x8); + sub_804AFB8(&gWindowTemplate_81E725C, gUnknown_020296CC[3], gLinkPlayers[mpId ^ 1].name, 0xC); + sub_804AFB8(&gWindowTemplate_81E725C, gUnknown_020296CC[6], gUnknown_0820C14C[0], 0x8); sub_804ACD8(gUnknown_0820C14C[1], gUnknown_020296CC[8], 0x14); nullsub_5(3, 0); } @@ -1087,12 +1087,12 @@ static void sub_8047EC0(void) ResetTasks(); sub_804A964(&gUnknown_03004824->unk_00c8, BG_SCREEN_ADDR(5)); SetVBlankCallback(sub_80489F4); - InitMenuWindow(&gWindowConfig_81E6CE4); - SetUpWindowConfig(&gWindowConfig_81E6F84); - InitWindowFromConfig(&gUnknown_03004824->window, &gWindowConfig_81E6F84); - gUnknown_03004824->unk_007a = SetTextWindowBaseTileNum(20); - LoadTextWindowGraphics(&gUnknown_03004824->window); - MenuZeroFillScreen(); + InitMenuWindow(&gWindowTemplate_81E6CE4); + Text_LoadWindowTemplate(&gWindowTemplate_81E6F84); + Text_InitWindowWithTemplate(&gUnknown_03004824->window, &gWindowTemplate_81E6F84); + gUnknown_03004824->unk_007a = TextWindow_SetBaseTileNum(20); + TextWindow_LoadStdFrameGraphics(&gUnknown_03004824->window); + Menu_EraseScreen(); sub_809D51C(); gUnknown_03004824->unk_0075 = 0; gUnknown_03004824->unk_007b = 0; @@ -1157,7 +1157,7 @@ static void sub_8047EC0(void) break; case 6: CalculateEnemyPartyCount(); - FillWindowRect_DefaultPalette(&gUnknown_03004824->window, 0, 0, 0, 29, 19); + Text_FillWindowRectDefPalette(&gUnknown_03004824->window, 0, 0, 0, 29, 19); REG_DISPCNT = 0; gUnknown_03004824->partyCounts[0] = gPlayerPartyCount; gUnknown_03004824->partyCounts[1] = gEnemyPartyCount; @@ -1267,12 +1267,12 @@ static void sub_80484F4(void) ResetTasks(); sub_804A964(&gUnknown_03004824->unk_00c8, BG_SCREEN_ADDR(5)); SetVBlankCallback(sub_80489F4); - InitMenuWindow(&gWindowConfig_81E6CE4); - SetUpWindowConfig(&gWindowConfig_81E6F84); - InitWindowFromConfig(&gUnknown_03004824->window, &gWindowConfig_81E6F84); - gUnknown_03004824->unk_007a = SetTextWindowBaseTileNum(20); - LoadTextWindowGraphics(&gUnknown_03004824->window); - MenuZeroFillScreen(); + InitMenuWindow(&gWindowTemplate_81E6CE4); + Text_LoadWindowTemplate(&gWindowTemplate_81E6F84); + Text_InitWindowWithTemplate(&gUnknown_03004824->window, &gWindowTemplate_81E6F84); + gUnknown_03004824->unk_007a = TextWindow_SetBaseTileNum(20); + TextWindow_LoadStdFrameGraphics(&gUnknown_03004824->window); + Menu_EraseScreen(); sub_809D51C(); gUnknown_03004824->unk_0075 = 0; gUnknown_03004824->unk_007b = 0; @@ -2096,8 +2096,8 @@ static void sub_8049680(void) PlaySE(SE_SELECT); if (gUnknown_03004824->tradeMenuCursorPosition < PARTY_SIZE) { - DrawTextWindow(&gUnknown_03004824->window, 18, 14, 28, 19); - PrintMenuItems(19, 15, 2, (const struct MenuAction *)gUnknown_0820C320); + TextWindow_DrawStdFrame(&gUnknown_03004824->window, 18, 14, 28, 19); + Menu_PrintItems(19, 15, 2, (const struct MenuAction *)gUnknown_0820C320); InitMenu(0, 19, 15, 2, 0, 9); gUnknown_03004824->unk_007b = 1; } @@ -2108,7 +2108,7 @@ static void sub_8049680(void) } else if (gUnknown_03004824->tradeMenuCursorPosition == 2 * PARTY_SIZE) { - DrawTextWindow(&gUnknown_03004824->window, 24, 14, 29, 19); + TextWindow_DrawStdFrame(&gUnknown_03004824->window, 24, 14, 29, 19); InitYesNoMenu(24, 14, 4); gUnknown_03004824->unk_007b = 4; sub_804ACD8(gUnknown_0820C14C[4], BG_CHAR_ADDR(4) + 32 * gUnknown_03004824->unk_007e, 20); @@ -2126,7 +2126,7 @@ static void sub_8049680(void) static void sub_8049804(void) { - HandleDestroyMenuCursors(); + Menu_DestroyCursor(); sub_804A80C(); gUnknown_03004824->unk_007b = 0; gSprites[gUnknown_03004824->tradeMenuCursorSpriteIdx].invisible = FALSE; @@ -2138,17 +2138,17 @@ static void sub_8049860(void) if (gMain.newAndRepeatedKeys & DPAD_UP) { PlaySE(SE_SELECT); - gUnknown_03004824->unk_007c = MoveMenuCursor(-1); + gUnknown_03004824->unk_007c = Menu_MoveCursor(-1); } else if (gMain.newAndRepeatedKeys & DPAD_DOWN) { PlaySE(SE_SELECT); - gUnknown_03004824->unk_007c = MoveMenuCursor(+1); + gUnknown_03004824->unk_007c = Menu_MoveCursor(+1); } if (gMain.newKeys & A_BUTTON) { PlaySE(SE_SELECT); - if (GetMenuCursorPos() == 0) + if (Menu_GetCursorPos() == 0) { BeginNormalPaletteFade(-1, 0, 0, 16, 0); gUnknown_03004824->unk_007b = 2; @@ -2239,17 +2239,17 @@ static void sub_8049AC0(void) if (gMain.newAndRepeatedKeys & DPAD_UP) { PlaySE(SE_SELECT); - gUnknown_03004824->unk_007c = MoveMenuCursor(-1); + gUnknown_03004824->unk_007c = Menu_MoveCursor(-1); } else if (gMain.newAndRepeatedKeys & DPAD_DOWN) { PlaySE(SE_SELECT); - gUnknown_03004824->unk_007c = MoveMenuCursor(+1); + gUnknown_03004824->unk_007c = Menu_MoveCursor(+1); } if (gMain.newKeys & A_BUTTON) { PlaySE(SE_SELECT); - if (GetMenuCursorPos() == 0) + if (Menu_GetCursorPos() == 0) { sub_8049A20(); } @@ -2267,9 +2267,9 @@ static void sub_8049AC0(void) else if (gMain.newKeys & B_BUTTON) { sub_804AADC(3, 1); - if (GetMenuCursorPos() == 0) + if (Menu_GetCursorPos() == 0) { - gUnknown_03004824->unk_007c = MoveMenuCursor(+1); + gUnknown_03004824->unk_007c = Menu_MoveCursor(+1); } gUnknown_03004824->linkData[0] = 0xbbcc; Trade_SendData(gUnknown_03004824); @@ -2282,17 +2282,17 @@ static void sub_8049BC0(void) if (gMain.newAndRepeatedKeys & DPAD_UP) { PlaySE(SE_SELECT); - gUnknown_03004824->unk_007c = MoveMenuCursor(-1); + gUnknown_03004824->unk_007c = Menu_MoveCursor(-1); } else if (gMain.newAndRepeatedKeys & DPAD_DOWN) { PlaySE(SE_SELECT); - gUnknown_03004824->unk_007c = MoveMenuCursor(+1); + gUnknown_03004824->unk_007c = Menu_MoveCursor(+1); } if (gMain.newKeys & A_BUTTON) { PlaySE(SE_SELECT); - if (GetMenuCursorPos() == 0) + if (Menu_GetCursorPos() == 0) { sub_804AA0C(4); gUnknown_03004824->linkData[0] = 0xeeaa; @@ -2337,7 +2337,7 @@ static void DisplayMessageAndContinueTask(void) gUnknown_03004824->unk_00b4++; if (gUnknown_03004824->unk_00b4 > 120) { - DrawTextWindow(&gUnknown_03004824->window, 24, 14, 29, 19); + TextWindow_DrawStdFrame(&gUnknown_03004824->window, 24, 14, 29, 19); InitYesNoMenu(24, 14, 4); gUnknown_03004824->unk_00b4 = 0; gUnknown_03004824->unk_007b = 3; @@ -2464,8 +2464,8 @@ static void sub_8049ED4(u8 a0) StoreSpriteCallbackInData(&gSprites[gUnknown_03004824->partyIcons[whichParty][whichPokemon]], sub_809D62C); gUnknown_03004824->unk_0080[a0] ++; sub_8078A34(&gSprites[gUnknown_03004824->partyIcons[whichParty][whichPokemon]]); - HandleDestroyMenuCursors(); - FillWindowRect_DefaultPalette(&gUnknown_03004824->window, 0, gUnknown_0820C330[whichParty][0], 0, gUnknown_0820C330[whichParty][1], 19); + Menu_DestroyCursor(); + Text_FillWindowRectDefPalette(&gUnknown_03004824->window, 0, gUnknown_0820C330[whichParty][0], 0, gUnknown_0820C330[whichParty][1], 19); sub_804A96C_alt(&gUnknown_03004824->unk_00c8, 15 * a0, 0, gTradePartyBoxTilemap, 15, 17, 0); if (whichParty == 0) { @@ -2491,10 +2491,10 @@ static void sub_8049ED4(u8 a0) string1[3] = 0xFC; string1[4] = 0x11; string1[5] = (64 - stringLength) / 2; - sub_8003460(&gUnknown_03004824->window, string1, gUnknown_03004824->unk_007a + whichParty * 6 * 32, gUnknown_0820C334[whichParty][0], gUnknown_0820C334[whichParty][1]); + Text_InitWindowAndPrintText(&gUnknown_03004824->window, string1, gUnknown_03004824->unk_007a + whichParty * 6 * 32, gUnknown_0820C334[whichParty][0], gUnknown_0820C334[whichParty][1]); sub_804A33C(string2, whichParty, whichPokemon); - sub_8003460(&gUnknown_03004824->window, gOtherText_Terminator2, gUnknown_03004824->unk_007a + whichParty * 6 * 32 + 32, gUnknown_0820C334[whichParty + 1][0], gUnknown_0820C334[whichParty + 1][1] + 1); - sub_8003460(&gUnknown_03004824->window, string2, gUnknown_03004824->unk_007a + whichParty * 6 * 32 + 38, gUnknown_0820C334[whichParty + 1][0], gUnknown_0820C334[whichParty + 1][1] + 1); + Text_InitWindowAndPrintText(&gUnknown_03004824->window, gOtherText_Terminator2, gUnknown_03004824->unk_007a + whichParty * 6 * 32 + 32, gUnknown_0820C334[whichParty + 1][0], gUnknown_0820C334[whichParty + 1][1] + 1); + Text_InitWindowAndPrintText(&gUnknown_03004824->window, string2, gUnknown_03004824->unk_007a + whichParty * 6 * 32 + 38, gUnknown_0820C334[whichParty + 1][0], gUnknown_0820C334[whichParty + 1][1] + 1); gUnknown_03004824->unk_0080[a0] ++; break; case 4: @@ -2692,7 +2692,7 @@ static void sub_8049ED4(u8 a0) "\tlsls r0, 2\n" "\tadds r0, r7\n" "\tbl sub_8078A34\n" - "\tbl HandleDestroyMenuCursors\n" + "\tbl Menu_DestroyCursor\n" "\tldr r3, _0804A09C @ =gUnknown_03004824\n" "\tldr r0, [r3]\n" "\tadds r0, 0x4\n" @@ -2708,7 +2708,7 @@ static void sub_8049ED4(u8 a0) "\tstr r1, [sp, 0x4]\n" "\tmovs r1, 0\n" "\tmovs r3, 0\n" - "\tbl FillWindowRect_DefaultPalette\n" + "\tbl Text_FillWindowRectDefPalette\n" "\tldr r1, _0804A09C @ =gUnknown_03004824\n" "\tldr r0, [r1]\n" "\tadds r0, 0xC8\n" @@ -2884,7 +2884,7 @@ static void sub_8049ED4(u8 a0) "\tldrb r1, [r1]\n" "\tstr r1, [sp]\n" "\tadd r1, sp, 0xC\n" - "\tbl sub_8003460\n" + "\tbl Text_InitWindowAndPrintText\n" "\tadd r7, sp, 0x34\n" "\tadds r0, r7, 0\n" "\tldr r1, [sp, 0x6C]\n" @@ -2910,7 +2910,7 @@ static void sub_8049ED4(u8 a0) "\tlsrs r4, 24\n" "\tstr r4, [sp]\n" "\tadds r3, r5, 0\n" - "\tbl sub_8003460\n" + "\tbl Text_InitWindowAndPrintText\n" "\tldr r0, _0804A22C @ =gUnknown_03004824\n" "\tldr r1, [r0]\n" "\tadds r0, r1, 0x4\n" @@ -2921,7 +2921,7 @@ static void sub_8049ED4(u8 a0) "\tstr r4, [sp]\n" "\tadds r1, r7, 0\n" "\tadds r3, r5, 0\n" - "\tbl sub_8003460\n" + "\tbl Text_InitWindowAndPrintText\n" "\tldr r2, _0804A22C @ =gUnknown_03004824\n" "\tldr r1, [r2]\n" "\tb _0804A28A\n" @@ -3010,7 +3010,7 @@ u8 sub_804A2B4(u8 *a0, u8 whichParty, u8 whichPokemon) GetMonGender(&gEnemyParty[whichPokemon]); GetMonData(&gEnemyParty[whichPokemon], MON_DATA_LEVEL); } - return GetStringWidthGivenWindowConfig(&gWindowConfig_81E7294, a0); + return Text_GetStringWidthFromWindowTemplate(&gWindowTemplate_81E7294, a0); } #ifdef NONMATCHING @@ -3067,8 +3067,8 @@ static void sub_804A41C(u8 whichParty) GetMonData(pokemon, MON_DATA_NICKNAME, nickname); StringCopy10(string + 6, nickname); GetMonGender(pokemon); - string[5] = (50 - GetStringWidthGivenWindowConfig(&gWindowConfig_81E7294, string + 6)) / 2; - sub_8003460(&gUnknown_03004824->window, string, gUnknown_03004824->unk_007a + 22 * 6 * whichParty + 22 * i, gTradeMonSpriteCoords[i + 6 * whichParty][0], gTradeMonSpriteCoords[i + 6 * whichParty][1]); + string[5] = (50 - Text_GetStringWidthFromWindowTemplate(&gWindowTemplate_81E7294, string + 6)) / 2; + Text_InitWindowAndPrintText(&gUnknown_03004824->window, string, gUnknown_03004824->unk_007a + 22 * 6 * whichParty + 22 * i, gTradeMonSpriteCoords[i + 6 * whichParty][0], gTradeMonSpriteCoords[i + 6 * whichParty][1]); } } #else @@ -3141,8 +3141,8 @@ static void sub_804A41C(u8 whichParty) "\tbl GetMonGender\n" "\tmov r1, sp\n" "\tadds r1, 0x22\n" - "\tldr r0, _0804A518 @ =gWindowConfig_81E7294\n" - "\tbl GetStringWidthGivenWindowConfig\n" + "\tldr r0, _0804A518 @ =gWindowTemplate_81E7294\n" + "\tbl Text_GetStringWidthFromWindowTemplate\n" "\tlsls r0, 24\n" "\tlsrs r0, 24\n" "\tmovs r1, 0x32\n" @@ -3177,7 +3177,7 @@ static void sub_804A41C(u8 whichParty) "\tldrb r1, [r1]\n" "\tstr r1, [sp]\n" "\tmov r1, r8\n" - "\tbl sub_8003460\n" + "\tbl Text_InitWindowAndPrintText\n" "\tadds r0, r6, 0x1\n" "\tlsls r0, 24\n" "\tlsrs r6, r0, 24\n" @@ -3198,7 +3198,7 @@ static void sub_804A41C(u8 whichParty) "\tbx r0\n" "\t.align 2, 0\n" "_0804A514: .4byte gEnemyParty\n" - "_0804A518: .4byte gWindowConfig_81E7294"); + "_0804A518: .4byte gWindowTemplate_81E7294"); } #endif @@ -3337,7 +3337,7 @@ static void sub_804A740(u8 whichParty) static void sub_804A80C(void) { - FillWindowRect_DefaultPalette(&gUnknown_03004824->window, 0, gUnknown_0820C330[1][0], 0, gUnknown_0820C330[1][1], 19); + Text_FillWindowRectDefPalette(&gUnknown_03004824->window, 0, gUnknown_0820C330[1][0], 0, gUnknown_0820C330[1][1], 19); sub_804A41C(1); } @@ -3345,7 +3345,7 @@ static void sub_804A840(u8 whichParty) { if (whichParty == 0) { - FillWindowRect_DefaultPalette(&gUnknown_03004824->window, 0, gUnknown_0820C330[0][0], 0, gUnknown_0820C330[0][1], 19); + Text_FillWindowRectDefPalette(&gUnknown_03004824->window, 0, gUnknown_0820C330[0][0], 0, gUnknown_0820C330[0][1], 19); sub_804A96C_alt(&gUnknown_03004824->unk_00c8, 0, 0, gTradePartyBoxTilemap, 15, 17, 0); sub_804A6DC(0); sub_804A41C(0); @@ -3354,8 +3354,8 @@ static void sub_804A840(u8 whichParty) } else { - HandleDestroyMenuCursors(); - FillWindowRect_DefaultPalette(&gUnknown_03004824->window, 0, gUnknown_0820C330[1][0], 0, gUnknown_0820C330[1][1], 19); + Menu_DestroyCursor(); + Text_FillWindowRectDefPalette(&gUnknown_03004824->window, 0, gUnknown_0820C330[1][0], 0, gUnknown_0820C330[1][1], 19); sub_804A96C_alt(&gUnknown_03004824->unk_00c8, 15, 0, gTradePartyBoxTilemap, 15, 17, 0); sub_804A6DC(1); sub_804A41C(1); @@ -3413,18 +3413,18 @@ static void sub_804A96C_alt(struct UnkStructD *arg0, u8 left, u8 top, const u16 static void sub_804A9F4(u8 unused) { - MenuZeroFillScreen(); + Menu_EraseScreen(); } static void sub_804AA00(u8 unused) { - MenuZeroFillScreen(); + Menu_EraseScreen(); } static void sub_804AA0C(u8 a0) { - DrawTextWindow(&gUnknown_03004824->window, gTradeMessageWindowRects[a0][0], gTradeMessageWindowRects[a0][1], gTradeMessageWindowRects[a0][2], gTradeMessageWindowRects[a0][3]); - sub_8003460(&gUnknown_03004824->window, gUnknown_0820C2F0[a0], 0x180 + gUnknown_03004824->unk_007a, gTradeMessageWindowRects[a0][0] + 1, gTradeMessageWindowRects[a0][1] + 1); + TextWindow_DrawStdFrame(&gUnknown_03004824->window, gTradeMessageWindowRects[a0][0], gTradeMessageWindowRects[a0][1], gTradeMessageWindowRects[a0][2], gTradeMessageWindowRects[a0][3]); + Text_InitWindowAndPrintText(&gUnknown_03004824->window, gUnknown_0820C2F0[a0], 0x180 + gUnknown_03004824->unk_007a, gTradeMessageWindowRects[a0][0] + 1, gTradeMessageWindowRects[a0][1] + 1); } static void sub_804AA88(void) @@ -3523,7 +3523,7 @@ static bool8 sub_804ABF8(void) static void sub_804ACD8(const u8 *src, u8 *dest, u8 a2) { - sub_804AFB8(&gWindowConfig_81E725C, dest, src, a2); + sub_804AFB8(&gWindowTemplate_81E725C, dest, src, a2); } #ifdef NONMATCHING @@ -3798,7 +3798,7 @@ static void sub_804AF84(void) gSaveBlock1.giftRibbons[i] = gUnknown_03004824->unk_00b5[i]; } -static void sub_804AFB8(const struct WindowConfig *windowConfig, u8 *dest, const u8 *src, u8 size) +static void sub_804AFB8(const struct WindowTemplate *windowConfig, u8 *dest, const u8 *src, u8 size) { u8 i; u8 *tileBuffer; @@ -3806,7 +3806,7 @@ static void sub_804AFB8(const struct WindowConfig *windowConfig, u8 *dest, const tileBuffer = gTileBuffer; CpuFill16(0, tileBuffer, size * 0x80); CpuFill16(0, tileBuffer + windowConfig->width * 0x20, size * 0x80); - sub_8004E3C(windowConfig, tileBuffer, src); + Text_InitWindow8004E3C(windowConfig, tileBuffer, src); for (i = 0; i < size; i ++) { CpuCopy16(&tileBuffer[32 * (i * 4)], &dest[32 * (i * 8)], 0x80); @@ -4028,11 +4028,11 @@ static void sub_804B41C(void) FreeAllSpritePalettes(); SetVBlankCallback(sub_804B210); sub_804B228(); - SetUpWindowConfig(&gWindowConfig_81E6F84); - InitWindowFromConfig(&gUnknown_03004828->window, &gWindowConfig_81E6F84); - gUnknown_03004828->textWindowBaseTileNum = SetTextWindowBaseTileNum(2); - LoadTextWindowGraphics(&gUnknown_03004828->window); - MenuZeroFillScreen(); + Text_LoadWindowTemplate(&gWindowTemplate_81E6F84); + Text_InitWindowWithTemplate(&gUnknown_03004828->window, &gWindowTemplate_81E6F84); + gUnknown_03004828->textWindowBaseTileNum = TextWindow_SetBaseTileNum(2); + TextWindow_LoadStdFrameGraphics(&gUnknown_03004828->window); + Menu_EraseScreen(); gLinkType = 0x1144; gMain.state ++; LZDecompressVram(gUnknown_08D00000, (void *)VRAM); @@ -4182,22 +4182,22 @@ static __attribute__((naked)) void sub_804B41C(void) "\tldr r0, _0804B578 @ =sub_804B210\n" "\tbl SetVBlankCallback\n" "\tbl sub_804B228\n" - "\tldr r4, _0804B57C @ =gWindowConfig_81E6F84\n" + "\tldr r4, _0804B57C @ =gWindowTemplate_81E6F84\n" "\tadds r0, r4, 0\n" - "\tbl SetUpWindowConfig\n" + "\tbl Text_LoadWindowTemplate\n" "\tldr r0, [r6]\n" "\tadds r0, 0x4\n" "\tadds r1, r4, 0\n" - "\tbl InitWindowFromConfig\n" + "\tbl Text_InitWindowWithTemplate\n" "\tmovs r0, 0x2\n" - "\tbl SetTextWindowBaseTileNum\n" + "\tbl TextWindow_SetBaseTileNum\n" "\tldr r1, [r6]\n" "\tadds r1, 0x34\n" "\tstrb r0, [r1]\n" "\tldr r0, [r6]\n" "\tadds r0, 0x4\n" - "\tbl LoadTextWindowGraphics\n" - "\tbl MenuZeroFillScreen\n" + "\tbl TextWindow_LoadStdFrameGraphics\n" + "\tbl Menu_EraseScreen\n" "\tldr r1, _0804B580 @ =gLinkType\n" "\tldr r4, _0804B584 @ =0x00001144\n" "\tadds r0, r4, 0\n" @@ -4279,7 +4279,7 @@ static __attribute__((naked)) void sub_804B41C(void) "_0804B570: .4byte gUnknown_03004828\n" "_0804B574: .4byte gSharedMem + 0x1F000\n" "_0804B578: .4byte sub_804B210\n" - "_0804B57C: .4byte gWindowConfig_81E6F84\n" + "_0804B57C: .4byte gWindowTemplate_81E6F84\n" "_0804B580: .4byte gLinkType\n" "_0804B584: .4byte 0x00001144\n" "_0804B588: .4byte gMain\n" @@ -4531,11 +4531,11 @@ static void sub_804B790(void) FreeAllSpritePalettes(); SetVBlankCallback(sub_804B210); sub_804B228(); - SetUpWindowConfig(&gWindowConfig_81E717C); - InitWindowFromConfig(&gUnknown_03004828->window, &gWindowConfig_81E717C); - gUnknown_03004828->textWindowBaseTileNum = SetTextWindowBaseTileNum(2); - LoadTextWindowGraphics(&gUnknown_03004828->window); - MenuZeroFillScreen(); + Text_LoadWindowTemplate(&gWindowTemplate_81E717C); + Text_InitWindowWithTemplate(&gUnknown_03004828->window, &gWindowTemplate_81E717C); + gUnknown_03004828->textWindowBaseTileNum = TextWindow_SetBaseTileNum(2); + TextWindow_LoadStdFrameGraphics(&gUnknown_03004828->window); + Menu_EraseScreen(); gLinkType = 0x1144; gUnknown_03004828->isLinkTrade = FALSE; gUnknown_03004828->unk_00b6 = 0; @@ -4733,7 +4733,7 @@ static void sub_804BBE8(u8 a0) for (i = 0; i < 0x280; i ++) buffer[i] |= 0x7000; DmaCopy16Defvars(3, gSharedMem, BG_SCREEN_ADDR(5), 0x500); - MenuZeroFillWindowRect(2, 15, 27, 18); + Menu_EraseWindowRect(2, 15, 27, 18); break; case 6: REG_DISPCNT = DISPCNT_MODE_1 | DISPCNT_OBJ_1D_MAP | DISPCNT_BG2_ON | DISPCNT_OBJ_ON; @@ -4843,7 +4843,7 @@ static bool8 sub_804C29C(void) case 10: StringExpandPlaceholders(gStringVar4, gTradeText_WillBeSent); - sub_8003460(&gUnknown_03004828->window, gStringVar4, gUnknown_03004828->textWindowBaseTileNum, 2, 15); + Text_InitWindowAndPrintText(&gUnknown_03004828->window, gStringVar4, gUnknown_03004828->textWindowBaseTileNum, 2, 15); gUnknown_03004828->unk_00c4 = 11; gUnknown_03004828->unk_00c0 = 0; break; @@ -4852,13 +4852,13 @@ static bool8 sub_804C29C(void) { gUnknown_03004828->unk_0102 = sub_8047580(gUnknown_03004828->pokePicSpriteIdxs[0], gSprites[gUnknown_03004828->pokePicSpriteIdxs[0]].oam.paletteNum, 0x78, 0x20, 0x2, 0x1, 0x14, 0xfffff); gUnknown_03004828->unk_00c4 ++; - ZeroFillWindowRect(&gUnknown_03004828->window, 0, 0, 29, 19); + Text_EraseWindowRect(&gUnknown_03004828->window, 0, 0, 29, 19); StringExpandPlaceholders(gStringVar4, gTradeText_ByeBye); - sub_8003460(&gUnknown_03004828->window, gStringVar4, gUnknown_03004828->textWindowBaseTileNum, 2, 15); + Text_InitWindowAndPrintText(&gUnknown_03004828->window, gStringVar4, gUnknown_03004828->textWindowBaseTileNum, 2, 15); } break; case 12: - if (gSprites[gUnknown_03004828->unk_0102].callback == SpriteCallbackDummy && sub_80035AC(&gUnknown_03004828->window) == TRUE) + if (gSprites[gUnknown_03004828->unk_0102].callback == SpriteCallbackDummy && Text_UpdateWindow(&gUnknown_03004828->window) == TRUE) { gUnknown_03004828->unk_0103 = CreateSprite(&gSpriteTemplate_821595C, 0x78, 0x20, 0); gSprites[gUnknown_03004828->unk_0103].callback = sub_804D738; @@ -5199,9 +5199,9 @@ static bool8 sub_804C29C(void) break; case 67: REG_DISPCNT = DISPCNT_MODE_0 | DISPCNT_OBJ_1D_MAP | DISPCNT_BG0_ON | DISPCNT_BG1_ON | DISPCNT_BG2_ON | DISPCNT_OBJ_ON; - ZeroFillWindowRect(&gUnknown_03004828->window, 0, 0, 29, 19); + Text_EraseWindowRect(&gUnknown_03004828->window, 0, 0, 29, 19); StringExpandPlaceholders(gStringVar4, gTradeText_SentOverPoke); - sub_8003460(&gUnknown_03004828->window, gStringVar4, gUnknown_03004828->textWindowBaseTileNum, 2, 15); + Text_InitWindowAndPrintText(&gUnknown_03004828->window, gStringVar4, gUnknown_03004828->textWindowBaseTileNum, 2, 15); gUnknown_03004828->unk_00c4 ++; gUnknown_03004828->unk_00c0 = 0; break; @@ -5213,9 +5213,9 @@ static bool8 sub_804C29C(void) if (gUnknown_03004828->unk_00c0 == 0xf0) { gUnknown_03004828->unk_00c4 ++; - ZeroFillWindowRect(&gUnknown_03004828->window, 0, 0, 29, 19); + Text_EraseWindowRect(&gUnknown_03004828->window, 0, 0, 29, 19); StringExpandPlaceholders(gStringVar4, gTradeText_TakeGoodCare); - sub_8003460(&gUnknown_03004828->window, gStringVar4, gUnknown_03004828->textWindowBaseTileNum, 2, 15); + Text_InitWindowAndPrintText(&gUnknown_03004828->window, gStringVar4, gUnknown_03004828->textWindowBaseTileNum, 2, 15); gUnknown_03004828->unk_00c0 = 0; } break; @@ -5536,9 +5536,9 @@ static void sub_804DC88(void) case 0: gUnknown_03004828 = &ewram_2010000.unk_0f000; gMain.state ++; - ZeroFillWindowRect(&gUnknown_03004828->window, 0, 0, 29, 19); + Text_EraseWindowRect(&gUnknown_03004828->window, 0, 0, 29, 19); StringExpandPlaceholders(gStringVar4, gOtherText_LinkStandby2); - sub_8003460(&gUnknown_03004828->window, gStringVar4, gUnknown_03004828->textWindowBaseTileNum, 2, 15); + Text_InitWindowAndPrintText(&gUnknown_03004828->window, gStringVar4, gUnknown_03004828->textWindowBaseTileNum, 2, 15); break; case 1: sub_80084A4(); @@ -5564,8 +5564,8 @@ static void sub_804DC88(void) break; case 2: gMain.state = 50; - ZeroFillWindowRect(&gUnknown_03004828->window, 0, 0, 29, 19); - sub_8003460(&gUnknown_03004828->window, gSystemText_Saving, gUnknown_03004828->textWindowBaseTileNum, 2, 15); + Text_EraseWindowRect(&gUnknown_03004828->window, 0, 0, 29, 19); + Text_InitWindowAndPrintText(&gUnknown_03004828->window, gSystemText_Saving, gUnknown_03004828->textWindowBaseTileNum, 2, 15); break; case 50: SetSecretBase2Field_9_AndHideBG(); diff --git a/src/engine/trainer_card.c b/src/engine/trainer_card.c index ffa4cbd08..70942fc29 100644 --- a/src/engine/trainer_card.c +++ b/src/engine/trainer_card.c @@ -565,8 +565,8 @@ void sub_80937A4() void sub_80937BC() { - SetUpWindowConfig(&WindowConfig_TrainerCard_Back_Values); - MultistepInitMenuWindowBegin(&WindowConfig_TrainerCard_Back_Values); + Text_LoadWindowTemplate(&gWindowTemplate_TrainerCard_Back_Values); + MultistepInitMenuWindowBegin(&gWindowTemplate_TrainerCard_Back_Values); } static void sub_80937D8() @@ -678,7 +678,7 @@ bool8 sub_8093980(struct Task *task) static void sub_80939A4(void) { CreateTask(sub_80939DC, 0); - BasicInitMenuWindow(&WindowConfig_TrainerCard_Back_Values); + BasicInitMenuWindow(&gWindowTemplate_TrainerCard_Back_Values); } static void sub_80939C0(void) @@ -700,7 +700,7 @@ static void sub_80939DC(u8 taskId) task->data[TD_0] ^= TRUE; } TrainerCard_Front_PrintPlayTime(buffer, task->data[TD_0]); - MenuPrint(buffer, 10, 12); + Menu_PrintText(buffer, 10, 12); } static void sub_8093A28(void) @@ -1130,7 +1130,7 @@ static void sub_8093DAC(void) static void sub_8093DC8(void) { - MenuZeroFillScreen(); + Menu_EraseScreen(); sub_80940E4(); sub_8093F14(); sub_8093F80(); @@ -1141,7 +1141,7 @@ static void sub_8093DC8(void) static void sub_8093DEC(void) { - MenuZeroFillScreen(); + Menu_EraseScreen(); sub_80940E4(); sub_8093F48(); sub_8094188(); @@ -1317,12 +1317,12 @@ static void sub_8094140(void) { u8 *buffer; - BasicInitMenuWindow(&WindowConfig_TrainerCard_Back_Values); + BasicInitMenuWindow(&gWindowTemplate_TrainerCard_Back_Values); buffer = gStringVar1; StringCopy(buffer, ewram0_2.var_64.playerName); ConvertInternationalString(buffer, ewram0_2.language); - MenuPrint(buffer, 7, 5); + Menu_PrintText(buffer, 7, 5); TrainerCard_Front_PrintTrainerID(); TrainerCard_Front_PrintMoney(); @@ -1332,7 +1332,7 @@ static void sub_8094140(void) static void sub_8094188(void) { - BasicInitMenuWindow(&WindowConfig_TrainerCard_Back_Values); + BasicInitMenuWindow(&gWindowTemplate_TrainerCard_Back_Values); TrainerCard_Back_PrintName(); TrainerCard_Back_PrintHallOfFameTime_Label(); TrainerCard_Back_PrintLinkBattlesLabel(); @@ -1341,7 +1341,7 @@ static void sub_8094188(void) TrainerCard_Back_PrintLinkPokeblocks_Label(); TrainerCard_Back_PrintPokemonTrades_Label(); - BasicInitMenuWindow(&WindowConfig_TrainerCard_Back_Labels); + BasicInitMenuWindow(&gWindowTemplate_TrainerCard_Back_Labels); TrainerCard_Back_PrintHallOfFameTime(); TrainerCard_Back_PrintLinkBattles(); TrainerCard_Back_PrintBattleTower(); @@ -1355,7 +1355,7 @@ static void TrainerCard_Front_PrintTrainerID(void) u8 buffer[8]; ConvertIntToDecimalStringN(buffer, ewram0_2.var_64.trainerId, STR_CONV_MODE_LEADING_ZEROS, 5); - MenuPrint(buffer, 20, 2); + Menu_PrintText(buffer, 20, 2); } static void TrainerCard_Front_PrintMoney(void) @@ -1406,14 +1406,14 @@ static void sub_809429C(void) str[0] = 00; str++; str = StringCopy(str, ewram0_2.var_20[1]); - MenuPrint(gStringVar1, 2, 14); + Menu_PrintText(gStringVar1, 2, 14); str = gStringVar1; str = StringCopy(str, ewram0_2.var_20[2]); str[0] = 00; str++; str = StringCopy(str, ewram0_2.var_20[3]); - MenuPrint(gStringVar1, 2, 16); + Menu_PrintText(gStringVar1, 2, 16); } } @@ -1437,7 +1437,7 @@ static void TrainerCard_Back_PrintName(void) static void TrainerCard_Back_PrintHallOfFameTime_Label(void) { if (ewram0_2.var_8 != 0) - MenuPrint(gOtherText_FirstHOF, 3, 5); + Menu_PrintText(gOtherText_FirstHOF, 3, 5); } static void TrainerCard_Back_PrintHallOfFameTime(void) @@ -1459,7 +1459,7 @@ static void TrainerCard_Back_PrintHallOfFameTime(void) static void TrainerCard_Back_PrintLinkBattlesLabel(void) { if (ewram0_2.var_9 != 0) - MenuPrint(gOtherText_LinkCableBattles, 3, 7); + Menu_PrintText(gOtherText_LinkCableBattles, 3, 7); } static void TrainerCard_Back_PrintLinkBattles(void) @@ -1479,7 +1479,7 @@ static void TrainerCard_Back_PrintLinkBattles(void) static void TrainerCard_Back_PrintBattleTower_Label(void) { if (ewram0_2.var_a != 0) - MenuPrint(gOtherText_BattleTowerWinRecord, 3, 15); + Menu_PrintText(gOtherText_BattleTowerWinRecord, 3, 15); } static void TrainerCard_Back_PrintBattleTower(void) @@ -1489,17 +1489,17 @@ static void TrainerCard_Back_PrintBattleTower(void) if (ewram0_2.var_a != 0) { sub_8072C44(buffer, ewram0_2.var_64.battleTowerWins, 24, 1); - MenuPrint_PixelCoords(buffer, 112, 120, 0); + Menu_PrintTextPixelCoords(buffer, 112, 120, 0); sub_8072C44(buffer, ewram0_2.var_64.battleTowerLosses, 24, 1); - MenuPrint_PixelCoords(buffer, 149, 120, 0); + Menu_PrintTextPixelCoords(buffer, 149, 120, 0); } } static void TrainerCard_Back_PrintLinkContests_Label(void) { if (ewram0_2.var_b != 0) - MenuPrint(gOtherText_ContestRecord, 3, 13); + Menu_PrintText(gOtherText_ContestRecord, 3, 13); } static void TrainerCard_Back_PrintLinkContests(void) @@ -1516,7 +1516,7 @@ static void TrainerCard_Back_PrintLinkContests(void) static void TrainerCard_Back_PrintLinkPokeblocks_Label(void) { if (ewram0_2.var_c != 0) - MenuPrint(gOtherText_MixingRecord, 3, 11); + Menu_PrintText(gOtherText_MixingRecord, 3, 11); } static void TrainerCard_Back_PrintLinkPokeblocks(void) @@ -1533,7 +1533,7 @@ static void TrainerCard_Back_PrintLinkPokeblocks(void) static void TrainerCard_Back_PrintPokemonTrades_Label(void) { if (ewram0_2.var_d != 0) - MenuPrint(gOtherText_TradeRecord, 3, 9); + Menu_PrintText(gOtherText_TradeRecord, 3, 9); } static void TrainerCard_Back_PrintPokemonTrades(void) @@ -1553,5 +1553,5 @@ void unref_sub_8094588(u16 left, u16 top) if (gSaveBlock2.playerGender == FEMALE) text = gOtherText_Girl; - MenuPrint(text, left, top); + Menu_PrintText(text, left, top); } diff --git a/src/field/berry_tag_screen.c b/src/field/berry_tag_screen.c index 960a163c1..a05d9bf87 100644 --- a/src/field/berry_tag_screen.c +++ b/src/field/berry_tag_screen.c @@ -109,11 +109,11 @@ static bool8 sub_8146058(void) gMain.state += 1; break; case 3: - SetUpWindowConfig(&gWindowConfig_81E6E18); + Text_LoadWindowTemplate(&gWindowTemplate_81E6E18); gMain.state += 1; break; case 4: - MultistepInitMenuWindowBegin(&gWindowConfig_81E6E18); + MultistepInitMenuWindowBegin(&gWindowTemplate_81E6E18); gMain.state += 1; break; case 5: @@ -280,18 +280,18 @@ static void sub_81464E4(void) berryInfo = GetBerryInfo(gSpecialVar_ItemId + OFFSET_7B + 1); ConvertIntToDecimalStringN(gStringVar1, gSpecialVar_ItemId - FIRST_BERRY + 1, STR_CONV_MODE_LEADING_ZEROS, 2); - MenuPrint(gStringVar1, 12, 4); + Menu_PrintText(gStringVar1, 12, 4); #if ENGLISH - MenuPrint(berryInfo->name, 14, 4); + Menu_PrintText(berryInfo->name, 14, 4); #elif GERMAN StringCopy(buffer, berryInfo->name); StringAppend(buffer, gOtherText_Berry2); - MenuPrint(buffer, 14, 4); + Menu_PrintText(buffer, 14, 4); #endif - MenuPrint(berryInfo->description1, 4, 14); - MenuPrint(berryInfo->description2, 4, 16); + Menu_PrintText(berryInfo->description1, 4, 14); + Menu_PrintText(berryInfo->description2, 4, 16); #ifdef UNITS_IMPERIAL size = (berryInfo->size * 1000) / 254; @@ -301,7 +301,7 @@ static void sub_81464E4(void) sizeMajor = size / 100; #endif - MenuPrint(gOtherText_Size, 11, 7); + Menu_PrintText(gOtherText_Size, 11, 7); if (berryInfo->size != 0) { #ifdef UNITS_IMPERIAL @@ -311,18 +311,18 @@ static void sub_81464E4(void) ConvertIntToDecimalStringN(gStringVar1, berryInfo->size / 10, STR_CONV_MODE_LEFT_ALIGN, 2); ConvertIntToDecimalStringN(gStringVar2, berryInfo->size % 10, STR_CONV_MODE_LEFT_ALIGN, 2); #endif - MenuPrint(gContestStatsText_Unknown1, 16, 7); + Menu_PrintText(gContestStatsText_Unknown1, 16, 7); } else { - MenuPrint(gOtherText_ThreeQuestions2, 16, 7); + Menu_PrintText(gOtherText_ThreeQuestions2, 16, 7); } - MenuPrint(gOtherText_Firm, 11, 9); + Menu_PrintText(gOtherText_Firm, 11, 9); if (berryInfo->firmness != 0) - MenuPrint(gUnknown_0841192C[berryInfo->firmness - 1], 16, 9); + Menu_PrintText(gUnknown_0841192C[berryInfo->firmness - 1], 16, 9); else - MenuPrint(gOtherText_ThreeQuestions2, 16, 9); + Menu_PrintText(gOtherText_ThreeQuestions2, 16, 9); } static void sub_8146600(u8 berry) @@ -445,7 +445,7 @@ static void sub_8146810(s8 berry) static void sub_81468BC(void) { - MenuZeroFillWindowRect(0, 4, 29, 19); + Menu_EraseWindowRect(0, 4, 29, 19); sub_81464E4(); // center of berry sprite diff --git a/src/field/braille_puzzles.c b/src/field/braille_puzzles.c index 0d304714d..f11fb5fb3 100644 --- a/src/field/braille_puzzles.c +++ b/src/field/braille_puzzles.c @@ -161,7 +161,7 @@ void Task_BrailleWait(u8 taskId) case 1: if (BrailleWait_CheckButtonPress() != FALSE) { - MenuZeroFillScreen(); + Menu_EraseScreen(); PlaySE(SE_SELECT); data[0] = 2; } @@ -170,7 +170,7 @@ void Task_BrailleWait(u8 taskId) data[1] = data[1] - 1; if (data[1] == 0) { - MenuZeroFillScreen(); + Menu_EraseScreen(); data[0] = 3; data[1] = 30; } diff --git a/src/field/choose_party.c b/src/field/choose_party.c index d278eda4a..3ba04e489 100644 --- a/src/field/choose_party.c +++ b/src/field/choose_party.c @@ -318,19 +318,19 @@ static void sub_812238C(u8 taskId) { if (gMain.newAndRepeatedKeys & 0x40) { - if (GetMenuCursorPos() != 0) + if (Menu_GetCursorPos() != 0) { PlaySE(SE_SELECT); - MoveMenuCursor(-1); + Menu_MoveCursor(-1); } return; } if (gMain.newAndRepeatedKeys & 0x80) { - if (GetMenuCursorPos() != 3) + if (Menu_GetCursorPos() != 3) { PlaySE(SE_SELECT); - MoveMenuCursor(1); + Menu_MoveCursor(1); } return; } @@ -343,7 +343,7 @@ static void sub_812238C(u8 taskId) gTasks[taskId].data[4], sBattleTowerEntryMenu, sBattleTowerEntryMenuItems, - GetMenuCursorPos()); + Menu_GetCursorPos()); popupMenuFunc(taskId); return; } @@ -461,8 +461,8 @@ static void BattleTowerEntryMenuCallback_Enter(u8 taskId) } } PlaySE(SE_HAZURE); - MenuZeroFillWindowRect(20, 10, 29, 19); - HandleDestroyMenuCursors(); + Menu_EraseWindowRect(20, 10, 29, 19); + Menu_DestroyCursor(); sub_806D5A4(); sub_806E834(gOtherText_NoMoreThreePoke, 1); gTasks[taskId].func = sub_8122728; @@ -475,8 +475,8 @@ static void sub_8122728(u8 taskId) if ((gMain.newKeys & A_BUTTON) || (gMain.newKeys & B_BUTTON)) { - MenuZeroFillWindowRect(0, 14, 29, 19); - HandleDestroyMenuCursors(); + Menu_EraseWindowRect(0, 14, 29, 19); + Menu_DestroyCursor(); BattleTowerEntryMenuCallback_Exit(taskId); } } @@ -515,8 +515,8 @@ static void BattleTowerEntryMenuCallback_NoEntry(u8 taskId) static void sub_81227FC(u8 taskId) { - MenuZeroFillWindowRect(20, 10, 29, 19); - HandleDestroyMenuCursors(); + Menu_EraseWindowRect(20, 10, 29, 19); + Menu_DestroyCursor(); PrintPartyMenuPromptText(0, 0); gTasks[taskId].func = HandleBattleTowerPartyMenu; } @@ -806,19 +806,19 @@ static void Task_DaycareStorageMenu8122EAC(u8 taskId) { if (gMain.newAndRepeatedKeys & 0x40) { - if (GetMenuCursorPos() != 0) + if (Menu_GetCursorPos() != 0) { PlaySE(SE_SELECT); - MoveMenuCursor(-1); + Menu_MoveCursor(-1); } return; } if (gMain.newAndRepeatedKeys & 0x80) { - if (GetMenuCursorPos() != 3) + if (Menu_GetCursorPos() != 3) { PlaySE(SE_SELECT); - MoveMenuCursor(1); + Menu_MoveCursor(1); } return; } @@ -831,7 +831,7 @@ static void Task_DaycareStorageMenu8122EAC(u8 taskId) gTasks[taskId].data[4], sDaycareStorageMenus, sDaycareStorageMenuItems, - GetMenuCursorPos()); + Menu_GetCursorPos()); popupMenuFunc(taskId); return; } @@ -896,8 +896,8 @@ static void DaycareStorageMenuCallback_Summary(u8 taskId) static void DaycareStorageMenuCallback_Exit(u8 taskId) { PlaySE(SE_SELECT); - MenuZeroFillWindowRect(20, 10, 29, 19); - HandleDestroyMenuCursors(); + Menu_EraseWindowRect(20, 10, 29, 19); + Menu_DestroyCursor(); PrintPartyMenuPromptText(15, 0); gTasks[taskId].func = HandleDaycarePartyMenu; } diff --git a/src/field/coins.c b/src/field/coins.c index 91a4b508d..2c217e635 100644 --- a/src/field/coins.c +++ b/src/field/coins.c @@ -13,13 +13,13 @@ void UpdateCoinsWindow(s32 coins, u8 x, u8 y) void ShowCoinsWindow(u32 coins, u8 x, u8 y) { - MenuDrawTextWindow(x, y, x + 9, y + 3); + Menu_DrawStdWindowFrame(x, y, x + 9, y + 3); UpdateCoinsWindow(coins, x, y); } void HideCoinsWindow(u8 x, u8 y) { - MenuZeroFillWindowRect(x, y, x + 9, y + 3); + Menu_EraseWindowRect(x, y, x + 9, y + 3); } void PrintCoins(s32 coins, u8 b, u8 x, u8 y) @@ -46,7 +46,7 @@ void PrintCoins(s32 coins, u8 b, u8 x, u8 y) ptr[2] = (b - StringLength(string)) * 6; ptr += 3; StringCopy(ptr, string); - MenuPrint(gOtherText_Coins2, x, y); + Menu_PrintText(gOtherText_Coins2, x, y); } u16 GetCoins(void) diff --git a/src/field/daycare.c b/src/field/daycare.c index c28bc65ca..5811461ae 100644 --- a/src/field/daycare.c +++ b/src/field/daycare.c @@ -1741,7 +1741,7 @@ static void HandleDaycareLevelMenuInput(u8 taskId) if (gTasks[taskId].data[0] != 0) { gTasks[taskId].data[0] --; - MoveMenuCursor(-1); + Menu_MoveCursor(-1); PlaySE(SE_SELECT); } } @@ -1750,25 +1750,25 @@ static void HandleDaycareLevelMenuInput(u8 taskId) if (gTasks[taskId].data[0] != 2) { gTasks[taskId].data[0]++; - MoveMenuCursor(+1); + Menu_MoveCursor(+1); PlaySE(SE_SELECT); } } else if (gMain.newKeys & A_BUTTON) { - HandleDestroyMenuCursors(); + Menu_DestroyCursor(); PlaySE(SE_SELECT); gLastFieldPokeMenuOpened = gSpecialVar_Result = gTasks[taskId].data[0]; DestroyTask(taskId); - MenuZeroFillWindowRect(15, 6, 29, 13); + Menu_EraseWindowRect(15, 6, 29, 13); EnableBothScriptContexts(); } else if (gMain.newKeys & B_BUTTON) { - HandleDestroyMenuCursors(); + Menu_DestroyCursor(); gLastFieldPokeMenuOpened = gSpecialVar_Result = 2; DestroyTask(taskId); - MenuZeroFillWindowRect(15, 6, 29, 13); + Menu_EraseWindowRect(15, 6, 29, 13); EnableBothScriptContexts(); } } @@ -1776,11 +1776,11 @@ static void HandleDaycareLevelMenuInput(u8 taskId) void ShowDaycareLevelMenu(void) { u8 buffer[100]; - MenuDrawTextWindow(15, 6, 29, 13); + Menu_DrawStdWindowFrame(15, 6, 29, 13); GetDaycareLevelMenuText(&gSaveBlock1.daycare, buffer); - MenuPrint(buffer, 16, 7); + Menu_PrintText(buffer, 16, 7); GetDaycareLevelMenuLevelText(&gSaveBlock1.daycare, buffer); - MenuPrint_PixelCoords(buffer, 0xce, 0x38, TRUE); + Menu_PrintTextPixelCoords(buffer, 0xce, 0x38, TRUE); InitMenu(0, 16, 7, 3, 0, 13); CreateTask(HandleDaycareLevelMenuInput, 3); } diff --git a/src/field/decoration.c b/src/field/decoration.c index 87a9d8028..a6c0bd21f 100644 --- a/src/field/decoration.c +++ b/src/field/decoration.c @@ -1433,8 +1433,8 @@ extern u8 gUnknown_0815F399[]; void sub_80FE1DC(void) { sub_80FE2B4(); - MenuDrawTextWindow(0, 0, 10, 9); - PrintMenuItems(1, 1, 4, (const struct MenuAction *)gUnknown_083EC604); + Menu_DrawStdWindowFrame(0, 0, 10, 9); + Menu_PrintItems(1, 1, 4, (const struct MenuAction *)gUnknown_083EC604); InitMenu(0, 1, 1, 4, gUnknown_020388D4, 9); } @@ -1487,13 +1487,13 @@ void Task_DecorationPCProcessMenuInput(u8 taskId) if (gMain.newKeys & DPAD_UP) { PlaySE(SE_SELECT); - gUnknown_020388D4 = MoveMenuCursor(-1); + gUnknown_020388D4 = Menu_MoveCursor(-1); sub_80FE394(); } if (gMain.newKeys & DPAD_DOWN) { PlaySE(SE_SELECT); - gUnknown_020388D4 = MoveMenuCursor(1); + gUnknown_020388D4 = Menu_MoveCursor(1); sub_80FE394(); } if (gMain.newKeys & A_BUTTON) @@ -1510,15 +1510,15 @@ void Task_DecorationPCProcessMenuInput(u8 taskId) void sub_80FE394(void) { - MenuFillWindowRectWithBlankTile(2, 15, 27, 18); - MenuPrint(gUnknown_083EC624[gUnknown_020388D4], 2, 15); + Menu_BlankWindowRect(2, 15, 27, 18); + Menu_PrintText(gUnknown_083EC624[gUnknown_020388D4], 2, 15); } void gpu_pal_decompress_alloc_tag_and_upload(u8 taskId) { - HandleDestroyMenuCursors(); - MenuZeroFillWindowRect(0, 0, 10, 9); - MenuFillWindowRectWithBlankTile(2, 15, 27, 18); + Menu_DestroyCursor(); + Menu_EraseWindowRect(0, 0, 10, 9); + Menu_BlankWindowRect(2, 15, 27, 18); FreeSpritePaletteByTag(6); if (ewram_1f000.isPlayerRoom == 0) { @@ -1546,7 +1546,7 @@ void sub_80FE470(u8 decoCat, u8 left, u8 top, u8 palIdx) // PrintDecorationCateg { u8 *strptr; u8 v0; - v0 = sub_8072CBC(); + v0 = Menu_GetTextWindowPaletteNum(); // PALETTE {palIdx} strptr = gStringVar4; strptr[0] = EXT_CTRL_CODE_BEGIN; @@ -1561,13 +1561,13 @@ void sub_80FE470(u8 decoCat, u8 left, u8 top, u8 palIdx) // PrintDecorationCateg strptr[1] = 5; strptr[2] = v0; strptr[3] = EOS; - MenuPrint(gStringVar4, left, top); + Menu_PrintText(gStringVar4, left, top); } void sub_80FE528(u8 taskId) // PrintDecorationCategorySelectionMenuStrings { u8 decoCat; - MenuDrawTextWindow(0, 0, 14, 19); + Menu_DrawStdWindowFrame(0, 0, 14, 19); for (decoCat=0; decoCat<8; decoCat++) { if (ewram_1f000.isPlayerRoom == 1 && gTasks[taskId].data[11] == 0 && decoCat != DECORCAT_DOLL && decoCat != DECORCAT_CUSHION) @@ -1578,13 +1578,13 @@ void sub_80FE528(u8 taskId) // PrintDecorationCategorySelectionMenuStrings sub_80FE470(decoCat, 1, 2 * decoCat + 1, 255); // Unselectable } } - MenuPrint(gUnknownText_Exit, 1, 17); + Menu_PrintText(gUnknownText_Exit, 1, 17); } void sub_80FE5AC(u8 taskId) { - HandleDestroyMenuCursors(); - MenuZeroFillWindowRect(0, 0, 29, 19); + Menu_DestroyCursor(); + Menu_EraseWindowRect(0, 0, 29, 19); sub_80FE528(taskId); InitMenu(0, 1, 1, 9, gUnknown_020388F6, 13); gTasks[taskId].func = sub_80FE604; @@ -1597,15 +1597,15 @@ void sub_80FE604(u8 taskId) if (gMain.newAndRepeatedKeys & DPAD_UP) { PlaySE(SE_SELECT); - MoveMenuCursor(-1); + Menu_MoveCursor(-1); } else if (gMain.newAndRepeatedKeys & DPAD_DOWN) { PlaySE(SE_SELECT); - MoveMenuCursor(1); + Menu_MoveCursor(1); } else if (gMain.newKeys & A_BUTTON) { PlaySE(SE_SELECT); - gUnknown_020388F6 = GetMenuCursorPos(); + gUnknown_020388F6 = Menu_GetCursorPos(); if (gUnknown_020388F6 != 8) { gUnknown_020388D5 = sub_8134194(gUnknown_020388F6); @@ -1620,8 +1620,8 @@ void sub_80FE604(u8 taskId) gTasks[taskId].func = sub_80FE868; } else { - HandleDestroyMenuCursors(); - MenuZeroFillWindowRect(0, 0, 14, 19); + Menu_DestroyCursor(); + Menu_EraseWindowRect(0, 0, 14, 19); DisplayItemMessageOnField(taskId, gSecretBaseText_NoDecors, sub_80FE418, 0); } } else @@ -1649,12 +1649,12 @@ void sub_80FE728(u8 taskId) void sub_80FE758(u8 taskId) { - HandleDestroyMenuCursors(); - MenuZeroFillWindowRect(0, 0, 14, 19); + Menu_DestroyCursor(); + Menu_EraseWindowRect(0, 0, 14, 19); if (gTasks[taskId].data[11] != 2) { sub_80FE1DC(); - MenuDisplayMessageBox(); + Menu_DisplayDialogueFrame(); sub_80FE394(); gTasks[taskId].func = Task_DecorationPCProcessMenuInput; } else @@ -1677,18 +1677,18 @@ void sub_80FE7D4(u8 *dest, u8 decClass) void sub_80FE7EC(u8 taskId) { - HandleDestroyMenuCursors(); - MenuZeroFillWindowRect(0, 0, 29, 19); + Menu_DestroyCursor(); + Menu_EraseWindowRect(0, 0, 29, 19); sub_80FEC94(taskId); sub_80FECB8(gUnknown_020388F6); #if ENGLISH - MenuDrawTextWindow(15, 12, 29, 19); + Menu_DrawStdWindowFrame(15, 12, 29, 19); #elif GERMAN if ((gUnknown_020388F2 + gUnknown_020388F4) != gUnknown_020388D5) { - MenuDrawTextWindow(15, 12, 29, 19); + Menu_DrawStdWindowFrame(15, 12, 29, 19); } #endif @@ -1710,7 +1710,7 @@ void sub_80FE894(u8 taskId /*r8*/, s8 cursorVector /*r5*/, s8 bgVector /*r7*/) PlaySE(SE_SELECT); if (cursorVector != 0) { - gUnknown_020388F2 = MoveMenuCursor(cursorVector); + gUnknown_020388F2 = Menu_MoveCursor(cursorVector); } if (bgVector != 0) { @@ -1722,12 +1722,12 @@ void sub_80FE894(u8 taskId /*r8*/, s8 cursorVector /*r5*/, s8 bgVector /*r7*/) { if (v0) { - MenuDrawTextWindow(15, 12, 29, 19); + Menu_DrawStdWindowFrame(15, 12, 29, 19); } sub_80FECE0(gUnknown_020388F2 + gUnknown_020388F4); } else { - MenuZeroFillWindowRect(15, 12, 29, 19); + Menu_EraseWindowRect(15, 12, 29, 19); } } @@ -1757,7 +1757,7 @@ void sub_80FE948(u8 taskId) } if (gMain.newKeys & A_BUTTON) { - HandleDestroyMenuCursors(); + Menu_DestroyCursor(); PlaySE(SE_SELECT); gUnknown_020388F5 = gUnknown_020388F2 + gUnknown_020388F4; if (gUnknown_020388F5 == gUnknown_020388D5) @@ -1769,7 +1769,7 @@ void sub_80FE948(u8 taskId) } } else if (gMain.newKeys & B_BUTTON) { - HandleDestroyMenuCursors(); + Menu_DestroyCursor(); PlaySE(SE_SELECT); gUnknown_083EC634[gTasks[taskId].data[11]].noFunc(taskId); } @@ -1839,13 +1839,13 @@ void sub_80FEABC(u8 taskId, u8 dummy1) void sub_80FEC94(u8 taskId) { - MenuDrawTextWindow(0, 0, 14, 19); + Menu_DrawStdWindowFrame(0, 0, 14, 19); sub_80FEABC(taskId, 0); } void sub_80FECB8(u8 decoCat) { - MenuDrawTextWindow(15, 0, 29, 3); + Menu_DrawStdWindowFrame(15, 0, 29, 3); sub_80FE470(decoCat, 16, 1, 0xff); } @@ -1902,8 +1902,8 @@ _080FED26:\n\ void sub_80FED1C(void) { - MenuZeroFillWindowRect(15, 0, 29, 3); - MenuZeroFillWindowRect(15, 12, 29, 19); + Menu_EraseWindowRect(15, 0, 29, 3); + Menu_EraseWindowRect(15, 12, 29, 19); } void sub_80FED3C(u8 taskId) @@ -2005,8 +2005,8 @@ void sub_80FEF74(void) sub_80F9520(gUnknown_020388F7, 8); DestroyVerticalScrollIndicator(0); DestroyVerticalScrollIndicator(1); - HandleDestroyMenuCursors(); - MenuZeroFillWindowRect(0, 0, 14, 19); + Menu_DestroyCursor(); + Menu_EraseWindowRect(0, 0, 14, 19); } bool8 sub_80FEFA4(void) @@ -2035,8 +2035,8 @@ void sub_80FEFF4(u8 taskId) void sub_80FF034(u8 taskId) { - HandleDestroyMenuCursors(); - MenuZeroFillWindowRect(0, 0, 14, 19); + Menu_DestroyCursor(); + Menu_EraseWindowRect(0, 0, 14, 19); sub_80FE5AC(taskId); } @@ -3128,7 +3128,7 @@ void sub_81000A0(u8 taskId) void sub_81000C4(u8 taskId) { - MenuZeroFillWindowRect(0, 0, 29, 19); + Menu_EraseWindowRect(0, 0, 29, 19); sub_8100174(taskId); if (gDecorations[gUnknown_020388D0[gUnknown_020388F5]].permission != DECORPERM_SOLID_MAT) { @@ -3186,7 +3186,7 @@ void sub_8100248(u8 taskId) void sub_810026C(u8 taskId) { - MenuZeroFillWindowRect(0, 0, 29, 19); + Menu_EraseWindowRect(0, 0, 29, 19); sub_810028C(taskId); } @@ -3341,7 +3341,7 @@ void sub_8100494(u8 taskId) void sub_810065C(u8 taskId) { - MenuZeroFillWindowRect(0, 0, 29, 19); + Menu_EraseWindowRect(0, 0, 29, 19); gSprites[gUnknown_020391A8].data[7] = 0; gTasks[taskId].data[10] = 0; gTasks[taskId].func = sub_8100494; @@ -3723,7 +3723,7 @@ void sub_8100C88(u8 taskId) { DrawWholeMapView(); ScriptContext1_SetupScript(gUnknown_081A2F8A); - MenuZeroFillWindowRect(0, 0, 29, 19); + Menu_EraseWindowRect(0, 0, 29, 19); gTasks[taskId].data[2] = 2; } break; @@ -3760,7 +3760,7 @@ bool8 sub_8100D38(u8 taskId) void SetUpPuttingAwayDecorationPlayerAvatar(void) { player_get_direction_lower_nybble(); - MenuZeroFillWindowRect(0, 0, 29, 19); + Menu_EraseWindowRect(0, 0, 29, 19); gUnknown_020391A8 = gSprites[gUnknown_03004880.unk4].data[0]; sub_81016C8(); gUnknown_03004880.unk4 = CreateSprite(&gSpriteTemplate_83ECA88, 0x78, 0x50, 0); @@ -3790,7 +3790,7 @@ void sub_8100E70(u8 taskId) data[2] = 1; data[6] = 1; data[5] = 1; - HandleDestroyMenuCursors(); + Menu_DestroyCursor(); } break; case 1: @@ -3810,7 +3810,7 @@ void sub_8100E70(u8 taskId) void sub_8100EEC(u8 taskId) { - MenuZeroFillWindowRect(0, 0, 29, 19); + Menu_EraseWindowRect(0, 0, 29, 19); gSprites[gUnknown_020391A8].data[7] = 0; gSprites[gUnknown_020391A8].invisible = 0; gSprites[gUnknown_020391A8].callback = sub_8101698; @@ -4150,7 +4150,7 @@ void sub_810156C(u8 taskId) void sub_8101590(u8 taskId) { - MenuZeroFillWindowRect(0, 0, 29, 19); + Menu_EraseWindowRect(0, 0, 29, 19); sub_81015B0(taskId); } @@ -4192,7 +4192,7 @@ void sub_8101648(u8 taskId) void sub_8101678(void) { pal_fill_black(); - MenuDisplayMessageBox(); + Menu_DisplayDialogueFrame(); sub_80FE220(); CreateTask(sub_8101648, 8); } @@ -4274,7 +4274,7 @@ void sub_8101824(u8 taskId) void sub_8101848(u8 taskId) { - MenuZeroFillWindowRect(20, 8, 26, 14); + Menu_EraseWindowRect(20, 8, 26, 14); sub_8109A30(gUnknown_020388D0[gUnknown_020388F5]); gUnknown_020388D0[gUnknown_020388F5] = DECOR_NONE; sub_80FF098(taskId); diff --git a/src/field/diploma.c b/src/field/diploma.c index 27601404c..7028eec02 100644 --- a/src/field/diploma.c +++ b/src/field/diploma.c @@ -68,8 +68,8 @@ void CB2_ShowDiploma(void) ResetPaletteFade(); FreeAllSpritePalettes(); LoadPalette(gDiplomaPalettes, 0, 64); - SetUpWindowConfig(&gWindowConfig_81E6C3C); - InitMenuWindow(&gWindowConfig_81E6CE4); + Text_LoadWindowTemplate(&gWindowTemplate_81E6C3C); + InitMenuWindow(&gWindowTemplate_81E6CE4); DisplayDiplomaText(); BeginNormalPaletteFade(-1, 0, 0x10, 0, 0); @@ -135,5 +135,5 @@ static void DisplayDiplomaText(void) REG_BG3HOFS = 0; StringCopy(gStringVar1, gOtherText_HoennDex); } - MenuPrint(gOtherText_DiplomaCertificationGameFreak, 6, 2); + Menu_PrintText(gOtherText_DiplomaCertificationGameFreak, 6, 2); }
\ No newline at end of file diff --git a/src/field/field_effect.c b/src/field/field_effect.c index 1e2aaa4ed..5ff89574b 100644 --- a/src/field/field_effect.c +++ b/src/field/field_effect.c @@ -2434,8 +2434,8 @@ void sub_8088380(struct Task *task) IntrCallback callback; LoadWordFromTwoHalfwords((u16 *)&task->data[13], (u32 *)&callback); SetVBlankCallback(callback); - SetUpWindowConfig(&gWindowConfig_81E6CE4); - InitMenuWindow(&gWindowConfig_81E6CE4); + Text_LoadWindowTemplate(&gWindowTemplate_81E6CE4); + InitMenuWindow(&gWindowTemplate_81E6CE4); FreeResourcesAndDestroySprite(&gSprites[task->data[15]]); FieldEffectActiveListRemove(FLDEFF_FIELD_MOVE_SHOW_MON); DestroyTask(FindTaskIdByFunc(sub_8088120)); @@ -2557,8 +2557,8 @@ void sub_808862C(struct Task *task) CpuFill32(0, (void *)VRAM + bg0cnt, 0x800); LoadWordFromTwoHalfwords((u16 *)&task->data[13], (u32 *)&intrCallback); SetVBlankCallback(intrCallback); - SetUpWindowConfig(&gWindowConfig_81E6CE4); - InitMenuWindow(&gWindowConfig_81E6CE4); + Text_LoadWindowTemplate(&gWindowTemplate_81E6CE4); + InitMenuWindow(&gWindowTemplate_81E6CE4); FreeResourcesAndDestroySprite(&gSprites[task->data[15]]); FieldEffectActiveListRemove(FLDEFF_FIELD_MOVE_SHOW_MON); DestroyTask(FindTaskIdByFunc(sub_808847C)); diff --git a/src/field/field_message_box.c b/src/field/field_message_box.c index 35aac7ac9..5eec7a14b 100644 --- a/src/field/field_message_box.c +++ b/src/field/field_message_box.c @@ -19,8 +19,8 @@ static void PrintFieldMessageFromStringVar4(void); void InitFieldMessageBox(void) { sMessageBoxMode = FIELD_MESSAGE_BOX_HIDDEN; - SetMessageBoxBaseTileNum(gMenuTextWindowContentTileOffset); - InitWindowFromConfig(&gFieldMessageBoxWindow, &gWindowConfig_81E6CE4); + TextWindow_SetDlgFrameBaseTileNum(gMenuTextWindowContentTileOffset); + Text_InitWindowWithTemplate(&gFieldMessageBoxWindow, &gWindowTemplate_81E6CE4); } static void Task_FieldMessageBox(u8 taskId) @@ -29,22 +29,22 @@ static void Task_FieldMessageBox(u8 taskId) switch (task->data[0]) { case 0: - LoadMessageBoxTiles(&gFieldMessageBoxWindow); + TextWindow_LoadDialogueFrameTiles(&gFieldMessageBoxWindow); task->data[0]++; break; case 1: - DrawStandardMessageBox(&gFieldMessageBoxWindow); + TextWindow_DrawDialogueFrame(&gFieldMessageBoxWindow); task->data[0]++; break; case 2: switch (sMessageBoxMode) { case FIELD_MESSAGE_BOX_NORMAL: - if (!sub_80035AC(&gFieldMessageBoxWindow)) + if (!Text_UpdateWindow(&gFieldMessageBoxWindow)) return; break; case FIELD_MESSAGE_BOX_AUTO_SCROLL: - if (!sub_8003778(&gFieldMessageBoxWindow)) + if (!Text_UpdateWindowAutoscroll(&gFieldMessageBoxWindow)) return; break; } @@ -117,20 +117,20 @@ bool8 unref_sub_8064BD0(const u8 *message) static void PrintFieldMessage(const u8 *message) { StringExpandPlaceholders(gStringVar4, message); - sub_8002EB0(&gFieldMessageBoxWindow, gStringVar4, gMenuTextTileOffset, 2, 15); + Text_InitWindow8002EB0(&gFieldMessageBoxWindow, gStringVar4, gMenuTextTileOffset, 2, 15); CreateFieldMessageBoxTask(); } static void PrintFieldMessageFromStringVar4(void) { - sub_8002EB0(&gFieldMessageBoxWindow, gStringVar4, gMenuTextTileOffset, 2, 15); + Text_InitWindow8002EB0(&gFieldMessageBoxWindow, gStringVar4, gMenuTextTileOffset, 2, 15); CreateFieldMessageBoxTask(); } void HideFieldMessageBox(void) { DestroyFieldMessageBoxTask(); - ClearStandardMessageBox(&gFieldMessageBoxWindow); + TextWindow_EraseDialogueFrame(&gFieldMessageBoxWindow); sMessageBoxMode = FIELD_MESSAGE_BOX_HIDDEN; } @@ -150,6 +150,6 @@ bool8 IsFieldMessageBoxHidden(void) void unref_sub_8064CA0(void) { DestroyFieldMessageBoxTask(); - DrawStandardMessageBox(&gFieldMessageBoxWindow); + TextWindow_DrawDialogueFrame(&gFieldMessageBoxWindow); sMessageBoxMode = FIELD_MESSAGE_BOX_HIDDEN; } diff --git a/src/field/field_player_avatar.c b/src/field/field_player_avatar.c index d80076be4..9a29e2e92 100644 --- a/src/field/field_player_avatar.c +++ b/src/field/field_player_avatar.c @@ -1507,7 +1507,7 @@ u8 Fishing4(struct Task *task) { u32 randVal; - MenuDisplayMessageBox(); + Menu_DisplayDialogueFrame(); task->tStep++; task->tFrameCounter = 0; task->tNumDots = 0; @@ -1549,7 +1549,7 @@ u8 Fishing5(struct Task *task) } else { - MenuPrint(dot, task->tNumDots + 4, 15); + Menu_PrintText(dot, task->tNumDots + 4, 15); task->tNumDots++; } } @@ -1573,7 +1573,7 @@ u8 Fishing6(struct Task *task) u8 Fishing7(struct Task *task) { sub_805A954(); - MenuPrint(gOtherText_OhABite, 4, 17); + Menu_PrintText(gOtherText_OhABite, 4, 17); task->tStep++; task->tFrameCounter = 0; return 0; @@ -1624,7 +1624,7 @@ u8 Fishing10(struct Task *task) { sub_805A954(); MenuPrintMessageDefaultCoords(gOtherText_PokeOnHook); - MenuDisplayMessageBox(); + Menu_DisplayDialogueFrame(); task->tStep++; task->tFrameCounter = 0; return 0; @@ -1637,7 +1637,7 @@ u8 Fishing11(struct Task *task) if (task->tFrameCounter == 0) { - if (MenuUpdateWindowText()) + if (Menu_UpdateWindowText()) { struct MapObject *playerMapObj = &gMapObjects[gPlayerAvatar.mapObjectId]; @@ -1647,7 +1647,7 @@ u8 Fishing11(struct Task *task) sub_8127F28(gMapObjects[gPlayerAvatar.mapObjectId].mapobj_unk_1A, 0, 0); gSprites[gPlayerAvatar.spriteId].pos2.x = 0; gSprites[gPlayerAvatar.spriteId].pos2.y = 0; - MenuZeroFillScreen(); + Menu_EraseScreen(); task->tFrameCounter++; return 0; } @@ -1688,7 +1688,7 @@ u8 Fishing13(struct Task *task) u8 Fishing14(struct Task *task) { sub_805A954(); - MenuDisplayMessageBox(); + Menu_DisplayDialogueFrame(); task->tStep++; return 0; } @@ -1713,12 +1713,12 @@ u8 Fishing15(struct Task *task) u8 Fishing16(struct Task *task) { - if (MenuUpdateWindowText()) + if (Menu_UpdateWindowText()) { gPlayerAvatar.preventStep = FALSE; ScriptContext2_Disable(); UnfreezeMapObjects(); - MenuZeroFillScreen(); + Menu_EraseScreen(); sub_80BE97C(0); DestroyTask(FindTaskIdByFunc(Task_Fishing)); } diff --git a/src/field/field_region_map.c b/src/field/field_region_map.c index 73e101d8f..54091459f 100644 --- a/src/field/field_region_map.c +++ b/src/field/field_region_map.c @@ -50,13 +50,13 @@ void CB2_FieldInitRegionMap(void) InitRegionMap((void *)&ewram0_5.unk8, 0); CreateRegionMapPlayerIcon(0, 0); CreateRegionMapCursor(1, 1); - SetUpWindowConfig(&gWindowConfig_81E709C); - InitMenuWindow(&gWindowConfig_81E709C); - MenuZeroFillScreen(); + Text_LoadWindowTemplate(&gWindowTemplate_81E709C); + InitMenuWindow(&gWindowTemplate_81E709C); + Menu_EraseScreen(); REG_BG0CNT = BGCNT_PRIORITY(0) | BGCNT_CHARBASE(0) | BGCNT_SCREENBASE(31) | BGCNT_16COLOR | BGCNT_TXT256x256; - MenuDrawTextWindow(21, 0, 29, 3); + Menu_DrawStdWindowFrame(21, 0, 29, 3); sub_8072BD8(gOtherText_Hoenn, 0x16, 1, 0x38); - MenuDrawTextWindow(16, 16, 29, 19); + Menu_DrawStdWindowFrame(16, 16, 29, 19); sub_813F0C8(); SetMainCallback2(CB2_FieldRegionMap); SetVBlankCallback(VBlankCB_FieldRegionMap); @@ -117,7 +117,7 @@ void sub_813EFDC(void) void sub_813F0C8(void) { - MenuFillWindowRectWithBlankTile(17, 17, 28, 18); + Menu_BlankWindowRect(17, 17, 28, 18); if (ewram0_5.unk8.unk16) - MenuPrint(ewram0_5.unk8.str, 17, 17); + Menu_PrintText(ewram0_5.unk8.str, 17, 17); } diff --git a/src/field/field_screen_effect.c b/src/field/field_screen_effect.c index a472d5a9c..6e818ce68 100644 --- a/src/field/field_screen_effect.c +++ b/src/field/field_screen_effect.c @@ -215,7 +215,7 @@ static void sub_80816A8(u8 taskId) data[0] = 1; break; case 1: - MenuFillWindowRectWithBlankTile(0, 0, 29, 19); + Menu_BlankWindowRect(0, 0, 29, 19); sub_808161C(data[1]); sub_8081534(data[2], data[3], 1, 160, 1, 2); data[0] = 2; @@ -264,8 +264,8 @@ static void sub_80816A8(u8 taskId) } break; case 5: - MenuZeroFillWindowRect(0, 0, 29, 19); - LoadFontDefaultPalette(&gWindowConfig_81E6CE4); + Menu_EraseWindowRect(0, 0, 29, 19); + LoadFontDefaultPalette(&gWindowTemplate_81E6CE4); REG_WIN0H = 255; REG_DISPCNT = data[6]; REG_BLDCNT = data[7]; diff --git a/src/field/field_specials.c b/src/field/field_specials.c index fc6f690a3..aade7cffd 100644 --- a/src/field/field_specials.c +++ b/src/field/field_specials.c @@ -1058,7 +1058,7 @@ static void sub_810E874(void) ScriptContext2_Enable(); if (gUnknown_0203925A > 5) { - MenuDrawTextWindow(0, 0, 8, 11); + Menu_DrawStdWindowFrame(0, 0, 8, 11); InitMenu(0, 1, 1, 5, 0, 7); gUnknown_0203925C = 0; sub_80F944C(); @@ -1067,12 +1067,12 @@ static void sub_810E874(void) } else { - MenuDrawTextWindow(0, 0, 8, 2 * gUnknown_0203925A + 1); + Menu_DrawStdWindowFrame(0, 0, 8, 2 * gUnknown_0203925A + 1); InitMenu(0, 1, 1, gUnknown_0203925A, 0, 7); } for (i = 0; i < 5 && gUnknown_03000760[i].var0 != 16; i ++) { - MenuPrint(gUnknown_083F8380[gUnknown_03000760[i].var0], 1, 2 * i + 1); + Menu_PrintText(gUnknown_083F8380[gUnknown_03000760[i].var0], 1, 2 * i + 1); } DisplayCurrentElevatorFloor(); CreateTask(sub_810E984, 8); @@ -1080,7 +1080,7 @@ static void sub_810E874(void) void DisplayCurrentElevatorFloor(void) { - MenuDrawTextWindow(20, 0, 29, 5); + Menu_DrawStdWindowFrame(20, 0, 29, 5); sub_8072BD8(gOtherText_NowOn, 21, 1, 64); sub_8072BD8(gUnknown_083F8380[gSpecialVar_0x8005], 21, 3, 64); } @@ -1091,15 +1091,15 @@ void sub_810E984(u8 taskId) if (gMain.newKeys == DPAD_UP && gUnknown_0203925B != 0) { gUnknown_0203925B--; - curMenuPos = GetMenuCursorPos(); - MoveMenuCursorNoWrap(-1); + curMenuPos = Menu_GetCursorPos(); + Menu_MoveCursorNoWrap(-1); sub_810EAC8(curMenuPos, DPAD_UP); } if (gMain.newKeys == DPAD_DOWN && gUnknown_0203925B != gUnknown_0203925A - 1) { gUnknown_0203925B++; - curMenuPos = GetMenuCursorPos(); - MoveMenuCursorNoWrap(+1); + curMenuPos = Menu_GetCursorPos(); + Menu_MoveCursorNoWrap(+1); sub_810EAC8(curMenuPos, DPAD_DOWN); } if (gMain.newKeys & A_BUTTON) @@ -1109,7 +1109,7 @@ void sub_810E984(u8 taskId) { gSpecialVar_Result = 0; PlaySE(SE_SELECT); - MenuZeroFillWindowRect(0, 0, 29, 12); + Menu_EraseWindowRect(0, 0, 29, 12); sub_810EC9C(taskId); } else @@ -1119,7 +1119,7 @@ void sub_810E984(u8 taskId) ShakeScreenInElevator(); FieldObjectTurnByLocalIdAndMap(gSpecialVar_LastTalked, gSaveBlock1.location.mapNum, gSaveBlock1.location.mapGroup, DIR_SOUTH); sub_810EEDC(); - MenuZeroFillScreen(); + Menu_EraseScreen(); DestroyTask(taskId); } } @@ -1128,7 +1128,7 @@ void sub_810E984(u8 taskId) gSpecialVar_Result = 0; PlaySE(SE_SELECT); sub_810EEDC(); - MenuZeroFillWindowRect(0, 0, 29, 12); + Menu_EraseWindowRect(0, 0, 29, 12); sub_810EC9C(taskId); } } @@ -1163,10 +1163,10 @@ bool8 sub_810EAC8(u8 prevMenuPos, u8 dpadInput) if (flag) { sub_810EB90(newPos, 5); - MenuFillWindowRectWithBlankTile(2, 1, 7, 10); + Menu_BlankWindowRect(2, 1, 7, 10); for (i=0; i<5 && gUnknown_03000760[newPos].var0 != 16; newPos++, i++) { - MenuPrint(gUnknown_083F8380[gUnknown_03000760[newPos].var0], 1, i * 2 + 1); + Menu_PrintText(gUnknown_083F8380[gUnknown_03000760[newPos].var0], 1, i * 2 + 1); } } return flag; @@ -1227,7 +1227,7 @@ bool8 sub_810EAC8(u8 prevMenuPos, u8 dpadInput) "\tmovs r1, 0x1\n" "\tmovs r2, 0x7\n" "\tmovs r3, 0xA\n" - "\tbl MenuFillWindowRectWithBlankTile\n" + "\tbl Menu_BlankWindowRect\n" "\tmovs r5, 0\n" "\tldr r2, _0810EB88 @ =gUnknown_03000760\n" "\tlsls r1, r4, 2\n" @@ -1249,7 +1249,7 @@ bool8 sub_810EAC8(u8 prevMenuPos, u8 dpadInput) "\tlsls r2, 24\n" "\tlsrs r2, 24\n" "\tmovs r1, 0x1\n" - "\tbl MenuPrint\n" + "\tbl Menu_PrintText\n" "\tadds r0, r4, 0x1\n" "\tlsls r0, 24\n" "\tlsrs r4, r0, 24\n" @@ -1539,7 +1539,7 @@ void ShowGlassWorkshopMenu(void) { u8 i; ScriptContext2_Enable(); - MenuDrawTextWindow(0, 0, 10, 11); + Menu_DrawStdWindowFrame(0, 0, 10, 11); InitMenu(0, 1, 1, 5, 0, 9); gUnknown_0203925C = 0; sub_80F944C(); @@ -1547,7 +1547,7 @@ void ShowGlassWorkshopMenu(void) sub_810F2B4(); for (i=0; i<5; i++) { - MenuPrint(gUnknown_083F83C0[i], 1, 2 * i + 1); + Menu_PrintText(gUnknown_083F83C0[i], 1, 2 * i + 1); } gUnknown_0203925B = 0; gUnknown_0203925A = ARRAY_COUNT(gUnknown_083F83C0); @@ -1560,33 +1560,33 @@ void sub_810F118(u8 taskId) if (gMain.newKeys == DPAD_UP && gUnknown_0203925B != 0) { gUnknown_0203925B--; - prevCursorPos = GetMenuCursorPos(); - MoveMenuCursorNoWrap(-1); + prevCursorPos = Menu_GetCursorPos(); + Menu_MoveCursorNoWrap(-1); sub_810F1F4(prevCursorPos, DPAD_UP); } if (gMain.newKeys == DPAD_DOWN && gUnknown_0203925B != gUnknown_0203925A - 1) { gUnknown_0203925B++; - prevCursorPos = GetMenuCursorPos(); - MoveMenuCursorNoWrap(1); + prevCursorPos = Menu_GetCursorPos(); + Menu_MoveCursorNoWrap(1); sub_810F1F4(prevCursorPos, DPAD_DOWN); } if (gMain.newKeys & A_BUTTON) { - HandleDestroyMenuCursors(); + Menu_DestroyCursor(); gSpecialVar_Result = gUnknown_0203925B; PlaySE(SE_SELECT); sub_810EEDC(); - MenuZeroFillWindowRect(0, 0, 29, 12); + Menu_EraseWindowRect(0, 0, 29, 12); sub_810EC9C(taskId); } if (gMain.newKeys & B_BUTTON) { - HandleDestroyMenuCursors(); + Menu_DestroyCursor(); gSpecialVar_Result = 0x7f; PlaySE(SE_SELECT); sub_810EEDC(); - MenuZeroFillWindowRect(0, 0, 29, 12); + Menu_EraseWindowRect(0, 0, 29, 12); sub_810EC9C(taskId); } } @@ -1621,10 +1621,10 @@ bool8 sub_810F1F4(u8 prevCursorPos, u8 dpadInput) if (flag) { GlassWorkshopUpdateScrollIndicators(newPos, 5); - MenuFillWindowRectWithBlankTile(2, 1, 9, 10); + Menu_BlankWindowRect(2, 1, 9, 10); for (i=0; i<5; newPos++, i++) { - MenuPrint(gUnknown_083F83C0[newPos], 1, 2 * i + 1); + Menu_PrintText(gUnknown_083F83C0[newPos], 1, 2 * i + 1); } } return flag; @@ -1683,7 +1683,7 @@ bool8 sub_810F1F4(u8 prevCursorPos, u8 dpadInput) "\tmovs r1, 0x1\n" "\tmovs r2, 0x9\n" "\tmovs r3, 0xA\n" - "\tbl MenuFillWindowRectWithBlankTile\n" + "\tbl Menu_BlankWindowRect\n" "\tmovs r5, 0\n" "\tldr r7, _0810F28C @ =gUnknown_083F83C0\n" "_0810F25C:\n" @@ -1695,7 +1695,7 @@ bool8 sub_810F1F4(u8 prevCursorPos, u8 dpadInput) "\tlsls r2, 24\n" "\tlsrs r2, 24\n" "\tmovs r1, 0x1\n" - "\tbl MenuPrint\n" + "\tbl Menu_PrintText\n" "\tadds r0, r4, 0x1\n" "\tlsls r0, 24\n" "\tlsrs r4, r0, 24\n" diff --git a/src/field/fldeff_softboiled.c b/src/field/fldeff_softboiled.c index a574232a8..3c64ec520 100644 --- a/src/field/fldeff_softboiled.c +++ b/src/field/fldeff_softboiled.c @@ -126,7 +126,7 @@ static void sub_8133E74(u8 taskId) { return; } - MenuZeroFillWindowRect(WINDOW_LEFT, 14, WINDOW_RIGHT, 19); + Menu_EraseWindowRect(WINDOW_LEFT, 14, WINDOW_RIGHT, 19); PrintPartyMenuPromptText(3, 0); gTasks[taskId].func = HandlePartyMenuSwitchPokemonInput; } @@ -142,7 +142,7 @@ static void sub_8133EF8(void) { sub_806CCE4(); EWRAM_1B000_2.unk261 = 2; DestroySprite(&gSprites[EWRAM_1000.unk1]); - MenuZeroFillWindowRect(WINDOW_LEFT, 14, WINDOW_RIGHT, 19); + Menu_EraseWindowRect(WINDOW_LEFT, 14, WINDOW_RIGHT, 19); PrintPartyMenuPromptText(0, 0); SwitchTaskToFollowupFunc(EWRAM_1000.unk0); } diff --git a/src/field/item_menu.c b/src/field/item_menu.c index e9b8b24d3..2be5f1e1d 100644 --- a/src/field/item_menu.c +++ b/src/field/item_menu.c @@ -424,11 +424,11 @@ static bool8 SetupBagMultistep(void) gMain.state++; break; case 7: - SetUpWindowConfig(&gWindowConfig_81E6DFC); + Text_LoadWindowTemplate(&gWindowTemplate_81E6DFC); gMain.state++; break; case 8: - MultistepInitMenuWindowBegin(&gWindowConfig_81E6DFC); + MultistepInitMenuWindowBegin(&gWindowTemplate_81E6DFC); gMain.state++; break; case 9: @@ -1062,7 +1062,7 @@ void sub_80A4164(u8 *dest, u16 value, enum StringConvertMode mode, u8 digits) void sub_80A418C(u16 value, enum StringConvertMode mode, u8 c, u8 d, u8 digits) { sub_80A4164(gStringVar1, value, mode, digits); - MenuPrint(gStringVar1, c, d); + Menu_PrintText(gStringVar1, c, d); } static void sub_80A41D4(u8 taskId) @@ -1112,7 +1112,7 @@ static bool8 sub_80A42B0(u8 itemPos, int b) return TRUE; r5 = itemPos * 2 + 2; sub_8072C74(gStringVar1, gOtherText_CloseBag, 0x78, 0); - MenuPrint(gStringVar1, 14, r5); + Menu_PrintText(gStringVar1, 14, r5); ptr = gBGTilemapBuffers[2] + 14 + r5 * 32; ptr[0] = 0x4F; ptr[1] = 0x4F; @@ -1121,9 +1121,9 @@ static bool8 sub_80A42B0(u8 itemPos, int b) if (itemPos == 7) return TRUE; if ((b == 1 && r8->unk2 != 0) || b == 2) - MenuFillWindowRectWithBlankTile(14, r5 + 2, 29, 13); + Menu_BlankWindowRect(14, r5 + 2, 29, 13); else - MenuFillWindowRectWithBlankTile(14, r5 + 2, 29, 17); + Menu_BlankWindowRect(14, r5 + 2, 29, 17); return TRUE; } return FALSE; @@ -1148,7 +1148,7 @@ static void sub_80A4380(u16 a, int b, int c, int d) text = sub_8072C74(text, ItemId_GetItem(gCurrentBagPocketItemSlots[r4].itemId)->name, 0x66, 0); *text++ = CHAR_MULT_SIGN; sub_8072C14(text, gCurrentBagPocketItemSlots[r4].quantity, 0x78, 1); - MenuPrint(gStringVar1, 14, r5); + Menu_PrintText(gStringVar1, 14, r5); } } @@ -1173,7 +1173,7 @@ static void sub_80A444C(u16 a, int b, int c, int d) #else sub_8072C74(text, ItemId_GetItem(gCurrentBagPocketItemSlots[r4].itemId)->name, 0x63, 0); #endif - MenuPrint(gStringVar1, 14, r5); + Menu_PrintText(gStringVar1, 14, r5); if (gUnknown_02038558 != 0) { if (gCurrentBagPocketItemSlots[r4].itemId == gSaveBlock1.registeredItem) @@ -1240,7 +1240,7 @@ static void sub_80A4548(u16 a, int b, int c, int d) moveName = gMoveNames[ItemIdToBattleMoveId(gCurrentBagPocketItemSlots[r4].itemId)]; sub_8072C74(text, moveName, 0x78, 0); } - MenuPrint(gStringVar1, 14, sp10); + Menu_PrintText(gStringVar1, 14, sp10); } } #else @@ -1421,7 +1421,7 @@ _080A46AE:\n\ ldr r0, _080A46F8 @ =gStringVar1\n\ movs r1, 0xE\n\ ldr r2, [sp, 0x10]\n\ - bl MenuPrint\n\ + bl Menu_PrintText\n\ mov r0, r8\n\ adds r0, 0x1\n\ lsls r0, 24\n\ @@ -1482,7 +1482,7 @@ static void sub_80A46FC(u16 a, int b, int c, int d) text = sub_80A425C(a, text, i); CopyItemName(gCurrentBagPocketItemSlots[r4].itemId, gStringVar2); sub_80A41E0(text, gCurrentBagPocketItemSlots[r4].itemId - 0x84, gStringVar2, gCurrentBagPocketItemSlots[r4].quantity, 3); - MenuPrint(gStringVar1, 14, r5); + Menu_PrintText(gStringVar1, 14, r5); } } @@ -1540,7 +1540,7 @@ static void ItemListMenu_InitDescription(s16 itemId) } if (r5 < 3) - MenuZeroFillWindowRect(0, 13 + r5 * 2, 13, 20); + Menu_EraseWindowRect(0, 13 + r5 * 2, 13, 20); } static void ItemListMenu_ChangeDescription(s16 itemId, int b) @@ -1551,20 +1551,20 @@ static void ItemListMenu_ChangeDescription(s16 itemId, int b) { if (b == 0) { - MenuZeroFillWindowRect(0, 13, 13, 20); - MenuPrint_PixelCoords(gOtherText_ReturnTo, 4, 0x68, 0); + Menu_EraseWindowRect(0, 13, 13, 20); + Menu_PrintTextPixelCoords(gOtherText_ReturnTo, 4, 0x68, 0); } else if (b == 1) { - MenuPrint_PixelCoords(gUnknown_0840E740[sReturnLocation], 4, 0x78, 0); + Menu_PrintTextPixelCoords(gUnknown_0840E740[sReturnLocation], 4, 0x78, 0); } } else { if (b == 0) - MenuZeroFillWindowRect(0, 13, 13, 20); + Menu_EraseWindowRect(0, 13, 13, 20); if (ItemId_CopyDescription(description, itemId, b)) - MenuPrint_PixelCoords(description, 4, 104 + b * 16, 0); + Menu_PrintTextPixelCoords(description, 4, 104 + b * 16, 0); } } @@ -1602,9 +1602,9 @@ static void sub_80A4A98(const u8 *text, u32 line) u8 buffer[100]; if (line == 0) - MenuZeroFillWindowRect(0, 13, 13, 20); + Menu_EraseWindowRect(0, 13, 13, 20); if (CopyTextLine(buffer, text, line)) - MenuPrint_PixelCoords(buffer, 4, 104 + line * 16, 0); + Menu_PrintTextPixelCoords(buffer, 4, 104 + line * 16, 0); } static void sub_80A4ADC(u8 taskId) @@ -1618,7 +1618,7 @@ static void sub_80A4ADC(u8 taskId) static void sub_80A4B14(s8 a, u8 b) { gBagPocketScrollStates[sCurrentBagPocket].scrollTop += a; - MoveMenuCursor(0); + Menu_MoveCursor(0); sub_80A73C0(); sub_80A763C(); sub_80A4ADC(b); @@ -1626,7 +1626,7 @@ static void sub_80A4B14(s8 a, u8 b) static void sub_80A4B58(s8 delta, u8 b) { - gBagPocketScrollStates[sCurrentBagPocket].cursorPos = MoveMenuCursor(delta); + gBagPocketScrollStates[sCurrentBagPocket].cursorPos = Menu_MoveCursor(delta); sub_80A73C0(); sub_80A4ADC(b); } @@ -1649,7 +1649,7 @@ static void sub_80A4BF0(u16 *a) if (gUnknown_02038564 == 4) { - MenuDrawTextWindow(0, 7, 13, 12); + Menu_DrawStdWindowFrame(0, 7, 13, 12); sub_80A4008(a, 1, 8, 12, 4); if (sub_80F9344() == TRUE && sReturnLocation == RETURN_TO_FIELD_5) { @@ -1665,7 +1665,7 @@ static void sub_80A4BF0(u16 *a) text = sub_80A4B90(gSpecialVar_ItemId); else text = sItemPopupMenuActions[sPopupMenuActionList[i]].text; - MenuPrint(text, 1 + (i / 2) * 6, 8 + (i % 2) * 2); + Menu_PrintText(text, 1 + (i / 2) * 6, 8 + (i % 2) * 2); } } if (sReturnLocation == RETURN_TO_FIELD_5) @@ -1676,10 +1676,10 @@ static void sub_80A4BF0(u16 *a) } else { - MenuDrawTextWindow(0, 5, 13, 12); + Menu_DrawStdWindowFrame(0, 5, 13, 12); sub_80A4008(a, 1, 6, 12, 6); for (i = 0; i < gUnknown_02038564; i++) - MenuPrint(sItemPopupMenuActions[sPopupMenuActionList[i]].text, 1 + (i / 3) * 6, 6 + (i % 3) * 2); + Menu_PrintText(sItemPopupMenuActions[sPopupMenuActionList[i]].text, 1 + (i / 3) * 6, 6 + (i % 3) * 2); InitMenu(0, 1, 6, gUnknown_02038564, 0, 1); sub_8072DCC(0x2F); } @@ -1690,7 +1690,7 @@ static void sub_80A4DA4(u16 *a) { sub_80A73FC(); sub_80A36B8(a, 0, 6, 13, 6); - MenuZeroFillWindowRect(0, 5, 13, 12); + Menu_EraseWindowRect(0, 5, 13, 12); sub_80A7590(); } @@ -1699,7 +1699,7 @@ static void sub_80A4DD8(u8 taskId, u8 b, u8 c, u8 d, u8 e, u8 digits) gTasks[taskId].data[1] = 1; gTasks[taskId].data[2] = b + 2; gTasks[taskId].data[3] = c + 1; - MenuDrawTextWindow(b, c, b + d, c + e); + Menu_DrawStdWindowFrame(b, c, b + d, c + e); sub_80A4008(gBGTilemapBuffers[1], b + 1, c + 1, d - 1, e - 1); sub_80A418C(1, 1, b + 2, c + 1, digits); } @@ -2539,7 +2539,7 @@ static void sub_80A57C4(void) r5 = 7; } sub_80A4008(gBGTilemapBuffers[1], 7, r5 + 1, 6, gUnknown_02038564 * 2); - MenuDrawTextWindow(6, r5, 13, gUnknown_02038564 * 2 + 1 + r5); + Menu_DrawStdWindowFrame(6, r5, 13, gUnknown_02038564 * 2 + 1 + r5); sub_80A7834(0, r5); InitMenu(0, 7, r5 + 1, gUnknown_02038564, 0, 6); } @@ -2553,7 +2553,7 @@ static void sub_80A5888(u8 taskId) if (sPopupMenuSelection != 0) { PlaySE(SE_SELECT); - sPopupMenuSelection = MoveMenuCursor(-1); + sPopupMenuSelection = Menu_MoveCursor(-1); } } else if (gMain.newAndRepeatedKeys & DPAD_DOWN) @@ -2561,7 +2561,7 @@ static void sub_80A5888(u8 taskId) if (sPopupMenuSelection != gUnknown_02038564 - 1) { PlaySE(SE_SELECT); - sPopupMenuSelection = MoveMenuCursor(1); + sPopupMenuSelection = Menu_MoveCursor(1); } } else if (gMain.newKeys & A_BUTTON) @@ -2690,14 +2690,14 @@ static void sub_80A5C24(u8 taskId) void CleanUpItemMenuMessage(u8 taskId) { sub_80A36B8(gBGTilemapBuffers[1], 0, 0, 31, 31); - MenuZeroFillWindowRect(7, 7, 13, 12); - MenuZeroFillWindowRect(0, 14, 29, 19); + Menu_EraseWindowRect(7, 7, 13, 12); + Menu_EraseWindowRect(0, 14, 29, 19); gTasks[taskId].func = sub_80A5C24; } void CleanUpOverworldMessage(u8 taskId) { - MenuZeroFillWindowRect(0, 13, 29, 19); + Menu_EraseWindowRect(0, 13, 29, 19); DestroyTask(taskId); sub_8064E2C(); ScriptContext2_Disable(); @@ -2760,7 +2760,7 @@ static void sub_80A5DA0(u16 itemId, u16 quantity) static void sub_80A5DF8(void) { sub_80A4DA4(gBGTilemapBuffers[1]); - MenuZeroFillWindowRect(7, 6, 11, 13); + Menu_EraseWindowRect(7, 6, 11, 13); sub_80A7528(4); } @@ -2857,7 +2857,7 @@ static void sub_80A6024(u8 taskId) if (gMain.newKeys & A_BUTTON) { sub_80A36B8(gBGTilemapBuffers[1], 0, 0, 31, 31); - MenuZeroFillWindowRect(0, 14, 29, 19); + Menu_EraseWindowRect(0, 14, 29, 19); gTasks[taskId].func = sub_80A6000; } } @@ -3008,7 +3008,7 @@ static void sub_80A640C(u8 taskId) static void sub_80A6444(u8 taskId) { sub_80A36B8(gBGTilemapBuffers[1], 0, 0, 31, 31); - MenuZeroFillWindowRect(0, 14, 29, 19); + Menu_EraseWindowRect(0, 14, 29, 19); gTasks[taskId].func = sub_80A640C; } @@ -3016,7 +3016,7 @@ static void sub_80A648C(u8 taskId) { gTasks[taskId].func = Task_BuyHowManyDialogueHandleInput; sub_80A4008(gBGTilemapBuffers[1], 1, 11, 12, 2); - MenuDrawTextWindow(0, 10, 13, 13); + Menu_DrawStdWindowFrame(0, 10, 13, 13); gTasks[taskId].data[1] = 1; gTasks[taskId].data[2] = 1; gTasks[taskId].data[3] = 11; @@ -3053,7 +3053,7 @@ static void sub_80A6574(u8 taskId) static void sub_80A65AC(u8 taskId) { - MenuZeroFillWindowRect(7, 6, 13, 12); + Menu_EraseWindowRect(7, 6, 13, 12); sub_80A36B8(gBGTilemapBuffers[1], 7, 6, 6, 6); CopyItemName(gSpecialVar_ItemId, gStringVar2); StringExpandPlaceholders(gStringVar4, gOtherText_SoldItem); @@ -3063,7 +3063,7 @@ static void sub_80A65AC(u8 taskId) static void sub_80A6618(u8 taskId) { - MenuZeroFillWindowRect(7, 6, 13, 12); + Menu_EraseWindowRect(7, 6, 13, 12); sub_80A36B8(gBGTilemapBuffers[1], 7, 6, 6, 6); BuyMenuPrintItemQuantityAndPrice(taskId); } @@ -3078,13 +3078,13 @@ static void Task_BuyHowManyDialogueHandleInput(u8 taskId) { if (sub_80A5350(taskId) == TRUE) { - MenuZeroFillWindowRect(6, 11, 12, 11); + Menu_EraseWindowRect(6, 11, 12, 11); BuyMenuDisplayMessage(gSpecialVar_ItemId, gTasks[taskId].data[1]); } else if (gMain.newKeys & A_BUTTON) { PlaySE(SE_SELECT); - MenuZeroFillWindowRect(0, 10, 13, 13); + Menu_EraseWindowRect(0, 10, 13, 13); sub_80A36B8(gBGTilemapBuffers[1], 0, 10, 13, 3); ConvertIntToDecimalStringN(gStringVar1, ItemId_GetPrice(gSpecialVar_ItemId) / 2 * gTasks[taskId].data[1], STR_CONV_MODE_LEFT_ALIGN, 6); StringExpandPlaceholders(gStringVar4, gOtherText_CanPay); @@ -3110,8 +3110,8 @@ static void BuyMenuPrintItemQuantityAndPrice(u8 taskId) { sub_80A36B8(gBGTilemapBuffers[1], 0, 0, 31, 31); CloseMoneyWindow(0, 0); - MenuZeroFillWindowRect(0, 4, 13, 13); - MenuZeroFillWindowRect(0, 14, 29, 19); + Menu_EraseWindowRect(0, 4, 13, 13); + Menu_EraseWindowRect(0, 14, 29, 19); gTasks[taskId].func = sub_80A6760; } @@ -3229,7 +3229,7 @@ static void sub_80A6A84(u8 taskId) sub_80A4DA4(gBGTilemapBuffers[1]); CopyItemName(gSpecialVar_ItemId, gStringVar1); ConvertIntToDecimalStringN(gStringVar2, taskData[1], STR_CONV_MODE_LEFT_ALIGN, 3); - MenuZeroFillWindowRect(7, 6, 11, 13); + Menu_EraseWindowRect(7, 6, 11, 13); sub_80A7528(7); sub_80A3D5C(taskId); gTasks[taskId].func = sub_80A5E1C; @@ -3361,16 +3361,16 @@ static void sub_80A6DF0(u16 *a) { u8 r6 = (gUnknown_02038564 - 1) * 2; - MenuDrawTextWindow(7, 9 - r6, 13, 12); + Menu_DrawStdWindowFrame(7, 9 - r6, 13, 12); sub_80A4008(a, 8, 10 - r6, 5, r6 + 2); if (gUnknown_02038564 == 1) { - MenuPrint(sItemPopupMenuActions[sPopupMenuActionList[0]].text, 8, 10); + Menu_PrintText(sItemPopupMenuActions[sPopupMenuActionList[0]].text, 8, 10); } else { - MenuPrint(sItemPopupMenuActions[sPopupMenuActionList[0]].text, 8, 8); - MenuPrint(sItemPopupMenuActions[sPopupMenuActionList[1]].text, 8, 10); + Menu_PrintText(sItemPopupMenuActions[sPopupMenuActionList[0]].text, 8, 8); + Menu_PrintText(sItemPopupMenuActions[sPopupMenuActionList[1]].text, 8, 10); } InitMenu(0, 8, 10 - r6, gUnknown_02038564, 0, 5); sub_80A7528(2); @@ -3383,7 +3383,7 @@ static void sub_80A6EB8(u8 taskId) if (sPopupMenuSelection == 1) { PlaySE(SE_SELECT); - sPopupMenuSelection = MoveMenuCursor(-1); + sPopupMenuSelection = Menu_MoveCursor(-1); } } else if ((gMain.newAndRepeatedKeys & DPAD_ANY) == DPAD_DOWN) @@ -3391,7 +3391,7 @@ static void sub_80A6EB8(u8 taskId) if (sPopupMenuSelection + 1 < gUnknown_02038564) { PlaySE(SE_SELECT); - sPopupMenuSelection = MoveMenuCursor(1); + sPopupMenuSelection = Menu_MoveCursor(1); } } else if (gMain.newKeys & A_BUTTON) @@ -3559,7 +3559,7 @@ static void ItemListMenu_InitMenu(void) static void sub_80A73C0(void) { - sub_814AD7C(0x70, gBagPocketScrollStates[sCurrentBagPocket].cursorPos * 16 + 16); + MenuCursor_SetPos814AD7C(0x70, gBagPocketScrollStates[sCurrentBagPocket].cursorPos * 16 + 16); } static void sub_80A73F0(void) @@ -3569,8 +3569,8 @@ static void sub_80A73F0(void) static void sub_80A73FC(void) { - HandleDestroyMenuCursors(); - sub_814AD44(); + Menu_DestroyCursor(); + MenuCursor_Destroy814AD44(); } static void sub_80A740C(void) @@ -3669,7 +3669,7 @@ static void sub_80A756C(void) static void sub_80A7590(void) { - MenuZeroFillWindowRect(0, 13, 13, 20); + Menu_EraseWindowRect(0, 13, 13, 20); sub_80A756C(); } @@ -3748,7 +3748,7 @@ static void sub_80A7694(void) static void sub_80A76A0(void) { - MenuZeroFillWindowRect(14, 2, 29, 18); + Menu_EraseWindowRect(14, 2, 29, 18); sub_80A7678(); } @@ -3816,7 +3816,7 @@ static void sub_80A7768(void) const u8 *text = sItemPopupMenuActions[sPopupMenuActionList[r4->unk1 - 1]].text; int var = r4->unk1 - 1; - MenuPrint(text, 7, var * 2 + 1 + r4->unk3); + Menu_PrintText(text, 7, var * 2 + 1 + r4->unk3); } else { @@ -3828,7 +3828,7 @@ static void sub_80A7768(void) else text = sItemPopupMenuActions[sPopupMenuActionList[r4->unk1 - 1]].text; var = r4->unk1 - 1; - MenuPrint(text, (var >> 1) * 6 + 1, (var & 1) * 2 + 8); + Menu_PrintText(text, (var >> 1) * 6 + 1, (var & 1) * 2 + 8); } if (r4->unk1 == gUnknown_02038564) { diff --git a/src/field/item_use.c b/src/field/item_use.c index e1fdddce0..bd76db77e 100644 --- a/src/field/item_use.c +++ b/src/field/item_use.c @@ -123,7 +123,7 @@ void HandleDeniedItemUseMessage(u8 var1, u8 playerMenuStatus, const u8 *text) switch (playerMenuStatus) { case 0: // Item Menu - MenuZeroFillWindowRect(0, 13, 13, 20); + Menu_EraseWindowRect(0, 13, 13, 20); DisplayItemMessageOnField(var1, gStringVar4, CleanUpItemMenuMessage, 1); break; default: // Field @@ -312,7 +312,7 @@ void RunItemfinderResults(u8 taskId) void ExitItemfinder(u8 taskId) { - MenuZeroFillWindowRect(0, 14, 29, 19); + Menu_EraseWindowRect(0, 14, 29, 19); sub_8064E2C(); ScriptContext2_Disable(); DestroyTask(taskId); @@ -744,7 +744,7 @@ void ItemUseOutOfBattle_CoinCase(u8 taskId) if (!gTasks[taskId].data[2]) { - MenuZeroFillWindowRect(0, 0xD, 0xD, 0x14); + Menu_EraseWindowRect(0, 0xD, 0xD, 0x14); DisplayItemMessageOnField(taskId, gStringVar4, CleanUpItemMenuMessage, 1); } else @@ -770,7 +770,7 @@ void ItemUseOutOfBattle_SSTicket(u8 taskId) { if (gTasks[taskId].data[2] == 0) { - MenuZeroFillWindowRect(0, 0xD, 0xD, 0x14); + Menu_EraseWindowRect(0, 0xD, 0xD, 0x14); DisplayItemMessageOnField(taskId, gUnknown_083D61DC[ItemId_GetSecondaryId(gSpecialVar_ItemId)], sub_80C9BB8, 1); } else @@ -875,7 +875,7 @@ void ItemUseOutOfBattle_RareCandy(u8 taskId) void ItemUseOutOfBattle_TMHM(u8 taskId) { - MenuZeroFillWindowRect(0, 0xD, 0xD, 0x14); + Menu_EraseWindowRect(0, 0xD, 0xD, 0x14); if (gSpecialVar_ItemId >= ITEM_HM01) DisplayItemMessageOnField(taskId, gOtherText_BootedHM, sub_80C9EE4, 1); // HM @@ -1022,7 +1022,7 @@ void ItemUseInBattle_PokeBall(u8 var) } else { - MenuZeroFillWindowRect(0, 0xD, 0xD, 0x14); + Menu_EraseWindowRect(0, 0xD, 0xD, 0x14); DisplayItemMessageOnField(var, gOtherText_BoxIsFull, CleanUpItemMenuMessage, 1); } } @@ -1047,7 +1047,7 @@ void ItemUseInBattle_StatIncrease(u8 taskId) { u16 partyId = gBattlePartyID[gBankInMenu]; - MenuZeroFillWindowRect(0, 0xD, 0xD, 0x14); + Menu_EraseWindowRect(0, 0xD, 0xD, 0x14); if (ExecuteTableBasedItemEffect_(&gPlayerParty[partyId], gSpecialVar_ItemId, partyId, 0) != FALSE) { @@ -1096,7 +1096,7 @@ void ItemUseInBattle_PPRecovery(u8 var) void unref_sub_80CA448(u8 var) { - MenuZeroFillWindowRect(0, 0xD, 0xD, 0x14); + Menu_EraseWindowRect(0, 0xD, 0xD, 0x14); if (ExecuteTableBasedItemEffect__(0, gSpecialVar_ItemId, 0) == FALSE) { @@ -1113,7 +1113,7 @@ void unref_sub_80CA448(u8 var) void ItemUseInBattle_Escape(u8 taskId) { - MenuZeroFillWindowRect(0, 0xD, 0xD, 0x14); + Menu_EraseWindowRect(0, 0xD, 0xD, 0x14); if((gBattleTypeFlags & BATTLE_TYPE_TRAINER) == FALSE) { diff --git a/src/field/map_name_popup.c b/src/field/map_name_popup.c index 2e2dfc72e..49a470cc1 100644 --- a/src/field/map_name_popup.c +++ b/src/field/map_name_popup.c @@ -89,8 +89,8 @@ void HideMapNamePopup(void) { if (FuncIsActiveTask(Task_MapNamePopup)) { - MenuLoadTextWindowGraphics(); - MenuZeroFillWindowRect(0, 0, 13, 3); + Menu_LoadStdFrameGraphics(); + Menu_EraseWindowRect(0, 0, 13, 3); REG_BG0VOFS = 0; DestroyTask(sTaskId); } @@ -100,8 +100,8 @@ void DrawMapNamePopup(void) { u8 name[20]; - MenuLoadTextWindowGraphics_OverrideFrameType(0); + Menu_LoadStdFrameGraphicsOverrideStyle(0); GetMapSectionName(name, gMapHeader.regionMapSectionId, 0); - MenuDrawTextWindow(0, 0, 13, 3); + Menu_DrawStdWindowFrame(0, 0, 13, 3); sub_8072BD8(name, 1, 1, 0x60); } diff --git a/src/field/mauville_man.c b/src/field/mauville_man.c index 4db513f65..0a841eed1 100644 --- a/src/field/mauville_man.c +++ b/src/field/mauville_man.c @@ -345,7 +345,7 @@ void PrepareSongText(void) void ScrSpecial_PlayBardSong(void) { StartBardSong(gSpecialVar_0x8004); - MenuDisplayMessageBox(); + Menu_DisplayDialogueFrame(); ScriptContext1_Stop(); } @@ -858,8 +858,8 @@ static void Task_BardSong(u8 taskId) { case 0: // Initialize song PrepareSongText(); - InitWindowFromConfig(gMenuWindowPtr, &gWindowConfig_81E6CE4); - sub_8002EB0(gMenuWindowPtr, gStringVar4, 2, 4, 15); + Text_InitWindowWithTemplate(gMenuWindowPtr, &gWindowTemplate_81E6CE4); + Text_InitWindow8002EB0(gMenuWindowPtr, gStringVar4, 2, 4, 15); task->data[1] = 0; task->data[2] = 0; task->tCharIndex = 0; @@ -921,7 +921,7 @@ static void Task_BardSong(u8 taskId) } else if (gStringVar4[task->tCharIndex] == CHAR_SPACE) { - sub_8003418(gMenuWindowPtr); + Text_PrintWindowSimple(gMenuWindowPtr); task->tCharIndex++; task->tState = 2; task->data[2] = 0; @@ -941,7 +941,7 @@ static void Task_BardSong(u8 taskId) else if (gStringVar4[task->tCharIndex] == CHAR_SONG_WORD_SEPARATOR) { gStringVar4[task->tCharIndex] = CHAR_SPACE; // restore it back to a space - sub_8003418(gMenuWindowPtr); + Text_PrintWindowSimple(gMenuWindowPtr); task->tCharIndex++; task->data[2] = 0; } @@ -950,7 +950,7 @@ static void Task_BardSong(u8 taskId) switch (task->data[1]) { case 0: - sub_8003418(gMenuWindowPtr); + Text_PrintWindowSimple(gMenuWindowPtr); task->data[1]++; break; case 1: @@ -1219,7 +1219,7 @@ static void PrintStoryList(void) { s32 i; - MenuDrawTextWindow(0, 0, 25, 4 + GetFreeStorySlot() * 2); + Menu_DrawStdWindowFrame(0, 0, 25, 4 + GetFreeStorySlot() * 2); for (i = 0; i < 4; i++) { struct MauvilleManStoryteller *storyteller = &gSaveBlock1.mauvilleMan.storyteller; @@ -1227,9 +1227,9 @@ static void PrintStoryList(void) if (stat == 0) break; - MenuPrint(GetStoryTitleByStat(stat), 1, 2 + i * 2); + Menu_PrintText(GetStoryTitleByStat(stat), 1, 2 + i * 2); } - MenuPrint(gPCText_Cancel, 1, 2 + i * 2); + Menu_PrintText(gPCText_Cancel, 1, 2 + i * 2); } static u8 gUnknown_03000748; @@ -1247,7 +1247,7 @@ static void Task_StoryListMenu(u8 taskId) task->data[0]++; break; case 1: - selection = ProcessMenuInput(); + selection = Menu_ProcessInput(); if (selection == -2) break; if (selection == -1 || selection == GetFreeStorySlot()) @@ -1259,8 +1259,8 @@ static void Task_StoryListMenu(u8 taskId) gSpecialVar_Result = 1; gUnknown_03000748 = selection; } - HandleDestroyMenuCursors(); - MenuZeroFillWindowRect(0, 0, 25, 12); + Menu_DestroyCursor(); + Menu_EraseWindowRect(0, 0, 25, 12); DestroyTask(taskId); EnableBothScriptContexts(); break; diff --git a/src/field/menu_helpers.c b/src/field/menu_helpers.c index e3ef0c790..76f0d367e 100644 --- a/src/field/menu_helpers.c +++ b/src/field/menu_helpers.c @@ -135,7 +135,7 @@ void sub_80F9020(void) // display message box, fill box with tile if tile is not zero, print string static void PrintMessage(const u8 *str, u16 tile) { - MenuDisplayMessageBox(); + Menu_DisplayDialogueFrame(); if (tile) { sub_80A3FA0(&gBGTilemapBuffers[1][0], 2, 15, 26, 4, tile); @@ -145,7 +145,7 @@ static void PrintMessage(const u8 *str, u16 tile) static void sub_80F9090(u8 taskId) { - if (MenuUpdateWindowText() == TRUE) + if (Menu_UpdateWindowText() == TRUE) { gUnknown_0300074C(taskId); } @@ -160,7 +160,7 @@ void DisplayItemMessageOnField(u8 taskId, const u8 *str, TaskFunc callback, u16 static void Task_CallYesOrNoCallback(u8 taskId) { - switch (ProcessMenuInputNoWrap_()) + switch (Menu_ProcessInputNoWrap_()) { case 0: PlaySE(SE_SELECT); @@ -196,7 +196,7 @@ static void PrintStringWithPalette(const u8 *str, u8 paletteNum, u8 left, u8 top StringCopy(gStringVar4, str); } - MenuPrint(gStringVar4, left, top); + Menu_PrintText(gStringVar4, left, top); } // unused @@ -209,7 +209,7 @@ void PrintNumberWithPalette(s32 value, u8 paletteNum, u8 n, u8 mode, u8 left, u8 } else { - MenuPrint(gStringVar1, left, top); + Menu_PrintText(gStringVar1, left, top); } } diff --git a/src/field/money.c b/src/field/money.c index d0f0ab1f6..b85ed8009 100644 --- a/src/field/money.c +++ b/src/field/money.c @@ -143,12 +143,12 @@ void PrintMoneyAmount(u32 amount, u8 size, u8 x, u8 y) if (stringWidth >= (size + 1) * 8) { - MenuPrint(buffer, x, y); + Menu_PrintText(buffer, x, y); } else { int xPlusOne = x + 1; - MenuPrint_PixelCoords(buffer, (xPlusOne + size) * 8 - stringWidth, y * 8, 1); + Menu_PrintTextPixelCoords(buffer, (xPlusOne + size) * 8 - stringWidth, y * 8, 1); } } @@ -275,7 +275,7 @@ void UpdateMoneyWindow(u32 amount, u8 x, u8 y) void OpenMoneyWindow(u32 amount, u8 x, u8 y) { - MenuDrawTextWindow(x, y, x + 13, y + 3); + Menu_DrawStdWindowFrame(x, y, x + 13, y + 3); UpdateMoneyWindow(amount, x, y); LoadCompressedObjectPic(gUnknown_083CF584); @@ -288,7 +288,7 @@ void CloseMoneyWindow(u8 x, u8 y) { DestroySpriteAndFreeResources(&gSprites[gUnknown_02038734]); FreeSpritePaletteByTag(SPRITE_TAG_MONEY); - MenuZeroFillWindowRect(x, y, x + 13, y + 3); + Menu_EraseWindowRect(x, y, x + 13, y + 3); } bool8 HasEnoughMoneyFor(void) diff --git a/src/field/overworld.c b/src/field/overworld.c index e239daec7..9fab20876 100644 --- a/src/field/overworld.c +++ b/src/field/overworld.c @@ -1456,8 +1456,8 @@ bool32 sub_805483C(u8 *a1) case 4: sub_8054814(); sub_8054C54(); - SetUpWindowConfig(&gWindowConfig_81E6C3C); - InitMenuWindow(&gWindowConfig_81E6CE4); + Text_LoadWindowTemplate(&gWindowTemplate_81E6C3C); + InitMenuWindow(&gWindowTemplate_81E6CE4); (*a1)++; break; case 5: @@ -1522,8 +1522,8 @@ bool32 sub_805493C(u8 *a1, u32 a2) case 4: sub_8054814(); sub_8054C54(); - SetUpWindowConfig(&gWindowConfig_81E6C3C); - InitMenuWindow(&gWindowConfig_81E6CE4); + Text_LoadWindowTemplate(&gWindowTemplate_81E6C3C); + InitMenuWindow(&gWindowTemplate_81E6CE4); (*a1)++; break; case 5: @@ -1612,8 +1612,8 @@ bool32 sub_8054A9C(u8 *a1) case 3: sub_8054814(); sub_8054C54(); - SetUpWindowConfig(&gWindowConfig_81E6C3C); - InitMenuWindow(&gWindowConfig_81E6CE4); + Text_LoadWindowTemplate(&gWindowTemplate_81E6C3C); + InitMenuWindow(&gWindowTemplate_81E6CE4); (*a1)++; break; case 4: @@ -1695,8 +1695,8 @@ void sub_8054C2C(void) { sub_8054814(); sub_8054C54(); - SetUpWindowConfig(&gWindowConfig_81E6C3C); - InitMenuWindow(&gWindowConfig_81E6CE4); + Text_LoadWindowTemplate(&gWindowTemplate_81E6C3C); + InitMenuWindow(&gWindowTemplate_81E6CE4); mapdata_load_assets_to_gpu_and_full_redraw(); } diff --git a/src/field/party_menu.c b/src/field/party_menu.c index 790aede60..9cad5bd73 100644 --- a/src/field/party_menu.c +++ b/src/field/party_menu.c @@ -679,11 +679,11 @@ bool8 InitPartyMenu(void) gMain.state++; break; case 7: - SetUpWindowConfig(&gWindowConfig_81E6C90); + Text_LoadWindowTemplate(&gWindowTemplate_81E6C90); gMain.state++; break; case 8: - InitWindowFromConfig(&gUnknown_03004210, &gWindowConfig_81E6C90); + Text_InitWindowWithTemplate(&gUnknown_03004210, &gWindowTemplate_81E6C90); MultistepInitWindowTileData(&gUnknown_03004210, 1); gMain.state++; break; @@ -716,7 +716,7 @@ bool8 InitPartyMenu(void) } break; case 13: - MultistepInitMenuWindowBegin(&gWindowConfig_81E6CC8); + MultistepInitMenuWindowBegin(&gWindowTemplate_81E6CC8); gMain.state++; break; case 14: @@ -2676,26 +2676,26 @@ void PrintPartyMenuPromptText(u8 textId, u8 b) switch (b) { case 0: - MenuDrawTextWindow(0, 16, 23, 19); + Menu_DrawStdWindowFrame(0, 16, 23, 19); break; case 1: - MenuDrawTextWindow(0, 16, 19, 19); + Menu_DrawStdWindowFrame(0, 16, 19, 19); break; case 2: - MenuDrawTextWindow(0, 16, 22, 19); + Menu_DrawStdWindowFrame(0, 16, 22, 19); break; case 3: - MenuDrawTextWindow(0, 16, 18, 19); + Menu_DrawStdWindowFrame(0, 16, 18, 19); break; } - MenuPrint(PartyMenuPromptTexts[textId], 1, 17); + Menu_PrintText(PartyMenuPromptTexts[textId], 1, 17); } } void sub_806D5A4(void) { - MenuZeroFillWindowRect(0, 16, 29, 19); + Menu_EraseWindowRect(0, 16, 29, 19); } void sub_806D5B8(u8 monIndex) @@ -2706,7 +2706,7 @@ void sub_806D5B8(u8 monIndex) u8 right = gUnknown_08376948[IsDoubleBattle()][monIndex].right; u8 bottom = gUnknown_08376948[IsDoubleBattle()][monIndex].bottom; - ZeroFillWindowRect(&gUnknown_03004210, left, top, right, bottom); + Text_EraseWindowRect(&gUnknown_03004210, left, top, right, bottom); var1 = 0; CpuFastSet(&var1, OBJ_VRAM1 + monIndex * 0x400, 0x1000100); @@ -2720,7 +2720,7 @@ void sub_806D668(u8 monIndex) u8 right = gUnknown_08376978[IsDoubleBattle()][monIndex].right; u8 bottom = gUnknown_08376978[IsDoubleBattle()][monIndex].bottom; - ZeroFillWindowRect(&gUnknown_03004210, left, top, right, bottom); + Text_EraseWindowRect(&gUnknown_03004210, left, top, right, bottom); var1 = 0; CpuFastSet(&var1, OBJ_VRAM1 + 0x300 + monIndex * 0x400, 0x1000040); @@ -3313,7 +3313,7 @@ void PartyMenuDoPrintMonNickname(u8 monIndex, int b, const u8 *nameBuffer) { u32 var1 = 0; CpuFastSet(&var1, gTileBuffer, 0x1000100); - sub_8004E3C((struct WindowConfig *)&gWindowConfig_81E6CAC, gTileBuffer, nameBuffer); + Text_InitWindow8004E3C((struct WindowTemplate *)&gWindowTemplate_81E6CAC, gTileBuffer, nameBuffer); CpuFastSet(gTileBuffer, OBJ_VRAM1 + (monIndex * 0x400), 128); } @@ -3423,7 +3423,7 @@ void PartyMenuDoPrintLevel(u8 monIndex, u8 menuLayout, u8 level) var1 = 0; CpuFastSet(&var1, gUnknown_02039460, 0x1000020); - sub_8004E3C((struct WindowConfig *)&gWindowConfig_81E6CAC, gUnknown_02039460 - 0x100 /*gTileBuffer*/, gStringVar1); + Text_InitWindow8004E3C((struct WindowTemplate *)&gWindowTemplate_81E6CAC, gUnknown_02039460 - 0x100 /*gTileBuffer*/, gStringVar1); CpuFastSet(gUnknown_02039460, OBJ_VRAM1 + 0x200 + (monIndex * 0x400), 32); } @@ -3517,7 +3517,7 @@ void PartyMenuDoPrintHP(u8 monIndex, u8 b, u16 currentHP, u16 maxHP) var = 0; CpuFastSet(&var, gUnknown_02039460, 0x1000040); - sub_8004E3C((struct WindowConfig *)&gWindowConfig_81E6CAC, gUnknown_02039460 - 0x100 /*gTileBuffer*/, gStringVar1); + Text_InitWindow8004E3C((struct WindowTemplate *)&gWindowTemplate_81E6CAC, gUnknown_02039460 - 0x100 /*gTileBuffer*/, gStringVar1); CpuFastSet(gUnknown_02039460, OBJ_VRAM1 + 0x300 + (monIndex * 0x400), 64); } @@ -3667,8 +3667,8 @@ void ClosePartyPopupMenu(u8 index, const struct PartyPopupMenu *menu) SetPartyPopupMenuOffsets(index, &left, &top, menu); - MenuZeroFillWindowRect(left, top, left + menu[index].width, menu[index].numChoices * 2 + top + 1); - HandleDestroyMenuCursors(); + Menu_EraseWindowRect(left, top, left + menu[index].width, menu[index].numChoices * 2 + top + 1); + Menu_DestroyCursor(); } TaskFunc PartyMenuGetPopupMenuFunc(u8 menuIndex, const struct PartyPopupMenu *menus, const struct MenuAction2 *menuActions, u8 itemIndex) @@ -3683,7 +3683,7 @@ u8 sub_806E834(const u8 *message, u8 arg1) gUnknown_0202E8F6 = 1; - MenuDrawTextWindow(WINDOW_LEFT, 14, WINDOW_RIGHT, 19); + Menu_DrawStdWindowFrame(WINDOW_LEFT, 14, WINDOW_RIGHT, 19); MenuPrintMessage(message, WINDOW_LEFT + 1, 15); taskId = CreateTask(sub_806E884, 1); @@ -3694,11 +3694,11 @@ u8 sub_806E834(const u8 *message, u8 arg1) static void sub_806E884(u8 taskId) { - if (MenuUpdateWindowText()) + if (Menu_UpdateWindowText()) { gUnknown_0202E8F6 = 0; if (gTasks[taskId].data[0] == 0) - MenuZeroFillWindowRect(WINDOW_LEFT, 14, WINDOW_RIGHT, 19); + Menu_EraseWindowRect(WINDOW_LEFT, 14, WINDOW_RIGHT, 19); DestroyTask(taskId); } } @@ -3788,13 +3788,13 @@ void party_menu_link_mon_held_item_object(u8 taskId) void PartyMenuTryGiveMonHeldItem_806EACC(u8 taskId) { - s8 selection = ProcessMenuInputNoWrap_(); + s8 selection = Menu_ProcessInputNoWrap_(); if (selection == 0) { u16 currentItem; - MenuZeroFillWindowRect(23, 8, 29, 13); + Menu_EraseWindowRect(23, 8, 29, 13); currentItem = GetMonData(ewram1C000.pokemon, MON_DATA_HELD_ITEM); RemoveBagItem(ewram1C000.unk6, 1); if (AddBagItem(currentItem, 1) == TRUE) @@ -3823,7 +3823,7 @@ void PartyMenuTryGiveMonHeldItem_806EACC(u8 taskId) return; if (selection == -1) PlaySE(SE_SELECT); - MenuZeroFillWindowRect(23, 8, 29, 13); + Menu_EraseWindowRect(23, 8, 29, 13); } gTasks[taskId].func = party_menu_link_mon_held_item_object; } @@ -3925,7 +3925,7 @@ void DoTakeMail(u8 taskId, TaskFunc func) void Task_LoseMailMessage(u8 taskId) { - s8 selection = ProcessMenuInputNoWrap_(); + s8 selection = Menu_ProcessInputNoWrap_(); if (selection == 0) { @@ -3938,7 +3938,7 @@ void Task_LoseMailMessage(u8 taskId) { sub_806E834(gOtherText_BagFullCannotRemoveItem, 0); } - MenuZeroFillWindowRect(23, 8, 29, 13); + Menu_EraseWindowRect(23, 8, 29, 13); gTasks[taskId].func = party_menu_link_mon_held_item_object; } else @@ -3947,8 +3947,8 @@ void Task_LoseMailMessage(u8 taskId) return; if (selection == -1) PlaySE(SE_SELECT); - MenuZeroFillWindowRect(23, 8, 29, 13); - MenuZeroFillWindowRect(0, 14, 29, 19); + Menu_EraseWindowRect(23, 8, 29, 13); + Menu_EraseWindowRect(0, 14, 29, 19); gTasks[taskId].func = party_menu_link_mon_held_item_object; } } @@ -3964,11 +3964,11 @@ void Task_ConfirmLoseMailMessage(u8 taskId) void Task_TakeHeldMail(u8 taskId) { - s8 selection = ProcessMenuInputNoWrap_(); + s8 selection = Menu_ProcessInputNoWrap_(); if (selection == 0) { - MenuZeroFillWindowRect(23, 8, 29, 13); + Menu_EraseWindowRect(23, 8, 29, 13); if (TakeMailFromMon2(ewram1C000.pokemon) != 0xFF) sub_806E834(gOtherText_MailWasSent, 0); else @@ -3981,7 +3981,7 @@ void Task_TakeHeldMail(u8 taskId) return; if (selection == -1) PlaySE(SE_SELECT); - MenuZeroFillWindowRect(23, 8, 29, 13); + Menu_EraseWindowRect(23, 8, 29, 13); sub_806E834(gOtherText_MailRemovedMessageLost, 1); gTasks[taskId].func = Task_ConfirmLoseMailMessage; } @@ -4126,11 +4126,11 @@ void sub_806F358(u8 taskId) void sub_806F390(u8 taskId) { - s8 selection = ProcessMenuInputNoWrap_(); + s8 selection = Menu_ProcessInputNoWrap_(); if (selection == 0) { - MenuZeroFillWindowRect(23, 8, 29, 13); + Menu_EraseWindowRect(23, 8, 29, 13); sub_806E834(gOtherText_WhichMoveToForget2, 1); gTasks[taskId].func = sub_806F44C; } @@ -4206,7 +4206,7 @@ void StopTryingToTeachMove_806F588(u8 taskId) void StopTryingToTeachMove_806F614(u8 taskId) { - MenuZeroFillWindowRect(23, 8, 29, 13); + Menu_EraseWindowRect(23, 8, 29, 13); StringCopy(gStringVar2, gMoveNames[ewram1C000.unk8]); StringExpandPlaceholders(gStringVar4, gOtherText_StopTryingTo); sub_806E834(gStringVar4, 1); @@ -4224,11 +4224,11 @@ void StopTryingToTeachMove_806F67C(u8 taskId) void StopTryingToTeachMove_806F6B4(u8 taskId) { - s8 selection = ProcessMenuInputNoWrap_(); + s8 selection = Menu_ProcessInputNoWrap_(); if (selection == 0) { - MenuZeroFillWindowRect(23, 8, 29, 13); + Menu_EraseWindowRect(23, 8, 29, 13); GetMonNickname(ewram1C000.pokemon, gStringVar1); StringCopy(gStringVar2, gMoveNames[ewram1C000.unk8]); StringExpandPlaceholders(gStringVar4, gOtherText_DidNotLearnMove2); @@ -4241,7 +4241,7 @@ void StopTryingToTeachMove_806F6B4(u8 taskId) return; if (selection == -1) PlaySE(SE_SELECT); - MenuZeroFillWindowRect(23, 8, 29, 13); + Menu_EraseWindowRect(23, 8, 29, 13); GetMonNickname(ewram1C000.pokemon, gStringVar1); StringCopy(gStringVar2, gMoveNames[ewram1C000.unk8]); StringExpandPlaceholders(gStringVar4, gOtherText_WantsToLearn); @@ -4592,7 +4592,7 @@ void sub_8070088(u8 taskId) else { gUnknown_0202E8F4 = 1; - MenuZeroFillWindowRect(WINDOW_LEFT, 14, WINDOW_RIGHT, 19); + Menu_EraseWindowRect(WINDOW_LEFT, 14, WINDOW_RIGHT, 19); PlaySE(SE_KAIFUKU); PartyMenuUpdateLevelOrStatus(ewram1C000.pokemon, ewram1C000.unk5); task_pc_turn_off(&gUnknown_083769A8[IsDoubleBattle() * 12 + ewram1C000.unk5 * 2], 9); @@ -4649,12 +4649,12 @@ void CreateItemUseMoveMenu(u8 partyMonIndex) u8 i; r6 = 0; - MenuDrawTextWindow(19, 10, 29, 19); + Menu_DrawStdWindowFrame(19, 10, 29, 19); for (i = 0; i < 4; i++) { u16 move = GetMonData(&gPlayerParty[partyMonIndex], MON_DATA_MOVE1 + i); - MenuPrint(gMoveNames[move], 20, i * 2 + 11); + Menu_PrintText(gMoveNames[move], 20, i * 2 + 11); if (move != 0) r6++; } @@ -4666,12 +4666,12 @@ void Task_HandleItemUseMoveMenuInput(u8 taskId) if (gMain.newKeys & DPAD_UP) { PlaySE(SE_SELECT); - MoveMenuCursor(-1); + Menu_MoveCursor(-1); } else if (gMain.newKeys & DPAD_DOWN) { PlaySE(SE_SELECT); - MoveMenuCursor(1); + Menu_MoveCursor(1); } else if (gMain.newKeys & A_BUTTON) { @@ -4713,17 +4713,17 @@ void DoPPRecoveryItemEffect(u8 taskId, u16 item, TaskFunc c) void ItemUseMoveMenu_HandleMoveSelection(u8 taskId) { - HandleDestroyMenuCursors(); - MenuZeroFillWindowRect(19, 10, 29, 19); + Menu_DestroyCursor(); + Menu_EraseWindowRect(19, 10, 29, 19); sub_806D5A4(); - gTasks[taskId].data[11] = GetMenuCursorPos(); + gTasks[taskId].data[11] = Menu_GetCursorPos(); DoRecoverPP(taskId); } void ItemUseMoveMenu_HandleCancel(u8 taskId) { - HandleDestroyMenuCursors(); - MenuZeroFillWindowRect(19, 10, 29, 19); + Menu_DestroyCursor(); + Menu_EraseWindowRect(19, 10, 29, 19); if (gMain.inBattle) gTasks[ewram1C000.unk4].func = HandleBattlePartyMenu; else @@ -4852,7 +4852,7 @@ void PrintStatGrowthsInLevelUpWindow(u8 taskId) { u8 i; - MenuDrawTextWindow(11, 0, 29, 7); + Menu_DrawStdWindowFrame(11, 0, 29, 7); for (i = 0; i < NUM_STATS; i++) { @@ -4868,12 +4868,12 @@ void PrintStatGrowthsInLevelUpWindow(u8 taskId) x = (i / 3) * 9 + 11; y = ((i % 3) << 1) + 1; - MenuPrint_PixelCoords(StatNames[i], (x + 1) * 8, y * 8, 1); + Menu_PrintTextPixelCoords(StatNames[i], (x + 1) * 8, y * 8, 1); if (i == 2) - MenuPrint_PixelCoords(gOtherText_TallPlusAndRightArrow, (x + 6) * 8 + 6, y * 8, 0); + Menu_PrintTextPixelCoords(gOtherText_TallPlusAndRightArrow, (x + 6) * 8 + 6, y * 8, 0); else - MenuPrint_PixelCoords(gOtherText_TallPlusAndRightArrow, (x + 6) * 8 + 6, y * 8, 1); + Menu_PrintTextPixelCoords(gOtherText_TallPlusAndRightArrow, (x + 6) * 8 + 6, y * 8, 1); gStringVar1[0] = EXT_CTRL_CODE_BEGIN; gStringVar1[1] = 0x14; @@ -4881,7 +4881,7 @@ void PrintStatGrowthsInLevelUpWindow(u8 taskId) ConvertIntToDecimalStringN(gStringVar1 + 3, ewram1B000.statGrowths[i], 1, 2); - MenuPrint_PixelCoords(gStringVar1, (x + 6) * 8 + 12, y * 8, 0); + Menu_PrintTextPixelCoords(gStringVar1, (x + 6) * 8 + 12, y * 8, 0); } } #elif GERMAN @@ -4897,7 +4897,7 @@ void PrintStatGrowthsInLevelUpWindow(u8 taskId) { movs r1, 0\n\ movs r2, 0x1D\n\ movs r3, 0x7\n\ - bl MenuDrawTextWindow\n\ + bl Menu_DrawStdWindowFrame\n\ movs r7, 0\n\ ldr r0, _0807092C @ =gStringVar1\n\ mov r10, r0\n\ @@ -4981,7 +4981,7 @@ _0807086C:\n\ mov r0, r10\n\ adds r1, r4, 0\n\ adds r2, r5, 0\n\ - bl MenuPrint\n\ + bl Menu_PrintText\n\ adds r0, r7, 0x1\n\ lsls r0, 24\n\ lsrs r7, r0, 24\n\ @@ -5028,7 +5028,7 @@ void PrintNewStatsInLevelUpWindow(u8 taskId) gStringVar1[2] = 0x06; ConvertIntToDecimalStringN(gStringVar1 + 3, ewram1B000.statGrowths[newStatIndex], 1, 3); - MenuPrint_PixelCoords(gStringVar1, (x + 6) * 8 + 6, y * 8, 0); + Menu_PrintTextPixelCoords(gStringVar1, (x + 6) * 8 + 6, y * 8, 0); } } @@ -5070,7 +5070,7 @@ void Task_RareCandy3(u8 taskId) u16 learnedMove; u16 evolutionSpecies; - MenuZeroFillWindowRect(11, 0, 29, 7); + Menu_EraseWindowRect(11, 0, 29, 7); learnedMove = MonTryLearningNewMove(ewram1C000.pokemon, TRUE); ewram1B000.unk282 = 1; diff --git a/src/field/player_pc.c b/src/field/player_pc.c index 928cb9689..0d5c5234b 100644 --- a/src/field/player_pc.c +++ b/src/field/player_pc.c @@ -217,8 +217,8 @@ void PlayerPC(void) static void InitPlayerPCMenu(u8 taskId) { - MenuDrawTextWindow(0, 0, 10, gPcItemMenuOptionsNum * 2 + 1); - PrintMenuItemsReordered(1, 1, gPcItemMenuOptionsNum, sPlayerPCMenuActions, gPcItemMenuOptionOrder); + Menu_DrawStdWindowFrame(0, 0, 10, gPcItemMenuOptionsNum * 2 + 1); + Menu_PrintItemsReordered(1, 1, gPcItemMenuOptionsNum, sPlayerPCMenuActions, gPcItemMenuOptionOrder); InitMenu(0, 1, 1, gPcItemMenuOptionsNum, 0, 9); TASK.FUNC = PlayerPCProcessMenuInput; } @@ -228,22 +228,22 @@ static void PlayerPCProcessMenuInput(u8 taskId) if (gMain.newAndRepeatedKeys & DPAD_UP) { PlaySE(SE_SELECT); - MoveMenuCursor(-1); + Menu_MoveCursor(-1); } else if (gMain.newAndRepeatedKeys & DPAD_DOWN) { PlaySE(SE_SELECT); - MoveMenuCursor(1); + Menu_MoveCursor(1); } else if (gMain.newKeys & A_BUTTON) { - HandleDestroyMenuCursors(); + Menu_DestroyCursor(); PlaySE(SE_SELECT); - sPlayerPCMenuActions[gPcItemMenuOptionOrder[GetMenuCursorPos()]].func(taskId); + sPlayerPCMenuActions[gPcItemMenuOptionOrder[Menu_GetCursorPos()]].func(taskId); } else if (gMain.newKeys & B_BUTTON) { - HandleDestroyMenuCursors(); + Menu_DestroyCursor(); PlaySE(SE_SELECT); sPlayerPCMenuActions[gPcItemMenuOptionsNum[gPcItemMenuOptionOrder - 1]].func(taskId); // run EXIT. } @@ -262,7 +262,7 @@ static void PlayerPC_ItemStorage(u8 taskId) static void PlayerPC_Mailbox(u8 taskId) { - MenuZeroFillWindowRect(0, 0, 10, 9); + Menu_EraseWindowRect(0, 0, 10, 9); eMailboxInfo.count = GetMailboxMailCount(); if (eMailboxInfo.count == 0) @@ -280,7 +280,7 @@ static void PlayerPC_Mailbox(u8 taskId) static void PlayerPC_Decoration(u8 var) { - MenuZeroFillWindowRect(0, 0, 10, 9); + Menu_EraseWindowRect(0, 0, 10, 9); DoPlayerPCDecoration(var); } @@ -288,7 +288,7 @@ static void PlayerPC_TurnOff(u8 taskId) { if (gPcItemMenuOptionsNum == 4) // if the option count is 4, we are at the bedroom PC and not player PC, so do gender specific handling. { - MenuZeroFillWindowRect(0, 0, 0x1D, 0x13); + Menu_EraseWindowRect(0, 0, 0x1D, 0x13); if (gSaveBlock2.playerGender == MALE) ScriptContext1_SetupScript(gBrendanHouse_TurnPCOff); @@ -297,7 +297,7 @@ static void PlayerPC_TurnOff(u8 taskId) } else { - MenuZeroFillWindowRect(0, 0, 10, 9); + Menu_EraseWindowRect(0, 0, 10, 9); EnableBothScriptContexts(); } DestroyTask(taskId); @@ -305,17 +305,17 @@ static void PlayerPC_TurnOff(u8 taskId) static void InitItemStorageMenu(u8 var) { - MenuZeroFillWindowRect(0, 0, 10, 9); - MenuDrawTextWindow(0, 0, 11, 9); - PrintMenuItems(1, 1, 4, (struct MenuAction *)gPCText_ItemPCOptionsText); + Menu_EraseWindowRect(0, 0, 10, 9); + Menu_DrawStdWindowFrame(0, 0, 11, 9); + Menu_PrintItems(1, 1, 4, (struct MenuAction *)gPCText_ItemPCOptionsText); InitMenu(0, 1, 1, 4, var, 10); ItemStorageMenuPrint(gPCText_OptionDescList[var]); } static void ItemStorageMenuPrint(const u8 *textPtr) { - MenuFillWindowRectWithBlankTile(2, 15, 27, 18); - MenuPrint(textPtr, 2, 15); + Menu_BlankWindowRect(2, 15, 27, 18); + Menu_PrintText(textPtr, 2, 15); } static void ItemStorageMenuProcessInput(u8 var) @@ -323,23 +323,23 @@ static void ItemStorageMenuProcessInput(u8 var) if (gMain.newAndRepeatedKeys & DPAD_UP) { PlaySE(SE_SELECT); - MoveMenuCursor(-1); - ItemStorageMenuPrint(gPCText_OptionDescList[GetMenuCursorPos()]); + Menu_MoveCursor(-1); + ItemStorageMenuPrint(gPCText_OptionDescList[Menu_GetCursorPos()]); } else if (gMain.newAndRepeatedKeys & DPAD_DOWN) { PlaySE(SE_SELECT); - MoveMenuCursor(1); - ItemStorageMenuPrint(gPCText_OptionDescList[GetMenuCursorPos()]); + Menu_MoveCursor(1); + ItemStorageMenuPrint(gPCText_OptionDescList[Menu_GetCursorPos()]); } else if (gMain.newKeys & A_BUTTON) { PlaySE(SE_SELECT); - gPCText_ItemPCOptionsText[GetMenuCursorPos()].func(var); + gPCText_ItemPCOptionsText[Menu_GetCursorPos()].func(var); } else if (gMain.newKeys & B_BUTTON) { - HandleDestroyMenuCursors(); + Menu_DestroyCursor(); PlaySE(SE_SELECT); gPCText_ItemPCOptionsText[ITEMPC_MENU_EXIT].func(var); } @@ -368,7 +368,7 @@ static void ItemStorage_HandleReturnToProcessInput(u8 taskId) void ItemStorage_ReturnToMenuAfterDeposit(void) { - MenuDisplayMessageBox(); + Menu_DisplayDialogueFrame(); InitItemStorageMenu(ITEMPC_MENU_DEPOSIT); CreateTask(ItemStorage_HandleReturnToProcessInput, 0); pal_fill_black(); @@ -378,13 +378,13 @@ static void ItemStorage_Withdraw(u8 taskId) { s16 *data = TASK.data; - HandleDestroyMenuCursors(); - MenuZeroFillWindowRect(0, 0, 11, 9); + Menu_DestroyCursor(); + Menu_EraseWindowRect(0, 0, 11, 9); NUM_ITEMS = CountUsedPCItemSlots(); if (NUM_ITEMS != 0) { - MenuZeroFillWindowRect(0, 14, 29, 19); + Menu_EraseWindowRect(0, 14, 29, 19); CURRENT_ITEM_STORAGE_MENU = ITEMPC_MENU_WITHDRAW; PAGE_INDEX = 0; ITEMS_ABOVE_TOP = 0; @@ -400,13 +400,13 @@ static void ItemStorage_Toss(u8 taskId) { s16 *data = TASK.data; - HandleDestroyMenuCursors(); - MenuZeroFillWindowRect(0, 0, 11, 9); + Menu_DestroyCursor(); + Menu_EraseWindowRect(0, 0, 11, 9); NUM_ITEMS = CountUsedPCItemSlots(); if (NUM_ITEMS) { - MenuZeroFillWindowRect(0, 14, 29, 19); + Menu_EraseWindowRect(0, 14, 29, 19); CURRENT_ITEM_STORAGE_MENU = ITEMPC_MENU_TOSS; PAGE_INDEX = 0; ITEMS_ABOVE_TOP = 0; @@ -420,8 +420,8 @@ static void ItemStorage_Toss(u8 taskId) static void ItemStorage_Exit(u8 var) { - HandleDestroyMenuCursors(); - MenuZeroFillWindowRect(0, 0, 11, 9); + Menu_DestroyCursor(); + Menu_EraseWindowRect(0, 0, 11, 9); ReshowPlayerPC(var); } @@ -450,7 +450,7 @@ static void ItemStorage_ProcessInput(u8 taskId) if(PAGE_INDEX != 0) // did the cursor move physically upwards? { PlaySE(SE_SELECT); - PAGE_INDEX = MoveMenuCursor(-1); + PAGE_INDEX = Menu_MoveCursor(-1); trueIndex = ITEMS_ABOVE_TOP + PAGE_INDEX; if (SWITCH_MODE_ACTIVE == FALSE) // are we not currently switching items? { @@ -474,7 +474,7 @@ static void ItemStorage_ProcessInput(u8 taskId) ItemStorage_DrawBothListAndDescription(taskId); if (SWITCH_MODE_ACTIVE != FALSE) - MoveMenuCursor(0); // don't move the cursor. it's at the top of the page index, but not the true index. + Menu_MoveCursor(0); // don't move the cursor. it's at the top of the page index, but not the true index. } } else if(gMain.newAndRepeatedKeys & DPAD_DOWN) // _0813A306 @@ -482,7 +482,7 @@ static void ItemStorage_ProcessInput(u8 taskId) if(PAGE_INDEX != NUM_PAGE_ITEMS - 1) { PlaySE(SE_SELECT); - PAGE_INDEX = MoveMenuCursor(1); + PAGE_INDEX = Menu_MoveCursor(1); trueIndex = ITEMS_ABOVE_TOP + PAGE_INDEX; if(SWITCH_MODE_ACTIVE != FALSE) @@ -500,7 +500,7 @@ static void ItemStorage_ProcessInput(u8 taskId) ItemStorage_DrawBothListAndDescription(taskId); if (SWITCH_MODE_ACTIVE != FALSE) - MoveMenuCursor(0); + Menu_MoveCursor(0); } } else if(gMain.newKeys & SELECT_BUTTON) // _0813A3A0 @@ -549,7 +549,7 @@ static void ItemStorage_ProcessInput(u8 taskId) PlaySE(SE_SELECT); if(SWITCH_MODE_ACTIVE == FALSE) { - HandleDestroyMenuCursors(); + Menu_DestroyCursor(); ItemStorage_GoBackToPlayerPCMenu(taskId); } else @@ -565,8 +565,8 @@ static void ItemStorage_GoBackToPlayerPCMenu(u8 taskId) BuyMenuFreeMemory(); DestroyVerticalScrollIndicator(0); DestroyVerticalScrollIndicator(1); - MenuZeroFillWindowRect(0, 0, 29, 19); - MenuDisplayMessageBox(); + Menu_EraseWindowRect(0, 0, 29, 19); + Menu_DisplayDialogueFrame(); InitItemStorageMenu(TASK.CURRENT_ITEM_STORAGE_MENU); TASK.FUNC = ItemStorageMenuProcessInput; } @@ -603,7 +603,7 @@ static void ItemStorage_DoItemAction(u8 taskId) ItemStorage_PrintItemPcResponse(ITEMPC_HOW_MANY_TO_TOSS); } NUM_QUANTITY_ROLLER = 1; - MenuDrawTextWindow(6, 8, 13, 11); + Menu_DrawStdWindowFrame(6, 8, 13, 11); sub_80A418C(NUM_QUANTITY_ROLLER, STR_CONV_MODE_RIGHT_ALIGN, 8, 9, 3); TASK.FUNC = ItemStorage_HandleQuantityRolling; } @@ -652,7 +652,7 @@ static void ItemStorage_HandleQuantityRolling(u8 taskId) else if(gMain.newKeys & A_BUTTON) // confirm quantity. { PlaySE(SE_SELECT); - MenuZeroFillWindowRect(6, 6, 0xD, 0xB); + Menu_EraseWindowRect(6, 6, 0xD, 0xB); if(CURRENT_ITEM_STORAGE_MENU == ITEMPC_MENU_WITHDRAW) ItemStorage_DoItemWithdraw(taskId); @@ -662,7 +662,7 @@ static void ItemStorage_HandleQuantityRolling(u8 taskId) else if(gMain.newKeys & B_BUTTON) // cancel quantity. { PlaySE(SE_SELECT); - MenuZeroFillWindowRect(6, 6, 0xD, 0xB); + Menu_EraseWindowRect(6, 6, 0xD, 0xB); StartVerticalScrollIndicators(0); StartVerticalScrollIndicators(1); ItemStorage_PrintItemPcResponse(gSaveBlock1.pcItems[ITEMS_ABOVE_TOP + PAGE_INDEX].itemId); // why not use trueIndex? @@ -713,7 +713,7 @@ static void ItemStorage_DoItemToss(u8 taskId) static void ItemStorage_ResumeInputFromYesToss(u8 taskId) { - MenuZeroFillWindowRect(0x6, 0x6, 0xD, 0xB); + Menu_EraseWindowRect(0x6, 0x6, 0xD, 0xB); ItemStorage_PrintItemPcResponse(ITEMPC_THREW_AWAY_ITEM); TASK.FUNC = ItemStorage_HandleRemoveItem; } @@ -722,7 +722,7 @@ static void ItemStorage_ResumeInputFromNoToss(u8 taskId) { s16 *data = TASK.data; - MenuZeroFillWindowRect(0x6, 0x6, 0xD, 0xB); + Menu_EraseWindowRect(0x6, 0x6, 0xD, 0xB); InitMenu(0, 16, 2, NUM_PAGE_ITEMS, PAGE_INDEX, 0xD); StartVerticalScrollIndicators(0); StartVerticalScrollIndicators(1); @@ -765,7 +765,7 @@ static void ItemStorage_WaitPressHandleResumeProcessInput(u8 taskId) static void ItemStorage_HandleResumeProcessInput(u8 taskId) { - MenuZeroFillWindowRect(0x6, 0x6, 0xD, 0xB); + Menu_EraseWindowRect(0x6, 0x6, 0xD, 0xB); StartVerticalScrollIndicators(0); StartVerticalScrollIndicators(1); ItemStorage_DrawBothListAndDescription(taskId); @@ -817,14 +817,14 @@ static void ItemStorage_DrawItemQuantity(u16 arg1, enum StringConvertMode arg2, sub_80A4164(gStringVar1, arg1, arg2, arg4); if(isSwapSelected != FALSE) - MenuPrint(gSelectedItemQuantityFormatText, 0x1A, arg3); + Menu_PrintText(gSelectedItemQuantityFormatText, 0x1A, arg3); else - MenuPrint(gNonSelectedItemQuantityFormatText, 0x1A, arg3); + Menu_PrintText(gNonSelectedItemQuantityFormatText, 0x1A, arg3); } static void ItemStorage_DrawItemVoidQuantity(u8 var) { - MenuPrint(gUnknown_08406330, 0x19, var); + Menu_PrintText(gUnknown_08406330, 0x19, var); } static void ItemStorage_DrawItemName(struct ItemSlot *itemSlot, u8 var, int isSwapSelected) @@ -832,9 +832,9 @@ static void ItemStorage_DrawItemName(struct ItemSlot *itemSlot, u8 var, int isSw CopyItemName(itemSlot->itemId, gStringVar1); if(isSwapSelected != FALSE) - MenuPrint(gSelectedItemFormattedText, 16, var); + Menu_PrintText(gSelectedItemFormattedText, 16, var); else - MenuPrint(gNonSelectedItemFormattedText, 16, var); + Menu_PrintText(gNonSelectedItemFormattedText, 16, var); } static void ItemStorage_DrawNormalItemEntry(struct ItemSlot *itemSlot, u8 var, int var2) @@ -900,7 +900,7 @@ static void ItemStorage_DrawItemList(u8 taskId) } if (i - ITEMS_ABOVE_TOP < 8) - MenuFillWindowRectWithBlankTile(16, yCoord + 4, 0x1C, 0x12); + Menu_BlankWindowRect(16, yCoord + 4, 0x1C, 0x12); if (ITEMS_ABOVE_TOP != 0) CreateVerticalScrollIndicators(0, 0xB8, 8); @@ -977,11 +977,11 @@ static void ItemStorage_GoBackToItemPCMenu(u8 taskId, u8 var) sub_80F944C(); LoadScrollIndicatorPalette(); ItemStorage_LoadPalette(); - MenuDrawTextWindow(0xF, 0, 0x1D, 0x13); - MenuDrawTextWindow(0, 0xC, 0xE, 0x13); - MenuDrawTextWindow(0, 0, 0xB, 3); + Menu_DrawStdWindowFrame(0xF, 0, 0x1D, 0x13); + Menu_DrawStdWindowFrame(0, 0xC, 0xE, 0x13); + Menu_DrawStdWindowFrame(0, 0, 0xB, 3); ItemStorage_PrintItemPcResponse(gSaveBlock1.pcItems[0].itemId); - MenuPrint(gPCText_ItemPCOptionsText[var].text, 1, 1); + Menu_PrintText(gPCText_ItemPCOptionsText[var].text, 1, 1); ItemStorage_DrawItemList(taskId); InitMenu(0, 0x10, 2, NUM_PAGE_ITEMS, PAGE_INDEX, 0xD); } @@ -1037,22 +1037,22 @@ static void Mailbox_DrawMailList(u8 taskId) // taskId is unused for (i = eMailboxInfo.itemsAbove; i < eMailboxInfo.itemsAbove + eMailboxInfo.pageItems; i++) { yCoord = (i - eMailboxInfo.itemsAbove) * 2; - MenuFillWindowRectWithBlankTile(0x15, yCoord + 2, 0x1C, yCoord + 3); + Menu_BlankWindowRect(0x15, yCoord + 2, 0x1C, yCoord + 3); if (i == eMailboxInfo.count) { - MenuPrint(gOtherText_CancelNoTerminator, 0x15, yCoord + 2); + Menu_PrintText(gOtherText_CancelNoTerminator, 0x15, yCoord + 2); break; } else { StringCopy(gStringVar1, gSaveBlock1.mail[i + 6].playerName); SanitizeNameString(gStringVar1); - MenuPrint(gStringVar1, 0x15, yCoord + 2); + Menu_PrintText(gStringVar1, 0x15, yCoord + 2); } } if (i - eMailboxInfo.itemsAbove != 8) - MenuFillWindowRectWithBlankTile(0x15, yCoord + 4, 0x1C, 0x12); + Menu_BlankWindowRect(0x15, yCoord + 4, 0x1C, 0x12); if (eMailboxInfo.itemsAbove != 0) CreateVerticalScrollIndicators(0, 0xC8, 8); @@ -1069,10 +1069,10 @@ static void Mailbox_DrawMailboxMenu(u8 taskId) { sub_80F944C(); LoadScrollIndicatorPalette(); - MenuZeroFillWindowRect(0, 0, 0x1D, 0x13); - MenuDrawTextWindow(0, 0, 0x8, 0x3); - MenuPrint(gPCText_Mailbox, 1, 1); - MenuDrawTextWindow(0x14, 0, 0x1D, 0x13); + Menu_EraseWindowRect(0, 0, 0x1D, 0x13); + Menu_DrawStdWindowFrame(0, 0, 0x8, 0x3); + Menu_PrintText(gPCText_Mailbox, 1, 1); + Menu_DrawStdWindowFrame(0x14, 0, 0x1D, 0x13); Mailbox_DrawMailList(taskId); InitMenu(0, 0x15, 2, eMailboxInfo.pageItems, eMailboxInfo.cursorPos, 8); } @@ -1087,7 +1087,7 @@ static void Mailbox_ProcessInput(u8 taskId) if(eMailboxInfo.cursorPos != 0) { PlaySE(SE_SELECT); - eMailboxInfo.cursorPos = MoveMenuCursor(-1); + eMailboxInfo.cursorPos = Menu_MoveCursor(-1); } else if(eMailboxInfo.itemsAbove != 0) { @@ -1101,7 +1101,7 @@ static void Mailbox_ProcessInput(u8 taskId) if(eMailboxInfo.cursorPos != eMailboxInfo.pageItems - 1) { PlaySE(SE_SELECT); - eMailboxInfo.cursorPos = MoveMenuCursor(1); + eMailboxInfo.cursorPos = Menu_MoveCursor(1); } else if(eMailboxInfo.itemsAbove + eMailboxInfo.cursorPos != eMailboxInfo.count) { @@ -1112,7 +1112,7 @@ static void Mailbox_ProcessInput(u8 taskId) } else if(gMain.newKeys & A_BUTTON) { - HandleDestroyMenuCursors(); + Menu_DestroyCursor(); PlaySE(SE_SELECT); if(eMailboxInfo.itemsAbove + eMailboxInfo.cursorPos == eMailboxInfo.count) @@ -1127,7 +1127,7 @@ static void Mailbox_ProcessInput(u8 taskId) } else if(gMain.newKeys & B_BUTTON) { - HandleDestroyMenuCursors(); + Menu_DestroyCursor(); PlaySE(SE_SELECT); Mailbox_TurnOff(taskId); } @@ -1143,7 +1143,7 @@ static void Mailbox_CloseScrollIndicators(void) static void Mailbox_PrintWhatToDoWithPlayerMailText(u8 taskId) { - MenuZeroFillWindowRect(0, 0, 0x1D, 0x13); + Menu_EraseWindowRect(0, 0, 0x1D, 0x13); StringCopy(gStringVar1, gSaveBlock1.mail[eMailboxInfo.itemsAbove + 6 + eMailboxInfo.cursorPos].playerName); SanitizeNameString(gStringVar1); StringExpandPlaceholders(gStringVar4, gOtherText_WhatWillYouDoMail); @@ -1152,7 +1152,7 @@ static void Mailbox_PrintWhatToDoWithPlayerMailText(u8 taskId) static void Mailbox_ReturnToPlayerPC(u8 taskId) { - MenuZeroFillWindowRect(0, 0, 0x1D, 0x13); + Menu_EraseWindowRect(0, 0, 0x1D, 0x13); ReshowPlayerPC(taskId); } @@ -1164,8 +1164,8 @@ static void Mailbox_TurnOff(u8 taskId) static void Mailbox_PrintMailOptions(u8 taskId) // Mailbox_PrintMailOptions { - MenuDrawTextWindow(0, 0, 0xC, 0x9); - PrintMenuItems(1, 1, 4, (struct MenuAction *)gMailboxMailOptions); + Menu_DrawStdWindowFrame(0, 0, 0xC, 0x9); + Menu_PrintItems(1, 1, 4, (struct MenuAction *)gMailboxMailOptions); InitMenu(0, 1, 1, 4, 0, 0xB); TASK.FUNC = Mailbox_MailOptionsProcessInput; } @@ -1175,17 +1175,17 @@ static void Mailbox_MailOptionsProcessInput(u8 taskId) if(gMain.newAndRepeatedKeys & DPAD_UP) { PlaySE(SE_SELECT); - MoveMenuCursor(-1); + Menu_MoveCursor(-1); } else if(gMain.newAndRepeatedKeys & DPAD_DOWN) { PlaySE(SE_SELECT); - MoveMenuCursor(1); + Menu_MoveCursor(1); } else if(gMain.newKeys & A_BUTTON) { PlaySE(SE_SELECT); - gMailboxMailOptions[GetMenuCursorPos()].func(taskId); + gMailboxMailOptions[Menu_GetCursorPos()].func(taskId); } else if(gMain.newKeys & B_BUTTON) { @@ -1231,9 +1231,9 @@ static const u8 gHighlightedMoveToBagFormatText[] = _("{COLOR RED}{STR_VAR_1}"); static void Mailbox_MoveToBag(u8 taskId) { - HandleDestroyMenuCursors(); + Menu_DestroyCursor(); StringCopy(gStringVar1, gOtherText_MoveToBag); - MenuPrint(gHighlightedMoveToBagFormatText, 1, 3); // gHighlightedMoveToBagFormatText + Menu_PrintText(gHighlightedMoveToBagFormatText, 1, 3); // gHighlightedMoveToBagFormatText DisplayItemMessageOnField(taskId, gOtherText_MessageWillBeLost, Mailbox_DrawYesNoBeforeMove, 0); } @@ -1247,7 +1247,7 @@ static void Mailbox_DoMailMoveToBag(u8 taskId) { struct MailStruct *mail = &gSaveBlock1.mail[eMailboxInfo.itemsAbove + 6 + eMailboxInfo.cursorPos]; - MenuZeroFillWindowRect(0x14, 8, 0x1A, 0xD); + Menu_EraseWindowRect(0x14, 8, 0x1A, 0xD); if(AddBagItem(mail->itemId, 1) == FALSE) { @@ -1270,7 +1270,7 @@ static void Mailbox_DoMailMoveToBag(u8 taskId) static void Mailbox_ReturnToInputAfterNo(u8 taskId) // Mailbox_ReturnToInputAfterNo { - MenuZeroFillWindowRect(0x14, 0x8, 0x1A, 0xD); + Menu_EraseWindowRect(0x14, 0x8, 0x1A, 0xD); Mailbox_DrawMailMenuAndDoProcessInput(taskId); } @@ -1325,8 +1325,8 @@ static void Mailbox_NoPokemonForMail(u8 taskId) static void Mailbox_Cancel(u8 taskId) { - HandleDestroyMenuCursors(); - MenuZeroFillWindowRect(0, 0, 0xC, 0x9); + Menu_DestroyCursor(); + Menu_EraseWindowRect(0, 0, 0xC, 0x9); Mailbox_DrawMailMenuAndDoProcessInput(taskId); } diff --git a/src/field/pokeblock.c b/src/field/pokeblock.c index 640d4731f..dd94e1755 100644 --- a/src/field/pokeblock.c +++ b/src/field/pokeblock.c @@ -275,15 +275,15 @@ static bool8 sub_810B6C0(void) gMain.state++; break; case 5: - SetUpWindowConfig(&gWindowConfig_81E6E34); + Text_LoadWindowTemplate(&gWindowTemplate_81E6E34); gMain.state++; break; case 6: - SetUpWindowConfig(&gWindowConfig_81E6E50); + Text_LoadWindowTemplate(&gWindowTemplate_81E6E50); gMain.state++; break; case 7: - MultistepInitMenuWindowBegin(&gWindowConfig_81E6E34); + MultistepInitMenuWindowBegin(&gWindowTemplate_81E6E34); gMain.state++; break; case 8: @@ -293,7 +293,7 @@ static bool8 sub_810B6C0(void) } break; case 9: - MultistepInitMenuWindowBegin(&gWindowConfig_81E6E50); + MultistepInitMenuWindowBegin(&gWindowTemplate_81E6E50); gMain.state++; break; case 10: @@ -445,18 +445,18 @@ void debug_sub_8120F98(void) static void sub_810BB0C(void) { - BasicInitMenuWindow(&gWindowConfig_81E6E34); + BasicInitMenuWindow(&gWindowTemplate_81E6E34); sub_8072BD8(ItemId_GetItem(ITEM_POKEBLOCK_CASE)->name, 2, 1, 0x48); } static void sub_810BB30(void) { - BasicInitMenuWindow(&gWindowConfig_81E6E34); - MenuPrint(gContestStatsText_Spicy, 2, 13); - MenuPrint(gContestStatsText_Dry, 2, 15); - MenuPrint(gContestStatsText_Sweet, 2, 17); - MenuPrint(gContestStatsText_Bitter, 8, 13); - MenuPrint(gContestStatsText_Sour, 8, 15); + BasicInitMenuWindow(&gWindowTemplate_81E6E34); + Menu_PrintText(gContestStatsText_Spicy, 2, 13); + Menu_PrintText(gContestStatsText_Dry, 2, 15); + Menu_PrintText(gContestStatsText_Sweet, 2, 17); + Menu_PrintText(gContestStatsText_Bitter, 8, 13); + Menu_PrintText(gContestStatsText_Sour, 8, 15); } static void sub_810BB88(u8 a0) @@ -464,17 +464,17 @@ static void sub_810BB88(u8 a0) u8 i; u8 y; u8 *buf; - BasicInitMenuWindow(&gWindowConfig_81E6E34); + BasicInitMenuWindow(&gWindowTemplate_81E6E34); for (i=a0; i<=a0+8; i++) { y = (i - a0) << 1; if (i == gUnknown_02039248.unk2) { buf = sub_8072C74(gStringVar1, gContestStatsText_StowCase, 0x78, 0); - MenuPrint(gStringVar1, 15, y + 1); + Menu_PrintText(gStringVar1, 15, y + 1); if (i != a0 + 8) { - MenuZeroFillWindowRect(15, y + 3, 29, 18); + Menu_EraseWindowRect(15, y + 3, 29, 18); } break; } @@ -484,7 +484,7 @@ static void sub_810BB88(u8 a0) buf[2] = 0x06; buf += 3; ConvertIntToDecimalStringN(buf, sub_810C9B0(&gSaveBlock1.pokeblocks[i]), STR_CONV_MODE_RIGHT_ALIGN, 3); - MenuPrint(gStringVar1, 15, y + 1); + Menu_PrintText(gStringVar1, 15, y + 1); } } @@ -596,15 +596,15 @@ static void sub_810BDAC(bool8 flag) gBGTilemapBuffers[2][v0 + 32] = 15; } } - BasicInitMenuWindow(&gWindowConfig_81E6E34); + BasicInitMenuWindow(&gWindowTemplate_81E6E34); if (gUnknown_02039248.unk0 + gUnknown_02039248.unk1 != gUnknown_02039248.unk2) { sub_8072C14(gStringVar1, sub_810C9E8(&gSaveBlock1.pokeblocks[gUnknown_02039248.unk0 + gUnknown_02039248.unk1]), 16, 1); - MenuPrint(gStringVar1, 11, 17); + Menu_PrintText(gStringVar1, 11, 17); } else { - MenuZeroFillWindowRect(11, 17, 12, 18); + Menu_EraseWindowRect(11, 17, 12, 18); } } @@ -812,9 +812,9 @@ static void sub_810C368(u8 taskId) v0 = 2; sub_80F98A4(0); sub_80F98A4(1); - BasicInitMenuWindow(&gWindowConfig_81E6E50); - MenuDrawTextWindow(7, v0 + 4, 13, 11); - PrintMenuItemsReordered(8, v0 + 5, gUnknown_0203924C, gUnknown_083F7EF4, gUnknown_03000758); + BasicInitMenuWindow(&gWindowTemplate_81E6E50); + Menu_DrawStdWindowFrame(7, v0 + 4, 13, 11); + Menu_PrintItemsReordered(8, v0 + 5, gUnknown_0203924C, gUnknown_083F7EF4, gUnknown_03000758); InitMenu(0, 8, v0 + 5, gUnknown_0203924C, 0, 5); gSpecialVar_ItemId = gUnknown_02039248.unk0 + gUnknown_02039248.unk1; gTasks[taskId].func = sub_810C40C; @@ -824,24 +824,24 @@ static void sub_810C40C(u8 taskId) { if (gMain.newAndRepeatedKeys & DPAD_UP) { - if (GetMenuCursorPos()) + if (Menu_GetCursorPos()) { PlaySE(SE_SELECT); - MoveMenuCursor(-1); + Menu_MoveCursor(-1); } } else if (gMain.newAndRepeatedKeys & DPAD_DOWN) { - if (GetMenuCursorPos() != gUnknown_0203924C - 1) + if (Menu_GetCursorPos() != gUnknown_0203924C - 1) { PlaySE(SE_SELECT); - MoveMenuCursor(+1); + Menu_MoveCursor(+1); } } else if (gMain.newKeys & A_BUTTON) { PlaySE(SE_SELECT); - gUnknown_083F7EF4[gUnknown_03000758[GetMenuCursorPos()]].func(taskId); + gUnknown_083F7EF4[gUnknown_03000758[Menu_GetCursorPos()]].func(taskId); } else if (gMain.newKeys & B_BUTTON) { @@ -868,9 +868,9 @@ static void sub_810C508(u8 taskId) static void sub_810C540(u8 taskId) { - BasicInitMenuWindow(&gWindowConfig_81E6E50); - HandleDestroyMenuCursors(); - MenuZeroFillWindowRect(7, 4, 13, 11); + BasicInitMenuWindow(&gWindowTemplate_81E6E50); + Menu_DestroyCursor(); + Menu_EraseWindowRect(7, 4, 13, 11); StringCopy(gStringVar1, gPokeblockNames[gSaveBlock1.pokeblocks[gUnknown_02039248.unk0 + gUnknown_02039248.unk1].color]); StringExpandPlaceholders(gStringVar4, gContestStatsText_ThrowAwayPrompt); DisplayItemMessageOnField(taskId, gStringVar4, sub_810C5EC, 0); @@ -890,7 +890,7 @@ static void sub_810C5EC(u8 taskId) static void sub_810C610(u8 taskId) { - MenuZeroFillWindowRect(7, 6, 13, 11); + Menu_EraseWindowRect(7, 6, 13, 11); PokeblockClearIfExists((gUnknown_02039248.unk0 + gUnknown_02039248.unk1)); StringExpandPlaceholders(gStringVar4, gContestStatsText_WasThrownAway); DisplayItemMessageOnField(taskId, gStringVar4, sub_810C704, 0); @@ -906,9 +906,9 @@ static void sub_810C668(u8 taskId) { sub_80F979C(1, 0); } - BasicInitMenuWindow(&gWindowConfig_81E6E50); - MenuZeroFillWindowRect(7, 6, 13, 11); - MenuZeroFillWindowRect(0, 14, 29, 19); + BasicInitMenuWindow(&gWindowTemplate_81E6E50); + Menu_EraseWindowRect(7, 6, 13, 11); + Menu_EraseWindowRect(0, 14, 29, 19); gTasks[taskId].func = sub_810BF7C; } @@ -922,7 +922,7 @@ static void sub_810C6DC(u8 taskId) static void sub_810C704(u8 taskId) { - BasicInitMenuWindow(&gWindowConfig_81E6E34); + BasicInitMenuWindow(&gWindowTemplate_81E6E34); sub_810BC84(gUnknown_02039248.unk1); sub_80F979C(1, 1); gTasks[taskId].func = sub_810C6DC; @@ -932,8 +932,8 @@ static void sub_810C748(u8 taskId) { StartVerticalScrollIndicators(0); StartVerticalScrollIndicators(1); - HandleDestroyMenuCursors(); - MenuZeroFillWindowRect(7, 4, 13, 11); + Menu_DestroyCursor(); + Menu_EraseWindowRect(7, 4, 13, 11); gTasks[taskId].func = sub_810BF7C; } diff --git a/src/field/region_map.c b/src/field/region_map.c index 07e77e389..a098eb73d 100644 --- a/src/field/region_map.c +++ b/src/field/region_map.c @@ -1540,11 +1540,11 @@ void CB2_InitFlyRegionMap(void) FreeAllSpritePalettes(); break; case 1: - SetUpWindowConfig(&gWindowConfig_81E7224); + Text_LoadWindowTemplate(&gWindowTemplate_81E7224); break; case 2: - InitMenuWindow(&gWindowConfig_81E7224); - MenuZeroFillScreen(); + InitMenuWindow(&gWindowTemplate_81E7224); + Menu_EraseScreen(); break; case 3: InitRegionMap(&ewram0_3.regionMap, 0); @@ -1562,7 +1562,7 @@ void CB2_InitFlyRegionMap(void) break; case 6: LoadPalette(sFlyRegionMapFrame_Pal, 16, 32); - MenuPrint_PixelCoords(gOtherText_FlyToWhere, 1, 0x90, 1); + Menu_PrintTextPixelCoords(gOtherText_FlyToWhere, 1, 0x90, 1); break; case 7: CreateFlyTargetGraphics(); @@ -1619,8 +1619,8 @@ static void PrintFlyTargetName(void) { if (FlagGet(r4->flag)) { - MenuDrawTextWindow(16, 14, 29, 19); - MenuPrint(ewram0_3.regionMap.mapSectionName, 17, 15); + Menu_DrawStdWindowFrame(16, 14, 29, 19); + Menu_PrintText(ewram0_3.regionMap.mapSectionName, 17, 15); MenuPrint_RightAligned(r4->unk0[ewram0_3.regionMap.everGrandeCityArea], 29, 17); return; } @@ -1631,16 +1631,16 @@ static void PrintFlyTargetName(void) asm("mov %0, #0\n":"=r"(zero)); // zero = 0 if (zero == 0) { - MenuDrawTextWindow(16, 16, 29, 19); - MenuPrint(ewram0_3.regionMap.mapSectionName, 17, 17); - MenuZeroFillWindowRect(16, 14, 29, 15); + Menu_DrawStdWindowFrame(16, 16, 29, 19); + Menu_PrintText(ewram0_3.regionMap.mapSectionName, 17, 17); + Menu_EraseWindowRect(16, 14, 29, 15); } } else { - MenuDrawTextWindow(16, 16, 29, 19); - MenuPrint(ewramBlankMapName, 17, 17); - MenuZeroFillWindowRect(16, 14, 29, 15); + Menu_DrawStdWindowFrame(16, 16, 29, 19); + Menu_PrintText(ewramBlankMapName, 17, 17); + Menu_EraseWindowRect(16, 14, 29, 15); } } diff --git a/src/field/scrcmd.c b/src/field/scrcmd.c index 05a909e81..e795fd8ed 100644 --- a/src/field/scrcmd.c +++ b/src/field/scrcmd.c @@ -1333,7 +1333,7 @@ bool8 ScrCmd_drawbox(struct ScriptContext *ctx) u8 right = ScriptReadByte(ctx); u8 bottom = ScriptReadByte(ctx); - MenuDrawTextWindow(left, top, right, bottom); + Menu_DrawStdWindowFrame(left, top, right, bottom); return FALSE; } @@ -1363,7 +1363,7 @@ bool8 ScrCmd_erasebox(struct ScriptContext *ctx) u8 right = ScriptReadByte(ctx); u8 bottom = ScriptReadByte(ctx); - MenuZeroFillWindowRect(left, top, right, bottom); + Menu_EraseWindowRect(left, top, right, bottom); return FALSE; } @@ -1428,8 +1428,8 @@ bool8 ScrCmd_braillemessage(struct ScriptContext *ctx) u8 v6 = ptr[4]; u8 v7 = ptr[5]; StringBraille(gStringVar4, ptr + 6); - MenuDrawTextWindow(v2, v3, v4, v5); - MenuPrint(gStringVar4, v6, v7); + Menu_DrawStdWindowFrame(v2, v3, v4, v5); + Menu_PrintText(gStringVar4, v6, v7); return FALSE; } diff --git a/src/field/script_menu.c b/src/field/script_menu.c index 9f3ab75cc..9d901a03c 100644 --- a/src/field/script_menu.c +++ b/src/field/script_menu.c @@ -622,7 +622,7 @@ bool8 ScriptMenu_MultichoiceWithDefault(u8 left, u8 top, u8 multichoiceId, u8 ig static u16 GetStringWidthInTilesForScriptMenu(const u8 *str) { // each tile on screen is 8x8, so it needs the number of tiles and not pixels, hence the division by 8. - return (GetStringWidthGivenWindowConfig((struct WindowConfig *)&gWindowConfig_81E6CE4, str) + 7) / 8; + return (Text_GetStringWidthFromWindowTemplate((struct WindowTemplate *)&gWindowTemplate_81E6CE4, str) + 7) / 8; } static void DrawMultichoiceMenu(u8 left, u8 top, u8 count, const struct MenuAction *list, u8 ignoreBPress, u8 cursorPos) @@ -651,8 +651,8 @@ static void DrawMultichoiceMenu(u8 left, u8 top, u8 count, const struct MenuActi bottom = top + (2 * count + 1); - MenuDrawTextWindow(left, top, right, bottom); - PrintMenuItems(left + 1, top + 1, count, list); + Menu_DrawStdWindowFrame(left, top, right, bottom); + Menu_PrintItems(left + 1, top + 1, count, list); InitMenu(0, left + 1, top + 1, count, cursorPos, right - left - 1); StartScriptMenuTask(left, top, right, bottom, ignoreBPress, count); } @@ -687,9 +687,9 @@ static void Task_HandleMultichoiceInput(u8 taskId) if (!gPaletteFade.active) { if (!gTasks[taskId].tDoWrap) - selection = ProcessMenuInputNoWrap(); + selection = Menu_ProcessInputNoWrap(); else - selection = ProcessMenuInput(); + selection = Menu_ProcessInput(); if (selection != -2) { @@ -704,8 +704,8 @@ static void Task_HandleMultichoiceInput(u8 taskId) { gSpecialVar_Result = selection; } - HandleDestroyMenuCursors(); - MenuZeroFillWindowRect(gTasks[taskId].tLeft, gTasks[taskId].tTop, gTasks[taskId].tRight, gTasks[taskId].tBottom); + Menu_DestroyCursor(); + Menu_EraseWindowRect(gTasks[taskId].tLeft, gTasks[taskId].tTop, gTasks[taskId].tRight, gTasks[taskId].tBottom); DestroyTask(taskId); EnableBothScriptContexts(); } @@ -745,7 +745,7 @@ static void sub_80B53B4(u8 left, u8 top, u8 count, const struct MenuAction *list right = (right + left) + 2; bottom = top + (2 * count + 1); - PrintMenuItems(left, top, count, list); + Menu_PrintItems(left, top, count, list); InitMenu(0, left, top, count, 0, right - left - 1); StartScriptMenuTask(left, top, right, bottom, ignoreBPress, count); } @@ -788,7 +788,7 @@ static void Task_HandleYesNoInput(u8 taskId) return; } - switch (ProcessMenuInputNoWrap()) + switch (Menu_ProcessInputNoWrap()) { case -2: return; @@ -805,7 +805,7 @@ static void Task_HandleYesNoInput(u8 taskId) left = gTasks[taskId].tLeft; top = gTasks[taskId].tTop; - MenuZeroFillWindowRect(left, top, left + 6, top + 5); + Menu_EraseWindowRect(left, top, left + 6, top + 5); DestroyTask(taskId); EnableBothScriptContexts(); } @@ -839,7 +839,7 @@ bool8 ScriptMenu_MultichoiceGrid(u8 left, u8 top, u8 multichoiceId, u8 ignoreBPr bottom = (2 * (gMultichoiceLists[multichoiceId].count / columnCount)) + 3 + top; } - width = sub_807288C(columnCount); + width = Menu_GetColumnXCoord(columnCount); gTasks[taskId].tLeft = left; gTasks[taskId].tTop = top; gTasks[taskId].tRight = width + left + 2; @@ -851,7 +851,7 @@ bool8 ScriptMenu_MultichoiceGrid(u8 left, u8 top, u8 multichoiceId, u8 ignoreBPr static void Task_HandleMultichoiceGridInput(u8 taskId) { - s8 selection = sub_80727CC(); + s8 selection = Menu_ProcessInputGridLayout(); if (selection != -2) { @@ -866,8 +866,8 @@ static void Task_HandleMultichoiceGridInput(u8 taskId) { gSpecialVar_Result = selection; } - HandleDestroyMenuCursors(); - MenuZeroFillWindowRect(gTasks[taskId].tLeft, gTasks[taskId].tTop, gTasks[taskId].tRight, gTasks[taskId].tBottom); + Menu_DestroyCursor(); + Menu_EraseWindowRect(gTasks[taskId].tLeft, gTasks[taskId].tTop, gTasks[taskId].tRight, gTasks[taskId].tBottom); DestroyTask(taskId); EnableBothScriptContexts(); } @@ -909,23 +909,23 @@ void ScriptMenu_CreatePCMenu(void) if (FlagGet(FLAG_SYS_GAME_CLEAR)) // player has cleared game? { numChoices = 4; - MenuDrawTextWindow(0, 0, width + 2, 9); - MenuPrint(gPCText_HallOfFame, 1, 5); - MenuPrint(gPCText_LogOff, 1, 7); + Menu_DrawStdWindowFrame(0, 0, width + 2, 9); + Menu_PrintText(gPCText_HallOfFame, 1, 5); + Menu_PrintText(gPCText_LogOff, 1, 7); } else { numChoices = 3; - MenuDrawTextWindow(0, 0, width + 2, 7); - MenuPrint(gPCText_LogOff, 1, 5); + Menu_DrawStdWindowFrame(0, 0, width + 2, 7); + Menu_PrintText(gPCText_LogOff, 1, 5); } if (FlagGet(FLAG_SYS_PC_LANETTE)) // player met lanette? - MenuPrint(gPCText_LanettesPC, 1, 1); + Menu_PrintText(gPCText_LanettesPC, 1, 1); else - MenuPrint(gPCText_SomeonesPC, 1, 1); + Menu_PrintText(gPCText_SomeonesPC, 1, 1); - MenuPrint(gPCText_PlayersPC, 1, 3); + Menu_PrintText(gPCText_PlayersPC, 1, 3); InitMenu(0, 1, 1, numChoices, 0, width + 1); StartScriptMenuTask(0, 0, width + 2, 2 * numChoices + 1, 0, numChoices); } @@ -1008,15 +1008,15 @@ _080B57B4:\n\ movs r0, 0\n\ movs r1, 0\n\ movs r3, 0x9\n\ - bl MenuDrawTextWindow\n\ + bl Menu_DrawStdWindowFrame\n\ ldr r0, _080B57F8 @ =gPCText_HallOfFame\n\ movs r1, 0x1\n\ movs r2, 0x5\n\ - bl MenuPrint\n\ + bl Menu_PrintText\n\ ldr r0, _080B57F0 @ =gPCText_LogOff\n\ movs r1, 0x1\n\ movs r2, 0x7\n\ - bl MenuPrint\n\ + bl Menu_PrintText\n\ b _080B5818\n\ .align 2, 0\n\ _080B57E8: .4byte gPCText_SomeonesPC\n\ @@ -1032,11 +1032,11 @@ _080B57FC:\n\ movs r0, 0\n\ movs r1, 0\n\ movs r3, 0x7\n\ - bl MenuDrawTextWindow\n\ + bl Menu_DrawStdWindowFrame\n\ ldr r0, _080B5834 @ =gPCText_LogOff\n\ movs r1, 0x1\n\ movs r2, 0x5\n\ - bl MenuPrint\n\ + bl Menu_PrintText\n\ _080B5818:\n\ adds r6, r4, 0\n\ ldr r0, _080B5838 @ =0x0000084b\n\ @@ -1047,7 +1047,7 @@ _080B5818:\n\ ldr r0, _080B583C @ =gPCText_LanettesPC\n\ movs r1, 0x1\n\ movs r2, 0x1\n\ - bl MenuPrint\n\ + bl Menu_PrintText\n\ b _080B584A\n\ .align 2, 0\n\ _080B5834: .4byte gPCText_LogOff\n\ @@ -1057,12 +1057,12 @@ _080B5840:\n\ ldr r0, _080B5888 @ =gPCText_SomeonesPC\n\ movs r1, 0x1\n\ movs r2, 0x1\n\ - bl MenuPrint\n\ + bl Menu_PrintText\n\ _080B584A:\n\ ldr r0, _080B588C @ =gPCText_PlayersPC\n\ movs r1, 0x1\n\ movs r2, 0x3\n\ - bl MenuPrint\n\ + bl Menu_PrintText\n\ movs r4, 0\n\ str r4, [sp]\n\ adds r0, r5, 0x1\n\ @@ -1096,8 +1096,8 @@ _080B588C: .4byte gPCText_PlayersPC\n\ void ScriptMenu_DisplayPCStartupPrompt(void) { - MenuDisplayMessageBox(); - MenuPrint(gPCText_WhichPCShouldBeAccessed, 2, 15); + Menu_DisplayDialogueFrame(); + Menu_PrintText(gPCText_WhichPCShouldBeAccessed, 2, 15); } #define tState data[0] @@ -1122,7 +1122,7 @@ static void Task_PokemonPicWindow(u8 taskId) task->tState++; break; case 3: - MenuZeroFillWindowRect(task->tWindowX, task->tWindowY, task->tWindowX + 9, task->tWindowY + 10); + Menu_EraseWindowRect(task->tWindowX, task->tWindowY, task->tWindowX + 9, task->tWindowY + 10); DestroyTask(taskId); break; } @@ -1139,7 +1139,7 @@ bool8 ScriptMenu_ShowPokemonPic(u16 species, u8 x, u8 y) } else { - MenuDrawTextWindow(x, y, x + 9, y + 10); + Menu_DrawStdWindowFrame(x, y, x + 9, y + 10); taskId = CreateTask(Task_PokemonPicWindow, 0x50); gTasks[taskId].tState = 0; gTasks[taskId].tMonSpecies = species; diff --git a/src/field/secret_base.c b/src/field/secret_base.c index 2e4138a3b..203b57867 100644 --- a/src/field/secret_base.c +++ b/src/field/secret_base.c @@ -913,7 +913,7 @@ void Task_SecretBasePC_Registry(u8 taskId) taskData[1] = 0; taskData[2] = 0; - MenuZeroFillWindowRect(0, 0, 29, 19); + Menu_EraseWindowRect(0, 0, 29, 19); sub_80BC7D8(taskId); gTasks[taskId].func = sub_80BC824; @@ -948,8 +948,8 @@ void sub_80BC6B0(u8 taskId) if (sub_80BC268(i) == TRUE) { sub_80BC190(gStringVar1, i); - MenuFillWindowRectWithBlankTile(18, 2 * n + 2, 28, 2 * n + 3); - MenuPrint(gStringVar1, 18, 2 * n + 2); + Menu_BlankWindowRect(18, 2 * n + 2, 28, 2 * n + 3); + Menu_PrintText(gStringVar1, 18, 2 * n + 2); if (++n == 8) break; } @@ -957,11 +957,11 @@ void sub_80BC6B0(u8 taskId) if (n < 8) { - MenuFillWindowRectWithBlankTile(18, 2 * n + 2, 28, 2 * n + 3); - MenuPrint(gUnknownText_Exit, 18, 2 * n + 2); + Menu_BlankWindowRect(18, 2 * n + 2, 28, 2 * n + 3); + Menu_PrintText(gUnknownText_Exit, 18, 2 * n + 2); DestroyVerticalScrollIndicator(1); if (n != 7) - MenuFillWindowRectWithBlankTile(18, ((n << 25) + (1 << 26)) >> 24, 28, 18); // the shifts are needed to match + Menu_BlankWindowRect(18, ((n << 25) + (1 << 26)) >> 24, 28, 18); // the shifts are needed to match } else CreateVerticalScrollIndicators(1, 0xbc, 0x98); @@ -975,7 +975,7 @@ void sub_80BC6B0(u8 taskId) void sub_80BC7D8(u8 taskId) { u16 *taskData = gTasks[taskId].data; - MenuDrawTextWindow(17, 0, 29, 19); + Menu_DrawStdWindowFrame(17, 0, 29, 19); InitMenu(0, 18, 2, taskData[3] + 1, taskData[1], 11); sub_80BC6B0(taskId); @@ -990,7 +990,7 @@ void sub_80BC824(u8 taskId) if (taskData[1]) { PlaySE(5); - taskData[1] = MoveMenuCursor(-1); + taskData[1] = Menu_MoveCursor(-1); } else if (taskData[2]) { @@ -1013,7 +1013,7 @@ void sub_80BC824(u8 taskId) else { PlaySE(5); - taskData[1] = MoveMenuCursor(1); + taskData[1] = Menu_MoveCursor(1); } } else if (gMain.newKeys & A_BUTTON) @@ -1021,13 +1021,13 @@ void sub_80BC824(u8 taskId) PlaySE(5); if (taskData[1] + taskData[2] == taskData[0]) { - HandleDestroyMenuCursors(); - MenuZeroFillWindowRect(0, 0, 29, 19); + Menu_DestroyCursor(); + Menu_EraseWindowRect(0, 0, 29, 19); sub_80BCC54(taskId); } else { - HandleDestroyMenuCursors(); + Menu_DestroyCursor(); taskData[4] = sub_80BC948(taskData[1] + taskData[2]); sub_80BC980(taskId); } @@ -1035,8 +1035,8 @@ void sub_80BC824(u8 taskId) else if (gMain.newKeys & B_BUTTON) { PlaySE(5); - HandleDestroyMenuCursors(); - MenuZeroFillWindowRect(0, 0, 29, 19); + Menu_DestroyCursor(); + Menu_EraseWindowRect(0, 0, 29, 19); sub_80BCC54(taskId); } } @@ -1066,8 +1066,8 @@ void sub_80BC980(u8 taskId) { PauseVerticalScrollIndicator(0); PauseVerticalScrollIndicator(1); - MenuDrawTextWindow(1, 0, 12, 5); - PrintMenuItems(2, 1, 2, (const struct MenuAction *)gUnknown_083D13D4); + Menu_DrawStdWindowFrame(1, 0, 12, 5); + Menu_PrintItems(2, 1, 2, (const struct MenuAction *)gUnknown_083D13D4); InitMenu(0, 2, 1, 2, 0, 10); gTasks[taskId].func = sub_80BC9E4; } @@ -1076,24 +1076,24 @@ void sub_80BC9E4(u8 taskId) { if (gMain.newAndRepeatedKeys & DPAD_UP) { - if (GetMenuCursorPos()) + if (Menu_GetCursorPos()) { PlaySE(5); - MoveMenuCursor(-1); + Menu_MoveCursor(-1); } } else if (gMain.newAndRepeatedKeys & DPAD_DOWN) { - if (GetMenuCursorPos() != 1) + if (Menu_GetCursorPos() != 1) { PlaySE(5); - MoveMenuCursor(1); + Menu_MoveCursor(1); } } else if (gMain.newKeys & A_BUTTON) { PlaySE(5); - gUnknown_083D13D4[GetMenuCursorPos()].func(taskId); + gUnknown_083D13D4[Menu_GetCursorPos()].func(taskId); } else if (gMain.newKeys & B_BUTTON) { @@ -1108,8 +1108,8 @@ void sub_80BCA84(u8 taskId) DestroyVerticalScrollIndicator(0); DestroyVerticalScrollIndicator(1); - HandleDestroyMenuCursors(); - MenuZeroFillWindowRect(0, 0, 29, 19); + Menu_DestroyCursor(); + Menu_EraseWindowRect(0, 0, 29, 19); sub_80BC190(gStringVar1, taskData[4]); StringExpandPlaceholders(gStringVar4, gOtherText_OkayToDeleteFromRegistry); @@ -1126,7 +1126,7 @@ void sub_80BCB10(u8 taskId) { s16 *taskData = gTasks[taskId].data; - MenuZeroFillWindowRect(0, 0, 29, 19); + Menu_EraseWindowRect(0, 0, 29, 19); gSaveBlock1.secretBases[taskData[4]].sbr_field_1_6 = 0; taskData[0]--; @@ -1147,13 +1147,13 @@ void sub_80BCB10(u8 taskId) void sub_80BCB90(u8 taskId) { - MenuZeroFillWindowRect(20, 8, 26, 13); + Menu_EraseWindowRect(20, 8, 26, 13); DisplayItemMessageOnField(taskId, gOtherText_RegisteredDataDeleted, sub_80BCB10, 0); } void sub_80BCBC0(u8 taskId) { - MenuZeroFillWindowRect(0, 0, 29, 19); + Menu_EraseWindowRect(0, 0, 29, 19); sub_80BC7D8(taskId); gTasks[taskId].func = sub_80BC824; @@ -1164,7 +1164,7 @@ void sub_80BCBF8(u8 taskId) s16 *taskData = gTasks[taskId].data; InitMenu(0, 18, 2, taskData[3] + 1, taskData[1], 11); - MenuZeroFillWindowRect(1, 0, 12, 5); + Menu_EraseWindowRect(1, 0, 12, 5); StartVerticalScrollIndicators(0); StartVerticalScrollIndicators(1); diff --git a/src/field/shop.c b/src/field/shop.c index 23d668fc7..d56d65c3f 100644 --- a/src/field/shop.c +++ b/src/field/shop.c @@ -84,14 +84,14 @@ u8 CreateShopMenu(u8 martType) if (martType == MART_TYPE_0) { gMartInfo.numChoices = 2; - MenuDrawTextWindow(0, 0, 10, 7); - PrintMenuItemsReordered(1, 1, 3, sBuySellQuitMenuActions, gUnknown_083CC6E8); + Menu_DrawStdWindowFrame(0, 0, 10, 7); + Menu_PrintItemsReordered(1, 1, 3, sBuySellQuitMenuActions, gUnknown_083CC6E8); } else { gMartInfo.numChoices = 1; - MenuDrawTextWindow(0, 0, 10, 5); - PrintMenuItemsReordered(1, 1, 2, sBuySellQuitMenuActions, gUnknown_083CC6EB); + Menu_DrawStdWindowFrame(0, 0, 10, 5); + Menu_PrintItemsReordered(1, 1, 2, sBuySellQuitMenuActions, gUnknown_083CC6EB); } InitMenu(0, 1, 1, gMartInfo.numChoices + 1, 0, 9); // add 1 for cancel @@ -126,7 +126,7 @@ void sub_80B2E38(u8 var) if (gMartInfo.cursor) // can move cursor up? { PlaySE(SE_SELECT); - gMartInfo.cursor = MoveMenuCursor(-1); + gMartInfo.cursor = Menu_MoveCursor(-1); } } else if (gMain.newAndRepeatedKeys & DPAD_DOWN) @@ -134,7 +134,7 @@ void sub_80B2E38(u8 var) if (gMartInfo.cursor != gMartInfo.numChoices) // can move cursor down? { PlaySE(SE_SELECT); - gMartInfo.cursor = MoveMenuCursor(1); + gMartInfo.cursor = Menu_MoveCursor(1); } } else if (gMain.newKeys & A_BUTTON) @@ -174,8 +174,8 @@ void sub_80B2F30(u8 taskId) void HandleShopMenuQuit(u8 taskId) { - HandleDestroyMenuCursors(); - MenuZeroFillWindowRect(0, 0, 11, 8); + Menu_DestroyCursor(); + Menu_EraseWindowRect(0, 0, 11, 8); sub_80BE3BC(); ScriptContext2_Disable(); DestroyTask(taskId); @@ -285,12 +285,12 @@ void BuyMenuDrawGraphics(void) ResetPaletteFade(); ResetSpriteData(); ResetTasks(); - SetUpWindowConfig(&gWindowConfig_81E6DFC); - InitMenuWindow(&gWindowConfig_81E6DFC); + Text_LoadWindowTemplate(&gWindowTemplate_81E6DFC); + InitMenuWindow(&gWindowTemplate_81E6DFC); BuyMenuDrawMapGraphics(); gMartInfo.cursor = zero; gMartInfo.choicesAbove = zero2; - MenuZeroFillWindowRect(0, 0, 0x20, 0x20); + Menu_EraseWindowRect(0, 0, 0x20, 0x20); OpenMoneyWindow(gSaveBlock1.money, 0, 0); sub_80B3764(0, 7); sub_80B37EC(); @@ -532,7 +532,7 @@ void sub_80B37F8(u8 taskId) gStringVar1[1] = 0x14; gStringVar1[2] = 0x6; ConvertIntToDecimalStringN(&gStringVar1[3], gTasks[taskId].data[1], 1, 2); - MenuPrint(gOtherText_xString1, 1, 11); + Menu_PrintText(gOtherText_xString1, 1, 11); sub_80A3FA0(gBGTilemapBuffers[1], 1, 11, 12, 2, 0xC3E1); } @@ -557,7 +557,7 @@ void sub_80B389C(u16 itemId, u8 var2, bool32 hasControlCode) stringPtr = &gStringVar1[3]; GetMoneyAmountText(stringPtr, (ItemId_GetPrice(itemId) >> GetPriceReduction(1)), 0x4); - MenuPrint_PixelCoords(&gStringVar1[0], 0xCA, var2 << 3, 1); + Menu_PrintTextPixelCoords(&gStringVar1[0], 0xCA, var2 << 3, 1); } void sub_80B3930(u16 itemId, u8 var2, bool32 hasControlCode) @@ -586,7 +586,7 @@ void sub_80B3930(u16 itemId, u8 var2, bool32 hasControlCode) else { GetMoneyAmountText(stringPtr, gDecorations[itemId].price, 0x4); - MenuPrint_PixelCoords(&gStringVar1[0], 0xCA, var2 << 3, 0x1); + Menu_PrintTextPixelCoords(&gStringVar1[0], 0xCA, var2 << 3, 0x1); } } @@ -604,8 +604,8 @@ void sub_80B39D0(int var1, int var2, bool32 hasControlCode) if (i != 8 && gMartInfo.choicesAbove + i == gMartInfo.itemCount) { - MenuFillWindowRectWithBlankTile(0xE, (i << 1) + 2, 0x1C, (i << 1) + 3); - MenuPrint(gOtherText_CancelNoTerminator, 0xE, (i << 1) + 2); + Menu_BlankWindowRect(0xE, (i << 1) + 2, 0x1C, (i << 1) + 3); + Menu_PrintText(gOtherText_CancelNoTerminator, 0xE, (i << 1) + 2); } } @@ -659,7 +659,7 @@ void sub_80B3BD0(u8 taskId) void sub_80B3BF4(u8 taskId) { - MenuZeroFillWindowRect(0x7, 0x8, 0xD, 0xD); + Menu_EraseWindowRect(0x7, 0x8, 0xD, 0xD); sub_80A3FA0(gBGTilemapBuffers[1], 8, 9, 4, 4, 0); sub_80B379C(); sub_80B3420(); @@ -706,7 +706,7 @@ void sub_80B3D38(u8 taskId) void sub_80B3D7C(u8 taskId) { sub_80B39D0(gMartInfo.cursor, gMartInfo.cursor, 0); - MenuZeroFillWindowRect(0x7, 0x8, 0xD, 0xD); + Menu_EraseWindowRect(0x7, 0x8, 0xD, 0xD); sub_80A3FA0(gBGTilemapBuffers[1], 0x8, 0x9, 0x4, 0x4, 0); sub_80B4378(taskId); } @@ -719,7 +719,7 @@ void sub_80B3DC8(u8 taskId) if (gMain.newKeys & A_BUTTON) { gMartTotalCost = (ItemId_GetPrice(gMartInfo.itemList[gMartInfo.choicesAbove + gMartInfo.cursor]) >> GetPriceReduction(1)) * gTasks[taskId].data[1]; // set total cost of your purchase. - MenuZeroFillWindowRect(0, 0xA, 0xD, 0xD); + Menu_EraseWindowRect(0, 0xA, 0xD, 0xD); sub_80A3FA0(gBGTilemapBuffers[1], 0x1, 0xB, 0xC, 0x2, 0); sub_80B379C(); sub_80B3420(); @@ -741,7 +741,7 @@ void sub_80B3EFC(u8 taskId) u16 var; gTasks[taskId].data[1] = 1; - MenuDrawTextWindow(0, 0xA, 0xD, 0xD); + Menu_DrawStdWindowFrame(0, 0xA, 0xD, 0xD); sub_80B37F8(taskId); var = gSaveBlock1.money / (ItemId_GetPrice(gMartInfo.itemList[gMartInfo.choicesAbove + gMartInfo.cursor]) >> GetPriceReduction(1)); @@ -1049,7 +1049,7 @@ void sub_80B40E8(u8 taskId) // Mart_DoCursorAction else // if the cursor is not 0, choicesAbove cannot be updated yet since the cursor is at the top of the menu, so update cursor. { PlaySE(SE_SELECT); - gMartInfo.cursor = MoveMenuCursor(-1); // move cursor up + gMartInfo.cursor = Menu_MoveCursor(-1); // move cursor up sub_80B3A70(); } } @@ -1070,7 +1070,7 @@ void sub_80B40E8(u8 taskId) // Mart_DoCursorAction else if (gMartInfo.cursor != gMartInfo.itemCount) { PlaySE(SE_SELECT); - gMartInfo.cursor = MoveMenuCursor(1); + gMartInfo.cursor = Menu_MoveCursor(1); sub_80B3A70(); } } @@ -1084,8 +1084,8 @@ void sub_80B40E8(u8 taskId) // Mart_DoCursorAction PauseVerticalScrollIndicator(1); sub_80F979C(1, 1); sub_80B39D0(gMartInfo.cursor, gMartInfo.cursor, 1); - HandleDestroyMenuCursors(); - MenuZeroFillWindowRect(0, 0xC, 0xD, 0x13); + Menu_DestroyCursor(); + Menu_EraseWindowRect(0, 0xC, 0xD, 0x13); if (gMartInfo.martType == MART_TYPE_0) { @@ -1139,8 +1139,8 @@ void sub_80B40E8(u8 taskId) // Mart_DoCursorAction void sub_80B4378(u8 taskId) { - MenuZeroFillWindowRect(0, 0xE, 0x1D, 0x13); - MenuZeroFillWindowRect(0, 0xA, 0xD, 0xD); + Menu_EraseWindowRect(0, 0xE, 0x1D, 0x13); + Menu_EraseWindowRect(0, 0xA, 0xD, 0xD); sub_80A3FA0(gBGTilemapBuffers[1], 0x1, 0xB, 0xC, 0x2, 0); sub_80B3420(); sub_80B3764(6, 7); diff --git a/src/field/slot_machine.c b/src/field/slot_machine.c index a524790b4..9ff3a037c 100644 --- a/src/field/slot_machine.c +++ b/src/field/slot_machine.c @@ -400,8 +400,8 @@ static void SlotMachineSetup_0_1(void) static void SlotMachineSetup_3_0(void) { - SetUpWindowConfig(&gWindowConfig_81E7128); - InitMenuWindow(&gWindowConfig_81E7128); + Text_LoadWindowTemplate(&gWindowTemplate_81E7128); + InitMenuWindow(&gWindowTemplate_81E7128); } static void SlotMachineSetup_4_0(void) @@ -584,8 +584,8 @@ static bool8 sub_8101E3C(struct Task *task) static void sub_8101F2C(const u8 *str) { - MenuDisplayMessageBox(); - MenuPrint(str, 2, 15); + Menu_DisplayDialogueFrame(); + Menu_PrintText(str, 2, 15); } static bool8 sub_8101F44(struct Task *task) @@ -599,7 +599,7 @@ static bool8 sub_8101F60(struct Task *task) { if (gMain.newKeys & (A_BUTTON | B_BUTTON)) { - MenuZeroFillScreen(); + Menu_EraseScreen(); eSlotMachine->state = 5; } return FALSE; @@ -850,10 +850,10 @@ static bool8 sub_8102318(struct Task *task) static bool8 sub_8102344(struct Task *task) { - s8 input = ProcessMenuInputNoWrap_(); + s8 input = Menu_ProcessInputNoWrap_(); if (input == 0) { - MenuZeroFillScreen(); + Menu_EraseScreen(); sub_8103D8C(0); sub_8103D8C(1); sub_8103D8C(2); @@ -862,7 +862,7 @@ static bool8 sub_8102344(struct Task *task) } else if (input == 1 || input == -1) { - MenuZeroFillScreen(); + Menu_EraseScreen(); eSlotMachine->state = 5; } return FALSE; @@ -879,7 +879,7 @@ static bool8 sub_81023B8(struct Task *task) { if (gMain.newKeys & (A_BUTTON | B_BUTTON)) { - MenuZeroFillScreen(); + Menu_EraseScreen(); eSlotMachine->state = 5; } return FALSE; @@ -896,7 +896,7 @@ static bool8 sub_81023FC(struct Task *task) { if (gMain.newKeys & (A_BUTTON | B_BUTTON)) { - MenuZeroFillScreen(); + Menu_EraseScreen(); eSlotMachine->state = 27; } return FALSE; @@ -2807,8 +2807,8 @@ static void sub_8104B80(struct Task *task) { sub_8104DA4(); sub_81065DC(); - BasicInitMenuWindow(&gWindowConfig_81E7144); - MenuPrint_PixelCoords(gOtherText_ReelTime, 10, 32, 1); + BasicInitMenuWindow(&gWindowTemplate_81E7144); + Menu_PrintTextPixelCoords(gOtherText_ReelTime, 10, 32, 1); BeginNormalPaletteFade(-1, 0, 16, 0, 0); task->data[0]++; } @@ -2824,8 +2824,8 @@ static void sub_8104BC8(struct Task *task) static void sub_8104BFC(struct Task *task) { - MenuZeroFillScreen(); - BasicInitMenuWindow(&gWindowConfig_81E7128); + Menu_EraseScreen(); + BasicInitMenuWindow(&gWindowTemplate_81E7128); sub_81064B8(); sub_8104CAC(task->data[1]); sub_810423C(eSlotMachine->pikaPower); diff --git a/src/field/start_menu.c b/src/field/start_menu.c index dccf1714e..5b2276d1b 100644 --- a/src/field/start_menu.c +++ b/src/field/start_menu.c @@ -193,8 +193,8 @@ static void BuildStartMenuActions_Link(void) static void DisplaySafariBallsWindow(void) { sub_8072C44(gStringVar1, gNumSafariBalls, 12, 1); - MenuDrawTextWindow(0, 0, 10, 5); - MenuPrint(gOtherText_SafariStock, 1, 1); + Menu_DrawStdWindowFrame(0, 0, 10, 5); + Menu_PrintText(gOtherText_SafariStock, 1, 1); } //Prints n menu items starting at *index @@ -204,7 +204,7 @@ static bool32 PrintStartMenuItemsMultistep(s16 *index, u32 n) do { - MenuPrint(sStartMenuItems[sCurrentStartMenuActions[_index]].text, 23, 2 + _index * 2); + Menu_PrintText(sStartMenuItems[sCurrentStartMenuActions[_index]].text, 23, 2 + _index * 2); _index++; if (_index >= sNumStartMenuActions) { @@ -226,7 +226,7 @@ static bool32 InitStartMenuMultistep(s16 *step, s16 *index) (*step)++; break; case 2: - MenuDrawTextWindow(22, 0, 29, sNumStartMenuActions * 2 + 3); + Menu_DrawStdWindowFrame(22, 0, 29, sNumStartMenuActions * 2 + 3); *index = 0; (*step)++; break; @@ -271,7 +271,7 @@ void CreateStartMenuTask(void (*func)(u8)) { u8 taskId; - InitMenuWindow(&gWindowConfig_81E6CE4); + InitMenuWindow(&gWindowTemplate_81E6CE4); taskId = CreateTask(Task_StartMenu, 0x50); SetTaskFuncWithFollowupFunc(taskId, Task_StartMenu, func); } @@ -310,12 +310,12 @@ static u8 StartMenu_InputProcessCallback(void) if (gMain.newKeys & DPAD_UP) { PlaySE(SE_SELECT); - sStartMenuCursorPos = MoveMenuCursor(-1); + sStartMenuCursorPos = Menu_MoveCursor(-1); } if (gMain.newKeys & DPAD_DOWN) { PlaySE(SE_SELECT); - sStartMenuCursorPos = MoveMenuCursor(1); + sStartMenuCursorPos = Menu_MoveCursor(1); } if (gMain.newKeys & A_BUTTON) { @@ -404,7 +404,7 @@ static u8 StartMenu_PlayerCallback(void) //When player selects SAVE static u8 StartMenu_SaveCallback(void) { - HandleDestroyMenuCursors(); + Menu_DestroyCursor(); gCallback_03004AE8 = SaveCallback1; return 0; } @@ -473,13 +473,13 @@ static u8 SaveCallback2(void) return FALSE; case SAVE_CANCELED: //Go back to start menu - MenuZeroFillScreen(); + Menu_EraseScreen(); InitStartMenu(); gCallback_03004AE8 = StartMenu_InputProcessCallback; return FALSE; case SAVE_SUCCESS: case SAVE_ERROR: - MenuZeroFillScreen(); + Menu_EraseScreen(); sub_8064E2C(); ScriptContext2_Disable(); return TRUE; @@ -498,7 +498,7 @@ static u8 RunSaveDialogCallback(void) { if (savingComplete) { - if (!MenuUpdateWindowText()) + if (!Menu_UpdateWindowText()) return 0; } savingComplete = FALSE; @@ -514,7 +514,7 @@ void ScrSpecial_DoSaveDialog(void) static void DisplaySaveMessageWithCallback(const u8 *ptr, u8 (*func)(void)) { StringExpandPlaceholders(gStringVar4, ptr); - MenuDisplayMessageBox(); + Menu_DisplayDialogueFrame(); MenuPrintMessageDefaultCoords(gStringVar4); savingComplete = TRUE; saveDialogCallback = func; @@ -547,7 +547,7 @@ static void sub_8071700(void) static void HideSaveDialog(void) { - MenuZeroFillWindowRect(20, 8, 26, 13); + Menu_EraseWindowRect(20, 8, 26, 13); } static void SaveDialogStartTimeout(void) @@ -579,7 +579,7 @@ static bool8 SaveDialogCheckForTimeoutAndKeypress(void) static u8 SaveDialogCB_DisplayConfirmMessage(void) { - MenuZeroFillScreen(); + Menu_EraseScreen(); HandleDrawSaveWindowInfo(0, 0); DisplaySaveMessageWithCallback(gSaveText_WouldYouLikeToSave, SaveDialogCB_DisplayConfirmYesNoMenu); return SAVE_IN_PROGRESS; @@ -594,7 +594,7 @@ static u8 SaveDialogCB_DisplayConfirmYesNoMenu(void) static u8 SaveDialogCB_ProcessConfirmYesNoMenu(void) { - switch (ProcessMenuInputNoWrap_()) + switch (Menu_ProcessInputNoWrap_()) { case 0: //YES HideSaveDialog(); @@ -640,7 +640,7 @@ static u8 SaveDialogCB_DisplayOverwriteYesNoMenu(void) static u8 SaveDialogCB_ProcessOverwriteYesNoMenu(void) { - switch (ProcessMenuInputNoWrap_()) + switch (Menu_ProcessInputNoWrap_()) { case 0: //YES HideSaveDialog(); @@ -694,7 +694,7 @@ static u8 SaveDialogCB_DoSave(void) static u8 SaveDialogCB_SaveSuccess(void) { - if (MenuUpdateWindowText()) + if (Menu_UpdateWindowText()) { PlaySE(SE_SAVE); saveDialogCallback = SaveDialogCB_ReturnSuccess; @@ -715,7 +715,7 @@ static u8 SaveDialogCB_ReturnSuccess(void) static u8 SaveDialogCB_SaveError(void) { - if (MenuUpdateWindowText()) + if (Menu_UpdateWindowText()) { PlaySE(SE_BOO); saveDialogCallback = SaveDialogCB_ReturnError; @@ -774,8 +774,8 @@ static bool32 sub_80719FC(u8 *step) dp12_8087EA4(); break; case 2: - SetUpWindowConfig(&gWindowConfig_81E6CE4); - InitMenuWindow(&gWindowConfig_81E6CE4); + Text_LoadWindowTemplate(&gWindowTemplate_81E6CE4); + InitMenuWindow(&gWindowTemplate_81E6CE4); REG_DISPCNT = DISPCNT_MODE_0 | DISPCNT_BG0_ON; break; case 3: @@ -821,8 +821,8 @@ static void Task_8071B64(u8 taskId) switch (*step) { case 0: - MenuDisplayMessageBox(); - MenuPrint(gSystemText_Saving, 2, 15); + Menu_DisplayDialogueFrame(); + Menu_PrintText(gSystemText_Saving, 2, 15); BeginNormalPaletteFade(-1, 0, 0x10, 0, 0); (*step)++; break; diff --git a/src/field/starter_choose.c b/src/field/starter_choose.c index 701d4087a..91b706e78 100644 --- a/src/field/starter_choose.c +++ b/src/field/starter_choose.c @@ -294,8 +294,8 @@ void CB2_ChooseStarter(void) LoadCompressedObjectPic(&gUnknown_083F7794[0]); LoadCompressedObjectPic(&gUnknown_083F77A4[0]); LoadSpritePalettes(gUnknown_083F77B4); - SetUpWindowConfig(&gWindowConfig_81E6C3C); - InitMenuWindow(&gWindowConfig_81E6CE4); + Text_LoadWindowTemplate(&gWindowTemplate_81E6C3C); + InitMenuWindow(&gWindowTemplate_81E6CE4); BeginNormalPaletteFade(-1, 0, 0x10, 0, 0); savedIme = REG_IME; @@ -355,8 +355,8 @@ static void MainCallback2(void) static void Task_StarterChoose1(u8 taskId) { CreateStarterPokemonLabel(0xFF, gTasks[taskId].tStarterSelection); - MenuDrawTextWindow(2, 14, 27, 19); - MenuPrint(gOtherText_BirchInTrouble, 3, 15); + Menu_DrawStdWindowFrame(2, 14, 27, 19); + Menu_PrintText(gOtherText_BirchInTrouble, 3, 15); gTasks[taskId].func = Task_StarterChoose2; } @@ -368,7 +368,7 @@ static void Task_StarterChoose2(u8 taskId) { u8 spriteId; - MenuZeroFillWindowRect( + Menu_EraseWindowRect( gStarterChoose_LabelCoords[selection][0], gStarterChoose_LabelCoords[selection][1], gStarterChoose_LabelCoords[selection][0] + 13, @@ -424,9 +424,9 @@ static void Task_StarterChoose3(u8 taskId) static void Task_StarterChoose4(u8 taskId) { PlayCry1(GetStarterPokemon(gTasks[taskId].tStarterSelection), 0); - MenuDrawTextWindow(2, 14, 27, 19); + Menu_DrawStdWindowFrame(2, 14, 27, 19); //"Do you choose this POKEMON?" - MenuPrint(gOtherText_DoYouChoosePoke, 3, 15); + Menu_PrintText(gOtherText_DoYouChoosePoke, 3, 15); DisplayYesNoMenu(21, 7, 1); gTasks[taskId].func = Task_StarterChoose5; } @@ -435,7 +435,7 @@ static void Task_StarterChoose5(u8 taskId) { u8 spriteId; - switch (ProcessMenuInputNoWrap_()) + switch (Menu_ProcessInputNoWrap_()) { case 0: // YES //Return the starter choice and exit. @@ -445,7 +445,7 @@ static void Task_StarterChoose5(u8 taskId) case 1: // NO case -1: // B button PlaySE(SE_SELECT); - MenuZeroFillWindowRect(21, 7, 27, 12); + Menu_EraseWindowRect(21, 7, 27, 12); spriteId = gTasks[taskId].tPkmnSpriteId; FreeSpritePaletteByTag(GetSpritePaletteTagByPaletteNum(gSprites[spriteId].oam.paletteNum)); @@ -498,7 +498,7 @@ static void CreateStarterPokemonLabel(u8 prevSelection, u8 selection) if (prevSelection != 0xFF) { //Remove the old Pokemon label - MenuZeroFillWindowRect( + Menu_EraseWindowRect( gStarterChoose_LabelCoords[prevSelection][0], gStarterChoose_LabelCoords[prevSelection][1], gStarterChoose_LabelCoords[prevSelection][0] + 13, @@ -527,7 +527,7 @@ static void CreateStarterPokemonLabel(u8 prevSelection, u8 selection) //Copy POKEMON string to label StringCopy(labelText + dstIndex, gOtherText_Poke); - MenuPrint( + Menu_PrintText( labelText, gStarterChoose_LabelCoords[selection][0], gStarterChoose_LabelCoords[selection][1]); @@ -535,7 +535,7 @@ static void CreateStarterPokemonLabel(u8 prevSelection, u8 selection) //Copy Pokemon name to label sub_8072C74(labelText + 5, gSpeciesNames[species], 0x6B, 1); - MenuPrint( + Menu_PrintText( labelText, gStarterChoose_LabelCoords[selection][0], gStarterChoose_LabelCoords[selection][1] + 2); @@ -574,7 +574,7 @@ static void CreateStarterPokemonLabel(u8 prevSelection, u8 selection) adds r3, r1, 0x3\n\ lsls r3, 24\n\ lsrs r3, 24\n\ - bl MenuZeroFillWindowRect\n\ + bl Menu_EraseWindowRect\n\ ldr r0, _0810A964 @ =0x04000040\n\ movs r1, 0\n\ strh r1, [r0]\n\ @@ -649,7 +649,7 @@ _0810A8CA:\n\ mov r0, sp\n\ adds r1, r4, 0\n\ adds r2, r5, 0\n\ - bl MenuPrint\n\ + bl Menu_PrintText\n\ mov r0, sp\n\ movs r1, 0\n\ movs r2, 0xF\n\ @@ -669,7 +669,7 @@ _0810A8CA:\n\ lsrs r2, 24\n\ mov r0, sp\n\ adds r1, r4, 0\n\ - bl MenuPrint\n\ + bl Menu_PrintText\n\ lsls r0, r4, 3\n\ adds r0, 0x4\n\ lsls r0, 24\n\ diff --git a/src/field/trader.c b/src/field/trader.c index 61cb0b4a2..b4732ab15 100644 --- a/src/field/trader.c +++ b/src/field/trader.c @@ -100,7 +100,7 @@ void CreateAvailableDecorationsMenu(u8 taskId) } } - MenuDrawTextWindow(0, 1, 12, numChoices * 2 + 2); + Menu_DrawStdWindowFrame(0, 1, 12, numChoices * 2 + 2); for (i = 0; i < 4; i++) { @@ -108,18 +108,18 @@ void CreateAvailableDecorationsMenu(u8 taskId) { if (trader->unk1[i] > DECOR_REGISTEEL_DOLL) { - MenuPrint(gOtherText_FiveQuestionsAndSlash, 1, numDecorations * 2 + 2); + Menu_PrintText(gOtherText_FiveQuestionsAndSlash, 1, numDecorations * 2 + 2); } else { - MenuPrint(gDecorations[trader->unk1[i]].name, 1, numDecorations * 2 + 2); + Menu_PrintText(gDecorations[trader->unk1[i]].name, 1, numDecorations * 2 + 2); } numDecorations++; } } - MenuPrint(gOtherText_CancelNoTerminator, 1, numDecorations * 2 + 2); + Menu_PrintText(gOtherText_CancelNoTerminator, 1, numDecorations * 2 + 2); InitMenu(0, 1, 2, numChoices, 0, 11); gTasks[taskId].data[1] = numDecorations; } @@ -135,8 +135,8 @@ void sub_8109B34(u8 taskId, u8 decorationId) gSpecialVar_0x8004 = decorationId; } - HandleDestroyMenuCursors(); - MenuZeroFillWindowRect(0, 1, 12, 12); + Menu_DestroyCursor(); + Menu_EraseWindowRect(0, 1, 12, 12); DestroyTask(taskId); EnableBothScriptContexts(); } @@ -148,17 +148,17 @@ void Task_HandleGetDecorationMenuInput(u8 taskId) if (gMain.newKeys & DPAD_UP) { PlaySE(SE_SELECT); - MoveMenuCursor(-1); + Menu_MoveCursor(-1); } else if (gMain.newKeys & DPAD_DOWN) { PlaySE(SE_SELECT); - MoveMenuCursor(1); + Menu_MoveCursor(1); } else if (gMain.newKeys & A_BUTTON) { PlaySE(SE_SELECT); - gSpecialVar_0x8005 = GetMenuCursorPos(); + gSpecialVar_0x8005 = Menu_GetCursorPos(); if (gTasks[taskId].data[1] == gSpecialVar_0x8005) { sub_8109B34(taskId, 0); @@ -215,8 +215,8 @@ void ScrSpecial_TraderMenuGiveDecoration(void) void sub_8109D04(u8 taskId) { - HandleDestroyMenuCursors(); - MenuZeroFillWindowRect(0, 0, 29, 19); + Menu_DestroyCursor(); + Menu_EraseWindowRect(0, 0, 29, 19); DestroyVerticalScrollIndicator(0); DestroyVerticalScrollIndicator(1); sub_80F9520(gUnknown_020388F7, 8); @@ -237,8 +237,8 @@ void sub_8109D04(u8 taskId) void sub_8109DAC(u8 taskId) { - HandleDestroyMenuCursors(); - MenuZeroFillWindowRect(0, 0, 29, 19); + Menu_DestroyCursor(); + Menu_EraseWindowRect(0, 0, 29, 19); gSpecialVar_0x8006 = 0; DestroyTask(taskId); EnableBothScriptContexts(); diff --git a/src/field/tv.c b/src/field/tv.c index e88e3c72b..e1eade130 100644 --- a/src/field/tv.c +++ b/src/field/tv.c @@ -864,7 +864,7 @@ void PutPokemonTodayCaughtOnAir(void) sub_80BE138((TVShow *)pokemonToday); pokemonToday->language = GAME_LANGUAGE; pokemonToday->language2 = sub_80BDEAC(pokemonToday->nickname); - StripExtCtrlCodes(pokemonToday->nickname); + Text_StripExtCtrlCodes(pokemonToday->nickname); } } } @@ -966,7 +966,7 @@ void InterviewAfter_BravoTrainerPokemonProfile(void) sub_80BE160((TVShow *)bravoTrainerNew); bravoTrainerNew->language = GAME_LANGUAGE; bravoTrainerNew->var1f = sub_80BDEAC(bravoTrainerNew->pokemonNickname); - StripExtCtrlCodes(bravoTrainerNew->pokemonNickname); + Text_StripExtCtrlCodes(bravoTrainerNew->pokemonNickname); } } @@ -1075,7 +1075,7 @@ void sub_80BE478(void) sub_80BE160((TVShow *)nameRaterShow); nameRaterShow->language = GAME_LANGUAGE; nameRaterShow->pokemonNameLanguage = sub_80BDEAC(nameRaterShow->pokemonName); - StripExtCtrlCodes(nameRaterShow->pokemonName); + Text_StripExtCtrlCodes(nameRaterShow->pokemonName); } } @@ -1138,7 +1138,7 @@ void InterviewAfter_PkmnFanClubOpinions(void) sub_80BE160((TVShow *)fanclubOpinions); fanclubOpinions->language = GAME_LANGUAGE; fanclubOpinions->var0E = sub_80BDEAC(fanclubOpinions->var10); - StripExtCtrlCodes(fanclubOpinions->var10); + Text_StripExtCtrlCodes(fanclubOpinions->var10); } void InterviewAfter_DummyShow4(void) diff --git a/src/field/use_pokeblock.c b/src/field/use_pokeblock.c index 7253ac901..9363498ba 100644 --- a/src/field/use_pokeblock.c +++ b/src/field/use_pokeblock.c @@ -228,11 +228,11 @@ static void sub_8136294(void) gUnknown_02039304->unk50++; break; case 3: - SetUpWindowConfig(&gWindowConfig_81E7080); + Text_LoadWindowTemplate(&gWindowTemplate_81E7080); gUnknown_02039304->unk50++; break; case 4: - MultistepInitMenuWindowBegin(&gWindowConfig_81E7080); + MultistepInitMenuWindowBegin(&gWindowTemplate_81E7080); gUnknown_02039304->unk50++; break; case 5: @@ -610,28 +610,28 @@ static void sub_8136BB8(void) GetMonData(&gPlayerParty[sub_81370A4(gUnknown_083DFEC4->unk87DC)], MON_DATA_NICKNAME, gUnknown_02039304->stringBuffer); StringGetEnd10(gUnknown_02039304->stringBuffer); StringAppend(gUnknown_02039304->stringBuffer, gOtherText_GetsAPokeBlock); - BasicInitMenuWindow(&gWindowConfig_81E709C); - MenuDrawTextWindow(0, 16, 29, 19); - MenuPrint(gUnknown_02039304->stringBuffer, 1, 17); + BasicInitMenuWindow(&gWindowTemplate_81E709C); + Menu_DrawStdWindowFrame(0, 16, 29, 19); + Menu_PrintText(gUnknown_02039304->stringBuffer, 1, 17); DisplayYesNoMenu(23, 10, 1); - MoveMenuCursor(0); + Menu_MoveCursor(0); } static s8 sub_8136C40(void) { - s8 retval = ProcessMenuInputNoWrap(); + s8 retval = Menu_ProcessInputNoWrap(); if ((u8)(retval + 1) < 3) { - MenuZeroFillScreen(); - BasicInitMenuWindow(&gWindowConfig_81E7080); + Menu_EraseScreen(); + BasicInitMenuWindow(&gWindowTemplate_81E7080); } return retval; } static void sub_8136C6C(void) { - BasicInitMenuWindow(&gWindowConfig_81E709C); - MenuDrawTextWindow(0, 16, 29, 19); + BasicInitMenuWindow(&gWindowTemplate_81E709C); + Menu_DrawStdWindowFrame(0, 16, 29, 19); for (gUnknown_02039304->unk53 = 0; gUnknown_02039304->unk53 < 5 && gUnknown_02039304->unk61[gUnknown_02039304->unk53] == 0; gUnknown_02039304->unk53++); if (gUnknown_02039304->unk53 < 5) { @@ -667,21 +667,21 @@ static bool8 sub_8136D00(void) static void sub_8136D60(void) { - BasicInitMenuWindow(&gWindowConfig_81E709C); - MenuDrawTextWindow(0, 16, 29, 19); - MenuPrint(gOtherText_WontEat, 1, 17); + BasicInitMenuWindow(&gWindowTemplate_81E709C); + Menu_DrawStdWindowFrame(0, 16, 29, 19); + Menu_PrintText(gOtherText_WontEat, 1, 17); } static void sub_8136D8C(void) { - MenuZeroFillScreen(); - BasicInitMenuWindow(&gWindowConfig_81E7080); + Menu_EraseScreen(); + BasicInitMenuWindow(&gWindowTemplate_81E7080); } static void Pokeblock_MenuWindowTextPrint(const u8 *message) { - MenuDrawTextWindow(0, 16, 29, 19); - MenuPrint(message, 1, 17); + Menu_DrawStdWindowFrame(0, 16, 29, 19); + Menu_PrintText(message, 1, 17); } #ifdef NONMATCHING diff --git a/src/field/wallclock.c b/src/field/wallclock.c index 2892d09f9..4f2a6dccd 100644 --- a/src/field/wallclock.c +++ b/src/field/wallclock.c @@ -236,8 +236,8 @@ static void LoadWallClockGraphics(void) FreeAllSpritePalettes(); LoadCompressedObjectPic(&gUnknown_083F7A90[0]); LoadSpritePalettes(gUnknown_083F7AA0); - SetUpWindowConfig(&gWindowConfig_81E6C3C); - InitMenuWindow(&gWindowConfig_81E6CE4); + Text_LoadWindowTemplate(&gWindowTemplate_81E6C3C); + InitMenuWindow(&gWindowTemplate_81E6CE4); } static void WallClockInit(void) @@ -414,10 +414,10 @@ static void Task_SetClock2(u8 taskId) //Ask player "Is this the correct time?" static void Task_SetClock3(u8 taskId) { - MenuDrawTextWindow(2, 16, 27, 19); - MenuPrint(gOtherText_CorrectTimePrompt, 3, 17); - MenuDrawTextWindow(23, 8, 29, 13); - PrintMenuItems(24, 9, 2, gMenuYesNoItems); + Menu_DrawStdWindowFrame(2, 16, 27, 19); + Menu_PrintText(gOtherText_CorrectTimePrompt, 3, 17); + Menu_DrawStdWindowFrame(23, 8, 29, 13); + Menu_PrintItems(24, 9, 2, gMenuYesNoItems); InitMenu(0, 24, 9, 2, 1, 5); gTasks[taskId].func = Task_SetClock4; } @@ -425,7 +425,7 @@ static void Task_SetClock3(u8 taskId) //Get menu selection static void Task_SetClock4(u8 taskId) { - switch (ProcessMenuInputNoWrap_()) + switch (Menu_ProcessInputNoWrap_()) { case 0: //YES PlaySE(SE_SELECT); @@ -433,10 +433,10 @@ static void Task_SetClock4(u8 taskId) return; case -1: //B button case 1: //NO - HandleDestroyMenuCursors(); + Menu_DestroyCursor(); PlaySE(SE_SELECT); - MenuZeroFillWindowRect(23, 8, 29, 13); - MenuZeroFillWindowRect(2, 16, 27, 19); + Menu_EraseWindowRect(23, 8, 29, 13); + Menu_EraseWindowRect(2, 16, 27, 19); gTasks[taskId].func = Task_SetClock2; //Go back and let player adjust clock } } diff --git a/src/pokemon/learn_move.c b/src/pokemon/learn_move.c index ef1d66349..356a31b00 100644 --- a/src/pokemon/learn_move.c +++ b/src/pokemon/learn_move.c @@ -25,8 +25,8 @@ extern u16 gSpecialVar_0x8004; extern u16 gSpecialVar_0x8005; extern u8 gTileBuffer[]; -extern const struct WindowConfig gWindowConfig_81E6CE4; -extern const struct WindowConfig gWindowConfig_81E7240; +extern const struct WindowTemplate gWindowTemplate_81E6CE4; +extern const struct WindowTemplate gWindowTemplate_81E7240; extern const u8 *const gContestEffectStrings[]; extern const u8 *const gMoveDescriptions[]; extern const u8 gTypeNames[][7]; @@ -268,13 +268,13 @@ void CB2_InitLearnMove(void) sub_8133558(); SetVBlankCallback(VBlankCB_LearnMove); - SetUpWindowConfig(&gWindowConfig_81E7240); - InitMenuWindow(&gWindowConfig_81E7240); - MenuZeroFillScreen(); + Text_LoadWindowTemplate(&gWindowTemplate_81E7240); + InitMenuWindow(&gWindowTemplate_81E7240); + Menu_EraseScreen(); - SetUpWindowConfig(&gWindowConfig_81E6CE4); - InitMenuWindow(&gWindowConfig_81E6CE4); - MenuZeroFillScreen(); + Text_LoadWindowTemplate(&gWindowTemplate_81E6CE4); + InitMenuWindow(&gWindowTemplate_81E6CE4); + Menu_EraseScreen(); REG_BG0VOFS = 0; REG_BG0VOFS = 0; // huh? @@ -302,13 +302,13 @@ void sub_81327A4(void) sLearnMoveStruct->unk2C6 = gSpecialVar_0x8005; SetVBlankCallback(VBlankCB_LearnMove); - SetUpWindowConfig(&gWindowConfig_81E7240); - InitMenuWindow(&gWindowConfig_81E7240); - MenuZeroFillScreen(); + Text_LoadWindowTemplate(&gWindowTemplate_81E7240); + InitMenuWindow(&gWindowTemplate_81E7240); + Menu_EraseScreen(); - SetUpWindowConfig(&gWindowConfig_81E6CE4); - InitMenuWindow(&gWindowConfig_81E6CE4); - MenuZeroFillScreen(); + Text_LoadWindowTemplate(&gWindowTemplate_81E6CE4); + InitMenuWindow(&gWindowTemplate_81E6CE4); + Menu_EraseScreen(); REG_DISPCNT = 0x1340; REG_BG0VOFS = 0; @@ -333,7 +333,7 @@ void CB2_LearnMove(void) if (sLearnMoveStruct->unk1D) { sLearnMoveStruct->unk1D = FALSE; - sub_814AD7C(0x58, (sLearnMoveStruct->unk18 * 2 + 1) * 8); + MenuCursor_SetPos814AD7C(0x58, (sLearnMoveStruct->unk18 * 2 + 1) * 8); } if (sLearnMoveStruct->unk1E != 0) { @@ -401,7 +401,7 @@ void LearnMoveMain(void) sub_813362C(); break; case 8: - if (MenuUpdateWindowText()) + if (Menu_UpdateWindowText()) { DisplayYesNoMenu(21, 7, 1); sLearnMoveStruct->state++; @@ -409,7 +409,7 @@ void LearnMoveMain(void) break; case 9: { - s8 selection = ProcessMenuInputNoWrap_(); + s8 selection = Menu_ProcessInputNoWrap_(); if (selection == 0) { @@ -436,7 +436,7 @@ void LearnMoveMain(void) } break; case 12: - if (MenuUpdateWindowText()) + if (Menu_UpdateWindowText()) { DisplayYesNoMenu(21, 7, 1); sLearnMoveStruct->state++; @@ -444,7 +444,7 @@ void LearnMoveMain(void) break; case 13: { - s8 selection = ProcessMenuInputNoWrap_(); + s8 selection = Menu_ProcessInputNoWrap_(); if (selection == 0) { @@ -467,7 +467,7 @@ void LearnMoveMain(void) sLearnMoveStruct->state++; break; case 17: - if (MenuUpdateWindowText()) + if (Menu_UpdateWindowText()) { DisplayYesNoMenu(21, 7, 1); sLearnMoveStruct->state = 18; @@ -475,7 +475,7 @@ void LearnMoveMain(void) break; case 18: { - s8 var = ProcessMenuInputNoWrap_(); + s8 var = Menu_ProcessInputNoWrap_(); if (var == 0) { @@ -495,7 +495,7 @@ void LearnMoveMain(void) sLearnMoveStruct->state++; break; case 25: - if (MenuUpdateWindowText()) + if (Menu_UpdateWindowText()) { sLearnMoveStruct->state = 26; DisplayYesNoMenu(21, 7, 1); @@ -503,7 +503,7 @@ void LearnMoveMain(void) break; case 26: { - s8 var = ProcessMenuInputNoWrap_(); + s8 var = Menu_ProcessInputNoWrap_(); if (var == 0) { @@ -524,7 +524,7 @@ void LearnMoveMain(void) } break; case 27: - if (MenuUpdateWindowText()) + if (Menu_UpdateWindowText()) { if (sLearnMoveStruct->showContestInfo == FALSE) sLearnMoveStruct->state = 3; @@ -533,7 +533,7 @@ void LearnMoveMain(void) } break; case 19: - if (MenuUpdateWindowText()) + if (Menu_UpdateWindowText()) { sLearnMoveStruct->state = 20; BeginNormalPaletteFade(0xFFFFFFFF, 0, 0, 16, 0); @@ -547,7 +547,7 @@ void LearnMoveMain(void) } break; case 21: - if (MenuUpdateWindowText()) + if (Menu_UpdateWindowText()) sLearnMoveStruct->state = 14; break; case 22: @@ -597,7 +597,7 @@ void LearnMoveMain(void) } break; case 30: - if (MenuUpdateWindowText()) + if (Menu_UpdateWindowText()) { #ifdef ENGLISH sub_81328E8(gOtherText_ForgotOrDidNotLearnMove); @@ -609,7 +609,7 @@ void LearnMoveMain(void) } break; case 31: - if (MenuUpdateWindowText()) + if (Menu_UpdateWindowText()) { PlayFanfare(BGM_FANFA1); sLearnMoveStruct->state = 32; @@ -633,16 +633,16 @@ void DrawLearnMoveMenuWindow(void) { u32 i; - BasicInitMenuWindow(&gWindowConfig_81E7240); + BasicInitMenuWindow(&gWindowTemplate_81E7240); for (i = 0; i < 4; i++) { - MenuDrawTextWindow( + Menu_DrawStdWindowFrame( gUnknown_08402CF8[i][0], gUnknown_08402CF8[i][1], gUnknown_08402CF8[i][2], gUnknown_08402CF8[i][3]); } - BasicInitMenuWindow(&gWindowConfig_81E6CE4); + BasicInitMenuWindow(&gWindowTemplate_81E6CE4); } void sub_8133030(bool8 a) @@ -658,7 +658,7 @@ void sub_8133030(bool8 a) for (i = 0; gUnknown_08402D08[0][i].unk0 != NULL; i++) { sub_8072C74(gTileBuffer, gUnknown_08402D08[0][i].unk0, 64, 2); - MenuPrint(gTileBuffer, gUnknown_08402D08[0][i].unk4, gUnknown_08402D08[0][i].unk5); + Menu_PrintText(gTileBuffer, gUnknown_08402D08[0][i].unk4, gUnknown_08402D08[0][i].unk5); } if (!a) @@ -696,10 +696,10 @@ void sub_8133140(bool8 a) for (i = 0; gUnknown_08402D08[0][i].unk0 != NULL; i++) { sub_8072C74(gTileBuffer, gUnknown_08402D08[1][i].unk0, 64, 2); - MenuPrint(gTileBuffer, gUnknown_08402D08[1][i].unk4, gUnknown_08402D08[1][i].unk5); + Menu_PrintText(gTileBuffer, gUnknown_08402D08[1][i].unk4, gUnknown_08402D08[1][i].unk5); if (i != 0) { - MenuZeroFillWindowRect( + Menu_EraseWindowRect( gUnknown_08402D08[1][i].unk4, gUnknown_08402D08[1][i].unk5 + 2, gUnknown_08402D08[1][i].unk4 + 7, @@ -938,7 +938,7 @@ void sub_8133800(void) r6++; } *str = EOS; - MenuPrint(gTileBuffer, 11, 1); + Menu_PrintText(gTileBuffer, 11, 1); sub_813360C(0); } @@ -972,17 +972,17 @@ void PrintMoveInfo(u16 moveId, const u8 *b) sub_8072C74(str, gOtherText_ThreeDashes2, 32, 2); else sub_8072C14(str, gBattleMoves[moveId].power, 32, 2); - MenuPrint(str, b[0], b[1]); + Menu_PrintText(str, b[0], b[1]); break; case 4: if (gBattleMoves[moveId].accuracy == 0) sub_8072C74(str, gOtherText_ThreeDashes2, 32, 2); else sub_8072C14(str, gBattleMoves[moveId].accuracy, 32, 2); - MenuPrint(str, b[0], b[1]); + Menu_PrintText(str, b[0], b[1]); break; case 6: - MenuZeroFillWindowRect(b[0], b[1], b[0], b[1] + 1); + Menu_EraseWindowRect(b[0], b[1], b[0], b[1] + 1); numHearts = gContestEffects[gContestMoves[moveId].effect].appeal / 10; if (numHearts == 255) numHearts = 0; @@ -995,7 +995,7 @@ void PrintMoveInfo(u16 moveId, const u8 *b) } break; case 7: - MenuZeroFillWindowRect(b[0], b[1], b[0], b[1] + 1); + Menu_EraseWindowRect(b[0], b[1], b[0], b[1] + 1); numHearts = gContestEffects[gContestMoves[moveId].effect].jam / 10; if (numHearts == 255) numHearts = 0; @@ -1037,7 +1037,7 @@ void sub_8133AEC(bool8 contestInfo, int unused) { u8 r1 = var * 2 + 9; - MenuFillWindowRectWithBlankTile(11, r1, 28, 12); + Menu_BlankWindowRect(11, r1, 28, 12); } } } @@ -1045,22 +1045,22 @@ void sub_8133AEC(bool8 contestInfo, int unused) { if (contestInfo) { - MenuZeroFillWindowRect(gUnknown_08402E24[5][0], gUnknown_08402E24[5][1], gUnknown_08402E24[5][0], gUnknown_08402E24[5][1] + 1); - MenuZeroFillWindowRect(gUnknown_08402E24[6][0], gUnknown_08402E24[6][1], gUnknown_08402E24[6][0], gUnknown_08402E24[6][1] + 1); + Menu_EraseWindowRect(gUnknown_08402E24[5][0], gUnknown_08402E24[5][1], gUnknown_08402E24[5][0], gUnknown_08402E24[5][1] + 1); + Menu_EraseWindowRect(gUnknown_08402E24[6][0], gUnknown_08402E24[6][1], gUnknown_08402E24[6][0], gUnknown_08402E24[6][1] + 1); for (i = 0; i < 16; i++) gSprites[sLearnMoveStruct->spriteIDs[i + 4]].invisible = TRUE; } else { - MenuZeroFillWindowRect(gUnknown_08402E24[1][0], gUnknown_08402E24[1][1], gUnknown_08402E24[1][0] + 3, gUnknown_08402E24[1][1] + 1); - MenuZeroFillWindowRect(gUnknown_08402E24[3][0], gUnknown_08402E24[3][1], gUnknown_08402E24[3][0] + 3, gUnknown_08402E24[3][1] + 1); + Menu_EraseWindowRect(gUnknown_08402E24[1][0], gUnknown_08402E24[1][1], gUnknown_08402E24[1][0] + 3, gUnknown_08402E24[1][1] + 1); + Menu_EraseWindowRect(gUnknown_08402E24[3][0], gUnknown_08402E24[3][1], gUnknown_08402E24[3][0] + 3, gUnknown_08402E24[3][1] + 1); } - MenuZeroFillWindowRect(11, 9, 28, 12); + Menu_EraseWindowRect(11, 9, 28, 12); } } void sub_8133CA4(void) { - MenuZeroFillWindowRect(21, 7, 27, 12); + Menu_EraseWindowRect(21, 7, 27, 12); sub_8133AEC(sLearnMoveStruct->showContestInfo, 0); } diff --git a/src/pokemon/mail.c b/src/pokemon/mail.c index 2ab05ca2b..ab43c033a 100644 --- a/src/pokemon/mail.c +++ b/src/pokemon/mail.c @@ -354,11 +354,11 @@ static u8 sub_80F8A28(void) RETURN_UP_STATE; case 6: - SetUpWindowConfig(&gWindowConfig_81E6DFC); + Text_LoadWindowTemplate(&gWindowTemplate_81E6DFC); RETURN_UP_STATE; case 7: - MultistepInitMenuWindowBegin(&gWindowConfig_81E6DFC); + MultistepInitMenuWindowBegin(&gWindowTemplate_81E6DFC); RETURN_UP_STATE; case 8: @@ -369,7 +369,7 @@ static u8 sub_80F8A28(void) RETURN_UP_STATE; case 9: - MenuZeroFillScreen(); + Menu_EraseScreen(); RETURN_UP_STATE; case 10: CpuFill16(1, (void *)(VRAM + 0x4800), 0x800); @@ -528,11 +528,11 @@ static void sub_80F8E80(void) x = ewram0_4.var10C->var4[pos].unk_0_4; y += ewram0_4.var10C->var4[pos].unk_0_0; - MenuPrint(ewram0_4.words[pos], ewram0_4.var10C->var3_4 + x, ewram0_4.var10C->var3_0 + y); + Menu_PrintText(ewram0_4.words[pos], ewram0_4.var10C->var3_4 + x, ewram0_4.var10C->var3_0 + y); y += 2; } - MenuPrint(ewram0_4.varD8, ewram0_4.varF9, ewram0_4.var10C->var1); + Menu_PrintText(ewram0_4.varD8, ewram0_4.varF9, ewram0_4.var10C->var1); } static void sub_80F8F18(void) diff --git a/src/pokemon/mon_markings.c b/src/pokemon/mon_markings.c index b4144ea34..3734856b8 100644 --- a/src/pokemon/mon_markings.c +++ b/src/pokemon/mon_markings.c @@ -312,7 +312,7 @@ void sub_80F727C(struct PokemonMarkMenu *ptr) void sub_80F728C(void) { - const struct FrameGraphics *frame = GetTextWindowFrameGraphics(gSaveBlock2.optionsWindowFrameType); + const struct FrameGraphics *frame = TextWindow_GetFrameGraphics(gSaveBlock2.optionsWindowFrameType); sMenu->frameTiles = frame->tiles; sMenu->framePalette = frame->palette; sMenu->tileLoadState = 0; @@ -566,8 +566,8 @@ void sub_80F761C(s16 x, s16 y, u16 baseTileTag, u16 basePaletteTag) } sMenu->cursorBaseY = y + 8; - sub_814A5C0(0, basePaletteTag + 1, 15, 0, 0x30); - sub_814A880(x + 8, sMenu->cursorBaseY); + MenuCursor_Create814A5C0(0, basePaletteTag + 1, 15, 0, 0x30); + MenuCursor_SetPos814A880(x + 8, sMenu->cursorBaseY); sub_814AABC(sub_80F7908); } diff --git a/src/pokemon/pokeblock_feed.c b/src/pokemon/pokeblock_feed.c index 8e3adda12..194636e4d 100644 --- a/src/pokemon/pokeblock_feed.c +++ b/src/pokemon/pokeblock_feed.c @@ -530,11 +530,11 @@ static bool8 TransitionToPokeblockFeedScene(void) gMain.state++; break; case 4: - SetUpWindowConfig(&gWindowConfig_81E6E50); + Text_LoadWindowTemplate(&gWindowTemplate_81E6E50); gMain.state++; break; case 5: - MultistepInitMenuWindowBegin(&gWindowConfig_81E6E50); + MultistepInitMenuWindowBegin(&gWindowTemplate_81E6E50); gMain.state++; break; case 6: @@ -559,7 +559,7 @@ static bool8 TransitionToPokeblockFeedScene(void) gMain.state++; break; case 10: - MenuDrawTextWindow(0, 14, 29, 19); + Menu_DrawStdWindowFrame(0, 14, 29, 19); gMain.state++; break; case 11: @@ -715,7 +715,7 @@ static void LaunchPokeblockFeedTask(u8 a0) static void Task_WaitForAtePokeblockText(u8 taskID) { - if (MenuUpdateWindowText() == 1) + if (Menu_UpdateWindowText() == 1) gTasks[taskID].func = Task_PaletteFadeToReturn; } diff --git a/src/pokemon/pokedex.c b/src/pokemon/pokedex.c index 1c1c71454..48ce26bb8 100644 --- a/src/pokemon/pokedex.c +++ b/src/pokemon/pokedex.c @@ -1425,8 +1425,8 @@ void CB2_InitPokedex(void) ResetPaletteFade(); FreeAllSpritePalettes(); gReservedSpritePaletteCount = 8; - SetUpWindowConfig(&gWindowConfig_81E7048); - InitMenuWindow(&gWindowConfig_81E7048); + Text_LoadWindowTemplate(&gWindowTemplate_81E7048); + InitMenuWindow(&gWindowTemplate_81E7048); gMain.state++; break; case 2: @@ -1937,8 +1937,8 @@ static bool8 sub_808D344(u8 a) gMain.state++; break; case 2: - SetUpWindowConfig(&gWindowConfig_81E7048); - InitMenuWindow(&gWindowConfig_81E7048); + Text_LoadWindowTemplate(&gWindowTemplate_81E7048); + InitMenuWindow(&gWindowTemplate_81E7048); LZ77UnCompVram(gUnknown_0839FA7C, (void *)(VRAM + 0xFF80)); gMain.state++; break; @@ -2241,7 +2241,7 @@ static void sub_808DEB0(u16 a, u8 b, u8 c, u16 d) text[3] = EOS; *(u16 *)(VRAM + d * 0x800 + c * 0x40 + b * 2) = unk[0]; *(u16 *)(VRAM + d * 0x800 + (c + 1) * 0x40 + b * 2) = unk[1]; - MenuPrint(text, b - 15, c); + Menu_PrintText(text, b - 15, c); } static void sub_808DF88(u16 a, u8 b, u8 c, u16 d) @@ -2283,7 +2283,7 @@ static u8 sub_808DFE4(u16 num, u8 b, u8 c) text[i] = CHAR_HYPHEN; break; } - MenuPrint_PixelCoords(text, (b - 0x11) * 8 + 0xFC, c * 8, 0); + Menu_PrintTextPixelCoords(text, (b - 0x11) * 8 + 0xFC, c * 8, 0); return i; } @@ -2951,8 +2951,8 @@ static void Task_InitPageScreenMultistep(u8 taskId) gMain.state++; break; case 3: - SetUpWindowConfig(&gWindowConfig_81E7064); - InitMenuWindow(&gWindowConfig_81E7064); + Text_LoadWindowTemplate(&gWindowTemplate_81E7064); + InitMenuWindow(&gWindowTemplate_81E7064); gMain.state++; break; case 4: @@ -2961,20 +2961,20 @@ static void Task_InitPageScreenMultistep(u8 taskId) else sub_8091154(gUnknown_0202FFBC->dexNum, 0xD, 3); sub_80911C8(gUnknown_0202FFBC->dexNum, 0x10, 3); - MenuPrint(gDexText_UnknownPoke, CATEGORY_LEFT, 5); - MenuPrint(gDexText_UnknownHeight, 16, 7); - MenuPrint(gDexText_UnknownWeight, 16, 9); + Menu_PrintText(gDexText_UnknownPoke, CATEGORY_LEFT, 5); + Menu_PrintText(gDexText_UnknownHeight, 16, 7); + Menu_PrintText(gDexText_UnknownWeight, 16, 9); if (gUnknown_0202FFBC->owned) { sub_8091304(gPokedexEntries[gUnknown_0202FFBC->dexNum].categoryName, CATEGORY_LEFT, 5); sub_8091458(gPokedexEntries[gUnknown_0202FFBC->dexNum].height, 16, 7); sub_8091564(gPokedexEntries[gUnknown_0202FFBC->dexNum].weight, 16, 9); - MenuPrint(gPokedexEntries[gUnknown_0202FFBC->dexNum].descriptionPage1, 2, 13); + Menu_PrintText(gPokedexEntries[gUnknown_0202FFBC->dexNum].descriptionPage1, 2, 13); sub_80917CC(14, 0x3FC); } else { - MenuPrint(gUnknown_083A05F8, 2, 13); + Menu_PrintText(gUnknown_083A05F8, 2, 13); LoadPalette(gPlttBufferUnfaded + 1, 0x31, 0x1E); } gMain.state++; @@ -3205,13 +3205,13 @@ static void Task_InitCryScreenMultistep(u8 taskId) gMain.state++; break; case 3: - SetUpWindowConfig(&gWindowConfig_81E702C); - InitMenuWindow(&gWindowConfig_81E702C); + Text_LoadWindowTemplate(&gWindowTemplate_81E702C); + InitMenuWindow(&gWindowTemplate_81E702C); ResetPaletteFade(); gMain.state++; break; case 4: - MenuPrint(gDexText_CryOf, 10, 4); + Menu_PrintText(gDexText_CryOf, 10, 4); sub_8091260(gUnknown_0202FFBC->dexNum, 10, 6, 2); gMain.state++; break; @@ -3394,8 +3394,8 @@ static void Task_InitSizeScreenMultistep(u8 taskId) { u8 string[40]; //I hope this is the correct size - SetUpWindowConfig(&gWindowConfig_81E702C); - InitMenuWindow(&gWindowConfig_81E702C); + Text_LoadWindowTemplate(&gWindowTemplate_81E702C); + InitMenuWindow(&gWindowTemplate_81E702C); string[0] = EOS; StringAppend(string, gDexText_SizeComparedTo); StringAppend(string, gSaveBlock2.playerName); @@ -3841,8 +3841,8 @@ static void sub_8090750(u8 taskId) gTasks[taskId].data[0]++; break; case 2: - SetUpWindowConfig(&gWindowConfig_81E7064); - InitMenuWindow(&gWindowConfig_81E7064); + Text_LoadWindowTemplate(&gWindowTemplate_81E7064); + InitMenuWindow(&gWindowTemplate_81E7064); DmaClear16(3, (void *)(VRAM + 0xC000), 0x200); gTasks[taskId].data[0]++; break; @@ -3853,13 +3853,13 @@ static void sub_8090750(u8 taskId) else sub_8091154(dexNum, 13, 3); sub_80911C8(dexNum, 16, 3); - MenuPrint(gDexText_UnknownPoke, CATEGORY_LEFT, 5); - MenuPrint(gDexText_UnknownHeight, 16, 7); - MenuPrint(gDexText_UnknownWeight, 16, 9); + Menu_PrintText(gDexText_UnknownPoke, CATEGORY_LEFT, 5); + Menu_PrintText(gDexText_UnknownHeight, 16, 7); + Menu_PrintText(gDexText_UnknownWeight, 16, 9); sub_8091304(gPokedexEntries[dexNum].categoryName, CATEGORY_LEFT, 5); sub_8091458(gPokedexEntries[dexNum].height, 16, 7); sub_8091564(gPokedexEntries[dexNum].weight, 16, 9); - MenuPrint(gPokedexEntries[dexNum].descriptionPage1, 2, 13); + Menu_PrintText(gPokedexEntries[dexNum].descriptionPage1, 2, 13); sub_80917CC(14, 0x3FC); gTasks[taskId].data[0]++; break; @@ -3906,8 +3906,8 @@ static void sub_8090A3C(u8 taskId) { u16 r4 = gTasks[taskId].data[1]; - MenuZeroFillWindowRect(2, 13, 27, 19); - MenuPrint(gPokedexEntries[r4].descriptionPage2, 2, 13); + Menu_EraseWindowRect(2, 13, 27, 19); + Menu_PrintText(gPokedexEntries[r4].descriptionPage2, 2, 13); (*(u16 *)(VRAM + 0x7ACA))++; (*(u16 *)(VRAM + 0x7B0A))++; gTasks[taskId].data[4] = 1; @@ -3970,8 +3970,8 @@ static void sub_8090C68(void) { if (gPokedexView->descriptionPageNum == 0) { - MenuZeroFillWindowRect(2, 13, 27, 19); - MenuPrint(gPokedexEntries[gUnknown_0202FFBC->dexNum].descriptionPage2, 2, 13); + Menu_EraseWindowRect(2, 13, 27, 19); + Menu_PrintText(gPokedexEntries[gUnknown_0202FFBC->dexNum].descriptionPage2, 2, 13); gPokedexView->descriptionPageNum = 1; (*(u16 *)(VRAM + 0x7ACA))++; (*(u16 *)(VRAM + 0x7B0A))++; @@ -3979,8 +3979,8 @@ static void sub_8090C68(void) } else { - MenuZeroFillWindowRect(2, 13, 27, 19); - MenuPrint(gPokedexEntries[gUnknown_0202FFBC->dexNum].descriptionPage1, 2, 13); + Menu_EraseWindowRect(2, 13, 27, 19); + Menu_PrintText(gPokedexEntries[gUnknown_0202FFBC->dexNum].descriptionPage1, 2, 13); gPokedexView->descriptionPageNum = 0; (*(u16 *)(VRAM + 0x7ACA))--; (*(u16 *)(VRAM + 0x7B0A))--; @@ -4190,7 +4190,7 @@ static void sub_8091154(u16 order, u8 b, u8 c) str[1] = CHAR_0 + (order % 100) / 10; str[2] = CHAR_0 + (order % 100) % 10; str[3] = EOS; - MenuPrint(str, b, c); + Menu_PrintText(str, b, c); } static u8 sub_80911C8(u16 num, u8 b, u8 c) @@ -4212,7 +4212,7 @@ static u8 sub_80911C8(u16 num, u8 b, u8 c) str[i] = 0xAE; break; } - MenuPrint(str, b, c); + Menu_PrintText(str, b, c); return i; } @@ -4237,7 +4237,7 @@ static u8 sub_8091260(u16 num, u8 b, u8 c, u8 d) break; } end[i] = EOS; - MenuPrint(str, b, c); + Menu_PrintText(str, b, c); return i; } @@ -4297,7 +4297,7 @@ void unref_sub_80913A4(u16 a, u8 left, u8 top) str[3] = CHAR_PERIOD; str[4] = CHAR_0 + ((a % 1000) % 100) % 10; str[5] = EOS; - MenuPrint(str, left, top); + Menu_PrintText(str, left, top); } #elif GERMAN void unref_sub_80913A4(u16 arg0, u8 left, u8 top) { @@ -4341,7 +4341,7 @@ void unref_sub_80913A4(u16 arg0, u8 left, u8 top) { buffer[r6++] = EOS; buffer[2] = offset; - MenuPrint(buffer, left, top); + Menu_PrintText(buffer, left, top); } #endif @@ -4378,7 +4378,7 @@ static void sub_8091458(u16 height, u8 left, u8 top) buffer[i++] = (inches % 10) + CHAR_0; buffer[i++] = CHAR_DOUBLE_PRIME; buffer[i++] = EOS; - MenuPrint(buffer, left, top); + Menu_PrintText(buffer, left, top); } #else static void sub_8091458(u16 height, u8 left, u8 top) @@ -4448,7 +4448,7 @@ static void sub_8091564(u16 weight, u8 left, u8 top) buffer[i++] = CHAR_s; buffer[i++] = CHAR_PERIOD; buffer[i++] = EOS; - MenuPrint(buffer, left, top); + Menu_PrintText(buffer, left, top); } #else static void sub_8091564(u16 arg0, u8 left, u8 top) @@ -4770,8 +4770,8 @@ static void sub_8091E54(u8 taskId) } break; case 1: - SetUpWindowConfig(&gWindowConfig_81E7064); - InitMenuWindow(&gWindowConfig_81E7064); + Text_LoadWindowTemplate(&gWindowTemplate_81E7064); + InitMenuWindow(&gWindowTemplate_81E7064); LoadCompressedObjectPic(&gUnknown_083A05CC[0]); LoadSpritePalettes(gUnknown_083A05DC); sub_809308C(taskId); @@ -4997,7 +4997,7 @@ static void sub_8092508(u8 taskId) static void sub_80925B4(u16 a, int unused) { - sub_814AD7C(0x90, (a * 2 + 1) * 8); + MenuCursor_SetPos814AD7C(0x90, (a * 2 + 1) * 8); } static void sub_80925CC(u8 taskId) @@ -5036,7 +5036,7 @@ static void sub_8092644(u8 taskId) { sub_814ADC8(); PlaySE(SE_PIN); - MenuZeroFillWindowRect(18, 1, 28, 12); + Menu_EraseWindowRect(18, 1, 28, 12); sub_8092C8C(1); gTasks[taskId].func = sub_809217C; return; @@ -5045,7 +5045,7 @@ static void sub_8092644(u8 taskId) { sub_814ADC8(); PlaySE(SE_BOWA); - MenuZeroFillWindowRect(18, 1, 28, 12); + Menu_EraseWindowRect(18, 1, 28, 12); sub_8092C8C(1); *p1 = gTasks[taskId].data[14]; *p2 = gTasks[taskId].data[15]; @@ -5305,29 +5305,29 @@ static void sub_8092B68(u8 taskId) var = gTasks[taskId].data[6] + gTasks[taskId].data[7]; StringCopy(gStringVar1, gUnknown_083B5910[var].text2); - MenuPrint_PixelCoords(gUnknown_083B5AB2, 45, 16, 1); + Menu_PrintTextPixelCoords(gUnknown_083B5AB2, 45, 16, 1); var = gTasks[taskId].data[8] + gTasks[taskId].data[9]; StringCopy(gStringVar1, gUnknown_083B5968[var].text2); - MenuPrint_PixelCoords(gUnknown_083B5AB2, 45, 32, 1); + Menu_PrintTextPixelCoords(gUnknown_083B5AB2, 45, 32, 1); var = gTasks[taskId].data[10] + gTasks[taskId].data[11]; StringCopy(gStringVar1, gUnknown_083B59C8[var].text2); - MenuPrint_PixelCoords(gUnknown_083B5AAC, 45, 48, 1); + Menu_PrintTextPixelCoords(gUnknown_083B5AAC, 45, 48, 1); var = gTasks[taskId].data[12] + gTasks[taskId].data[13]; StringCopy(gStringVar1, gUnknown_083B59C8[var].text2); - MenuPrint_PixelCoords(gUnknown_083B5AAC, 93, 48, 1); + Menu_PrintTextPixelCoords(gUnknown_083B5AAC, 93, 48, 1); var = gTasks[taskId].data[4] + gTasks[taskId].data[5]; StringCopy(gStringVar1, gUnknown_083B58D8[var].text2); - MenuPrint_PixelCoords(gUnknown_083B5AB2, 45, 64, 1); + Menu_PrintTextPixelCoords(gUnknown_083B5AB2, 45, 64, 1); if (IsNationalPokedexEnabled()) { var = gTasks[taskId].data[2] + gTasks[taskId].data[3]; StringCopy(gStringVar1, gUnknown_083B58C0[var].text2); - MenuPrint_PixelCoords(gUnknown_083B5AB2, 45, 80, 1); + Menu_PrintTextPixelCoords(gUnknown_083B5AB2, 45, 80, 1); } } @@ -5374,13 +5374,13 @@ static void sub_8092D78(u8 taskId) u16 i; u16 j; - MenuZeroFillWindowRect(18, 1, 28, 12); + Menu_EraseWindowRect(18, 1, 28, 12); for (i = 0, j = *r7; i < 6 && r6[j].text2 != NULL; i++, j++) { #ifndef NONMATCHING j += 0; // Useless statement needed to match #endif - MenuPrint(r6[j].text2, 18, i * 2 + 1); + Menu_PrintText(r6[j].text2, 18, i * 2 + 1); } sub_8091E20(r6[*r8 + *r7].text1); } diff --git a/src/pokemon/pokemon_1.c b/src/pokemon/pokemon_1.c index f4d227f7f..bfd0bc972 100644 --- a/src/pokemon/pokemon_1.c +++ b/src/pokemon/pokemon_1.c @@ -308,7 +308,7 @@ void sub_803ADE8(struct Pokemon *mon, struct UnknownPokemonStruct *src) language = GAME_LANGUAGE; SetMonData(mon, MON_DATA_LANGUAGE, &language); - StripExtCtrlCodes(nickname); + Text_StripExtCtrlCodes(nickname); SetMonData(mon, MON_DATA_NICKNAME, nickname); SetMonData(mon, MON_DATA_FRIENDSHIP, &src->friendship); SetMonData(mon, MON_DATA_HP_EV, &src->hpEV); diff --git a/src/pokemon/pokemon_menu.c b/src/pokemon/pokemon_menu.c index 6c3c6c2b8..70234ac48 100644 --- a/src/pokemon/pokemon_menu.c +++ b/src/pokemon/pokemon_menu.c @@ -229,8 +229,8 @@ static void sub_8089A8C(void) static void sub_8089BDC(u8 arg0, u8 arg1, u8 arg2, u8 noOfOptions, const struct MenuAction2 *menuActions, const u8 *order, u8 arg6) { PrintPartyMenuPromptText(5, arg6); - MenuDrawTextWindow(arg0, arg1, arg0 + arg2, (noOfOptions * 2) + arg1 + 1); - PrintMenuItemsReordered(arg0 + 1, arg1 + 1, noOfOptions, menuActions, order); + Menu_DrawStdWindowFrame(arg0, arg1, arg0 + arg2, (noOfOptions * 2) + arg1 + 1); + Menu_PrintItemsReordered(arg0 + 1, arg1 + 1, noOfOptions, menuActions, order); } void sub_8089C50(u8 arg0, u8 arg1, u8 arg2, u8 noOfOptions, const struct MenuAction2 *menuActions, const u8 *order) @@ -279,13 +279,13 @@ static void sub_8089D94(u8 taskID) if ((gMain.newAndRepeatedKeys & DPAD_ANY) == DPAD_UP) { PlaySE(SE_SELECT); - sPokeMenuCursorPos = MoveMenuCursor(-1); + sPokeMenuCursorPos = Menu_MoveCursor(-1); sub_808B5B4(taskID); } else if ((gMain.newAndRepeatedKeys & DPAD_ANY) == DPAD_DOWN) { PlaySE(SE_SELECT); - sPokeMenuCursorPos = MoveMenuCursor(1); + sPokeMenuCursorPos = Menu_MoveCursor(1); sub_808B5B4(taskID); } else if (gMain.newKeys & A_BUTTON) @@ -363,12 +363,12 @@ static void PokemonMenu_Summary(u8 taskID) void DoPokemonMenu_Switch(u8 taskID) { SetTaskFuncWithFollowupFunc(taskID, SetupDefaultPartyMenuSwitchPokemon, HandleDefaultPartyMenu); - MenuZeroFillWindowRect(19, 0, 29, 19); + Menu_EraseWindowRect(19, 0, 29, 19); } static void PokemonMenu_Switch(u8 taskID) { - HandleDestroyMenuCursors(); + Menu_DestroyCursor(); ewram01000.unkC = sub_806CD5C; ewram01000.array[53553] = 1; DoPokemonMenu_Switch(taskID); @@ -378,12 +378,12 @@ static void sub_808A060(u8 taskID) { if (gMain.newKeys == DPAD_UP && sPokeMenuCursorPos != 0) { - sPokeMenuCursorPos = MoveMenuCursor(-1); + sPokeMenuCursorPos = Menu_MoveCursor(-1); PlaySE(SE_SELECT); } if (gMain.newKeys == DPAD_DOWN && sPokeMenuCursorPos != 2) { - sPokeMenuCursorPos = MoveMenuCursor(1); + sPokeMenuCursorPos = Menu_MoveCursor(1); PlaySE(SE_SELECT); } if (gMain.newKeys & A_BUTTON) @@ -407,9 +407,9 @@ static void sub_808A100(u8 taskID) static void PokemonMenu_Item(u8 taskID) { - HandleDestroyMenuCursors(); + Menu_DestroyCursor(); sPokeMenuCursorPos = 0; - MenuZeroFillWindowRect(19, 0, 29, 19); + Menu_EraseWindowRect(19, 0, 29, 19); gTasks[taskID].func = sub_808A100; } @@ -442,7 +442,7 @@ static void sub_808A228(u8 taskID) } else { - MenuZeroFillWindowRect(0, 0, 29, 19); + Menu_EraseWindowRect(0, 0, 29, 19); PrintPartyMenuPromptText(0, 0); gTasks[taskID].func = HandleDefaultPartyMenu; } @@ -600,25 +600,25 @@ static void sub_808A678(u8 taskID) static void PokemonMenu_TakeItem(u8 taskID) { - HandleDestroyMenuCursors(); - MenuZeroFillWindowRect(19, 0, 29, 19); + Menu_DestroyCursor(); + Menu_EraseWindowRect(19, 0, 29, 19); sub_806D5A4(); PartyMenuTryGiveMonHeldItem_806ECE8(taskID, sub_808A678); } static void PokemonMenu_TakeMail(u8 taskID) { - HandleDestroyMenuCursors(); - MenuZeroFillWindowRect(19, 0, 29, 19); + Menu_DestroyCursor(); + Menu_EraseWindowRect(19, 0, 29, 19); sub_806D5A4(); DoTakeMail(taskID, sub_808A678); } static void PokemonMenu_Mail(u8 taskID) { - HandleDestroyMenuCursors(); + Menu_DestroyCursor(); sPokeMenuCursorPos = 0; - MenuZeroFillWindowRect(19, 0, 29, 19); + Menu_EraseWindowRect(19, 0, 29, 19); ShowPartyPopupMenu(0, &sUnknown_0839F584, (void*) sPokemonMenuActions, 0); gTasks[taskID].func = sub_808A73C; } @@ -629,17 +629,17 @@ static void sub_808A73C(u8 taskID) { PlaySE(SE_SELECT); if (sPokeMenuCursorPos == 0) - sPokeMenuCursorPos = MoveMenuCursor(sUnknown_0839F584.numChoices - 1); + sPokeMenuCursorPos = Menu_MoveCursor(sUnknown_0839F584.numChoices - 1); else - sPokeMenuCursorPos = MoveMenuCursor(-1); + sPokeMenuCursorPos = Menu_MoveCursor(-1); } if (gMain.newAndRepeatedKeys == DPAD_DOWN) { PlaySE(SE_SELECT); if (sPokeMenuCursorPos == sUnknown_0839F584.numChoices - 1) - sPokeMenuCursorPos = MoveMenuCursor(1 - sUnknown_0839F584.numChoices); + sPokeMenuCursorPos = Menu_MoveCursor(1 - sUnknown_0839F584.numChoices); else - sPokeMenuCursorPos = MoveMenuCursor(1); + sPokeMenuCursorPos = Menu_MoveCursor(1); } if (gMain.newKeys & A_BUTTON) { @@ -679,23 +679,23 @@ static void sub_808A8A8(void) static void sub_808A8D4(u8 taskID) { sPokeMenuCursorPos = 0; - MenuZeroFillWindowRect(19, 0, 29, 19); + Menu_EraseWindowRect(19, 0, 29, 19); PrintPartyMenuPromptText(0, 0); gTasks[taskID].func = HandleDefaultPartyMenu; } static void PokemonMenu_Cancel(u8 taskID) { - HandleDestroyMenuCursors(); + Menu_DestroyCursor(); PlaySE(SE_SELECT); sub_808A8D4(taskID); } static void PokemonMenu_CancelSubmenu(u8 taskID) { - HandleDestroyMenuCursors(); + Menu_DestroyCursor(); PlaySE(SE_SELECT); - MenuZeroFillWindowRect(19, 0, 29, 19); + Menu_EraseWindowRect(19, 0, 29, 19); sub_806D5A4(); sub_8089C7C(sPokeMenuCursorPos); gTasks[taskID].func = sub_8089D94; @@ -711,11 +711,11 @@ static void PokemonMenu_FieldMove(u8 taskID) { s16* data = gTasks[taskID].data; - HandleDestroyMenuCursors(); + Menu_DestroyCursor(); tFieldMoveId = sPokeMenuOptionsOrder[sPokeMenuCursorPos] - POKEMENU_FIRST_FIELD_MOVE_ID; if (sub_80F9344() == TRUE) { - MenuZeroFillWindowRect(19, 0, 29, 19); + Menu_EraseWindowRect(19, 0, 29, 19); if (IS_SOFTBOILED_MILKDRINK(tFieldMoveId)) PrintPartyMenuPromptText(9, 0); else @@ -725,7 +725,7 @@ static void PokemonMenu_FieldMove(u8 taskID) else if (tFieldMoveId <= 7 && FlagGet(FLAG_BADGE01_GET + tFieldMoveId) != TRUE) { // can't use a field HM move without a proper badge - MenuZeroFillWindowRect(19, 0, 29, 19); + Menu_EraseWindowRect(19, 0, 29, 19); sub_806D5A4(); sub_806E834(gOtherText_CantBeUsedBadge, 1); gTasks[taskID].func = sub_808AAF0; @@ -745,7 +745,7 @@ static void PokemonMenu_FieldMove(u8 taskID) } else { - MenuZeroFillWindowRect(19, 0, 29, 19); + Menu_EraseWindowRect(19, 0, 29, 19); if (IS_SURF(tFieldMoveId) && TestPlayerAvatarFlags(8)) PrintPartyMenuPromptText(8, 0); else @@ -759,7 +759,7 @@ static void sub_808AAF0(u8 taskID) { if (gUnknown_0202E8F6 != 1 && (gMain.newKeys & A_BUTTON || gMain.newKeys & B_BUTTON)) { - MenuZeroFillWindowRect(0, 14, 29, 19); + Menu_EraseWindowRect(0, 14, 29, 19); PokemonMenu_Cancel(taskID); } } @@ -798,7 +798,7 @@ static void sub_808ABF4(u8 taskID) { if (gMain.newKeys & A_BUTTON || gMain.newKeys & B_BUTTON) { - MenuZeroFillWindowRect(1, 17, 28, 18); + Menu_EraseWindowRect(1, 17, 28, 18); PokemonMenu_Cancel(taskID); } } diff --git a/src/pokemon/pokemon_storage_system.c b/src/pokemon/pokemon_storage_system.c index 4a68b846a..001cebe45 100644 --- a/src/pokemon/pokemon_storage_system.c +++ b/src/pokemon/pokemon_storage_system.c @@ -16,7 +16,7 @@ EWRAM_DATA struct PokemonStorage gPokemonStorage = {0}; void sub_8098898(u8 index) { u8 *ptr; - MenuDrawTextWindow(10, 16, 29, 19); + Menu_DrawStdWindowFrame(10, 16, 29, 19); switch (gUnknown_083B6DF4[index].format) { @@ -89,5 +89,5 @@ void sub_8098898(u8 index) { } ptr[0] = EOS; - MenuPrint(gUnk2002694, 11, 17); + Menu_PrintText(gUnk2002694, 11, 17); } diff --git a/src/pokemon/pokemon_summary_screen.c b/src/pokemon/pokemon_summary_screen.c index 9563bc08f..d98383c6d 100644 --- a/src/pokemon/pokemon_summary_screen.c +++ b/src/pokemon/pokemon_summary_screen.c @@ -718,11 +718,11 @@ bool8 sub_809DA84(void) gMain.state++; break; case 5: - SetUpWindowConfig(&gWindowConfig_81E6E6C); + Text_LoadWindowTemplate(&gWindowTemplate_81E6E6C); gMain.state++; break; case 6: - MultistepInitMenuWindowBegin(&gWindowConfig_81E6E6C); + MultistepInitMenuWindowBegin(&gWindowTemplate_81E6E6C); gMain.state++; break; case 7: @@ -1037,7 +1037,7 @@ static void sub_809E260(u8 taskId) { if (pssData.page == PSS_PAGE_CONTEST_MOVES && (pssData.selectedMoveIndex != 4 || pssData.moveToLearn != 0)) { - MenuZeroFillWindowRect(0, 14, 9, 18); + Menu_EraseWindowRect(0, 14, 9, 18); } SummaryScreenHandleLeftRightInput(taskId, -1); @@ -1048,7 +1048,7 @@ static void sub_809E260(u8 taskId) { if (pssData.page == PSS_PAGE_BATTLE_MOVES && (pssData.selectedMoveIndex != 4 || pssData.moveToLearn != 0)) { - MenuZeroFillWindowRect(0, 14, 9, 18); + Menu_EraseWindowRect(0, 14, 9, 18); } SummaryScreenHandleLeftRightInput(taskId, 1); @@ -1482,8 +1482,8 @@ static void sub_809EAC8(u8 taskId) sub_80A1B1C(9); sub_80A16CC(1); - MenuZeroFillWindowRect(15, 12, 28, 13); - MenuZeroFillWindowRect(11, 15, 28, 18); + Menu_EraseWindowRect(15, 12, 28, 13); + Menu_EraseWindowRect(11, 15, 28, 18); pssData.headerActionTextId = 6; PrintSummaryWindowHeaderText(); @@ -2371,7 +2371,7 @@ void sub_809F814(u8 taskId) { if (pssData.page == PSS_PAGE_CONTEST_MOVES && (pssData.selectedMoveIndex != 4 || pssData.moveToLearn != 0)) { - MenuZeroFillWindowRect(0, 14, 9, 18); + Menu_EraseWindowRect(0, 14, 9, 18); } gTasks[taskId].func = sub_809E260; @@ -2387,7 +2387,7 @@ void sub_809F814(u8 taskId) { if (pssData.page == PSS_PAGE_BATTLE_MOVES && (pssData.selectedMoveIndex != 4 || pssData.moveToLearn != 0)) { - MenuZeroFillWindowRect(0, 14, 9, 18); + Menu_EraseWindowRect(0, 14, 9, 18); } gTasks[taskId].func = sub_809E260; @@ -2414,8 +2414,8 @@ static void sub_809F9D0(u8 taskId, u8 b) sub_80A1488(-2, 4); sub_80A1654(-2, 4); - MenuZeroFillWindowRect(11, 15, 28, 18); - MenuPrint(gOtherText_CantForgetHMs, 11, 15); + Menu_EraseWindowRect(11, 15, 28, 18); + Menu_PrintText(gOtherText_CantForgetHMs, 11, 15); gTasks[taskId].func = sub_809F814; } @@ -2494,9 +2494,9 @@ static void sub_809FAC8(struct Pokemon *mon) if (GetMonData(mon, MON_DATA_IS_EGG)) { - MenuZeroFillWindowRect(1, 2, 4, 3); - MenuZeroFillWindowRect(3, 16, 9, 17); - MenuZeroFillWindowRect(0, 12, 11, 15); + Menu_EraseWindowRect(1, 2, 4, 3); + Menu_EraseWindowRect(3, 16, 9, 17); + Menu_EraseWindowRect(0, 12, 11, 15); GetMonNickname(mon, gStringVar1); sub_80A1FF8(gStringVar1, 13, 3, 16); LoadPalette(sUnknown_083C157C, 4, 2); @@ -2520,7 +2520,7 @@ static void sub_809FAC8(struct Pokemon *mon) } else { - MenuZeroFillWindowRect(1, 2, 4, 3); + Menu_EraseWindowRect(1, 2, 4, 3); } buffer = gStringVar1; @@ -2530,7 +2530,7 @@ static void sub_809FAC8(struct Pokemon *mon) buffer[1] = 0x13; buffer[2] = 0x3C; buffer[3] = EOS; - MenuPrint(gStringVar1, 1, 12); + Menu_PrintText(gStringVar1, 1, 12); sub_80A0958(mon); } @@ -2545,12 +2545,12 @@ static void sub_809FBE4(void) sub_80A1918(i, 1); } - MenuZeroFillWindowRect(11, 4, 29, 18); + Menu_EraseWindowRect(11, 4, 29, 18); } static void sub_809FC0C(void) { - MenuPrint(gOtherText_Type2, 11, 6); + Menu_PrintText(gOtherText_Type2, 11, 6); GetStringCenterAlignXOffset(0, 22, 4); GetStringCenterAlignXOffset(2, 23, 4); } @@ -2569,7 +2569,7 @@ static void sub_809FC34(struct Pokemon *mon) sub_80A1918(i, 1); } - MenuZeroFillWindowRect(11, 9, 28, 12); + Menu_EraseWindowRect(11, 9, 28, 12); if (GetMonData(mon, MON_DATA_IS_EGG)) { buffer = gStringVar1; @@ -2580,7 +2580,7 @@ static void sub_809FC34(struct Pokemon *mon) buffer[1] = 0x13; buffer[2] = 0x4E; buffer[3] = EOS; - MenuPrint(gStringVar1, 11, 4); + Menu_PrintText(gStringVar1, 11, 4); sub_80A1EF8(gOtherText_FiveQuestionsAndSlash, 13, 193, 32, 1); sub_80A198C(9, 120, 48, 0); @@ -2588,19 +2588,19 @@ static void sub_809FC34(struct Pokemon *mon) friendship = GetMonData(mon, MON_DATA_FRIENDSHIP); if (friendship < 6) { - MenuPrint(gOtherText_EggAbout, 11, 9); + Menu_PrintText(gOtherText_EggAbout, 11, 9); } else if (friendship < 11) { - MenuPrint(gOtherText_EggSoon, 11, 9); + Menu_PrintText(gOtherText_EggSoon, 11, 9); } else if (friendship < 41) { - MenuPrint(gOtherText_EggSomeTime, 11, 9); + Menu_PrintText(gOtherText_EggSomeTime, 11, 9); } else { - MenuPrint(gOtherText_EggLongTime, 11, 9); + Menu_PrintText(gOtherText_EggLongTime, 11, 9); } PokemonSummaryScreen_PrintEggTrainerMemo(mon, 11, 14); @@ -2629,7 +2629,7 @@ static void sub_809FC34(struct Pokemon *mon) buffer[1] = 0x13; buffer[2] = 0x4E; buffer[3] = EOS; - MenuPrint(gStringVar1, 11, 4); + Menu_PrintText(gStringVar1, 11, 4); sub_80A1F98(GetMonData(mon, MON_DATA_OT_ID) & 0xFFFF, 13, 5, 2, 193, 32, 1); @@ -2642,7 +2642,7 @@ static void sub_809FC34(struct Pokemon *mon) ability = GetAbilityBySpecies(GetMonData(mon, MON_DATA_SPECIES), GetMonData(mon, MON_DATA_ALT_ABILITY)); sub_80A1FF8(gAbilityNames[ability], 13, 11, 9); - MenuPrint(gAbilityDescriptions[ability], 11, 11); + Menu_PrintText(gAbilityDescriptions[ability], 11, 11); PokemonSummaryScreen_PrintTrainerMemo(mon, 11, 14); } @@ -2656,17 +2656,17 @@ static void sub_809FE6C(struct Pokemon *mon) static void sub_809FE80(void) { - MenuZeroFillWindowRect(14, 4, 18, 5); - MenuZeroFillWindowRect(25, 4, 30, 5); - MenuZeroFillWindowRect(11, 9, 28, 12); - MenuZeroFillWindowRect(11, 14, 28, 17); + Menu_EraseWindowRect(14, 4, 18, 5); + Menu_EraseWindowRect(25, 4, 30, 5); + Menu_EraseWindowRect(11, 9, 28, 12); + Menu_EraseWindowRect(11, 14, 28, 17); } static void sub_809FEB8(void) { sub_80A1FF8(gOtherText_ExpPoints, 13, 11, 14); sub_80A1FF8(gOtherText_NextLv, 13, 11, 16); - MenuPrint(gOtherText_Terminator18, 21, 16); + Menu_PrintText(gOtherText_Terminator18, 21, 16); sub_80A1F48(gOtherText_HP, 13, 11, 7, 42); sub_80A1F48(gOtherText_Attack, 13, 11, 9, 42); @@ -2716,7 +2716,7 @@ static void sub_809FF64(struct Pokemon *mon) *buffer++ = CHAR_SLASH; buffer = sub_8072C14(buffer, GetMonData(mon, MON_DATA_MAX_HP), 48, 1); - MenuPrint_PixelCoords(gStringVar1, 126, 56, 1); + Menu_PrintTextPixelCoords(gStringVar1, 126, 56, 1); } static void sub_80A0090(struct Pokemon *mon) @@ -2727,12 +2727,12 @@ static void sub_80A0090(struct Pokemon *mon) static void sub_80A00A4(void) { - MenuZeroFillWindowRect(11, 4, 19, 5); - MenuZeroFillWindowRect(16, 7, 21, 8); - MenuZeroFillWindowRect(17, 9, 21, 12); - MenuZeroFillWindowRect(27, 7, 29, 12); - MenuZeroFillWindowRect(22, 14, 28, 15); - MenuZeroFillWindowRect(23, 16, 28, 17); + Menu_EraseWindowRect(11, 4, 19, 5); + Menu_EraseWindowRect(16, 7, 21, 8); + Menu_EraseWindowRect(17, 9, 21, 12); + Menu_EraseWindowRect(27, 7, 29, 12); + Menu_EraseWindowRect(22, 14, 28, 15); + Menu_EraseWindowRect(23, 16, 28, 17); } static void sub_80A00F4(u8 a) @@ -2770,7 +2770,7 @@ static void sub_80A015C(struct Pokemon *mon) { sub_80A1918(i, 1); sub_80A1FF8(gOtherText_OneDash, 13, 15, (2 * i) + 4); - MenuPrint(gOtherText_TwoDashes, 26, (2 * i) + 4); + Menu_PrintText(gOtherText_TwoDashes, 26, (2 * i) + 4); } else { @@ -2793,7 +2793,7 @@ static void sub_80A015C(struct Pokemon *mon) buffer = sub_8072C14(buffer, curPP, 14, 1); *buffer++ = CHAR_SLASH; sub_8072C14(buffer, maxPP, 32, 1); - MenuPrint(gStringVar1, 25, (2 * i) + 4); + Menu_PrintText(gStringVar1, 25, (2 * i) + 4); } } } @@ -2829,7 +2829,7 @@ static void sub_80A029C(struct Pokemon *mon) buffer = sub_8072C14(buffer, pp, 14, 1); *buffer++ = CHAR_SLASH; buffer = sub_8072C14(buffer, pp, 32, 1); - MenuPrint(gStringVar1, 25, 12); + Menu_PrintText(gStringVar1, 25, 12); } static void sub_80A0390(void) @@ -2838,7 +2838,7 @@ static void sub_80A0390(void) for (i = 0; i < MAX_MON_MOVES; i++) { - MenuZeroFillWindowRect(15, (i * 2) + 4, 28, (i * 2) + 5); + Menu_EraseWindowRect(15, (i * 2) + 4, 28, (i * 2) + 5); } } @@ -2883,7 +2883,7 @@ void sub_80A03F0(struct Pokemon *mon, u8 *selectedMoveIndex) static void sub_80A0428(struct Pokemon *mon, u8 *selectedMoveIndex) { u16 move = sub_80A03BC(mon, *selectedMoveIndex); - MenuZeroFillWindowRect(11, 15, 28, 18); + Menu_EraseWindowRect(11, 15, 28, 18); if (pssData.page == PSS_PAGE_BATTLE_MOVES) { @@ -2901,14 +2901,14 @@ static void sub_80A046C(u16 move) { if (move == 0xFFFF) return; - MenuPrint(gMoveDescriptions[move - 1], 11, 15); + Menu_PrintText(gMoveDescriptions[move - 1], 11, 15); } static void sub_80A0498(u16 move) { if (move == 0xFFFF) return; - MenuPrint(gContestEffectStrings[gContestMoves[move].effect], 11, 15); + Menu_PrintText(gContestEffectStrings[gContestMoves[move].effect], 11, 15); } static void sub_80A04CC(u16 move) @@ -2921,26 +2921,26 @@ static void sub_80A04CC(u16 move) { buffer = gStringVar1; buffer = sub_8072C74(buffer, gOtherText_ThreeDashes2, 21, 1); - MenuPrint(gStringVar1, 7, 15); + Menu_PrintText(gStringVar1, 7, 15); } else { buffer = gStringVar1; buffer = sub_8072C14(buffer, gBattleMoves[move].power, 21, 1); - MenuPrint(gStringVar1, 7, 15); + Menu_PrintText(gStringVar1, 7, 15); } if (gBattleMoves[move].accuracy == 0) { buffer = gStringVar1; buffer = sub_8072C74(buffer, gOtherText_ThreeDashes2, 21, 1); - MenuPrint(gStringVar1, 7, 17); + Menu_PrintText(gStringVar1, 7, 17); } else { buffer = gStringVar1; buffer = sub_8072C14(buffer, gBattleMoves[move].accuracy, 21, 1); - MenuPrint(gStringVar1, 7, 17); + Menu_PrintText(gStringVar1, 7, 17); } } @@ -3127,7 +3127,7 @@ bool8 PokemonSummaryScreen_CheckOT(struct Pokemon *mon) u8 enemyId = GetMultiplayerId() ^ 1; trainerId = gLinkPlayers[enemyId].trainerId & 0xFFFF; StringCopy(gStringVar1, gLinkPlayers[enemyId].name); - StripExtCtrlCodes(gStringVar1); + Text_StripExtCtrlCodes(gStringVar1); } else { @@ -3153,7 +3153,7 @@ static void PokemonSummaryScreen_PrintEggTrainerMemo(struct Pokemon *mon, u8 lef if (!(gameMet == VERSION_RUBY || gameMet == VERSION_SAPPHIRE || gameMet == VERSION_EMERALD)) { - MenuPrint(gOtherText_EggObtainedInTrade, left, top); + Menu_PrintText(gOtherText_EggObtainedInTrade, left, top); return; } @@ -3162,13 +3162,13 @@ static void PokemonSummaryScreen_PrintEggTrainerMemo(struct Pokemon *mon, u8 lef if (locationMet == 255) { // Eggs received from Pokemon Box. - MenuPrint(gOtherText_EggNicePlace, left, top); + Menu_PrintText(gOtherText_EggNicePlace, left, top); return; } if (!PokemonSummaryScreen_CheckOT(mon)) { - MenuPrint(gOtherText_EggObtainedInTrade, left, top); + Menu_PrintText(gOtherText_EggObtainedInTrade, left, top); return; } @@ -3176,11 +3176,11 @@ static void PokemonSummaryScreen_PrintEggTrainerMemo(struct Pokemon *mon, u8 lef if (locationMet == 253) { - MenuPrint(gOtherText_EggHotSprings, left, top); + Menu_PrintText(gOtherText_EggHotSprings, left, top); return; } - MenuPrint(gOtherText_EggDayCare, left, top); + Menu_PrintText(gOtherText_EggDayCare, left, top); } static void PokemonSummaryScreen_PrintTrainerMemo(struct Pokemon *mon, u8 left, u8 top) @@ -3285,7 +3285,7 @@ static void PokemonSummaryScreen_PrintTrainerMemo(struct Pokemon *mon, u8 left, } } - MenuPrint(gStringVar4, left++, top++); + Menu_PrintText(gStringVar4, left++, top++); } static void sub_80A0958(struct Pokemon *mon) @@ -3310,8 +3310,8 @@ static void sub_80A0958(struct Pokemon *mon) buffer[2] = 0x50; buffer[3] = EOS; - MenuPrint(gStringVar1, 0, 14); - MenuZeroFillWindowRect(3, 16, 9, 17); + Menu_PrintText(gStringVar1, 0, 14); + Menu_EraseWindowRect(3, 16, 9, 17); level = GetMonData(mon, MON_DATA_LEVEL); @@ -3325,7 +3325,7 @@ static void sub_80A0958(struct Pokemon *mon) buffer[2] = 0x20; buffer[3] = EOS; - MenuPrint(gStringVar1, 3, 16); + Menu_PrintText(gStringVar1, 3, 16); sub_80A0A2C(mon, 7, 16); } @@ -3343,7 +3343,7 @@ static void sub_80A0A2C(struct Pokemon *mon, u8 left, u8 top) { default: bottom = top + 1; - MenuZeroFillWindowRect(left, top, left, bottom); + Menu_EraseWindowRect(left, top, left, bottom); return; case MON_MALE: genderSymbol = gOtherText_MaleSymbol2; @@ -3406,7 +3406,7 @@ static void PrintNumRibbons(struct Pokemon *mon) ConvertIntToDecimalStringN(&text[3], numRibbons, 1, 2); } - MenuPrint(sUnknown_083C15AE, 21, 4); + Menu_PrintText(sUnknown_083C15AE, 21, 4); } static void PrintHeldItemName(u16 itemId, u8 left, u8 top) @@ -3427,7 +3427,7 @@ static void PrintHeldItemName(u16 itemId, u8 left, u8 top) CopyItemName(itemId, gStringVar1); } - MenuPrint(sUnknown_083C15B4, left, top); + Menu_PrintText(sUnknown_083C15B4, left, top); } static void DrawExperienceProgressBar(struct Pokemon *mon, u8 left, u8 top) @@ -3518,7 +3518,7 @@ static void PrintSummaryWindowHeaderText(void) buffer[2] = 0x58; buffer[3] = EOS; - MenuPrint(gStringVar1, 0, 0); + Menu_PrintText(gStringVar1, 0, 0); if (pssData.headerActionTextId != 0) { @@ -3527,7 +3527,7 @@ static void PrintSummaryWindowHeaderText(void) } else { - MenuZeroFillWindowRect(23, 0, 24, 1); + Menu_EraseWindowRect(23, 0, 24, 1); } buffer = gStringVar1; @@ -3539,7 +3539,7 @@ static void PrintSummaryWindowHeaderText(void) buffer[2] = 0x28; buffer[3] = EOS; - MenuPrint(gStringVar1, 25, 0); + Menu_PrintText(gStringVar1, 25, 0); } // If the given pokemon previously had the pokerus virus, a small @@ -4138,7 +4138,7 @@ static void sub_80A12D0(s8 a) { u8 newTaskId; - MenuZeroFillWindowRect(1, 18, 5, 19); + Menu_EraseWindowRect(1, 18, 5, 19); sub_80A18E4(29); newTaskId = CreateTask(sub_80A1048, 0); @@ -4194,14 +4194,14 @@ static void sub_80A12D0(s8 a) // } // else // { -// MenuZeroFillWindowRect(0, 19, 9, 19); +// Menu_EraseWindowRect(0, 19, 9, 19); // } // if (gTasks[taskId].data[0] == 0 || gTasks[taskId].data[1] < 0) // { // if (pssData.page == PSS_PAGE_BATTLE_MOVES) // { -// MenuZeroFillWindowRect(0, 14, 9, 18); +// Menu_EraseWindowRect(0, 14, 9, 18); // sub_80A0958(pssData.loadedMon); // if (GetMonStatusAndPokerus(pssData.loadedMon)) @@ -4327,7 +4327,7 @@ _080A13F4:\n\ movs r1, 0x13\n\ movs r2, 0x9\n\ movs r3, 0x13\n\ - bl MenuZeroFillWindowRect\n\ + bl Menu_EraseWindowRect\n\ _080A1400:\n\ movs r1, 0\n\ ldrsh r0, [r7, r1]\n\ @@ -4346,7 +4346,7 @@ _080A1410:\n\ movs r1, 0xE\n\ movs r2, 0x9\n\ movs r3, 0x12\n\ - bl MenuZeroFillWindowRect\n\ + bl Menu_EraseWindowRect\n\ adds r4, 0x10\n\ adds r0, r4, 0\n\ bl sub_80A0958\n\ @@ -4404,7 +4404,7 @@ static void sub_80A1488(s8 a, u8 b) if (pssData.page == PSS_PAGE_BATTLE_MOVES) { - MenuZeroFillWindowRect(0, 14, 9, 19); + Menu_EraseWindowRect(0, 14, 9, 19); } taskId = FindTaskIdByFunc(sub_80A1334); @@ -4531,7 +4531,7 @@ _080A15C0:\n\ movs r1, 0x13\n\ movs r2, 0x9\n\ movs r3, 0x13\n\ - bl MenuZeroFillWindowRect\n\ + bl Menu_EraseWindowRect\n\ _080A15CC:\n\ movs r1, 0\n\ ldrsh r0, [r7, r1]\n\ @@ -4550,7 +4550,7 @@ _080A15DC:\n\ movs r1, 0xE\n\ movs r2, 0x9\n\ movs r3, 0x12\n\ - bl MenuZeroFillWindowRect\n\ + bl Menu_EraseWindowRect\n\ adds r4, 0x10\n\ adds r0, r4, 0\n\ bl sub_80A0958\n\ @@ -4606,7 +4606,7 @@ static void sub_80A1654(s8 a, u8 b) if (pssData.page == PSS_PAGE_CONTEST_MOVES) { - MenuZeroFillWindowRect(0, 14, 9, 19); + Menu_EraseWindowRect(0, 14, 9, 19); } taskId = FindTaskIdByFunc(sub_80A1500); @@ -5272,7 +5272,7 @@ u8 *sub_80A1E9C(u8 *dest, const u8 *src, u8 id) { u8 arr[3]; - sub_8072CD4(&arr[0], &arr[1], &arr[2]); + Menu_GetTextColors(&arr[0], &arr[1], &arr[2]); dest = sub_80A1E58(dest, id); dest = StringCopy(dest, src); @@ -5295,7 +5295,7 @@ u8 *sub_80A1E9C(u8 *dest, const u8 *src, u8 id) static void sub_80A1EF8(const u8 *text, u8 id, u8 left, u16 top, s32 e) { sub_80A1E9C(gStringVar4, text, id); - MenuPrint_PixelCoords(gStringVar4, left, top, (bool8)e); + Menu_PrintTextPixelCoords(gStringVar4, left, top, (bool8)e); } static void sub_80A1F48(const u8 *text, u8 id, u8 c, u8 d, u16 e) @@ -5313,7 +5313,7 @@ static void sub_80A1F98(s32 value, u8 id, u8 n, u8 mode, u8 left, u16 top, s32 e static void sub_80A1FF8(const u8 *text, u8 id, u8 left, u8 top) { sub_80A1E9C(gStringVar4, text, id); - MenuPrint(gStringVar4, left, top); + Menu_PrintText(gStringVar4, left, top); } u8 *PokemonSummaryScreen_CopyPokemonLevel(u8 *dest, u8 level) diff --git a/src/pokenav_before.c b/src/pokenav_before.c index 8a67390ad..3b534c96c 100644 --- a/src/pokenav_before.c +++ b/src/pokenav_before.c @@ -3268,10 +3268,10 @@ bool8 sub_80EF284(u8 a) sub_80EEDE8(); break; case 1: - SetUpWindowConfig(&gWindowConfig_81E7224); + Text_LoadWindowTemplate(&gWindowTemplate_81E7224); break; case 2: - MultistepInitMenuWindowBegin(&gWindowConfig_81E7224); + MultistepInitMenuWindowBegin(&gWindowTemplate_81E7224); break; case 3: if (!MultistepInitMenuWindowContinue()) @@ -3337,7 +3337,7 @@ void sub_80EF428(u8 a, u8 b) tileBuffer = gUnknown_083DFEC8; sub_8072C74(&tileBuffer[0x800], pcText, 0xC0, 2); - MenuPrint(&tileBuffer[0x800], 3, 17); + Menu_PrintText(&tileBuffer[0x800], 3, 17); } void sub_80EF490(u8 a) @@ -3660,17 +3660,17 @@ bool8 sub_80EF874(void) sub_80EEDE8(); break; case 1: - SetUpWindowConfig(&gWindowConfig_81E7224); + Text_LoadWindowTemplate(&gWindowTemplate_81E7224); break; case 2: - MultistepInitMenuWindowBegin(&gWindowConfig_81E7224); + MultistepInitMenuWindowBegin(&gWindowTemplate_81E7224); break; case 3: if (!MultistepInitMenuWindowContinue()) return TRUE; break; case 4: - MenuZeroFillScreen(); + Menu_EraseScreen(); break; case 5: sub_80FA904(&gUnknown_083DFEC4->regionMap, gSaveBlock2.regionMapZoom ? TRUE : FALSE); @@ -3691,7 +3691,7 @@ bool8 sub_80EF874(void) return TRUE; break; case 10: - MenuDrawTextWindow(13, 3, 29, 17); + Menu_DrawStdWindowFrame(13, 3, 29, 17); sub_80EF9F8(); break; case 11: @@ -3765,8 +3765,8 @@ void sub_80EF9F8(void) b = gUnknown_083DFEC4->regionMap.everGrandeCityArea; if (gUnknown_083DFEC4->unkCDCC[mapSectionId][b] != NULL) { - MenuFillWindowRectWithBlankTile(14, top, 15, 15); - MenuFillWindowRectWithBlankTile(26, top, 28, 15); + Menu_BlankWindowRect(14, top, 15, 15); + Menu_BlankWindowRect(26, top, 28, 15); sub_8095C8C((void *)(VRAM + 0xF800), 16, 6, gUnknown_083DFEC4->unkCDCC[mapSectionId][b], 0, 0, 10, 10, 10); top += 11; } @@ -3779,7 +3779,7 @@ void sub_80EF9F8(void) // Epic fail by the compiler at optimizing this. if (!someBool && top < 16) - MenuFillWindowRectWithBlankTile(14, top, 28, 15); + Menu_BlankWindowRect(14, top, 28, 15); if (gUnknown_083DFEC4->regionMap.unk16 == 2) sub_80EFD74(); @@ -3972,17 +3972,17 @@ bool8 sub_80EFF68(void) gUnknown_083DFEC4->unkD162[0] = 11; break; case 1: - SetUpWindowConfig(&gWindowConfig_81E7080); + Text_LoadWindowTemplate(&gWindowTemplate_81E7080); break; case 2: - MultistepInitMenuWindowBegin(&gWindowConfig_81E7080); + MultistepInitMenuWindowBegin(&gWindowTemplate_81E7080); break; case 3: if (!MultistepInitMenuWindowContinue()) return TRUE; break; case 4: - MenuZeroFillScreen(); + Menu_EraseScreen(); break; case 5: sub_80F1614(); @@ -4050,13 +4050,13 @@ void sub_80F01A4(void) void sub_80F01E0(u16 a) { - MenuPrint(gUnknown_083DFEC4->unk8829[a], 13, 1); + Menu_PrintText(gUnknown_083DFEC4->unk8829[a], 13, 1); if (gUnknown_083DFEC4->unk76AA == 1) { - MenuPrint(gUnknown_083DFEC4->unk88E9[a], 13, 3); + Menu_PrintText(gUnknown_083DFEC4->unk88E9[a], 13, 3); sub_80F443C(gUnknown_083DFEC4->unk8788, gUnknown_083DFEC4->unk893c[gUnknown_083DFEC4->unk87DC].unk2); - MenuPrint(gUnknown_083DFEC4->unk8788, 1, 6); + Menu_PrintText(gUnknown_083DFEC4->unk8788, 1, 6); } } @@ -4086,10 +4086,10 @@ bool8 sub_80F02A0(void) gUnknown_083DFEC4->unkD162[0] = 11; break; case 1: - SetUpWindowConfig(&gWindowConfig_81E70D4); + Text_LoadWindowTemplate(&gWindowTemplate_81E70D4); break; case 2: - MultistepInitMenuWindowBegin(&gWindowConfig_81E70D4); + MultistepInitMenuWindowBegin(&gWindowTemplate_81E70D4); break; case 3: if (!MultistepInitMenuWindowContinue()) @@ -4098,7 +4098,7 @@ bool8 sub_80F02A0(void) } break; case 4: - MenuZeroFillScreen(); + Menu_EraseScreen(); break; case 5: LZ77UnCompVram(gUnknown_08E9FC64, (void *)VRAM + 0xE800); @@ -4268,17 +4268,17 @@ _080F0338: .4byte 0x000087ca\n\ _080F033C: .4byte 0x000087c8\n\ _080F0340: .4byte 0x0000d162\n\ _080F0344:\n\ - ldr r0, _080F034C @ =gWindowConfig_81E70D4\n\ - bl SetUpWindowConfig\n\ + ldr r0, _080F034C @ =gWindowTemplate_81E70D4\n\ + bl Text_LoadWindowTemplate\n\ b _080F0618\n\ .align 2, 0\n\ -_080F034C: .4byte gWindowConfig_81E70D4\n\ +_080F034C: .4byte gWindowTemplate_81E70D4\n\ _080F0350:\n\ - ldr r0, _080F0358 @ =gWindowConfig_81E70D4\n\ + ldr r0, _080F0358 @ =gWindowTemplate_81E70D4\n\ bl MultistepInitMenuWindowBegin\n\ b _080F0618\n\ .align 2, 0\n\ -_080F0358: .4byte gWindowConfig_81E70D4\n\ +_080F0358: .4byte gWindowTemplate_81E70D4\n\ _080F035C:\n\ bl MultistepInitMenuWindowContinue\n\ cmp r0, 0\n\ @@ -4287,7 +4287,7 @@ _080F035C:\n\ _080F0366:\n\ b _080F0626\n\ _080F0368:\n\ - bl MenuZeroFillScreen\n\ + bl Menu_EraseScreen\n\ b _080F0618\n\ _080F036E:\n\ ldr r0, _080F0378 @ =gUnknown_08E9FC64\n\ diff --git a/src/rom_800D42C.c b/src/rom_800D42C.c index bf6d03fb7..9449ca0d1 100644 --- a/src/rom_800D42C.c +++ b/src/rom_800D42C.c @@ -28,8 +28,8 @@ extern u8 BattleText_Tie[]; #define PRINT_MESSAGE(text, tileDataStartOffset, x) \ { \ - InitWindow(&gUnknown_03004210, text, tileDataStartOffset, x, MESSAGE_Y); \ - sub_8002F44(&gUnknown_03004210); \ + Text_InitWindow(&gUnknown_03004210, text, tileDataStartOffset, x, MESSAGE_Y); \ + Text_PrintWindow8002F44(&gUnknown_03004210); \ } #define PRINT_MESSAGE_LEFT(text, tileDataStartOffset) PRINT_MESSAGE(text, tileDataStartOffset, LEFT_MESSAGE_X) diff --git a/src/roulette.c b/src/roulette.c index 1d612d071..e88c36c01 100644 --- a/src/roulette.c +++ b/src/roulette.c @@ -596,8 +596,8 @@ void sub_8115384(void) gMain.state++; break; case 0x2: - SetUpWindowConfig(&gWindowConfig_81E6C3C); - InitMenuWindow(&gWindowConfig_81E6CE4); + Text_LoadWindowTemplate(&gWindowTemplate_81E6C3C); + InitMenuWindow(&gWindowTemplate_81E6CE4); LoadPalette(&gUnknown_083F86BC, 0x0, 0x1C0); gMain.state++; break; @@ -625,8 +625,8 @@ void sub_8115384(void) sub_81182F8(0x6); sub_811829C(0x0); sub_8117158(0x0); - MenuDrawTextWindow(0x0, 0xE, 0x1D, 0x13); - MenuPrint(&gUnknown_081C4157[0], 0x1, 0xF); + Menu_DrawStdWindowFrame(0x0, 0xE, 0x1D, 0x13); + Menu_PrintText(&gUnknown_081C4157[0], 0x1, 0xF); gSpriteCoordOffsetX = -0x3C; gSpriteCoordOffsetY = 0x0; gMain.state++; @@ -693,14 +693,14 @@ void sub_8115734(u8 taskid) { DisplayYesNoMenu(0x14, 0x8, 0x1); sub_814AAF8(0x2D9E); - MenuDrawTextWindow(0x0, 0xE, 0x1D, 0x13); - MenuPrint(&gUnknown_081C41E3, 0x1, 0xF); + Menu_DrawStdWindowFrame(0x0, 0xE, 0x1D, 0x13); + Menu_PrintText(&gUnknown_081C41E3, 0x1, 0xF); DoYesNoFuncWithChoice(taskid, &gUnknown_083F8EBC); } void sub_811577C(u8 taskid) { - MenuZeroFillWindowRect(0x14, 0x8, 0x1A, 0xD); + Menu_EraseWindowRect(0x14, 0x8, 0x1A, 0xD); gTasks[taskid].func = &sub_81159BC; } @@ -1446,21 +1446,21 @@ void sub_8116638(u8 taskid) if (gTasks[taskid].data[0x2] == 0xC) { PlayFanfare(BGM_ME_B_BIG); - MenuDrawTextWindow(0x0, 0xE, 0x1D, 0x13); - MenuPrint(&gUnknown_081C41A5, 0x1, 0xF); + Menu_DrawStdWindowFrame(0x0, 0xE, 0x1D, 0x13); + Menu_PrintText(&gUnknown_081C41A5, 0x1, 0xF); } else { PlayFanfare(BGM_ME_B_SMALL); - MenuDrawTextWindow(0x0, 0xE, 0x1D, 0x13); - MenuPrint(&gUnknown_081C4199, 0x1, 0xF); + Menu_DrawStdWindowFrame(0x0, 0xE, 0x1D, 0x13); + Menu_PrintText(&gUnknown_081C4199, 0x1, 0xF); } break; case 0: default: m4aSongNumStart(SE_HAZURE); - MenuDrawTextWindow(0x0, 0xE, 0x1D, 0x13); - MenuPrint(&gUnknown_081C41AE, 0x1, 0xF); + Menu_DrawStdWindowFrame(0x0, 0xE, 0x1D, 0x13); + Menu_PrintText(&gUnknown_081C41AE, 0x1, 0xF); } gTasks[taskid].data[0x1] = 0x0; gTasks[taskid].func = &sub_811659C; @@ -1500,8 +1500,8 @@ void sub_811677C(u8 taskid) { ConvertIntToDecimalStringN((u8 *)&gStringVar1, (eRoulette->var19 * gTasks[taskid].data[0x2]), STR_CONV_MODE_LEFT_ALIGN, 0x2); StringExpandPlaceholders((u8 *)&gStringVar4, &gUnknown_081C41BD); - MenuDrawTextWindow(0x0, 0xE, 0x1D, 0x13); - MenuPrint((u8 *)&gStringVar4, 0x1, 0xF); + Menu_DrawStdWindowFrame(0x0, 0xE, 0x1D, 0x13); + Menu_PrintText((u8 *)&gStringVar4, 0x1, 0xF); gTasks[taskid].data[0x1] = (eRoulette->var19 * gTasks[taskid].data[0x2]); gTasks[taskid].data[0x7] = 0x0; gTasks[taskid].func = &sub_81166E8; @@ -1534,14 +1534,14 @@ void sub_8116880(u8 taskid) { if (gTasks[taskid].data[0x6] == 0x6) { - MenuDrawTextWindow(0x0, 0xE, 0x1D, 0x13); - MenuPrint(&gUnknown_081C41F1, 0x1, 0xF); + Menu_DrawStdWindowFrame(0x0, 0xE, 0x1D, 0x13); + Menu_PrintText(&gUnknown_081C41F1, 0x1, 0xF); sub_8116C34(taskid, &dp01t_12_3_battle_menu, 0xFFFF, 0x3); } else if (gTasks[taskid].data[0xD] == 0x270F) { - MenuDrawTextWindow(0x0, 0xE, 0x1D, 0x13); - MenuPrint(&gUnknown_081C4231, 0x1, 0xF); + Menu_DrawStdWindowFrame(0x0, 0xE, 0x1D, 0x13); + Menu_PrintText(&gUnknown_081C4231, 0x1, 0xF); sub_8116C34(taskid, &sub_8115734, 0xFFFF, 0x3); } else @@ -1551,8 +1551,8 @@ void sub_8116880(u8 taskid) } else { - MenuDrawTextWindow(0x0, 0xE, 0x1D, 0x13); - MenuPrint(&gUnknown_081C41D2, 0x1, 0xF); + Menu_DrawStdWindowFrame(0x0, 0xE, 0x1D, 0x13); + Menu_PrintText(&gUnknown_081C41D2, 0x1, 0xF); sub_8116C34(taskid, &sub_81157AC, 0x3C, 0x3); } } @@ -1570,8 +1570,8 @@ void dp01t_12_3_battle_menu(u8 taskid) gSprites[eRoulette->var3C[i + 0x7]].invisible = FALSE; if (gTasks[taskid].data[0xD] == 0x270F) { - MenuDrawTextWindow(0x0, 0xE, 0x1D, 0x13); - MenuPrint(&gUnknown_081C4231, 0x1, 0xF); + Menu_DrawStdWindowFrame(0x0, 0xE, 0x1D, 0x13); + Menu_PrintText(&gUnknown_081C4231, 0x1, 0xF); sub_8116C34(taskid, &sub_8115734, 0xFFFF, 0x3); } else @@ -2619,8 +2619,8 @@ void sub_8117528(u8 taskid) void sub_811755C(u8 taskid) { - MenuZeroFillWindowRect(0x14, 0x8, 0x1A, 0xD); - MenuZeroFillScreen(); + Menu_EraseWindowRect(0x14, 0x8, 0x1A, 0xD); + Menu_EraseScreen(); BeginNormalPaletteFade(-0x1, 0x0, 0x0, 0x10, 0x0); gPaletteFade.delayCounter = gPaletteFade.multipurpose2; UpdatePaletteFade(); @@ -2629,7 +2629,7 @@ void sub_811755C(u8 taskid) void sub_81175C0(u8 taskid) { - MenuZeroFillScreen(); + Menu_EraseScreen(); ScriptContext2_Disable(); DestroyTask(taskid); } @@ -2640,7 +2640,7 @@ void sub_81175DC(u8 taskid) if (!(gMain.newKeys & (A_BUTTON | B_BUTTON)) && gTasks[taskid].data[0] < 0x3D) return; gSpecialVar_0x8004 = 0x1; - MenuZeroFillScreen(); + Menu_EraseScreen(); ScriptContext2_Disable(); DestroyTask(taskid); } @@ -2650,8 +2650,8 @@ void sub_8117630(u8 taskid) u32 temp = gUnknown_083F8DF0[(gSpecialVar_0x8004 & 0x1) + (gSpecialVar_0x8004 >> 0x7 << 0x1)]; ConvertIntToDecimalStringN(gStringVar1, temp, 0x2, 0x1); StringExpandPlaceholders(gStringVar4, &gUnknown_081C40DF); - MenuDrawTextWindow(0x0, 0xE, 0x1D, 0x13); - MenuPrint(gStringVar4, 0x1, 0xF); + Menu_DrawStdWindowFrame(0x0, 0xE, 0x1D, 0x13); + Menu_PrintText(gStringVar4, 0x1, 0xF); gTasks[taskid].func = &sub_81174F8; } @@ -2660,7 +2660,7 @@ void Task_Roulette_0(u8 taskid) s32 temp; ConvertIntToDecimalStringN(gStringVar1, gTasks[taskid].data[0xD], 0x1, 0x4); StringExpandPlaceholders(gStringVar4, gOtherText_Coins); - MenuDrawTextWindow(0x0, 0x0, 0x9, 0x3); + Menu_DrawStdWindowFrame(0x0, 0x0, 0x9, 0x3); MenuPrint_RightAligned(gStringVar4, 0x9, 0x1); temp = gUnknown_083F8DF0[(gSpecialVar_0x8004 & 0x1) + (gSpecialVar_0x8004 >> 0x7 << 0x1)]; ConvertIntToDecimalStringN(gStringVar1, temp, 0x2, 0x1); @@ -2668,23 +2668,23 @@ void Task_Roulette_0(u8 taskid) { if ((gSpecialVar_0x8004 & 0x80) && (gSpecialVar_0x8004 & 0x1)) { - MenuDrawTextWindow(0x0, 0xE, 0x1D, 0x13); - MenuPrint(&gUnknown_081C4139, 0x1, 0xF); + Menu_DrawStdWindowFrame(0x0, 0xE, 0x1D, 0x13); + Menu_PrintText(&gUnknown_081C4139, 0x1, 0xF); sub_8116C34(taskid , &sub_8117630, 0xFFFF, 0x3); } else { StringExpandPlaceholders(gStringVar4, &gUnknown_081C40DF); - MenuDrawTextWindow(0x0, 0xE, 0x1D, 0x13); - MenuPrint(gStringVar4, 0x1, 0xF); + Menu_DrawStdWindowFrame(0x0, 0xE, 0x1D, 0x13); + Menu_PrintText(gStringVar4, 0x1, 0xF); gTasks[taskid].func = &sub_81174F8; } } else { StringExpandPlaceholders(gStringVar4, &gUnknown_081C411C); - MenuDrawTextWindow(0x0, 0xE, 0x1D, 0x13); - MenuPrint(gStringVar4, 0x1, 0xF); + Menu_DrawStdWindowFrame(0x0, 0xE, 0x1D, 0x13); + Menu_PrintText(gStringVar4, 0x1, 0xF); gTasks[taskid].func = &sub_81175DC; gTasks[taskid].data[0xD] = 0x0; gTasks[taskid].data[0x0] = 0x0; diff --git a/src/scene/berry_blender.c b/src/scene/berry_blender.c index 53308e856..b59d02939 100644 --- a/src/scene/berry_blender.c +++ b/src/scene/berry_blender.c @@ -198,8 +198,8 @@ void m4aMPlayTempoControl(struct MusicPlayerInfo *mplayInfo, u16 tempo); void m4aMPlayStop(struct MusicPlayerInfo *mplayInfo); void sub_80A6978(void); u8 sub_80A7DEC(u8 berryId, u8 x, u8 y, bool8 animate); -void sub_814A880(u8 a1, u8 a2); -u8 sub_814A5C0(u8 a1, u16 a2, u8 a3, u16 a4, u8 a5); +void MenuCursor_SetPos814A880(u8 a1, u8 a2); +u8 MenuCursor_Create814A5C0(u8 a1, u16 a2, u8 a3, u16 a4, u8 a5); s8 GetFirstFreePokeblockSlot(void); bool8 sub_810CA34(struct Pokeblock *pokeblock); #ifdef GERMAN @@ -215,7 +215,7 @@ extern u8 byte_3002A68; extern const u8 gUnknown_08E6C100[]; extern const u8 gUnknown_08E6C920[]; extern const u8 gUnknown_08E6D354[]; -extern const struct WindowConfig gWindowConfig_81E6F68; +extern const struct WindowTemplate gWindowTemplate_81E6F68; extern const u8 *const gPokeblockNames[]; extern const struct Berry gBerries[]; @@ -957,8 +957,8 @@ static void sub_804E56C(void) ResetSpriteData(); FreeAllSpritePalettes(); SetVBlankCallback(NULL); - SetUpWindowConfig(&gWindowConfig_81E6F68); - InitMenuWindow(&gWindowConfig_81E6F68); + Text_LoadWindowTemplate(&gWindowTemplate_81E6F68); + InitMenuWindow(&gWindowTemplate_81E6F68); gBerryBlenderData->field_0++; gBerryBlenderData->field_140 = 0; gBerryBlenderData->field_13E = 0; @@ -993,12 +993,12 @@ static void sub_804E56C(void) } break; case 4: - MenuDrawTextWindow(0, 14, 29, 19); + Menu_DrawStdWindowFrame(0, 14, 29, 19); MenuPrintMessage(gOtherText_BlenderChooseBerry, 1, 15); gBerryBlenderData->field_0++; break; case 5: - if (MenuUpdateWindowText()) + if (Menu_UpdateWindowText()) { gBerryBlenderData->field_0++; BeginNormalPaletteFade(-1, 0, 0, 0x10, 0); @@ -1135,8 +1135,8 @@ static void sub_804E9F8(void) FreeAllSpritePalettes(); ResetTasks(); SetVBlankCallback(VBlankCB0_BerryBlender); - SetUpWindowConfig(&gWindowConfig_81E6F68); - InitMenuWindow(&gWindowConfig_81E6F68); + Text_LoadWindowTemplate(&gWindowTemplate_81E6F68); + InitMenuWindow(&gWindowTemplate_81E6F68); gLinkType = 0x4422; gBerryBlenderData->field_0++; gBerryBlenderData->field_4E = 0; @@ -1184,8 +1184,8 @@ static void sub_804E9F8(void) } break; case 5: - MenuDrawTextWindow(0, 13, 29, 19); - MenuPrint(gOtherText_LinkStandby3, 1, 14); + Menu_DrawStdWindowFrame(0, 13, 29, 19); + Menu_PrintText(gOtherText_LinkStandby3, 1, 14); gBerryBlenderData->field_0 = 8; gBerryBlenderData->framesToWait = 0; break; @@ -1209,7 +1209,7 @@ static void sub_804E9F8(void) case 10: if (++gBerryBlenderData->framesToWait > 20) { - MenuZeroFillScreen(); + Menu_EraseScreen(); if (GetBlockReceivedStatus() == sub_8008198()) { for (i = 0; i < GetLinkPlayerCount(); i++) @@ -1309,12 +1309,12 @@ static void sub_804E9F8(void) PlayBGM(BGM_CYCLING); break; case 100: - MenuDrawTextWindow(0, 13, 29, 19); + Menu_DrawStdWindowFrame(0, 13, 29, 19); MenuPrintMessage(gOtherText_LinkNotFound, 1, 15); gBerryBlenderData->field_0++; break; case 101: - if (MenuUpdateWindowText()) + if (Menu_UpdateWindowText()) gBerryBlenderData->field_0++; break; case 102: @@ -1338,8 +1338,8 @@ static void sub_804F0F4(void) SetVBlankCallback(VBlankCB0_BerryBlender); - SetUpWindowConfig(&gWindowConfig_81E6F68); - InitMenuWindow(&gWindowConfig_81E6F68); + Text_LoadWindowTemplate(&gWindowTemplate_81E6F68); + InitMenuWindow(&gWindowTemplate_81E6F68); gLinkType = 0x4422; @@ -1426,7 +1426,7 @@ static void sub_804F2A8(void) if (GetMultiplayerId() == gBerryBlenderData->field_9A[i]) stringPtr = StringCopy(stringPtr, sRedColorString); StringCopy(stringPtr, gLinkPlayers[gBerryBlenderData->field_9A[i]].name); - MenuPrint_PixelCoords(gStringVar1, gUnknown_082162D4[i][0] * 8 + 1, gUnknown_082162D4[i][1] * 8, 1); + Menu_PrintTextPixelCoords(gStringVar1, gUnknown_082162D4[i][0] * 8 + 1, gUnknown_082162D4[i][1] * 8, 1); } } } @@ -2494,15 +2494,15 @@ static void sub_8050760(void) static void sub_80508D4(u8 value) { gBerryBlenderData->field_AA = value; - sub_814A880(192, (gBerryBlenderData->field_AA * 16) + 72); + MenuCursor_SetPos814A880(192, (gBerryBlenderData->field_AA * 16) + 72); } static void sub_80508FC(void) { gBerryBlenderData->field_AA = 0; - MenuDrawTextWindow(23, 8, 28, 13); - sub_814A5C0(0, -1, 12, 0x2D9F, 32); - MenuPrint(gOtherText_YesNoTerminating, 24, 9); + Menu_DrawStdWindowFrame(23, 8, 28, 13); + MenuCursor_Create814A5C0(0, -1, 12, 0x2D9F, 32); + Menu_PrintText(gOtherText_YesNoTerminating, 24, 9); sub_80508D4(gBerryBlenderData->field_AA); } @@ -2575,11 +2575,11 @@ static void sub_8050954(void) break; case 7: gBerryBlenderData->field_6F++; - MenuDrawTextWindow(0, 14, 29, 19); + Menu_DrawStdWindowFrame(0, 14, 29, 19); MenuPrintMessage(gOtherText_BlendAnotherBerryPrompt, 1, 15); break; case 8: - if (MenuUpdateWindowText()) + if (Menu_UpdateWindowText()) gBerryBlenderData->field_6F++; break; case 9: @@ -2654,7 +2654,7 @@ static void sub_8050954(void) } break; case 13: - if (MenuUpdateWindowText()) + if (Menu_UpdateWindowText()) { SetMainCallback2(sub_8050E30); gBerryBlenderData->field_6F = 0; @@ -2746,7 +2746,7 @@ static void sub_8050E30(void) case 1: gBerryBlenderData->field_6F = 3; DestroyMenuCursor(); - MenuZeroFillWindowRect(23, 8, 28, 13); + Menu_EraseWindowRect(23, 8, 28, 13); #ifdef ENGLISH StringCopy(gStringVar4, gLinkPlayers[gBerryBlenderData->field_7A].name); StringAppend(gStringVar4, gOtherText_OtherCaseIsFull); @@ -2759,7 +2759,7 @@ static void sub_8050E30(void) case 2: gBerryBlenderData->field_6F++; DestroyMenuCursor(); - MenuZeroFillWindowRect(23, 8, 28, 13); + Menu_EraseWindowRect(23, 8, 28, 13); #ifdef ENGLISH StringCopy(gStringVar4, gLinkPlayers[gBerryBlenderData->field_7A].name); StringAppend(gStringVar4, gOtherText_NoBerriesForBlend); @@ -2770,7 +2770,7 @@ static void sub_8050E30(void) MenuPrintMessage(gStringVar4, 1, 15); break; case 3: - if (MenuUpdateWindowText()) + if (Menu_UpdateWindowText()) { gBerryBlenderData->framesToWait = 0; gBerryBlenderData->field_6F++; @@ -2781,8 +2781,8 @@ static void sub_8050E30(void) gBerryBlenderData->field_6F = 5; break; case 5: - MenuDrawTextWindow(0, 14, 29, 19); - MenuPrint(gMultiText_Saving, 2, 15); + Menu_DrawStdWindowFrame(0, 14, 29, 19); + Menu_PrintText(gMultiText_Saving, 2, 15); sub_80084A4(); gBerryBlenderData->field_6F++; break; @@ -2859,17 +2859,17 @@ static void sub_80510E8(void) case 1: gBerryBlenderData->field_6F = 3; DestroyMenuCursor(); - MenuZeroFillWindowRect(23, 8, 28, 13); + Menu_EraseWindowRect(23, 8, 28, 13); MenuPrintMessage(gOtherText_CaseIsFull, 1, 15); break; case 2: gBerryBlenderData->field_6F++; DestroyMenuCursor(); - MenuZeroFillWindowRect(23, 8, 28, 13); + Menu_EraseWindowRect(23, 8, 28, 13); MenuPrintMessage(gOtherText_OutOfBerries, 1, 15); break; case 3: - if (MenuUpdateWindowText()) + if (Menu_UpdateWindowText()) gBerryBlenderData->field_6F = 9; break; case 9: @@ -3080,14 +3080,14 @@ void unref_sub_80516F8(u8 taskID) task->data[0] = 0; if (task->data[0] == 100) { - ZeroFillWindowRect(&gBerryBlenderData->field_4, 0, 0, 16, 20); - MenuDrawTextWindow(4, 4, 10, 12); + Text_EraseWindowRect(&gBerryBlenderData->field_4, 0, 0, 16, 20); + Menu_DrawStdWindowFrame(4, 4, 10, 12); for (i = 0; i < 3; i++) { if (gLinkPlayers[i + 1].trainerId != 0) - MenuPrint(gUnknown_08216284[i], 5, (2 * i) + 5); - MenuDrawTextWindow(0, 13, 29, 19); - MenuPrint(gOtherText_PressAToStart, 1, 15); + Menu_PrintText(gUnknown_08216284[i], 5, (2 * i) + 5); + Menu_DrawStdWindowFrame(0, 13, 29, 19); + Menu_PrintText(gOtherText_PressAToStart, 1, 15); } } if (gMain.newKeys & A_BUTTON) @@ -3099,7 +3099,7 @@ void unref_sub_80516F8(u8 taskID) else { if (task->data[0] == 10) - MenuPrint(gOtherText_PleaseWait, 3, 10); + Menu_PrintText(gOtherText_PleaseWait, 3, 10); if (++task->data[0] > 120) task->data[0] = 0; if (byte_3002A68 > 4 && gReceivedRemoteLinkPlayers == 1) @@ -3348,7 +3348,7 @@ static bool8 Blender_PrintBlendingResults(void) u8* textPtr; u16 secondsPassed, minutes, seconds; - MenuDrawTextWindow(4, 2, 25, 17); + Menu_DrawStdWindowFrame(4, 2, 25, 17); sub_8072BD8(gOtherText_ResultsOfBlending, 5, 3, 160); for (i = 0; i < gBerryBlenderData->playersNo; i++) { @@ -3370,7 +3370,7 @@ static bool8 Blender_PrintBlendingResults(void) textPtr += 3; textPtr = sub_8072C74(textPtr, gLinkPlayers[place].name, 88, 0); sub_8072C74(textPtr, text[0], 157, 0); - MenuPrint(gBerryBlenderData->stringVar, 5, gUnknown_082165E9[gBerryBlenderData->playersNo] + (i * gUnknown_082165EE[gBerryBlenderData->playersNo])); + Menu_PrintText(gBerryBlenderData->stringVar, 5, gUnknown_082165E9[gBerryBlenderData->playersNo] + (i * gUnknown_082165EE[gBerryBlenderData->playersNo])); } ConvertIntToDecimalStringN(text[0], gBerryBlenderData->max_RPM % 100, 2, 2); textPtr = gBerryBlenderData->stringVar; @@ -3388,7 +3388,7 @@ static bool8 Blender_PrintBlendingResults(void) textPtr = sub_8072C74(textPtr, text[0], 136, 1); #endif StringCopy(textPtr, gOtherText_RPM); - MenuPrint(gBerryBlenderData->stringVar, 5, 13); + Menu_PrintText(gBerryBlenderData->stringVar, 5, 13); secondsPassed = gBerryBlenderData->gameFrameTime / 60; seconds = secondsPassed % 60; @@ -3408,7 +3408,7 @@ static bool8 Blender_PrintBlendingResults(void) textPtr = sub_8072C74(textPtr, text[1], 136, 1); StringCopy(textPtr, gOtherText_Sec); - MenuPrint(gBerryBlenderData->stringVar, 5, 15); + Menu_PrintText(gBerryBlenderData->stringVar, 5, 15); gBerryBlenderData->framesToWait = 0; gBerryBlenderData->field_0++; @@ -3419,8 +3419,8 @@ static bool8 Blender_PrintBlendingResults(void) gBerryBlenderData->field_0++; break; case 5: - MenuZeroFillScreen(); - MenuDrawTextWindow(0, 14, 29, 19); + Menu_EraseScreen(); + Menu_DrawStdWindowFrame(0, 14, 29, 19); for (i = 0; i < BLENDER_MAX_PLAYERS; i++) { if (gBerryBlenderData->chosenItemID[i] != 0) @@ -3436,7 +3436,7 @@ static bool8 Blender_PrintBlendingResults(void) gBerryBlenderData->field_0++; break; case 6: - if (MenuUpdateWindowText()) + if (Menu_UpdateWindowText()) { Blender_TrySettingRecord(); return TRUE; @@ -3536,7 +3536,7 @@ static bool8 Blender_PrintBlendingRanking(void) } break; case 3: - MenuDrawTextWindow(4, 2, 25, 17); + Menu_DrawStdWindowFrame(4, 2, 25, 17); sub_8072BD8(gOtherText_Ranking, 5, 3, 160); gBerryBlenderData->scoreIconIDs[BLENDER_SCORE_BEST] = CreateSprite(&sSpriteTemplate_821645C, 140, 52, 0); @@ -3575,7 +3575,7 @@ static bool8 Blender_PrintBlendingRanking(void) txtPtr = sub_8072C14(txtPtr, gBerryBlenderData->scores[place][BLENDER_SCORE_GOOD], 132, 1); txtPtr = sub_8072C14(txtPtr, gBerryBlenderData->scores[place][BLENDER_SCORE_MISS], 156, 1); - MenuPrint(gBerryBlenderData->stringVar, 5, i * gUnknown_082165F3[gBerryBlenderData->playersNo] + 8); + Menu_PrintText(gBerryBlenderData->stringVar, 5, i * gUnknown_082165F3[gBerryBlenderData->playersNo] + 8); } gBerryBlenderData->framesToWait = 0; gBerryBlenderData->field_0++; @@ -3606,8 +3606,8 @@ void unref_sub_80524BC(void) FreeAllSpritePalettes(); ResetTasks(); SetVBlankCallback(VBlankCB1_BerryBlender); - SetUpWindowConfig(&gWindowConfig_81E6CE4); - InitMenuWindow(&gWindowConfig_81E6CE4); + Text_LoadWindowTemplate(&gWindowTemplate_81E6CE4); + InitMenuWindow(&gWindowTemplate_81E6CE4); SeedRng(gMain.vblankCounter1); REG_DISPCNT = 0x1540; RunTasks(); @@ -3625,10 +3625,10 @@ static void BlenderDebug_PrintBerryData(void) u8 i; StringCopy(text, sText_BPM); - MenuPrint(text, 2, 0); + Menu_PrintText(text, 2, 0); ConvertIntToDecimalStringN(text, sBlenderDebug.BPM / 100, 2, 3); - MenuPrint(text, 6, 0); + Menu_PrintText(text, 6, 0); for (i = 0; i < 4; i++) { @@ -3646,7 +3646,7 @@ static void BlenderDebug_PrintBerryData(void) text[7] = EOS; } var = (i * 3) + 3; - MenuPrint(text, 2, var); + Menu_PrintText(text, 2, var); ConvertIntToDecimalStringN(&text[0], gBerries[sBlenderDebug.berries[i]].spicy, 2, 2); StringAppend(text, sText_Space); @@ -3666,12 +3666,12 @@ static void BlenderDebug_PrintBerryData(void) ConvertIntToDecimalStringN(&text[15], gBerries[sBlenderDebug.berries[i]].smoothness, 2, 2); text[17] = EOS; - MenuPrint(text, 7, var); + Menu_PrintText(text, 7, var); } if (sBlenderDebug.pokeblock.color != 0) { StringCopy(text, gPokeblockNames[sBlenderDebug.pokeblock.color]); - MenuPrint(text, 2, 15); + Menu_PrintText(text, 2, 15); ConvertIntToHexStringN(&text[0], sBlenderDebug.spicy, 2, 2); StringAppend(text, sText_Space); @@ -3691,7 +3691,7 @@ static void BlenderDebug_PrintBerryData(void) ConvertIntToHexStringN(&text[15], sBlenderDebug.feel, 2, 2); text[17] = EOS; - MenuPrint(text, 7, 17); + Menu_PrintText(text, 7, 17); } } @@ -3743,7 +3743,7 @@ static void sub_80527BC(void) gUnknown_020297DC = 0; } - MenuPrint(text, 2, 15); + Menu_PrintText(text, 2, 15); } static void sub_8052918(void) @@ -3845,9 +3845,9 @@ void ShowBerryBlenderRecordWindow(void) u8 text[30]; s32 i; - MenuDrawTextWindow(6, 3, 23, 16); - MenuPrint(gMultiText_BerryBlenderMaxSpeedRecord, 8, 4); - MenuPrint(gMultiText_2P3P4P, 8, 9); + Menu_DrawStdWindowFrame(6, 3, 23, 16); + Menu_PrintText(gMultiText_BerryBlenderMaxSpeedRecord, 8, 4); + Menu_PrintText(gMultiText_2P3P4P, 8, 9); for (i = 0; i < 3; i++) { @@ -3865,7 +3865,7 @@ void ShowBerryBlenderRecordWindow(void) txtPtr = ConvertIntToDecimalStringN(txtPtr, record % 100, 2, 2); StringAppend(txtPtr, gOtherText_RPM); - MenuPrint(text, 15, i * 2 + 9); + Menu_PrintText(text, 15, i * 2 + 9); } } diff --git a/src/scene/contest_painting.c b/src/scene/contest_painting.c index 442d8ec26..401872644 100644 --- a/src/scene/contest_painting.c +++ b/src/scene/contest_painting.c @@ -243,8 +243,8 @@ static void HoldContestPainting(void) static void ContestPaintingInitWindow(u8 arg0) { - InitMenuWindow(&gWindowConfig_81E7160); - SetUpWindowConfig(&gWindowConfig_81E7160); + InitMenuWindow(&gWindowTemplate_81E7160); + Text_LoadWindowTemplate(&gWindowTemplate_81E7160); } static void ContestPaintingPrintCaption(u8 contestType, u8 arg1) @@ -291,7 +291,7 @@ static void ContestPaintingPrintCaption(u8 contestType, u8 arg1) xPos = 3; yPos = 14; } - MenuPrint_PixelCoords(gUnknown_03005E40, xPos * 8 + 1, yPos * 8, 1); + Menu_PrintTextPixelCoords(gUnknown_03005E40, xPos * 8 + 1, yPos * 8, 1); } static void ContestPaintingInitBG(void) diff --git a/src/scene/credits.c b/src/scene/credits.c index 17c1bf263..e31e2c797 100644 --- a/src/scene/credits.c +++ b/src/scene/credits.c @@ -474,8 +474,8 @@ void sub_81439D0(void) taskIdC = gTasks[taskIdA].data[TDA_TASK_C_ID]; gTasks[taskIdC].data[TDC_0] = 40; - SetUpWindowConfig(&gWindowConfig_81E7208); - InitMenuWindow(&gWindowConfig_81E7208); + Text_LoadWindowTemplate(&gWindowTemplate_81E7208); + InitMenuWindow(&gWindowTemplate_81E7208); LoadPalette(&gUnknown_0840B7BC, 0x80, sizeof(gUnknown_0840B7BC)); CpuCopy16(&gUnknown_0840B7FC, (void *)(VRAM + 0xBEE0), sizeof(gUnknown_0840B7FC)); @@ -857,7 +857,7 @@ static void task_b_81441B8(u8 taskIdB) case 5: if (!gPaletteFade.active) { - MenuZeroFillWindowRect(0, 9, 29, 19); + Menu_EraseWindowRect(0, 9, 29, 19); gTasks[taskIdB].data[TDB_0] = 2; } return; diff --git a/src/scene/egg_hatch.c b/src/scene/egg_hatch.c index c0111de7d..e0b798aea 100644 --- a/src/scene/egg_hatch.c +++ b/src/scene/egg_hatch.c @@ -471,10 +471,10 @@ static void CB2_EggHatch_0(void) gSpecialVar_0x8005 = GetCurrentMapMusic(); break; case 1: - SetUpWindowConfig(&gWindowConfig_81E6F84); - InitWindowFromConfig(&gEggHatchData->window, &gWindowConfig_81E6F84); - gEggHatchData->tileDataStartOffset = SetTextWindowBaseTileNum(20); - LoadTextWindowGraphics(&gEggHatchData->window); + Text_LoadWindowTemplate(&gWindowTemplate_81E6F84); + Text_InitWindowWithTemplate(&gEggHatchData->window, &gWindowTemplate_81E6F84); + gEggHatchData->tileDataStartOffset = TextWindow_SetBaseTileNum(20); + TextWindow_LoadStdFrameGraphics(&gEggHatchData->window); gMain.state++; break; case 2: @@ -625,7 +625,7 @@ static void CB2_EggHatch_1(void) case 8: if (EggHatchUpdateWindowText()) { - MenuDrawTextWindow(22, 8, 27, 13); + Menu_DrawStdWindowFrame(22, 8, 27, 13); InitYesNoMenu(22, 8, 4); gEggHatchData->CB2_state++; } @@ -633,7 +633,7 @@ static void CB2_EggHatch_1(void) case 9: { s8 menuInput; - if ((menuInput = ProcessMenuInputNoWrap_()) != -2) + if ((menuInput = Menu_ProcessInputNoWrap_()) != -2) { if (menuInput != -1 && menuInput != 1) { @@ -848,15 +848,15 @@ static void CreateEggShardSprite(u8 x, u8 y, s16 data1, s16 data2, s16 data3, u8 static void EggHatchPrintMessage1(u8* src) { - sub_8002EB0(&gEggHatchData->window, src, gEggHatchData->tileDataStartOffset, 3, 15); + Text_InitWindow8002EB0(&gEggHatchData->window, src, gEggHatchData->tileDataStartOffset, 3, 15); } static void EggHatchPrintMessage2(u8* src) { - sub_8003460(&gEggHatchData->window, src, gEggHatchData->tileDataStartOffset, 3, 15); + Text_InitWindowAndPrintText(&gEggHatchData->window, src, gEggHatchData->tileDataStartOffset, 3, 15); } static bool8 EggHatchUpdateWindowText(void) { - return sub_80035AC(&gEggHatchData->window); + return Text_UpdateWindow(&gEggHatchData->window); } diff --git a/src/scene/evolution_scene.c b/src/scene/evolution_scene.c index 4ee601360..167130aa5 100644 --- a/src/scene/evolution_scene.c +++ b/src/scene/evolution_scene.c @@ -197,7 +197,7 @@ void EvolutionScene(struct Pokemon* mon, u16 speciesToEvolve, bool8 canStopEvo, REG_WININ = 0; REG_WINOUT = 0; - SetUpWindowConfig(&gWindowConfig_81E6C58); + Text_LoadWindowTemplate(&gWindowTemplate_81E6C58); ResetPaletteFade(); gBattle_BG0_X = 0; @@ -209,7 +209,7 @@ void EvolutionScene(struct Pokemon* mon, u16 speciesToEvolve, bool8 canStopEvo, gUnknown_030041B0 = 256; gUnknown_030041B8 = 0; - InitWindowFromConfig(&gUnknown_03004210, &gWindowConfig_81E6C58); + Text_InitWindowWithTemplate(&gUnknown_03004210, &gWindowTemplate_81E6C58); gBattleTerrain = BATTLE_TERRAIN_PLAIN; sub_800D6D4(); @@ -306,7 +306,7 @@ static void CB2_EvolutionSceneLoadGraphics(void) REG_WIN1V = 0; REG_WININ = 0; REG_WINOUT = 0; - SetUpWindowConfig(&gWindowConfig_81E6C58); + Text_LoadWindowTemplate(&gWindowTemplate_81E6C58); ResetPaletteFade(); gBattle_BG0_X = 0; gBattle_BG0_Y = 0; @@ -317,7 +317,7 @@ static void CB2_EvolutionSceneLoadGraphics(void) gUnknown_030041B0 = 256; gUnknown_030041B8 = 0; - InitWindowFromConfig(&gUnknown_03004210, &gWindowConfig_81E6C58); + Text_InitWindowWithTemplate(&gUnknown_03004210, &gWindowTemplate_81E6C58); gBattleTerrain = BATTLE_TERRAIN_PLAIN; sub_800D6D4(); @@ -373,15 +373,15 @@ static void CB2_TradeEvolutionSceneLoadGraphics(void) gMain.state++; break; case 1: - SetUpWindowConfig(&gWindowConfig_81E6F84); - InitWindowFromConfig(&gUnknown_03004828->window, &gWindowConfig_81E6F84); + Text_LoadWindowTemplate(&gWindowTemplate_81E6F84); + Text_InitWindowWithTemplate(&gUnknown_03004828->window, &gWindowTemplate_81E6F84); gMain.state++; break; case 2: - LoadTextWindowGraphics(&gUnknown_03004828->window); - gUnknown_03004828->textWindowBaseTileNum = SetTextWindowBaseTileNum(2); - LoadTextWindowGraphics(&gUnknown_03004828->window); - MenuZeroFillScreen(); + TextWindow_LoadStdFrameGraphics(&gUnknown_03004828->window); + gUnknown_03004828->textWindowBaseTileNum = TextWindow_SetBaseTileNum(2); + TextWindow_LoadStdFrameGraphics(&gUnknown_03004828->window); + Menu_EraseScreen(); ResetPaletteFade(); gMain.state++; SetHBlankCallback(EvoDummyFunc); @@ -481,7 +481,7 @@ static void CB2_EvolutionSceneUpdate(void) { AnimateSprites(); BuildOamBuffer(); - sub_800374C(&gUnknown_03004210); + Text_UpdateWindowInBattle(&gUnknown_03004210); UpdatePaletteFade(); RunTasks(); } @@ -490,7 +490,7 @@ static void CB2_TradeEvolutionSceneUpdate(void) { AnimateSprites(); BuildOamBuffer(); - sub_80035AC(&gUnknown_03004828->window); + Text_UpdateWindow(&gUnknown_03004828->window); UpdatePaletteFade(); RunTasks(); } @@ -558,7 +558,7 @@ static void Task_EvolutionScene(u8 taskID) if (!gPaletteFade.active) { StringExpandPlaceholders(gStringVar4, BattleText_StartEvo); - sub_8002EB0(&gUnknown_03004210, gStringVar4, 144, 2, 15); + Text_InitWindow8002EB0(&gUnknown_03004210, gStringVar4, 144, 2, 15); gTasks[taskID].tState++; } break; @@ -646,7 +646,7 @@ static void Task_EvolutionScene(u8 taskID) if (IsCryFinished() && !gPaletteFade.active) { StringExpandPlaceholders(gStringVar4, BattleText_FinishEvo); - sub_8002EB0(&gUnknown_03004210, gStringVar4, 144, 2, 15); + Text_InitWindow8002EB0(&gUnknown_03004210, gStringVar4, 144, 2, 15); PlayBGM(BGM_FANFA5); gTasks[taskID].tState++; SetMonData(mon, MON_DATA_SPECIES, (void*)(&gTasks[taskID].tPostEvoSpecies)); @@ -715,7 +715,7 @@ static void Task_EvolutionScene(u8 taskID) if (IsCryFinished()) { StringExpandPlaceholders(gStringVar4, BattleText_StopEvo); - sub_8002EB0(&gUnknown_03004210, gStringVar4, 144, 2, 15); + Text_InitWindow8002EB0(&gUnknown_03004210, gStringVar4, 144, 2, 15); gTasks[taskID].tEvoWasStopped = TRUE; gTasks[taskID].tState = 14; } @@ -726,7 +726,7 @@ static void Task_EvolutionScene(u8 taskID) sub_8024CEC(); PlayFanfare(BGM_FANFA1); StrCpyDecodeToDisplayedStringBattle(gBattleStringsTable[3]); - sub_8002EB0(&gUnknown_03004210, gDisplayedStringBattle, 144, 2, 15); + Text_InitWindow8002EB0(&gUnknown_03004210, gDisplayedStringBattle, 144, 2, 15); gTasks[taskID].tLearnsFirstMove = 0x40; // re-used as a counter gTasks[taskID].tState++; } @@ -743,7 +743,7 @@ static void Task_EvolutionScene(u8 taskID) { sub_8024CEC(); StrCpyDecodeToDisplayedStringBattle(gBattleStringsTable[4]); - sub_8002EB0(&gUnknown_03004210, gDisplayedStringBattle, 144, 2, 15); + Text_InitWindow8002EB0(&gUnknown_03004210, gDisplayedStringBattle, 144, 2, 15); gTasks[taskID].tLearnMoveState++; } break; @@ -751,7 +751,7 @@ static void Task_EvolutionScene(u8 taskID) if (gUnknown_03004210.state == 0 && !IsSEPlaying()) { StrCpyDecodeToDisplayedStringBattle(gBattleStringsTable[5]); - sub_8002EB0(&gUnknown_03004210, gDisplayedStringBattle, 144, 2, 15); + Text_InitWindow8002EB0(&gUnknown_03004210, gDisplayedStringBattle, 144, 2, 15); gTasks[taskID].tLearnMoveState++; } break; @@ -761,7 +761,7 @@ static void Task_EvolutionScene(u8 taskID) if (!IsSEPlaying()) { StrCpyDecodeToDisplayedStringBattle(gBattleStringsTable[6]); - sub_8002EB0(&gUnknown_03004210, gDisplayedStringBattle, 144, 2, 15); + Text_InitWindow8002EB0(&gUnknown_03004210, gDisplayedStringBattle, 144, 2, 15); gTasks[taskID].tData9 = 5; gTasks[taskID].tdata10 = 9; gTasks[taskID].tLearnMoveState++; @@ -794,7 +794,7 @@ static void Task_EvolutionScene(u8 taskID) { sub_8023AD8(); StrCpyDecodeToDisplayedStringBattle(gBattleStringsTable[292]); - sub_8002EB0(&gUnknown_03004210, gDisplayedStringBattle, 144, 2, 15); + Text_InitWindow8002EB0(&gUnknown_03004210, gDisplayedStringBattle, 144, 2, 15); PlaySE(SE_SELECT); if (sEvoCursorPos != 0) gTasks[taskID].tLearnMoveState = gTasks[taskID].tdata10; @@ -809,7 +809,7 @@ static void Task_EvolutionScene(u8 taskID) { sub_8023AD8(); StrCpyDecodeToDisplayedStringBattle(gBattleStringsTable[292]); - sub_8002EB0(&gUnknown_03004210, gDisplayedStringBattle, 144, 2, 15); + Text_InitWindow8002EB0(&gUnknown_03004210, gDisplayedStringBattle, 144, 2, 15); PlaySE(SE_SELECT); gTasks[taskID].tLearnMoveState = gTasks[taskID].tdata10; } @@ -835,7 +835,7 @@ static void Task_EvolutionScene(u8 taskID) if (IsHMMove2(move)) { StrCpyDecodeToDisplayedStringBattle(gBattleStringsTable[307]); - sub_8002EB0(&gUnknown_03004210, gDisplayedStringBattle, 144, 2, 15); + Text_InitWindow8002EB0(&gUnknown_03004210, gDisplayedStringBattle, 144, 2, 15); gTasks[taskID].tLearnMoveState = 11; } else @@ -848,7 +848,7 @@ static void Task_EvolutionScene(u8 taskID) RemoveMonPPBonus(mon, var); SetMonMoveSlot(mon, gMoveToLearn, var); StrCpyDecodeToDisplayedStringBattle(gBattleStringsTable[207]); - sub_8002EB0(&gUnknown_03004210, gDisplayedStringBattle, 144, 2, 15); + Text_InitWindow8002EB0(&gUnknown_03004210, gDisplayedStringBattle, 144, 2, 15); gTasks[taskID].tLearnMoveState++; } } @@ -858,7 +858,7 @@ static void Task_EvolutionScene(u8 taskID) if (gUnknown_03004210.state == 0 && !IsSEPlaying()) { StrCpyDecodeToDisplayedStringBattle(gBattleStringsTable[7]); - sub_8002EB0(&gUnknown_03004210, gDisplayedStringBattle, 144, 2, 15); + Text_InitWindow8002EB0(&gUnknown_03004210, gDisplayedStringBattle, 144, 2, 15); gTasks[taskID].tLearnMoveState++; } break; @@ -866,20 +866,20 @@ static void Task_EvolutionScene(u8 taskID) if (gUnknown_03004210.state == 0 && !IsSEPlaying()) { StrCpyDecodeToDisplayedStringBattle(gBattleStringsTable[208]); - sub_8002EB0(&gUnknown_03004210, gDisplayedStringBattle, 144, 2, 15); + Text_InitWindow8002EB0(&gUnknown_03004210, gDisplayedStringBattle, 144, 2, 15); gTasks[taskID].tState = 19; } break; case 9: StrCpyDecodeToDisplayedStringBattle(gBattleStringsTable[8]); - sub_8002EB0(&gUnknown_03004210, gDisplayedStringBattle, 144, 2, 15); + Text_InitWindow8002EB0(&gUnknown_03004210, gDisplayedStringBattle, 144, 2, 15); gTasks[taskID].tData9 = 10; gTasks[taskID].tdata10 = 0; gTasks[taskID].tLearnMoveState = 3; break; case 10: StrCpyDecodeToDisplayedStringBattle(gBattleStringsTable[9]); - sub_8002EB0(&gUnknown_03004210, gDisplayedStringBattle, 144, 2, 15); + Text_InitWindow8002EB0(&gUnknown_03004210, gDisplayedStringBattle, 144, 2, 15); gTasks[taskID].tState = 14; break; case 11: @@ -900,7 +900,7 @@ static void Task_TradeEvolutionScene(u8 taskID) { case 0: StringExpandPlaceholders(gStringVar4, BattleText_StartEvo); - sub_8002EB0(&gUnknown_03004828->window, gStringVar4, gUnknown_03004828->textWindowBaseTileNum, 2, 15); + Text_InitWindow8002EB0(&gUnknown_03004828->window, gStringVar4, gUnknown_03004828->textWindowBaseTileNum, 2, 15); gTasks[taskID].tState++; break; case 1: @@ -988,7 +988,7 @@ static void Task_TradeEvolutionScene(u8 taskID) if (IsCryFinished() && !gPaletteFade.active) { StringExpandPlaceholders(gStringVar4, BattleText_FinishEvo); - sub_8002EB0(&gUnknown_03004828->window, gStringVar4, gUnknown_03004828->textWindowBaseTileNum, 2, 15); + Text_InitWindow8002EB0(&gUnknown_03004828->window, gStringVar4, gUnknown_03004828->textWindowBaseTileNum, 2, 15); PlayFanfare(BGM_FANFA5); gTasks[taskID].tState++; SetMonData(mon, MON_DATA_SPECIES, (void*)(&gTasks[taskID].tPostEvoSpecies)); @@ -1022,7 +1022,7 @@ static void Task_TradeEvolutionScene(u8 taskID) else { PlayBGM(BGM_SHINKA); - sub_8002EB0(&gUnknown_03004828->window, gOtherText_LinkStandby2, gUnknown_03004828->textWindowBaseTileNum, 2, 15); + Text_InitWindow8002EB0(&gUnknown_03004828->window, gOtherText_LinkStandby2, gUnknown_03004828->textWindowBaseTileNum, 2, 15); gTasks[taskID].tState++; } } @@ -1040,7 +1040,7 @@ static void Task_TradeEvolutionScene(u8 taskID) sub_8024CEC(); PlayFanfare(BGM_FANFA1); StrCpyDecodeToDisplayedStringBattle(gBattleStringsTable[3]); - sub_8002EB0(&gUnknown_03004828->window, gDisplayedStringBattle, gUnknown_03004828->textWindowBaseTileNum, 2, 15); + Text_InitWindow8002EB0(&gUnknown_03004828->window, gDisplayedStringBattle, gUnknown_03004828->textWindowBaseTileNum, 2, 15); gTasks[taskID].tLearnsFirstMove = 0x40; // re-used as a counter gTasks[taskID].tState++; } @@ -1057,7 +1057,7 @@ static void Task_TradeEvolutionScene(u8 taskID) { sub_8024CEC(); StrCpyDecodeToDisplayedStringBattle(gBattleStringsTable[4]); - sub_8002EB0(&gUnknown_03004828->window, gDisplayedStringBattle, gUnknown_03004828->textWindowBaseTileNum, 2, 15); + Text_InitWindow8002EB0(&gUnknown_03004828->window, gDisplayedStringBattle, gUnknown_03004828->textWindowBaseTileNum, 2, 15); gTasks[taskID].tLearnMoveState++; } break; @@ -1065,7 +1065,7 @@ static void Task_TradeEvolutionScene(u8 taskID) if (gUnknown_03004828->window.state == 0 && !IsSEPlaying()) { StrCpyDecodeToDisplayedStringBattle(gBattleStringsTable[5]); - sub_8002EB0(&gUnknown_03004828->window, gDisplayedStringBattle, gUnknown_03004828->textWindowBaseTileNum, 2, 15); + Text_InitWindow8002EB0(&gUnknown_03004828->window, gDisplayedStringBattle, gUnknown_03004828->textWindowBaseTileNum, 2, 15); gTasks[taskID].tLearnMoveState++; } break; @@ -1075,7 +1075,7 @@ static void Task_TradeEvolutionScene(u8 taskID) if (!IsSEPlaying()) { StrCpyDecodeToDisplayedStringBattle(gBattleStringsTable[6]); - sub_8002EB0(&gUnknown_03004828->window, gDisplayedStringBattle, gUnknown_03004828->textWindowBaseTileNum, 2, 15); + Text_InitWindow8002EB0(&gUnknown_03004828->window, gDisplayedStringBattle, gUnknown_03004828->textWindowBaseTileNum, 2, 15); gTasks[taskID].tData9 = 5; gTasks[taskID].tdata10 = 9; gTasks[taskID].tLearnMoveState++; @@ -1083,11 +1083,11 @@ static void Task_TradeEvolutionScene(u8 taskID) case 3: if (gUnknown_03004828->window.state == 0 && !IsSEPlaying()) { - DrawTextWindow(&gUnknown_03004828->window, 24, 8, 29, 13); + TextWindow_DrawStdFrame(&gUnknown_03004828->window, 24, 8, 29, 13); sEvoCursorPos = 0; - InitWindow(&gUnknown_03004828->window, gOtherText_YesNoAndPlayer, gUnknown_03004828->textWindowBaseTileNum + 128, 25, 9); - sub_8002F44(&gUnknown_03004828->window); - sub_814A5C0(0, 0xFFFF, 0xC, 0x2D9F, 0x20); + Text_InitWindow(&gUnknown_03004828->window, gOtherText_YesNoAndPlayer, gUnknown_03004828->textWindowBaseTileNum + 128, 25, 9); + Text_PrintWindow8002F44(&gUnknown_03004828->window); + MenuCursor_Create814A5C0(0, 0xFFFF, 0xC, 0x2D9F, 0x20); sub_81150D8(); gTasks[taskID].tLearnMoveState++; sEvoCursorPos = 0; @@ -1110,10 +1110,10 @@ static void Task_TradeEvolutionScene(u8 taskID) } if (gMain.newKeys & A_BUTTON) { - ZeroFillWindowRect(&gUnknown_03004828->window, 0x18, 8, 0x1D, 0xD); + Text_EraseWindowRect(&gUnknown_03004828->window, 0x18, 8, 0x1D, 0xD); DestroyMenuCursor(); StrCpyDecodeToDisplayedStringBattle(gBattleStringsTable[292]); - sub_8002EB0(&gUnknown_03004828->window, gDisplayedStringBattle, gUnknown_03004828->textWindowBaseTileNum, 2, 15); + Text_InitWindow8002EB0(&gUnknown_03004828->window, gDisplayedStringBattle, gUnknown_03004828->textWindowBaseTileNum, 2, 15); PlaySE(SE_SELECT); if (sEvoCursorPos != 0) gTasks[taskID].tLearnMoveState = gTasks[taskID].tdata10; @@ -1126,10 +1126,10 @@ static void Task_TradeEvolutionScene(u8 taskID) } if (gMain.newKeys & B_BUTTON) { - ZeroFillWindowRect(&gUnknown_03004828->window, 0x18, 8, 0x1D, 0xD); + Text_EraseWindowRect(&gUnknown_03004828->window, 0x18, 8, 0x1D, 0xD); DestroyMenuCursor(); StrCpyDecodeToDisplayedStringBattle(gBattleStringsTable[292]); - sub_8002EB0(&gUnknown_03004828->window, gDisplayedStringBattle, gUnknown_03004828->textWindowBaseTileNum, 2, 15); + Text_InitWindow8002EB0(&gUnknown_03004828->window, gDisplayedStringBattle, gUnknown_03004828->textWindowBaseTileNum, 2, 15); PlaySE(SE_SELECT); gTasks[taskID].tLearnMoveState = gTasks[taskID].tdata10; } @@ -1155,7 +1155,7 @@ static void Task_TradeEvolutionScene(u8 taskID) if (IsHMMove2(move)) { StrCpyDecodeToDisplayedStringBattle(gBattleStringsTable[307]); - sub_8002EB0(&gUnknown_03004828->window, gDisplayedStringBattle, gUnknown_03004828->textWindowBaseTileNum, 2, 15); + Text_InitWindow8002EB0(&gUnknown_03004828->window, gDisplayedStringBattle, gUnknown_03004828->textWindowBaseTileNum, 2, 15); gTasks[taskID].tLearnMoveState = 11; } else @@ -1168,7 +1168,7 @@ static void Task_TradeEvolutionScene(u8 taskID) RemoveMonPPBonus(mon, var); SetMonMoveSlot(mon, gMoveToLearn, var); StrCpyDecodeToDisplayedStringBattle(gBattleStringsTable[207]); - sub_8002EB0(&gUnknown_03004828->window, gDisplayedStringBattle, gUnknown_03004828->textWindowBaseTileNum, 2, 15); + Text_InitWindow8002EB0(&gUnknown_03004828->window, gDisplayedStringBattle, gUnknown_03004828->textWindowBaseTileNum, 2, 15); gTasks[taskID].tLearnMoveState++; } } @@ -1178,7 +1178,7 @@ static void Task_TradeEvolutionScene(u8 taskID) if (gUnknown_03004828->window.state == 0 && !IsSEPlaying()) { StrCpyDecodeToDisplayedStringBattle(gBattleStringsTable[7]); - sub_8002EB0(&gUnknown_03004828->window, gDisplayedStringBattle, gUnknown_03004828->textWindowBaseTileNum, 2, 15); + Text_InitWindow8002EB0(&gUnknown_03004828->window, gDisplayedStringBattle, gUnknown_03004828->textWindowBaseTileNum, 2, 15); gTasks[taskID].tLearnMoveState++; } break; @@ -1186,20 +1186,20 @@ static void Task_TradeEvolutionScene(u8 taskID) if (gUnknown_03004828->window.state == 0 && !IsSEPlaying()) { StrCpyDecodeToDisplayedStringBattle(gBattleStringsTable[208]); - sub_8002EB0(&gUnknown_03004828->window, gDisplayedStringBattle, gUnknown_03004828->textWindowBaseTileNum, 2, 15); + Text_InitWindow8002EB0(&gUnknown_03004828->window, gDisplayedStringBattle, gUnknown_03004828->textWindowBaseTileNum, 2, 15); gTasks[taskID].tState = 15; } break; case 9: StrCpyDecodeToDisplayedStringBattle(gBattleStringsTable[8]); - sub_8002EB0(&gUnknown_03004828->window, gDisplayedStringBattle, gUnknown_03004828->textWindowBaseTileNum, 2, 15); + Text_InitWindow8002EB0(&gUnknown_03004828->window, gDisplayedStringBattle, gUnknown_03004828->textWindowBaseTileNum, 2, 15); gTasks[taskID].tData9 = 10; gTasks[taskID].tdata10 = 0; gTasks[taskID].tLearnMoveState = 3; break; case 10: StrCpyDecodeToDisplayedStringBattle(gBattleStringsTable[9]); - sub_8002EB0(&gUnknown_03004828->window, gDisplayedStringBattle, gUnknown_03004828->textWindowBaseTileNum, 2, 15); + Text_InitWindow8002EB0(&gUnknown_03004828->window, gDisplayedStringBattle, gUnknown_03004828->textWindowBaseTileNum, 2, 15); gTasks[taskID].tState = 13; break; case 11: @@ -3955,7 +3955,7 @@ static void VBlankCB_TradeEvolutionScene(void) static void sub_81150D8(void) { - sub_814A880(200, 72 + (sEvoCursorPos * 16)); + MenuCursor_SetPos814A880(200, 72 + (sEvoCursorPos * 16)); } static void EvoDummyFunc2(void) diff --git a/src/scene/hall_of_fame.c b/src/scene/hall_of_fame.c index 1751ee99c..948c288ff 100644 --- a/src/scene/hall_of_fame.c +++ b/src/scene/hall_of_fame.c @@ -558,8 +558,8 @@ static void sub_814217C(u8 taskID) lastSavedTeam--; } *lastSavedTeam = *fameMons; - MenuDrawTextWindow(2, 14, 27, 19); - MenuPrint(gMenuText_HOFSaving, 3, 15); + Menu_DrawStdWindowFrame(2, 14, 27, 19); + Menu_PrintText(gMenuText_HOFSaving, 3, 15); gTasks[taskID].func = sub_8142274; } @@ -582,8 +582,8 @@ static void sub_81422B8(u8 taskID) static void sub_81422E8(u8 taskID) { - SetUpWindowConfig(&gWindowConfig_81E7198); - InitMenuWindow(&gWindowConfig_81E7198); + Text_LoadWindowTemplate(&gWindowTemplate_81E7198); + InitMenuWindow(&gWindowTemplate_81E7198); gTasks[taskID].func = sub_8142320; } @@ -617,7 +617,7 @@ static void sub_8142320(u8 taskID) gSprites[spriteID].data[0] = 0; gSprites[spriteID].callback = sub_81435DC; gTasks[taskID].tMonSpriteID(currPokeID) = spriteID; - MenuZeroFillWindowRect(0, 14, 29, 19); + Menu_EraseWindowRect(0, 14, 29, 19); gTasks[taskID].func = sub_8142404; } @@ -670,7 +670,7 @@ static void sub_8142570(u8 taskID) if (gTasks[taskID].tMonSpriteID(i) != 0xFF) gSprites[gTasks[taskID].tMonSpriteID(i)].oam.priority = 0; } - MenuZeroFillWindowRect(0, 14, 29, 19); + Menu_EraseWindowRect(0, 14, 29, 19); sub_8143068(0, 15); PlaySE(SE_DENDOU); gTasks[taskID].tFrameCount = 400; @@ -694,7 +694,7 @@ static void sub_8142618(u8 taskID) gSprites[gTasks[taskID].tMonSpriteID(i)].oam.priority = 1; } BeginNormalPaletteFade(sUnknown_0203931C, 0, 12, 12, 0x735F); - MenuZeroFillWindowRect(0, 14, 29, 19); + Menu_EraseWindowRect(0, 14, 29, 19); gTasks[taskID].tFrameCount = 7; gTasks[taskID].func = sub_81426F8; } @@ -714,8 +714,8 @@ static void sub_81426F8(u8 taskID) static void sub_8142738(u8 taskID) { REG_DISPCNT = 0x1940; - SetUpWindowConfig(&gWindowConfig_81E71B4); - InitMenuWindow(&gWindowConfig_81E71B4); + Text_LoadWindowTemplate(&gWindowTemplate_81E71B4); + InitMenuWindow(&gWindowTemplate_81E71B4); gTasks[taskID].tPlayerSpriteID = HallOfFame_LoadTrainerPic(gSaveBlock2.playerGender, 120, 72, 6); gTasks[taskID].tFrameCount = 120; @@ -732,10 +732,10 @@ static void sub_8142794(u8 taskID) gSprites[gTasks[taskID].tPlayerSpriteID].pos1.x++; else { - MenuDrawTextWindow(1, 2, 15, 9); + Menu_DrawStdWindowFrame(1, 2, 15, 9); HallOfFame_PrintPlayerInfo(1, 2); - MenuDrawTextWindow(2, 14, 27, 19); - MenuPrint(gMenuText_HOFCongratulations, 4, 15); + Menu_DrawStdWindowFrame(2, 14, 27, 19); + Menu_PrintText(gMenuText_HOFCongratulations, 4, 15); gTasks[taskID].func = sub_8142818; } } @@ -864,8 +864,8 @@ static void sub_8142A28(u8 taskID) *(vram1 + i) = i + 3; *(vram2 + i) = i + 20; } - SetUpWindowConfig(&gWindowConfig_81E7198); - InitMenuWindow(&gWindowConfig_81E7198); + Text_LoadWindowTemplate(&gWindowTemplate_81E7198); + InitMenuWindow(&gWindowTemplate_81E7198); gTasks[taskID].func = sub_8142B04; } } @@ -930,7 +930,7 @@ static void sub_8142B04(u8 taskID) stringPtr[1] = 0x13; stringPtr[2] = 0xF0; stringPtr[3] = EOS; - MenuPrint(gStringVar1, 0, 0); + Menu_PrintText(gStringVar1, 0, 0); gTasks[taskID].func = sub_8142CC8; } @@ -1042,14 +1042,14 @@ static void sub_8142FCC(u8 taskID) static void sub_8142FEC(u8 taskID) { - MenuDrawTextWindow(2, 14, 27, 19); + Menu_DrawStdWindowFrame(2, 14, 27, 19); MenuPrintMessage(gMenuText_HOFCorrupt, 3, 15); gTasks[taskID].func = sub_814302C; } static void sub_814302C(u8 taskID) { - if (MenuUpdateWindowText() && gMain.newKeys & A_BUTTON) + if (Menu_UpdateWindowText() && gMain.newKeys & A_BUTTON) gTasks[taskID].func = sub_8142F78; } @@ -1086,7 +1086,7 @@ static void HallOfFame_PrintMonInfo(struct HallofFameMon* currMon, u8 a1, u8 a2) } } - MenuPrint(gStringVar1, a1 + 4, a2 + 1); + Menu_PrintText(gStringVar1, a1 + 4, a2 + 1); stringPtr = gStringVar1; for (i = 0; i < 10 && currMon->nick[i] != EOS; stringPtr[i] = currMon->nick[i], i++) {} @@ -1099,8 +1099,8 @@ static void HallOfFame_PrintMonInfo(struct HallofFameMon* currMon, u8 a1, u8 a2) stringPtr[1] = 0x13; stringPtr[2] = 0xA0; stringPtr[3] = EOS; - MenuPrint(gStringVar1, a1 + 9, a2 + 1); - MenuZeroFillWindowRect(0, a2 + 3, 29, a2 + 4); + Menu_PrintText(gStringVar1, a1 + 9, a2 + 1); + Menu_EraseWindowRect(0, a2 + 3, 29, a2 + 4); } else { @@ -1139,7 +1139,7 @@ static void HallOfFame_PrintMonInfo(struct HallofFameMon* currMon, u8 a1, u8 a2) stringPtr[2] = 0xA0; stringPtr[3] = EOS; - MenuPrint(gStringVar1, a1 + 9, a2 + 1); + Menu_PrintText(gStringVar1, a1 + 9, a2 + 1); monData = currMon->lvl; @@ -1157,14 +1157,14 @@ static void HallOfFame_PrintMonInfo(struct HallofFameMon* currMon, u8 a1, u8 a2) stringPtr[2] = 0x30; stringPtr[3] = EOS; - MenuPrint(gStringVar1, a1 + 7, a2 + 3); + Menu_PrintText(gStringVar1, a1 + 7, a2 + 3); monData = currMon->tid; stringPtr = StringCopy(gStringVar1, gOtherText_IDNumber); ConvertIntToDecimalStringN(stringPtr, monData, 2, 5); - MenuPrint(gStringVar1, a1 + 13, a2 + 3); + Menu_PrintText(gStringVar1, a1 + 13, a2 + 3); } } @@ -1175,15 +1175,15 @@ static void HallOfFame_PrintPlayerInfo(u8 a0, u8 a1) u8* stringPtr; u16 visibleTid; - MenuPrint(gOtherText_Name, a0 + 1, a1 + 1); + Menu_PrintText(gOtherText_Name, a0 + 1, a1 + 1); MenuPrint_RightAligned(gSaveBlock2.playerName, a0 + 14, a1 + 1); - MenuPrint(gOtherText_IDNumber2, a0 + 1, a1 + 3); + Menu_PrintText(gOtherText_IDNumber2, a0 + 1, a1 + 3); visibleTid = ByteRead16(gSaveBlock2.playerTrainerId); ConvertIntToDecimalStringN(gStringVar1, visibleTid, 2, 5); MenuPrint_RightAligned(gStringVar1, a0 + 14, a1 + 3); - MenuPrint(gMainMenuString_Time, a0 + 1, a1 + 5); + Menu_PrintText(gMainMenuString_Time, a0 + 1, a1 + 5); stringPtr = ConvertIntToDecimalString(gStringVar1, gSaveBlock2.playTimeHours); stringPtr[0] = CHAR_SPACE; @@ -1285,8 +1285,8 @@ static void sub_8143570(void) gReservedSpritePaletteCount = 8; LoadCompressedObjectPic(&sHallOfFame_ConfettiSpriteSheet); LoadCompressedObjectPalette(&sHallOfFame_ConfettiSpritePalette); - SetUpWindowConfig(&gWindowConfig_81E71B4); - InitMenuWindow(&gWindowConfig_81E71B4); + Text_LoadWindowTemplate(&gWindowTemplate_81E71B4); + InitMenuWindow(&gWindowTemplate_81E71B4); } static void sub_81435B8(void) diff --git a/src/script_pokemon_util_80C4BF0.c b/src/script_pokemon_util_80C4BF0.c index f397e5ebb..b13006c13 100644 --- a/src/script_pokemon_util_80C4BF0.c +++ b/src/script_pokemon_util_80C4BF0.c @@ -292,7 +292,7 @@ void ShowContestEntryMonPic(void) u8 left = CONTEST_ENTRY_PIC_LEFT; u8 top = CONTEST_ENTRY_PIC_TOP; - MenuDrawTextWindow(left, top, 19, 13); + Menu_DrawStdWindowFrame(left, top, 19, 13); species = gContestMons[gSpecialVar_0x8006].species; var1 = gContestMons[gSpecialVar_0x8006].personality; var2 = gContestMons[gSpecialVar_0x8006].otId; @@ -349,7 +349,7 @@ void sub_80C5190(u8 taskId) task->data[0]++; break; case 3: - MenuZeroFillWindowRect(task->data[3], task->data[4], task->data[3] + 9, task->data[4] + 10); + Menu_EraseWindowRect(task->data[3], task->data[4], task->data[3] + 9, task->data[4] + 10); DestroyTask(taskId); break; case 1: diff --git a/src/unused_81258BC.c b/src/unused_81258BC.c index c509ea4c9..c25884053 100644 --- a/src/unused_81258BC.c +++ b/src/unused_81258BC.c @@ -31,6 +31,6 @@ bool8 unref_sub_812AECC(u8 *script) void sub_812AF10(void) { - MenuDrawTextWindow(2, 14, 27, 19); - MenuPrint(gStringVar4, 3, 15); + Menu_DrawStdWindowFrame(2, 14, 27, 19); + Menu_PrintText(gStringVar4, 3, 15); }
\ No newline at end of file |