From d979ac3bf3924051de8bb4154e8398083535eabb Mon Sep 17 00:00:00 2001 From: Phlosioneer Date: Mon, 11 Feb 2019 00:05:20 -0500 Subject: [PATCH 01/20] Document main_menu state machine, name window constants The new names for the constants (and newly named functions) give a much better understanding of what the window system is trying to do. --- asm/rom_8011DC0.s | 12 +- common_syms/window.txt | 2 +- include/menu.h | 4 +- include/window.h | 10 +- src/battle_controller_link_partner.c | 10 +- src/battle_controller_recorded_opponent.c | 6 +- src/battle_controller_safari.c | 8 +- src/battle_controller_wally.c | 8 +- src/battle_dome.c | 2 +- src/battle_factory_screen.c | 48 +++--- src/battle_pyramid_bag.c | 18 +-- src/battle_records.c | 6 +- src/battle_tower.c | 6 +- src/berry_blender.c | 4 +- src/berry_fix_program.c | 4 +- src/berry_tag_screen.c | 14 +- src/cable_club.c | 4 +- src/clear_save_data_screen.c | 4 +- src/coins.c | 4 +- src/contest.c | 14 +- src/contest_link_80F57C4.c | 2 +- src/contest_painting.c | 2 +- src/credits.c | 2 +- src/daycare.c | 4 +- src/decoration.c | 30 ++-- src/diploma.c | 2 +- src/egg_hatch.c | 4 +- src/field_message_box.c | 2 +- src/field_player_avatar.c | 10 +- src/field_region_map.c | 4 +- src/field_specials.c | 4 +- src/frontier_pass.c | 8 +- src/frontier_util.c | 20 +-- src/hall_of_fame.c | 10 +- src/item_menu.c | 28 ++-- src/item_use.c | 4 +- src/learn_move.c | 6 +- src/list_menu.c | 4 +- src/mail.c | 4 +- src/main_menu.c | 189 ++++++++++++++++++---- src/map_name_popup.c | 4 +- src/menu.c | 51 +++--- src/money.c | 2 +- src/mystery_event_menu.c | 2 +- src/naming_screen.c | 8 +- src/option_menu.c | 4 +- src/party_menu.c | 6 +- src/player_pc.c | 10 +- src/pokeblock.c | 4 +- src/pokeblock_feed.c | 2 +- src/pokedex.c | 8 +- src/pokemon_storage_system.c | 26 +-- src/pokemon_summary_screen.c | 16 +- src/record_mixing.c | 2 +- src/region_map.c | 4 +- src/rom_8011DC0.c | 12 +- src/roulette.c | 8 +- src/save_failed_screen.c | 16 +- src/scrcmd.c | 4 +- src/script_menu.c | 12 +- src/secret_base.c | 14 +- src/shop.c | 4 +- src/slot_machine.c | 14 +- src/start_menu.c | 12 +- src/starter_choose.c | 6 +- src/trade.c | 18 +-- src/trainer_card.c | 8 +- src/trainer_hill.c | 2 +- src/window.c | 8 +- 69 files changed, 480 insertions(+), 334 deletions(-) diff --git a/asm/rom_8011DC0.s b/asm/rom_8011DC0.s index af7fdbf3df..ac7f6ac1c0 100644 --- a/asm/rom_8011DC0.s +++ b/asm/rom_8011DC0.s @@ -745,7 +745,7 @@ _08017228: bl DestroyListMenuTask ldrb r0, [r5] movs r1, 0x1 - bl sub_819746C + bl ClearWindowAndBorder ldrb r0, [r5] bl RemoveWindow movs r0, 0 @@ -765,7 +765,7 @@ _08017264: bl DestroyListMenuTask ldrb r0, [r5] movs r1, 0x1 - bl sub_819746C + bl ClearWindowAndBorder ldrb r0, [r5] bl RemoveWindow strb r4, [r7] @@ -23941,7 +23941,7 @@ _08022DE8: beq _08022DFA movs r0, 0 movs r1, 0x1 - bl sub_8197434 + bl ClearWindowAndWideBorder _08022DFA: ldrb r0, [r7, 0xE] movs r1, 0x1 @@ -24245,7 +24245,7 @@ _0802301E: _08023044: movs r0, 0 movs r1, 0x1 - bl sub_8197434 + bl ClearWindowAndWideBorder movs r0, 0xA movs r1, 0x1 movs r2, 0 @@ -26578,7 +26578,7 @@ _080242A4: _080242A6: movs r0, 0 movs r1, 0x1 - bl sub_8197434 + bl ClearWindowAndWideBorder movs r4, 0 str r4, [sp] adds r0, r6, 0 @@ -26756,7 +26756,7 @@ _080243EA: _080243F6: movs r0, 0 movs r1, 0x1 - bl sub_8197434 + bl ClearWindowAndWideBorder adds r0, r5, 0 bl sub_8021488 movs r0, 0x1 diff --git a/common_syms/window.txt b/common_syms/window.txt index e1b52a24fa..87a1679d16 100644 --- a/common_syms/window.txt +++ b/common_syms/window.txt @@ -1,5 +1,5 @@ filler_03002F58 filler_03002F5C -gUnknown_03002F60 +gTransparentTileNumber filler_03002F64 gUnknown_03002F70 diff --git a/include/menu.h b/include/menu.h index aca4624687..cb017187a1 100644 --- a/include/menu.h +++ b/include/menu.h @@ -26,11 +26,11 @@ void sub_8197200(void); u16 RunTextPrintersAndIsPrinter0Active(void); void sub_81973A4(void); void NewMenuHelpers_DrawDialogueFrame(u8, u8); -void sub_819746C(u8 windowId, bool8 copyToVram); +void ClearWindowAndBorder(u8 windowId, bool8 copyToVram); u16 AddTextPrinterParameterized2(u8 windowId, u8 fontId, const u8 *str, u8 speed, void (*callback)(struct TextPrinterTemplate *, u16), u8 fgColor, u8 bgColor, u8 shadowColor); void PrintPlayerNameOnWindow(u8, const u8*, u16, u16); void DisplayItemMessageOnField(u8 taskId, const u8 *src, TaskFunc callback); -void sub_8197434(u8 windowId, bool8 copyToVram); +void ClearWindowAndWideBorder(u8 windowId, bool8 copyToVram); void SetStandardWindowBorderStyle(u8 a0, u8 a1); void DisplayYesNoMenu(void); u32 GetPlayerTextSpeed(void); diff --git a/include/window.h b/include/window.h index 25573ac3e9..4138ce948d 100644 --- a/include/window.h +++ b/include/window.h @@ -1,6 +1,13 @@ #ifndef GUARD_WINDOW_H #define GUARD_WINDOW_H +// The tile ID for a transparent tile in the window tilesheet +#define TRANSPARENT_TILE_NUMBER 0 + +#define PIXEL_BUFFER_TRANSPARENT 0x00 +#define PIXEL_BUFFER_WHITE 0x11 +#define PIXEL_BUFFER_UNKNOWN 0xFF + enum { WINDOW_BG, @@ -73,6 +80,7 @@ extern u32 filler_03002F58; extern u32 filler_03002F5C; extern u32 filler_03002F64; -extern u8 gUnknown_03002F60; +// This global is set to TRANSPARENT_TILE_NUMBER and never changed. +extern u8 gTransparentTileNumber; #endif // GUARD_WINDOW_H diff --git a/src/battle_controller_link_partner.c b/src/battle_controller_link_partner.c index 19d39609fb..4eb122d054 100644 --- a/src/battle_controller_link_partner.c +++ b/src/battle_controller_link_partner.c @@ -90,7 +90,7 @@ static void LinkPartnerHandleBattleAnimation(void); static void LinkPartnerHandleLinkStandbyMsg(void); static void LinkPartnerHandleResetActionMoveSelection(void); static void LinkPartnerHandleCmd55(void); -static void nullsub_113(void); +static void SpriteCB_Null3(void); static void LinkPartnerBufferRunCommand(void); static void LinkPartnerBufferExecCompleted(void); @@ -161,10 +161,10 @@ static void (*const sLinkPartnerBufferCommands[CONTROLLER_CMDS_COUNT])(void) = LinkPartnerHandleLinkStandbyMsg, LinkPartnerHandleResetActionMoveSelection, LinkPartnerHandleCmd55, - nullsub_113 + SpriteCB_Null3 }; -static void nullsub_112(void) +static void SpriteCB_Null2(void) { } @@ -1564,7 +1564,7 @@ static void LinkPartnerHandleIntroTrainerBallThrow(void) gTasks[gBattlerStatusSummaryTaskId[gActiveBattler]].func = Task_HidePartyStatusSummary; gBattleSpritesDataPtr->animationData->field_9_x1 = 1; - gBattlerControllerFuncs[gActiveBattler] = nullsub_112; + gBattlerControllerFuncs[gActiveBattler] = SpriteCB_Null2; } static void sub_814DCCC(u8 taskId) @@ -1687,6 +1687,6 @@ static void LinkPartnerHandleCmd55(void) gBattlerControllerFuncs[gActiveBattler] = sub_80587B0; } -static void nullsub_113(void) +static void SpriteCB_Null3(void) { } diff --git a/src/battle_controller_recorded_opponent.c b/src/battle_controller_recorded_opponent.c index 911eb6ce58..25e59172d4 100644 --- a/src/battle_controller_recorded_opponent.c +++ b/src/battle_controller_recorded_opponent.c @@ -93,7 +93,7 @@ static void RecordedOpponentHandleBattleAnimation(void); static void RecordedOpponentHandleLinkStandbyMsg(void); static void RecordedOpponentHandleResetActionMoveSelection(void); static void RecordedOpponentHandleCmd55(void); -static void nullsub_119(void); +static void SpriteCB_Null9(void); static void RecordedOpponentBufferRunCommand(void); static void RecordedOpponentBufferExecCompleted(void); @@ -165,7 +165,7 @@ static void (*const sRecordedOpponentBufferCommands[CONTROLLER_CMDS_COUNT])(void RecordedOpponentHandleLinkStandbyMsg, RecordedOpponentHandleResetActionMoveSelection, RecordedOpponentHandleCmd55, - nullsub_119 + SpriteCB_Null9 }; static void nullsub_70(void) @@ -1791,6 +1791,6 @@ static void RecordedOpponentHandleCmd55(void) gBattlerControllerFuncs[gActiveBattler] = sub_80587B0; } -static void nullsub_119(void) +static void SpriteCB_Null9(void) { } diff --git a/src/battle_controller_safari.c b/src/battle_controller_safari.c index 54ba04ab4a..b7223844f1 100644 --- a/src/battle_controller_safari.c +++ b/src/battle_controller_safari.c @@ -84,7 +84,7 @@ static void SafariHandleBattleAnimation(void); static void SafariHandleLinkStandbyMsg(void); static void SafariHandleResetActionMoveSelection(void); static void SafariHandleCmd55(void); -static void nullsub_115(void); +static void SpriteCB_Null5(void); static void SafariBufferRunCommand(void); static void SafariBufferExecCompleted(void); @@ -148,10 +148,10 @@ static void (*const sSafariBufferCommands[CONTROLLER_CMDS_COUNT])(void) = SafariHandleLinkStandbyMsg, SafariHandleResetActionMoveSelection, SafariHandleCmd55, - nullsub_115 + SpriteCB_Null5 }; -static void nullsub_114(void) +static void SpriteCB_Null4(void) { } @@ -688,6 +688,6 @@ static void SafariHandleCmd55(void) gBattlerControllerFuncs[gActiveBattler] = sub_81595E4; } -static void nullsub_115(void) +static void SpriteCB_Null5(void) { } diff --git a/src/battle_controller_wally.c b/src/battle_controller_wally.c index d891b96b67..a196f8a44b 100644 --- a/src/battle_controller_wally.c +++ b/src/battle_controller_wally.c @@ -92,7 +92,7 @@ static void WallyHandleBattleAnimation(void); static void WallyHandleLinkStandbyMsg(void); static void WallyHandleResetActionMoveSelection(void); static void WallyHandleCmd55(void); -static void nullsub_118(void); +static void SpriteCB_Null8(void); static void WallyBufferRunCommand(void); static void WallyBufferExecCompleted(void); @@ -161,10 +161,10 @@ static void (*const sWallyBufferCommands[CONTROLLER_CMDS_COUNT])(void) = WallyHandleLinkStandbyMsg, WallyHandleResetActionMoveSelection, WallyHandleCmd55, - nullsub_118 + SpriteCB_Null8 }; -static void nullsub_117(void) +static void SpriteCB_Null7(void) { } @@ -1559,6 +1559,6 @@ static void WallyHandleCmd55(void) gBattlerControllerFuncs[gActiveBattler] = sub_80587B0; } -static void nullsub_118(void) +static void SpriteCB_Null8(void) { } diff --git a/src/battle_dome.c b/src/battle_dome.c index bfede1b28b..2ec9f8f3d4 100644 --- a/src/battle_dome.c +++ b/src/battle_dome.c @@ -3794,7 +3794,7 @@ static void sub_8190CD4(u8 taskId) for (i = windowId; i < windowId + 9; i++) { CopyWindowToVram(i, 2); - FillWindowPixelBuffer(i, 0); + FillWindowPixelBuffer(i, PIXEL_BUFFER_TRANSPARENT); } gTasks[taskId].data[0] = 3; break; diff --git a/src/battle_factory_screen.c b/src/battle_factory_screen.c index bb9fe8e280..6d7ec3c45f 100644 --- a/src/battle_factory_screen.c +++ b/src/battle_factory_screen.c @@ -1786,14 +1786,14 @@ static void sub_819B958(u8 windowId) { gSprites[sFactorySelectScreen->menuCursor1SpriteId].invisible = TRUE; gSprites[sFactorySelectScreen->menuCursor2SpriteId].invisible = TRUE; - FillWindowPixelBuffer(windowId, 0); + FillWindowPixelBuffer(windowId, PIXEL_BUFFER_TRANSPARENT); CopyWindowToVram(windowId, 2); ClearWindowTilemap(windowId); } static void Select_PrintRentalPkmnString(void) { - FillWindowPixelBuffer(0, 0); + FillWindowPixelBuffer(0, PIXEL_BUFFER_TRANSPARENT); AddTextPrinterParameterized(0, 1, gText_RentalPkmn2, 2, 1, 0, NULL); CopyWindowToVram(0, 3); } @@ -1804,7 +1804,7 @@ static void Select_PrintMonSpecies(void) u8 x; u8 monId = sFactorySelectScreen->cursorPos; - FillWindowPixelBuffer(1, 0); + FillWindowPixelBuffer(1, PIXEL_BUFFER_TRANSPARENT); species = GetMonData(&sFactorySelectScreen->mons[monId].monData, MON_DATA_SPECIES, NULL); StringCopy(gStringVar4, gSpeciesNames[species]); x = GetStringRightAlignXOffset(1, gStringVar4, 86); @@ -1816,7 +1816,7 @@ static void Select_PrintSelectMonString(void) { const u8 *str = NULL; - FillWindowPixelBuffer(2, 0); + FillWindowPixelBuffer(2, PIXEL_BUFFER_TRANSPARENT); if (sFactorySelectScreen->selectingMonsState == 1) str = gText_SelectFirstPkmn; else if (sFactorySelectScreen->selectingMonsState == 2) @@ -1832,7 +1832,7 @@ static void Select_PrintSelectMonString(void) static void Select_PrintCantSelectSameMon(void) { - FillWindowPixelBuffer(2, 0); + FillWindowPixelBuffer(2, PIXEL_BUFFER_TRANSPARENT); AddTextPrinterParameterized(2, 1, gText_CantSelectSamePkmn, 2, 5, 0, NULL); CopyWindowToVram(2, 2); } @@ -1842,7 +1842,7 @@ static void Select_PrintMenuOptions(void) u8 selectedId = sFactorySelectScreen->mons[sFactorySelectScreen->cursorPos].selectedId; PutWindowTilemap(3); - FillWindowPixelBuffer(3, 0); + FillWindowPixelBuffer(3, PIXEL_BUFFER_TRANSPARENT); AddTextPrinterParameterized3(3, 1, 7, 1, gUnknown_08610476, 0, gText_Summary); if (selectedId != 0) AddTextPrinterParameterized3(3, 1, 7, 17, gUnknown_08610476, 0, gText_Deselect); @@ -1856,7 +1856,7 @@ static void Select_PrintMenuOptions(void) static void Select_PrintYesNoOptions(void) { PutWindowTilemap(4); - FillWindowPixelBuffer(4, 0); + FillWindowPixelBuffer(4, PIXEL_BUFFER_TRANSPARENT); AddTextPrinterParameterized3(4, 1, 7, 1, gUnknown_08610476, 0, gText_Yes2); AddTextPrinterParameterized3(4, 1, 7, 17, gUnknown_08610476, 0, gText_No2); CopyWindowToVram(4, 3); @@ -1924,7 +1924,7 @@ static void Select_PrintMonCategory(void) if (monId < SELECTABLE_MONS_COUNT) { PutWindowTilemap(5); - FillWindowPixelBuffer(5, 0); + FillWindowPixelBuffer(5, PIXEL_BUFFER_TRANSPARENT); species = GetMonData(&sFactorySelectScreen->mons[monId].monData, MON_DATA_SPECIES, NULL); CopyMonCategoryText(SpeciesToNationalPokedexNum(species), text); x = GetStringRightAlignXOffset(1, text, 0x76); @@ -2873,7 +2873,7 @@ static void sub_819D588(u8 taskId) case 3: if (!gPaletteFade.active) { - FillWindowPixelBuffer(5, 0); + FillWindowPixelBuffer(5, PIXEL_BUFFER_TRANSPARENT); CopyWindowToVram(5, 2); if (sFactorySwapScreen->inEnemyScreen == TRUE) { @@ -3002,7 +3002,7 @@ static void sub_819D770(u8 taskId) gTasks[taskId].data[0]++; break; case 6: - FillWindowPixelBuffer(5, 0); + FillWindowPixelBuffer(5, PIXEL_BUFFER_TRANSPARENT); CopyWindowToVram(5, 2); gTasks[taskId].data[0]++; break; @@ -3546,7 +3546,7 @@ static void sub_819EA64(u8 windowId) { gSprites[sFactorySwapScreen->menuCursor1SpriteId].invisible = TRUE; gSprites[sFactorySwapScreen->menuCursor2SpriteId].invisible = TRUE; - FillWindowPixelBuffer(windowId, 0); + FillWindowPixelBuffer(windowId, PIXEL_BUFFER_TRANSPARENT); CopyWindowToVram(windowId, 2); ClearWindowTilemap(windowId); } @@ -3554,14 +3554,14 @@ static void sub_819EA64(u8 windowId) static void sub_819EAC0(void) { PutWindowTilemap(1); - FillWindowPixelBuffer(1, 0); + FillWindowPixelBuffer(1, PIXEL_BUFFER_TRANSPARENT); CopyWindowToVram(1, 2); } static void sub_819EADC(void) { PutWindowTilemap(7); - FillWindowPixelBuffer(7, 0); + FillWindowPixelBuffer(7, PIXEL_BUFFER_TRANSPARENT); CopyWindowToVram(7, 2); } @@ -3569,13 +3569,13 @@ static void sub_819EAF8(void) { sub_819EAC0(); PutWindowTilemap(5); - FillWindowPixelBuffer(5, 0); + FillWindowPixelBuffer(5, PIXEL_BUFFER_TRANSPARENT); CopyWindowToVram(5, 2); } static void Swap_PrintPkmnSwap(void) { - FillWindowPixelBuffer(0, 0x11); + FillWindowPixelBuffer(0, PIXEL_BUFFER_WHITE); AddTextPrinterParameterized(0, 1, gText_PkmnSwap, 2, 1, 0, NULL); CopyWindowToVram(0, 3); } @@ -3585,7 +3585,7 @@ static void Swap_PrintMonSpecies(void) u16 species; u8 x; - FillWindowPixelBuffer(1, 0); + FillWindowPixelBuffer(1, PIXEL_BUFFER_TRANSPARENT); if (sFactorySwapScreen->cursorPos > 2) { CopyWindowToVram(1, 2); @@ -3606,7 +3606,7 @@ static void Swap_PrintMonSpecies(void) static void Swap_PrintOnInfoWindow(const u8 *str) { - FillWindowPixelBuffer(2, 0); + FillWindowPixelBuffer(2, PIXEL_BUFFER_TRANSPARENT); AddTextPrinterParameterized(2, 1, str, 2, 5, 0, NULL); CopyWindowToVram(2, 2); } @@ -3614,7 +3614,7 @@ static void Swap_PrintOnInfoWindow(const u8 *str) static void Swap_PrintMenuOptions(void) { PutWindowTilemap(3); - FillWindowPixelBuffer(3, 0); + FillWindowPixelBuffer(3, PIXEL_BUFFER_TRANSPARENT); AddTextPrinterParameterized3(3, 1, 15, 1, gUnknown_08610922, 0, gText_Summary2); AddTextPrinterParameterized3(3, 1, 15, 17, gUnknown_08610922, 0, gText_Swap); AddTextPrinterParameterized3(3, 1, 15, 33, gUnknown_08610922, 0, gText_Rechoose); @@ -3624,7 +3624,7 @@ static void Swap_PrintMenuOptions(void) static void Swap_PrintYesNoOptions(void) { PutWindowTilemap(4); - FillWindowPixelBuffer(4, 0); + FillWindowPixelBuffer(4, PIXEL_BUFFER_TRANSPARENT); AddTextPrinterParameterized3(4, 1, 7, 1, gUnknown_08610922, 0, gText_Yes3); AddTextPrinterParameterized3(4, 1, 7, 17, gUnknown_08610922, 0, gText_No3); CopyWindowToVram(4, 3); @@ -3638,7 +3638,7 @@ static void Swap_PrintActionString(const u8 *str, u32 y, u32 windowId) static void Swap_PrintActionStrings(void) { - FillWindowPixelBuffer(5, 0); + FillWindowPixelBuffer(5, PIXEL_BUFFER_TRANSPARENT); switch (sFactorySwapScreen->inEnemyScreen) { case TRUE: @@ -3652,7 +3652,7 @@ static void Swap_PrintActionStrings(void) static void Swap_PrintActionStrings2(void) { - FillWindowPixelBuffer(3, 0); + FillWindowPixelBuffer(3, PIXEL_BUFFER_TRANSPARENT); switch (sFactorySwapScreen->inEnemyScreen) { case TRUE: @@ -3693,7 +3693,7 @@ static void Swap_PrintMonSpecies2(void) LoadPalette(pal, 0xF0, 0xA); PutWindowTilemap(7); - FillWindowPixelBuffer(7, 0); + FillWindowPixelBuffer(7, PIXEL_BUFFER_TRANSPARENT); if (sFactorySwapScreen->cursorPos > 2) { CopyWindowToVram(7, 3); @@ -3745,7 +3745,7 @@ static void Swap_PrintMonCategory(void) u8 x; u8 monId = sFactorySwapScreen->cursorPos; - FillWindowPixelBuffer(8, 0); + FillWindowPixelBuffer(8, PIXEL_BUFFER_TRANSPARENT); if (monId > 2) { CopyWindowToVram(8, 2); @@ -3940,7 +3940,7 @@ static void Task_SwapCantHaveSameMons(u8 taskId) case 2: if (sFactorySwapScreen->unk30 != TRUE) { - FillWindowPixelBuffer(5, 0); + FillWindowPixelBuffer(5, PIXEL_BUFFER_TRANSPARENT); CopyWindowToVram(5, 2); gTasks[taskId].data[0]++; } diff --git a/src/battle_pyramid_bag.c b/src/battle_pyramid_bag.c index 1f0672dcb1..3601c5ad2b 100644 --- a/src/battle_pyramid_bag.c +++ b/src/battle_pyramid_bag.c @@ -651,7 +651,7 @@ static void PrintItemDescription(s32 listMenuId) StringExpandPlaceholders(gStringVar4, gText_ReturnToVar1); desc = gStringVar4; } - FillWindowPixelBuffer(1, 0); + FillWindowPixelBuffer(1, PIXEL_BUFFER_TRANSPARENT); PrintOnWindow_Font1(1, desc, 3, 0, 0, 1, 0, 0); } @@ -911,7 +911,7 @@ static void sub_81C5D20(u8 taskId) CopyItemName(gSpecialVar_ItemId, gStringVar1); StringExpandPlaceholders(gStringVar4, gText_Var1IsSelected); - FillWindowPixelBuffer(1, 0); + FillWindowPixelBuffer(1, PIXEL_BUFFER_TRANSPARENT); PrintOnWindow_Font1(1, gStringVar4, 3, 0, 0, 1, 0, 0); if (gPyramidBagResources->menuActionsCount == 1) sub_81C5EAC(sub_81C6D24(0)); @@ -1048,7 +1048,7 @@ static void BagAction_UseOnField(u8 taskId) else if (ItemId_GetFieldFunc(gSpecialVar_ItemId) != NULL) { sub_81C61A8(); - FillWindowPixelBuffer(1, 0); + FillWindowPixelBuffer(1, PIXEL_BUFFER_TRANSPARENT); schedule_bg_copy_tilemap_to_vram(0); ItemId_GetFieldFunc(gSpecialVar_ItemId)(taskId); } @@ -1086,7 +1086,7 @@ static void BagAction_Toss(u8 taskId) { CopyItemName(gSpecialVar_ItemId, gStringVar1); StringExpandPlaceholders(gStringVar4, gText_TossHowManyVar1s); - FillWindowPixelBuffer(1, 0); + FillWindowPixelBuffer(1, PIXEL_BUFFER_TRANSPARENT); PrintOnWindow_Font1(1, gStringVar4, 3, 0, 0, 1, 0, 0); sub_81C6404(); gTasks[taskId].func = sub_81C64B4; @@ -1100,7 +1100,7 @@ static void sub_81C6350(u8 taskId) CopyItemName(gSpecialVar_ItemId, gStringVar1); ConvertIntToDecimalStringN(gStringVar2, data[8], STR_CONV_MODE_LEFT_ALIGN, 2); StringExpandPlaceholders(gStringVar4, gText_ConfirmTossItems); - FillWindowPixelBuffer(1, 0); + FillWindowPixelBuffer(1, PIXEL_BUFFER_TRANSPARENT); PrintOnWindow_Font1(1, gStringVar4, 3, 0, 0, 1, 0, 0); sub_81C6DAC(taskId, &sYesNoTossFuncions); } @@ -1168,7 +1168,7 @@ static void TossItem(u8 taskId) CopyItemName(gSpecialVar_ItemId, gStringVar1); ConvertIntToDecimalStringN(gStringVar2, data[8], STR_CONV_MODE_LEFT_ALIGN, 2); StringExpandPlaceholders(gStringVar4, gText_ThrewAwayVar2Var1s); - FillWindowPixelBuffer(1, 0); + FillWindowPixelBuffer(1, PIXEL_BUFFER_TRANSPARENT); PrintOnWindow_Font1(1, gStringVar4, 3, 0, 0, 1, 0, 0); gTasks[taskId].func = sub_81C65CC; } @@ -1265,7 +1265,7 @@ static void Task_BeginItemSwap(u8 taskId) ListMenuSetUnkIndicatorsStructField(data[0], 0x10, 1); CopyItemName(gSaveBlock2Ptr->frontier.pyramidBag.itemId[gSaveBlock2Ptr->frontier.lvlMode][data[1]], gStringVar1); StringExpandPlaceholders(gStringVar4, gText_MoveVar1Where); - FillWindowPixelBuffer(1, 0); + FillWindowPixelBuffer(1, PIXEL_BUFFER_TRANSPARENT); PrintOnWindow_Font1(1, gStringVar4, 3, 0, 0, 1, 0, 0); sub_81C5A98(data[0], 1); sub_81C704C(data[1]); @@ -1395,7 +1395,7 @@ static void sub_81C6BD8(void) LoadPalette(gUnknown_0860F074, 0xF0, 0x20); for (i = 0; i < 5; i++) - FillWindowPixelBuffer(i, 0); + FillWindowPixelBuffer(i, PIXEL_BUFFER_TRANSPARENT); PutWindowTilemap(0); PutWindowTilemap(1); @@ -1456,7 +1456,7 @@ static void sub_81C6DAC(u8 taskId, const struct YesNoFuncTable *yesNoTable) void DisplayItemMessageInBattlePyramid(u8 taskId, const u8 *str, void (*callback)(u8 taskId)) { - FillWindowPixelBuffer(2, 0x11); + FillWindowPixelBuffer(2, PIXEL_BUFFER_WHITE); DisplayMessageAndContinueTask(taskId, 2, 0xA, 0xD, 1, GetPlayerTextSpeedDelay(), str, callback); schedule_bg_copy_tilemap_to_vram(1); } diff --git a/src/battle_records.c b/src/battle_records.c index f9c40d8de6..2ec0ee91e5 100644 --- a/src/battle_records.c +++ b/src/battle_records.c @@ -321,7 +321,7 @@ void ShowLinkBattleRecords(void) gRecordsWindowId = AddWindow(&sLinkBattleRecordsWindow); NewMenuHelpers_DrawStdWindowFrame(gRecordsWindowId, FALSE); - FillWindowPixelBuffer(gRecordsWindowId, 0x11); + FillWindowPixelBuffer(gRecordsWindowId, PIXEL_BUFFER_WHITE); StringExpandPlaceholders(gStringVar4, gText_PlayersBattleResults); x = GetStringCenterAlignXOffset(1, gStringVar4, 208); @@ -342,7 +342,7 @@ void ShowLinkBattleRecords(void) void RemoveRecordsWindow(void) { - sub_819746C(gRecordsWindowId, FALSE); + ClearWindowAndBorder(gRecordsWindowId, FALSE); RemoveWindow(gRecordsWindowId); } @@ -383,7 +383,7 @@ static void Task_ExitTrainerHillRecords(u8 taskId) static void RemoveTrainerHillRecordsWindow(u8 windowId) { - FillWindowPixelBuffer(windowId, 0); + FillWindowPixelBuffer(windowId, PIXEL_BUFFER_TRANSPARENT); ClearWindowTilemap(windowId); CopyWindowToVram(windowId, 2); RemoveWindow(windowId); diff --git a/src/battle_tower.c b/src/battle_tower.c index fbb77789e0..35c72f6132 100644 --- a/src/battle_tower.c +++ b/src/battle_tower.c @@ -51,7 +51,7 @@ static void AwardBattleTowerRibbons(void); static void SaveBattleTowerProgress(void); static void sub_8163914(void); static void nullsub_61(void); -static void nullsub_116(void); +static void SpriteCB_Null6(void); static void sub_81642A0(void); static void sub_8164828(void); static void sub_8164B74(void); @@ -1061,7 +1061,7 @@ static void (* const gUnknown_085DF96C[])(void) = SaveBattleTowerProgress, sub_8163914, nullsub_61, - nullsub_116, + SpriteCB_Null6, sub_81642A0, sub_8164828, sub_8164B74, @@ -2437,7 +2437,7 @@ static void nullsub_61(void) } -static void nullsub_116(void) +static void SpriteCB_Null6(void) { } diff --git a/src/berry_blender.c b/src/berry_blender.c index f2e3c7d14a..3075cc9352 100644 --- a/src/berry_blender.c +++ b/src/berry_blender.c @@ -945,7 +945,7 @@ static void InitBerryBlenderWindows(void) DeactivateAllTextPrinters(); for (i = 0; i < 5; i++) - FillWindowPixelBuffer(i, 0); + FillWindowPixelBuffer(i, PIXEL_BUFFER_TRANSPARENT); FillBgTilemapBufferRect_Palette0(0, 0, 0, 0, 0x1E, 0x14); sub_81978B0(0xE0); @@ -3538,7 +3538,7 @@ void ShowBerryBlenderRecordWindow(void) winTemplate = sBlenderRecordWindowTemplate; gRecordsWindowId = AddWindow(&winTemplate); NewMenuHelpers_DrawStdWindowFrame(gRecordsWindowId, 0); - FillWindowPixelBuffer(gRecordsWindowId, 0x11); + FillWindowPixelBuffer(gRecordsWindowId, PIXEL_BUFFER_WHITE); xPos = GetStringCenterAlignXOffset(1, gText_BlenderMaxSpeedRecord, 0x90); AddTextPrinterParameterized(gRecordsWindowId, 1, gText_BlenderMaxSpeedRecord, xPos, 1, 0, NULL); diff --git a/src/berry_fix_program.c b/src/berry_fix_program.c index 3631c083ad..7e72a9f3ba 100644 --- a/src/berry_fix_program.c +++ b/src/berry_fix_program.c @@ -226,8 +226,8 @@ static void berry_fix_gpu_set(void) DmaCopy32(3, sUnknown_08618138, BG_PLTT + 0x1E0, 0x20); SetGpuReg(REG_OFFSET_DISPCNT, DISPCNT_OBJ_1D_MAP); - FillWindowPixelBuffer(2, 0); - FillWindowPixelBuffer(3, 0); + FillWindowPixelBuffer(2, PIXEL_BUFFER_TRANSPARENT); + FillWindowPixelBuffer(3, PIXEL_BUFFER_TRANSPARENT); FillWindowPixelBuffer(0, 0xAA); width = GetStringWidth(0, sUnknown_08617E9B, 0); diff --git a/src/berry_tag_screen.c b/src/berry_tag_screen.c index 6e968fc0ab..6c08611add 100644 --- a/src/berry_tag_screen.c +++ b/src/berry_tag_screen.c @@ -381,7 +381,7 @@ static void PrintTextInBerryTagScreen(u8 windowId, const u8 *text, u8 x, u8 y, s static void AddBerryTagTextToBg0(void) { memcpy(GetBgTilemapBuffer(0), sBerryTag->tilemapBuffers[2], sizeof(sBerryTag->tilemapBuffers[2])); - FillWindowPixelBuffer(WIN_BERRY_TAG, 0xFF); + FillWindowPixelBuffer(WIN_BERRY_TAG, PIXEL_BUFFER_UNKNOWN); PrintTextInBerryTagScreen(WIN_BERRY_TAG, gText_BerryTag, GetStringCenterAlignXOffset(1, gText_BerryTag, 0x40), 1, 0, 1); PutWindowTilemap(WIN_BERRY_TAG); schedule_bg_copy_tilemap_to_vram(0); @@ -598,7 +598,7 @@ static void Task_DisplayAnotherBerry(u8 taskId) switch (data[0]) { case 0x30: - FillWindowPixelBuffer(0, 0); + FillWindowPixelBuffer(0, PIXEL_BUFFER_TRANSPARENT); break; case 0x40: PrintBerryNumberAndName(); @@ -608,7 +608,7 @@ static void Task_DisplayAnotherBerry(u8 taskId) CreateBerrySprite(); break; case 0x60: - FillWindowPixelBuffer(1, 0); + FillWindowPixelBuffer(1, PIXEL_BUFFER_TRANSPARENT); break; case 0x70: PrintBerrySize(); @@ -620,7 +620,7 @@ static void Task_DisplayAnotherBerry(u8 taskId) SetFlavorCirclesVisiblity(); break; case 0xA0: - FillWindowPixelBuffer(2, 0); + FillWindowPixelBuffer(2, PIXEL_BUFFER_TRANSPARENT); break; case 0xB0: PrintBerryDescription1(); @@ -635,7 +635,7 @@ static void Task_DisplayAnotherBerry(u8 taskId) switch (data[0]) { case 0x30: - FillWindowPixelBuffer(2, 0); + FillWindowPixelBuffer(2, PIXEL_BUFFER_TRANSPARENT); break; case 0x40: PrintBerryDescription2(); @@ -647,7 +647,7 @@ static void Task_DisplayAnotherBerry(u8 taskId) SetFlavorCirclesVisiblity(); break; case 0x70: - FillWindowPixelBuffer(1, 0); + FillWindowPixelBuffer(1, PIXEL_BUFFER_TRANSPARENT); break; case 0x80: PrintBerryFirmness(); @@ -660,7 +660,7 @@ static void Task_DisplayAnotherBerry(u8 taskId) CreateBerrySprite(); break; case 0xB0: - FillWindowPixelBuffer(0, 0); + FillWindowPixelBuffer(0, PIXEL_BUFFER_TRANSPARENT); break; case 0xC0: PrintBerryNumberAndName(); diff --git a/src/cable_club.c b/src/cable_club.c index 303b0d016c..f8137fd8fa 100644 --- a/src/cable_club.c +++ b/src/cable_club.c @@ -92,7 +92,9 @@ static void sub_80B23B0(u16 windowId, u32 value) static void sub_80B241C(u16 windowId) { - sub_819746C(windowId, FALSE); + // Following this call with a copy-to-vram with mode 3 is identical to + // calling ClearWindowAndBorder(windowId, TRUE). + ClearWindowAndBorder(windowId, FALSE); CopyWindowToVram(windowId, 3); } diff --git a/src/clear_save_data_screen.c b/src/clear_save_data_screen.c index 72d0daf559..6a89a05337 100644 --- a/src/clear_save_data_screen.c +++ b/src/clear_save_data_screen.c @@ -90,7 +90,7 @@ static void Task_ClearSaveDataScreenYesNoChoice(u8 taskId) switch (Menu_ProcessInputNoWrapClearOnChoose()) { case 0: - FillWindowPixelBuffer(0, 17); + FillWindowPixelBuffer(0, PIXEL_BUFFER_WHITE); AddTextPrinterParameterized(0, 1, gText_ClearingData, 0, 1, 0, 0); gTasks[taskId].func = Task_ClearSaveData; break; @@ -203,7 +203,7 @@ static void InitClearSaveDataScreenWindows(void) { InitWindows(sClearSaveTextWindow); DeactivateAllTextPrinters(); - FillWindowPixelBuffer(0, 0); + FillWindowPixelBuffer(0, PIXEL_BUFFER_TRANSPARENT); LoadWindowGfx(0, 0, 2, 224); LoadPalette(gUnknown_0860F074, 0xF0, 0x20); } diff --git a/src/coins.c b/src/coins.c index 967eb92aca..6ad80f80c7 100644 --- a/src/coins.c +++ b/src/coins.c @@ -27,7 +27,7 @@ void ShowCoinsWindow(u32 coinAmount, u8 x, u8 y) struct WindowTemplate template; SetWindowTemplateFields(&template, 0, x, y, 8, 2, 0xF, 0x141); sCoinsWindowId = AddWindow(&template); - FillWindowPixelBuffer(sCoinsWindowId, 0); + FillWindowPixelBuffer(sCoinsWindowId, PIXEL_BUFFER_TRANSPARENT); PutWindowTilemap(sCoinsWindowId); SetWindowBorderStyle(sCoinsWindowId, FALSE, 0x214, 0xE); PrintCoinsString(coinAmount); @@ -35,7 +35,7 @@ void ShowCoinsWindow(u32 coinAmount, u8 x, u8 y) void HideCoinsWindow(void) { - sub_819746C(sCoinsWindowId, TRUE); + ClearWindowAndBorder(sCoinsWindowId, TRUE); RemoveWindow(sCoinsWindowId); } diff --git a/src/contest.c b/src/contest.c index cf084e35e4..1799612984 100644 --- a/src/contest.c +++ b/src/contest.c @@ -819,7 +819,7 @@ static void sub_80D8490(u8 taskId) } r5 = StringCopy(r5, gMoveNames[move]); - FillWindowPixelBuffer(i + 5, 0); + FillWindowPixelBuffer(i + 5, PIXEL_BUFFER_TRANSPARENT); Contest_PrintTextToBg0WindowAt(i + 5, sp8, 5, 1, 7); } @@ -941,7 +941,7 @@ static void sub_80D895C(u8 taskId) for (i = 0; i < 4; i++) { - FillWindowPixelBuffer(5 + i, 0); + FillWindowPixelBuffer(5 + i, PIXEL_BUFFER_TRANSPARENT); PutWindowTilemap(5 + i); CopyWindowToVram(5 + i, 2); } @@ -2258,7 +2258,7 @@ static void sub_80DAEA4(void) for (i = 0; i < 4; i++) { - FillWindowPixelBuffer(gUnknown_02039F26[i], 0); + FillWindowPixelBuffer(gUnknown_02039F26[i], PIXEL_BUFFER_TRANSPARENT); sub_80DAF04(i); sub_80DAF88(i); } @@ -2478,7 +2478,7 @@ static void prints_contest_move_description(u16 a) ContestBG_FillBoxWithTile(0, 0x5036, 0x15, 0x20, 0x08, 0x01, 0x11); ContestBG_FillBoxWithTile(0, 0x5014, 0x15, 0x20, numHearts, 0x01, 0x11); - FillWindowPixelBuffer(10, 0); + FillWindowPixelBuffer(10, PIXEL_BUFFER_TRANSPARENT); Contest_PrintTextToBg0WindowStd(10, gContestEffectDescriptionPointers[gContestMoves[a].effect]); Contest_PrintTextToBg0WindowStd(9, gText_Slash); } @@ -2621,7 +2621,7 @@ static void sub_80DB884(void) static void sub_80DB89C(void) { - FillWindowPixelBuffer(4, 0); + FillWindowPixelBuffer(4, PIXEL_BUFFER_TRANSPARENT); CopyWindowToVram(4, 2); Contest_SetBgCopyFlags(0); } @@ -3456,7 +3456,7 @@ static void sub_80DCD48(void) break; default: for (i = 0; i < 4; i++) - FillWindowPixelBuffer(i, 0); + FillWindowPixelBuffer(i, PIXEL_BUFFER_TRANSPARENT); for (i = 0; i < 4; i++) { value = sContestantStatus[i].unk4; @@ -5038,7 +5038,7 @@ static void sub_80DF750(void) return; for (i = 0; i < 4; i++) - FillWindowPixelBuffer(i, 0); + FillWindowPixelBuffer(i, PIXEL_BUFFER_TRANSPARENT); if (gHeap[0x1A000] == 2) { diff --git a/src/contest_link_80F57C4.c b/src/contest_link_80F57C4.c index 381fb34fab..50d844b93b 100644 --- a/src/contest_link_80F57C4.c +++ b/src/contest_link_80F57C4.c @@ -904,7 +904,7 @@ static void sub_80F6AE8(void) // windowTemplate.width = 30; // windowTemplate.height = 2; // windowId = AddWindow(&windowTemplate); -// FillWindowPixelBuffer(windowId, 0x11); +// FillWindowPixelBuffer(windowId, PIXEL_BUFFER_WHITE); // origWidth = GetStringWidth(1, text, 0) + 9; // strWidth = origWidth; // if (strWidth < 0) diff --git a/src/contest_painting.c b/src/contest_painting.c index 71a110aa84..429d553aa6 100644 --- a/src/contest_painting.c +++ b/src/contest_painting.c @@ -279,7 +279,7 @@ static void InitContestPaintingWindow(void) SetBgTilemapBuffer(1, AllocZeroed(BG_SCREEN_SIZE)); gContestPaintingWindowId = AddWindow(&gUnknown_085B07EC); DeactivateAllTextPrinters(); - FillWindowPixelBuffer(gContestPaintingWindowId, 0); + FillWindowPixelBuffer(gContestPaintingWindowId, PIXEL_BUFFER_TRANSPARENT); PutWindowTilemap(gContestPaintingWindowId); CopyWindowToVram(gContestPaintingWindowId, 3); ShowBg(1); diff --git a/src/credits.c b/src/credits.c index 3639d36e4c..747d63f094 100644 --- a/src/credits.c +++ b/src/credits.c @@ -1592,7 +1592,7 @@ static void sub_8175DA0(u8 taskIdB) case 5: if (!gPaletteFade.active) { - FillWindowPixelBuffer(0, 0); + FillWindowPixelBuffer(0, PIXEL_BUFFER_TRANSPARENT); CopyWindowToVram(0, 2); gTasks[taskIdB].data[TDB_0] = 2; } diff --git a/src/daycare.c b/src/daycare.c index b75fab2924..14120f20bf 100644 --- a/src/daycare.c +++ b/src/daycare.c @@ -1259,7 +1259,7 @@ static void Task_HandleDaycareLevelMenuInput(u8 taskId) break; } DestroyListMenuTask(gTasks[taskId].tMenuListTaskId, NULL, NULL); - sub_819746C(gTasks[taskId].tWindowId, TRUE); + ClearWindowAndBorder(gTasks[taskId].tWindowId, TRUE); RemoveWindow(gTasks[taskId].tWindowId); DestroyTask(taskId); EnableBothScriptContexts(); @@ -1268,7 +1268,7 @@ static void Task_HandleDaycareLevelMenuInput(u8 taskId) { gSpecialVar_Result = 2; DestroyListMenuTask(gTasks[taskId].tMenuListTaskId, NULL, NULL); - sub_819746C(gTasks[taskId].tWindowId, TRUE); + ClearWindowAndBorder(gTasks[taskId].tWindowId, TRUE); RemoveWindow(gTasks[taskId].tWindowId); DestroyTask(taskId); EnableBothScriptContexts(); diff --git a/src/decoration.c b/src/decoration.c index 2ac49b98c1..afbb4ad409 100644 --- a/src/decoration.c +++ b/src/decoration.c @@ -543,7 +543,7 @@ void sub_8126B80(u8 taskId) void sub_8126C08(void) { - FillWindowPixelBuffer(0, 0x11); + FillWindowPixelBuffer(0, PIXEL_BUFFER_WHITE); AddTextPrinterParameterized2(0, 1, sSecretBasePCMenuItemDescriptions[sSecretBasePCMenuCursorPos], 0, 0, 2, 1, 3); } @@ -572,7 +572,7 @@ void SecretBasePC_PutAway(u8 taskId) else { sub_8126A58(0); - sub_8197434(0, 0); + ClearWindowAndWideBorder(0, 0); FadeScreen(1, 0); gTasks[taskId].data[2] = 0; gTasks[taskId].func = sub_8129ABC; @@ -617,7 +617,7 @@ void sub_8126DA4(u8 taskId) void SecretBasePC_PrepMenuForSelectingStoredDecors(u8 taskId) { LoadPalette(gUnknown_085A6BB0, 0xd0, 0x20); - sub_8197434(0, 0); + ClearWindowAndWideBorder(0, 0); sub_8126A58(0); sub_8126DFC(taskId); } @@ -634,7 +634,7 @@ void sub_8126DFC(u8 taskId) void sub_8126E44(u8 taskId) { - FillWindowPixelBuffer(sDecorMenuWindowIndices[1], 0x11); + FillWindowPixelBuffer(sDecorMenuWindowIndices[1], PIXEL_BUFFER_WHITE); sub_8126E8C(taskId); InitMenuInUpperLeftCornerPlaySoundWhenAPressed(sDecorMenuWindowIndices[1], 9, sCurDecorationCategory); gTasks[taskId].func = sub_8127088; @@ -751,7 +751,7 @@ void sub_81270E8(u8 taskId) void sub_8127180(u8 taskId) { - sub_8197434(0, 0); + ClearWindowAndWideBorder(0, 0); sub_8126DFC(taskId); } @@ -779,7 +779,7 @@ void sub_81271CC(u8 taskId) void sub_8127208(u8 taskId) { LoadPalette(gUnknown_085A6BB0, 0xd0, 0x20); - sub_8197434(0, 0); + ClearWindowAndWideBorder(0, 0); gTasks[taskId].data[11] = 2; sCurDecorationCategory = DECORCAT_DESK; sub_8126DFC(taskId); @@ -968,7 +968,7 @@ void sub_8127744(u32 a0) const u8 *txt; winidx = sDecorMenuWindowIndices[3]; - FillWindowPixelBuffer(winidx, 0x11); + FillWindowPixelBuffer(winidx, PIXEL_BUFFER_WHITE); if (a0 >= sCurDecorCatCount) { txt = gText_GoBackPrevMenu; @@ -1095,7 +1095,7 @@ void sub_8127A14(u8 taskId) void sub_8127A30(u8 taskId) { - sub_8197434(0, 0); + ClearWindowAndWideBorder(0, 0); gTasks[taskId].func = sub_8127A14; } @@ -1103,7 +1103,7 @@ void sub_8127A5C(u8 taskId) { if (gMain.newKeys & (A_BUTTON | B_BUTTON)) { - sub_8197434(0, 0); + ClearWindowAndWideBorder(0, 0); sub_81269D4(1); sub_8127620(taskId); } @@ -1634,7 +1634,7 @@ void sub_81289D0(u8 taskId) void sub_81289F0(u8 taskId) { - sub_8197434(0, 0); + ClearWindowAndWideBorder(0, 0); sub_8128AAC(taskId); if (gDecorations[gCurDecorInventoryItems[gCurDecorationIndex]].permission != DECORPERM_SOLID_MAT) { @@ -1699,7 +1699,7 @@ void sub_8128B80(u8 taskId) void sub_8128BA0(u8 taskId) { - sub_8197434(0, 0); + ClearWindowAndWideBorder(0, 0); sub_8128BBC(taskId); } @@ -1887,7 +1887,7 @@ void sub_8128E18(u8 taskId) void sub_8128FD8(u8 taskId) { - sub_8197434(0, 1); + ClearWindowAndWideBorder(0, 1); gSprites[sDecor_CameraSpriteObjectIdx1].data[7] = 0; gTasks[taskId].data[10] = 0; gTasks[taskId].func = sub_8128E18; @@ -2251,7 +2251,7 @@ void sub_81298EC(u8 taskId) if (!gPaletteFade.active) { DrawWholeMapView(); ScriptContext1_SetupScript(EventScript_275D2E); - sub_8197434(0, 1); + ClearWindowAndWideBorder(0, 1); gTasks[taskId].data[2] = 2; } break; @@ -2343,7 +2343,7 @@ void sub_8129ABC(u8 taskId) void sub_8129B34(u8 taskId) { - sub_8197434(0, 1); + ClearWindowAndWideBorder(0, 1); gSprites[sDecor_CameraSpriteObjectIdx1].data[7] = 0; gSprites[sDecor_CameraSpriteObjectIdx1].invisible = FALSE; gSprites[sDecor_CameraSpriteObjectIdx1].callback = sub_812A36C; @@ -2607,7 +2607,7 @@ void sub_812A1F0(u8 taskId) void sub_812A210(u8 taskId) { - sub_8197434(0, 0); + ClearWindowAndWideBorder(0, 0); sub_812A22C(taskId); } diff --git a/src/diploma.c b/src/diploma.c index b3d5a48fa0..9194af7106 100644 --- a/src/diploma.c +++ b/src/diploma.c @@ -197,7 +197,7 @@ static void InitDiplomaWindow(void) InitWindows(sDiplomaWinTemplates); DeactivateAllTextPrinters(); LoadPalette(gUnknown_0860F074, 0xF0, 0x20); - FillWindowPixelBuffer(0, 0); + FillWindowPixelBuffer(0, PIXEL_BUFFER_TRANSPARENT); PutWindowTilemap(0); } diff --git a/src/egg_hatch.c b/src/egg_hatch.c index e1d94889a8..f52f66a2aa 100644 --- a/src/egg_hatch.c +++ b/src/egg_hatch.c @@ -606,7 +606,7 @@ static void CB2_EggHatch_1(void) case 1: if (!gPaletteFade.active) { - FillWindowPixelBuffer(sEggHatchData->windowId, 0); + FillWindowPixelBuffer(sEggHatchData->windowId, PIXEL_BUFFER_TRANSPARENT); sEggHatchData->CB2_PalCounter = 0; sEggHatchData->CB2_state++; } @@ -857,7 +857,7 @@ static void CreateEggShardSprite(u8 x, u8 y, s16 data1, s16 data2, s16 data3, u8 static void EggHatchPrintMessage(u8 windowId, u8* string, u8 x, u8 y, u8 speed) { - FillWindowPixelBuffer(windowId, 0xFF); + FillWindowPixelBuffer(windowId, PIXEL_BUFFER_UNKNOWN); sEggHatchData->textColor[0] = 0; sEggHatchData->textColor[1] = 5; sEggHatchData->textColor[2] = 6; diff --git a/src/field_message_box.c b/src/field_message_box.c index 299aafaf26..111807240b 100755 --- a/src/field_message_box.c +++ b/src/field_message_box.c @@ -127,7 +127,7 @@ static void textbox_auto_and_task_add(void) void HideFieldMessageBox(void) { task_del_textbox(); - sub_8197434(0, 1); + ClearWindowAndWideBorder(0, 1); sFieldMessageBoxMode = 0; } diff --git a/src/field_player_avatar.c b/src/field_player_avatar.c index b1291f0ce1..dff010d13c 100644 --- a/src/field_player_avatar.c +++ b/src/field_player_avatar.c @@ -1918,7 +1918,7 @@ static bool8 Fishing9(struct Task *task) static bool8 Fishing10(struct Task *task) { AlignFishingAnimationFrames(); - FillWindowPixelBuffer(0, 0x11); + FillWindowPixelBuffer(0, PIXEL_BUFFER_WHITE); AddTextPrinterParameterized2(0, 1, gText_PokemonOnHook, 1, 0, 2, 1, 3); task->tStep++; task->tFrameCounter = 0; @@ -1944,7 +1944,7 @@ static bool8 Fishing11(struct Task *task) sub_8155604(gEventObjects[gPlayerAvatar.eventObjectId].fieldEffectSpriteId, 0, 0); gSprites[gPlayerAvatar.spriteId].pos2.x = 0; gSprites[gPlayerAvatar.spriteId].pos2.y = 0; - sub_8197434(0, TRUE); + ClearWindowAndWideBorder(0, TRUE); task->tFrameCounter++; return FALSE; } @@ -1966,7 +1966,7 @@ static bool8 Fishing12(struct Task *task) { AlignFishingAnimationFrames(); StartSpriteAnim(&gSprites[gPlayerAvatar.spriteId], GetFishingNoCatchDirectionAnimNum(GetPlayerFacingDirection())); - FillWindowPixelBuffer(0, 0x11); + FillWindowPixelBuffer(0, PIXEL_BUFFER_WHITE); AddTextPrinterParameterized2(0, 1, gText_NotEvenANibble, 1, 0, 2, 1, 3); task->tStep = FISHING_SHOW_RESULT; return TRUE; @@ -1977,7 +1977,7 @@ static bool8 Fishing13(struct Task *task) { AlignFishingAnimationFrames(); StartSpriteAnim(&gSprites[gPlayerAvatar.spriteId], GetFishingNoCatchDirectionAnimNum(GetPlayerFacingDirection())); - FillWindowPixelBuffer(0, 0x11); + FillWindowPixelBuffer(0, PIXEL_BUFFER_WHITE); AddTextPrinterParameterized2(0, 1, gText_ItGotAway, 1, 0, 2, 1, 3); task->tStep++; return TRUE; @@ -2017,7 +2017,7 @@ static bool8 Fishing16(struct Task *task) gPlayerAvatar.preventStep = FALSE; ScriptContext2_Disable(); UnfreezeEventObjects(); - sub_8197434(0, TRUE); + ClearWindowAndWideBorder(0, TRUE); sub_80ED950(0); DestroyTask(FindTaskIdByFunc(Task_Fishing)); } diff --git a/src/field_region_map.c b/src/field_region_map.c index d49ce3a4e4..6814b26bd3 100644 --- a/src/field_region_map.c +++ b/src/field_region_map.c @@ -196,13 +196,13 @@ static void PrintRegionMapSecName(void) { if (sFieldRegionMapHandler->regionMap.iconDrawType != MAPSECTYPE_NONE) { - FillWindowPixelBuffer(0, 0x11); + FillWindowPixelBuffer(0, PIXEL_BUFFER_WHITE); AddTextPrinterParameterized(0, 1, sFieldRegionMapHandler->regionMap.mapSecName, 0, 1, 0, NULL); schedule_bg_copy_tilemap_to_vram(0); } else { - FillWindowPixelBuffer(0, 0x11); + FillWindowPixelBuffer(0, PIXEL_BUFFER_WHITE); CopyWindowToVram(0, 3); } } diff --git a/src/field_specials.c b/src/field_specials.c index 3c26085dde..9390eab87b 100644 --- a/src/field_specials.c +++ b/src/field_specials.c @@ -2645,7 +2645,7 @@ static void sub_813A570(u8 taskId) DestroyListMenuTask(task->data[14], NULL, NULL); Free(gUnknown_0203AB64); sub_8198070(task->data[13], 1); - FillWindowPixelBuffer(task->data[13], 0); + FillWindowPixelBuffer(task->data[13], PIXEL_BUFFER_TRANSPARENT); CopyWindowToVram(task->data[13], 2); RemoveWindow(task->data[13]); DestroyTask(taskId); @@ -3226,7 +3226,7 @@ void sub_813AF48(void) DestroyListMenuTask(task->data[14], NULL, NULL); Free(gUnknown_0203AB64); sub_8198070(task->data[13], TRUE); - FillWindowPixelBuffer(task->data[13], 0); + FillWindowPixelBuffer(task->data[13], PIXEL_BUFFER_TRANSPARENT); ClearWindowTilemap(task->data[13]); CopyWindowToVram(task->data[13], 2); RemoveWindow(task->data[13]); diff --git a/src/frontier_pass.c b/src/frontier_pass.c index 0db546c4d7..39442dcfd0 100644 --- a/src/frontier_pass.c +++ b/src/frontier_pass.c @@ -1090,7 +1090,7 @@ static void ShowAndPrintWindows(void) for (i = 0; i < WINDOW_COUNT; i++) { PutWindowTilemap(i); - FillWindowPixelBuffer(i, 0); + FillWindowPixelBuffer(i, PIXEL_BUFFER_TRANSPARENT); } x = GetStringCenterAlignXOffset(1, gText_SymbolsEarned, 96); @@ -1116,7 +1116,7 @@ static void ShowAndPrintWindows(void) static void PrintAreaDescription(u8 cursorArea) { - FillWindowPixelBuffer(WINDOW_DESCRIPTION, 0); + FillWindowPixelBuffer(WINDOW_DESCRIPTION, PIXEL_BUFFER_TRANSPARENT); if (cursorArea == CURSOR_AREA_RECORD && !sPassData->hasBattleRecord) AddTextPrinterParameterized3(WINDOW_DESCRIPTION, 1, 2, 0, sTextColors[1], 0, sPassAreaDescriptions[0]); else if (cursorArea != CURSOR_AREA_NOTHING) @@ -1656,7 +1656,7 @@ static void PrintOnFrontierMap(void) for (i = 0; i < MAP_WINDOW_COUNT; i++) { PutWindowTilemap(i); - FillWindowPixelBuffer(i, 0); + FillWindowPixelBuffer(i, PIXEL_BUFFER_TRANSPARENT); } for (i = 0; i < NUM_FRONTIER_FACILITIES; i++) @@ -1698,7 +1698,7 @@ static void HandleFrontierMapCursorMove(u8 direction) StartSpriteAnim(sMapData->mapIndicatorSprite, sMapLandmarks[sMapData->cursorPos].animNum); sMapData->mapIndicatorSprite->pos1.x = sMapLandmarks[sMapData->cursorPos].x; sMapData->mapIndicatorSprite->pos1.y = sMapLandmarks[sMapData->cursorPos].y; - FillWindowPixelBuffer(MAP_WINDOW_DESCRIPTION, 0); + FillWindowPixelBuffer(MAP_WINDOW_DESCRIPTION, PIXEL_BUFFER_TRANSPARENT); AddTextPrinterParameterized3(MAP_WINDOW_DESCRIPTION, 1, 4, 0, sTextColors[0], 0, sMapLandmarks[sMapData->cursorPos].description); for (i = 0; i < 3; i++) diff --git a/src/frontier_util.c b/src/frontier_util.c index e6954c3560..071eece0ca 100644 --- a/src/frontier_util.c +++ b/src/frontier_util.c @@ -1045,7 +1045,7 @@ static void ShowTowerResultsWindow(u8 battleMode) { gRecordsWindowId = AddWindow(&gUnknown_08611C74); NewMenuHelpers_DrawStdWindowFrame(gRecordsWindowId, FALSE); - FillWindowPixelBuffer(gRecordsWindowId, 0x11); + FillWindowPixelBuffer(gRecordsWindowId, PIXEL_BUFFER_WHITE); if (battleMode == FRONTIER_MODE_SINGLES) StringExpandPlaceholders(gStringVar4, gText_SingleBattleRoomResults); else if (battleMode == FRONTIER_MODE_DOUBLES) @@ -1116,7 +1116,7 @@ static void ShowDomeResultsWindow(u8 battleMode) { gRecordsWindowId = AddWindow(&gUnknown_08611C74); NewMenuHelpers_DrawStdWindowFrame(gRecordsWindowId, FALSE); - FillWindowPixelBuffer(gRecordsWindowId, 0x11); + FillWindowPixelBuffer(gRecordsWindowId, PIXEL_BUFFER_WHITE); if (battleMode == FRONTIER_MODE_SINGLES) StringExpandPlaceholders(gStringVar4, gText_SingleBattleTourneyResults); else @@ -1192,7 +1192,7 @@ static void ShowPalaceResultsWindow(u8 battleMode) { gRecordsWindowId = AddWindow(&gUnknown_08611C74); NewMenuHelpers_DrawStdWindowFrame(gRecordsWindowId, FALSE); - FillWindowPixelBuffer(gRecordsWindowId, 0x11); + FillWindowPixelBuffer(gRecordsWindowId, PIXEL_BUFFER_WHITE); if (battleMode == FRONTIER_MODE_SINGLES) StringExpandPlaceholders(gStringVar4, gText_SingleBattleHallResults); else @@ -1248,7 +1248,7 @@ static void ShowPikeResultsWindow(void) { gRecordsWindowId = AddWindow(&gUnknown_08611C74); NewMenuHelpers_DrawStdWindowFrame(gRecordsWindowId, FALSE); - FillWindowPixelBuffer(gRecordsWindowId, 0x11); + FillWindowPixelBuffer(gRecordsWindowId, PIXEL_BUFFER_WHITE); StringExpandPlaceholders(gStringVar4, gText_BattleChoiceResults); PrintAligned(gStringVar4, 0); AddTextPrinterParameterized(gRecordsWindowId, 1, gText_Lv502, 8, 33, TEXT_SPEED_FF, NULL); @@ -1310,7 +1310,7 @@ static void ShowArenaResultsWindow(void) { gRecordsWindowId = AddWindow(&gUnknown_08611C74); NewMenuHelpers_DrawStdWindowFrame(gRecordsWindowId, FALSE); - FillWindowPixelBuffer(gRecordsWindowId, 0x11); + FillWindowPixelBuffer(gRecordsWindowId, PIXEL_BUFFER_WHITE); PrintHyphens(10); StringExpandPlaceholders(gStringVar4, gText_SetKOTourneyResults); PrintAligned(gStringVar4, 2); @@ -1396,7 +1396,7 @@ static void ShowFactoryResultsWindow(u8 battleMode) { gRecordsWindowId = AddWindow(&gUnknown_08611C74); NewMenuHelpers_DrawStdWindowFrame(gRecordsWindowId, FALSE); - FillWindowPixelBuffer(gRecordsWindowId, 0x11); + FillWindowPixelBuffer(gRecordsWindowId, PIXEL_BUFFER_WHITE); if (battleMode == FRONTIER_MODE_SINGLES) StringExpandPlaceholders(gStringVar4, gText_BattleSwapSingleResults); else @@ -1461,7 +1461,7 @@ static void ShowPyramidResultsWindow(void) { gRecordsWindowId = AddWindow(&gUnknown_08611C74); NewMenuHelpers_DrawStdWindowFrame(gRecordsWindowId, FALSE); - FillWindowPixelBuffer(gRecordsWindowId, 0x11); + FillWindowPixelBuffer(gRecordsWindowId, PIXEL_BUFFER_WHITE); StringExpandPlaceholders(gStringVar4, gText_BattleQuestResults); PrintAligned(gStringVar4, 2); AddTextPrinterParameterized(gRecordsWindowId, 1, gText_Lv502, 8, 49, TEXT_SPEED_FF, NULL); @@ -1484,7 +1484,7 @@ static void ShowLinkContestResultsWindow(void) gRecordsWindowId = AddWindow(&gUnknown_08611C7C); NewMenuHelpers_DrawStdWindowFrame(gRecordsWindowId, FALSE); - FillWindowPixelBuffer(gRecordsWindowId, 0x11); + FillWindowPixelBuffer(gRecordsWindowId, PIXEL_BUFFER_WHITE); StringExpandPlaceholders(gStringVar4, gText_LinkContestResults); x = GetStringCenterAlignXOffset(1, gStringVar4, 208); @@ -2354,7 +2354,7 @@ void ShowRankingHallRecordsWindow(void) { gRecordsWindowId = AddWindow(&gUnknown_08611C84); NewMenuHelpers_DrawStdWindowFrame(gRecordsWindowId, FALSE); - FillWindowPixelBuffer(gRecordsWindowId, 0x11); + FillWindowPixelBuffer(gRecordsWindowId, PIXEL_BUFFER_WHITE); PrintHallRecords(gSpecialVar_0x8005, FRONTIER_LVL_50); PutWindowTilemap(gRecordsWindowId); CopyWindowToVram(gRecordsWindowId, 3); @@ -2362,7 +2362,7 @@ void ShowRankingHallRecordsWindow(void) void ScrollRankingHallRecordsWindow(void) { - FillWindowPixelBuffer(gRecordsWindowId, 0x11); + FillWindowPixelBuffer(gRecordsWindowId, PIXEL_BUFFER_WHITE); PrintHallRecords(gSpecialVar_0x8005, FRONTIER_LVL_OPEN); CopyWindowToVram(gRecordsWindowId, 2); } diff --git a/src/hall_of_fame.c b/src/hall_of_fame.c index 3f217b7828..b064c991ba 100644 --- a/src/hall_of_fame.c +++ b/src/hall_of_fame.c @@ -570,7 +570,7 @@ static void Task_Hof_DisplayMon(u8 taskId) gSprites[spriteId].tSpecies = currMon->species; gSprites[spriteId].callback = SpriteCB_GetOnScreenAndAnimate; gTasks[taskId].tMonSpriteId(currMonId) = spriteId; - sub_8197434(0, TRUE); + ClearWindowAndWideBorder(0, TRUE); gTasks[taskId].func = Task_Hof_PrintMonInfoAfterAnimating; } @@ -649,7 +649,7 @@ static void sub_8173DC0(u8 taskId) gSprites[gTasks[taskId].tMonSpriteId(i)].oam.priority = 1; } BeginNormalPaletteFade(sUnknown_0203BCD4, 0, 12, 12, RGB(16, 29, 24)); - FillWindowPixelBuffer(0, 0); + FillWindowPixelBuffer(0, PIXEL_BUFFER_TRANSPARENT); CopyWindowToVram(0, 3); gTasks[taskId].tFrameCount = 7; gTasks[taskId].func = sub_8173EA4; @@ -1086,7 +1086,7 @@ static void Task_HofPC_ExitOnButtonPress(u8 taskId) static void HallOfFame_PrintWelcomeText(u8 unusedPossiblyWindowId, u8 unused2) { - FillWindowPixelBuffer(0, 0); + FillWindowPixelBuffer(0, PIXEL_BUFFER_TRANSPARENT); PutWindowTilemap(0); AddTextPrinterParameterized3(0, 1, GetStringCenterAlignXOffset(1, gText_WelcomeToHOF, 0xD0), 1, sUnknown_085E5388, 0, gText_WelcomeToHOF); CopyWindowToVram(0, 3); @@ -1099,7 +1099,7 @@ static void HallOfFame_PrintMonInfo(struct HallofFameMon* currMon, u8 unused1, u s32 dexNumber; s32 width; - FillWindowPixelBuffer(0, 0); + FillWindowPixelBuffer(0, PIXEL_BUFFER_TRANSPARENT); PutWindowTilemap(0); // dex number @@ -1180,7 +1180,7 @@ static void HallOfFame_PrintPlayerInfo(u8 unused1, u8 unused2) u32 width; u16 trainerId; - FillWindowPixelBuffer(1, 0x11); + FillWindowPixelBuffer(1, PIXEL_BUFFER_WHITE); PutWindowTilemap(1); SetWindowBorderStyle(1, FALSE, 0x21D, 0xD); AddTextPrinterParameterized3(1, 1, 0, 1, sUnknown_085E538C, -1, gText_Name); diff --git a/src/item_menu.c b/src/item_menu.c index 43f2afce34..db16a887ec 100755 --- a/src/item_menu.c +++ b/src/item_menu.c @@ -884,7 +884,7 @@ void bag_menu_print_description_box_text(int a) StringExpandPlaceholders(gStringVar4, gText_ReturnToVar1); str = gStringVar4; } - FillWindowPixelBuffer(1, 0); + FillWindowPixelBuffer(1, PIXEL_BUFFER_TRANSPARENT); bag_menu_print(1, 1, str, 3, 1, 0, 0, 0, 0); } @@ -1028,7 +1028,7 @@ void DisplayItemMessage(u8 taskId, u8 fontId, const u8 *str, void ( *callback)(u s16* data = gTasks[taskId].data; data[10] = AddItemMessageWindow(4); - FillWindowPixelBuffer(data[10], 17); + FillWindowPixelBuffer(data[10], PIXEL_BUFFER_WHITE); DisplayMessageAndContinueTask(taskId, data[10], 10, 13, fontId, GetPlayerTextSpeedDelay(), str, callback); schedule_bg_copy_tilemap_to_vram(1); } @@ -1293,7 +1293,7 @@ void bag_menu_swap_items(u8 taskId) gUnknown_0203CE54->unk81A = data[1]; CopyItemName(BagGetItemIdByPocketPosition(gUnknown_0203CE58.pocket + 1, data[1]), gStringVar1); StringExpandPlaceholders(gStringVar4, gText_MoveVar1Where); - FillWindowPixelBuffer(1, 0); + FillWindowPixelBuffer(1, PIXEL_BUFFER_TRANSPARENT); bag_menu_print(1, 1, gStringVar4, 3, 1, 0, 0, 0, 0); sub_80D4FEC(data[1]); sub_81AB89C(); @@ -1505,7 +1505,7 @@ void sub_81AC644(u8 unused) { CopyItemName(gSpecialVar_ItemId, gStringVar1); StringExpandPlaceholders(gStringVar4, gText_Var1IsSelected); - FillWindowPixelBuffer(1, 0); + FillWindowPixelBuffer(1, PIXEL_BUFFER_TRANSPARENT); bag_menu_print(1, 1, gStringVar4, 3, 1, 0, 0, 0, 0); } if (gUnknown_0203CE54->unk828 == 1) @@ -1646,7 +1646,7 @@ void ItemMenu_UseOutOfBattle(u8 taskId) bag_menu_print_there_is_no_pokemon(taskId); else { - FillWindowPixelBuffer(1, 0); + FillWindowPixelBuffer(1, PIXEL_BUFFER_TRANSPARENT); schedule_bg_copy_tilemap_to_vram(0); if (gUnknown_0203CE58.pocket != BERRIES_POCKET) ItemId_GetFieldFunc(gSpecialVar_ItemId)(taskId); @@ -1670,7 +1670,7 @@ void ItemMenu_Toss(u8 taskId) { CopyItemName(gSpecialVar_ItemId, gStringVar1); StringExpandPlaceholders(gStringVar4, gText_TossHowManyVar1s); - FillWindowPixelBuffer(1, 0); + FillWindowPixelBuffer(1, PIXEL_BUFFER_TRANSPARENT); bag_menu_print(1, 1, gStringVar4, 3, 1, 0, 0, 0, 0); sub_81ABC3C(7); gTasks[taskId].func = Task_ChooseHowManyToToss; @@ -1684,7 +1684,7 @@ void BagMenuConfirmToss(u8 taskId) CopyItemName(gSpecialVar_ItemId, gStringVar1); ConvertIntToDecimalStringN(gStringVar2, data[8], 0, 3); StringExpandPlaceholders(gStringVar4, gText_ConfirmTossItems); - FillWindowPixelBuffer(1, 0); + FillWindowPixelBuffer(1, PIXEL_BUFFER_TRANSPARENT); bag_menu_print(1, 1, gStringVar4, 3, 1, 0, 0, 0, 0); bag_menu_yes_no(taskId, 5, &gUnknown_08614084); } @@ -1727,7 +1727,7 @@ void BagMenuActuallyToss(u8 taskId) CopyItemName(gSpecialVar_ItemId, gStringVar1); ConvertIntToDecimalStringN(gStringVar2, data[8], 0, 3); StringExpandPlaceholders(gStringVar4, gText_ThrewAwayVar2Var1s); - FillWindowPixelBuffer(1, 0); + FillWindowPixelBuffer(1, PIXEL_BUFFER_TRANSPARENT); bag_menu_print(1, 1, gStringVar4, 3, 1, 0, 0, 0, 0); gTasks[taskId].func = Task_ActuallyToss; } @@ -2043,7 +2043,7 @@ void display_deposit_item_ask_str(u8 taskId) { CopyItemName(gSpecialVar_ItemId, gStringVar1); StringExpandPlaceholders(gStringVar4, gText_DepositHowManyVar1); - FillWindowPixelBuffer(1, 0); + FillWindowPixelBuffer(1, PIXEL_BUFFER_TRANSPARENT); bag_menu_print(1, 1, gStringVar4, 3, 1, 0, 0, 0, 0); sub_81ABC3C(7); gTasks[taskId].func = sub_81ADA7C; @@ -2078,7 +2078,7 @@ void sub_81ADB14(u8 taskId) { s16* data = gTasks[taskId].data; - FillWindowPixelBuffer(1, 0); + FillWindowPixelBuffer(1, PIXEL_BUFFER_TRANSPARENT); if (ItemId_GetImportance(gSpecialVar_ItemId)) { bag_menu_print(1, 1, gText_CantStoreImportantItems, 3, 1, 0, 0, 0, 0); @@ -2244,7 +2244,7 @@ void bag_menu_print_pocket_names(const u8 *pocketName1, const u8 *pocketName2) window.width = 16; window.height = 2; windowId = AddWindow(&window); - FillWindowPixelBuffer(windowId, 0); + FillWindowPixelBuffer(windowId, PIXEL_BUFFER_TRANSPARENT); offset = GetStringCenterAlignXOffset(1, pocketName1, 0x40); bag_menu_print(windowId, 1, pocketName1, offset, 1, 0, 0, -1, 1); if (pocketName2) @@ -2283,7 +2283,7 @@ void setup_bag_menu_textboxes(void) LoadPalette(&gUnknown_0860F074, 0xF0, 0x20); for (i = 0; i < 3; i++) { - FillWindowPixelBuffer(i, 0); + FillWindowPixelBuffer(i, PIXEL_BUFFER_TRANSPARENT); PutWindowTilemap(i); } schedule_bg_copy_tilemap_to_vram(0); @@ -2366,7 +2366,7 @@ void bag_menu_remove_money_window(void) void bag_menu_prepare_tmhm_move_window(void) { - FillWindowPixelBuffer(3, 0); + FillWindowPixelBuffer(3, PIXEL_BUFFER_TRANSPARENT); blit_move_info_icon(3, 19, 0, 0); blit_move_info_icon(3, 20, 0, 12); blit_move_info_icon(3, 21, 0, 24); @@ -2380,7 +2380,7 @@ void PrintTMHMMoveData(u16 itemId) u16 moveId; const u8* text; - FillWindowPixelBuffer(4, 0); + FillWindowPixelBuffer(4, PIXEL_BUFFER_TRANSPARENT); if (itemId == ITEM_NONE) { for (i = 0; i < 4; i++) diff --git a/src/item_use.c b/src/item_use.c index 97d6292c45..81f4b7b542 100755 --- a/src/item_use.c +++ b/src/item_use.c @@ -188,7 +188,7 @@ void DisplayCannotDismountBikeMessage(u8 taskId, bool8 isUsingRegisteredKeyItemO void CleanUpAfterFailingToUseRegisteredKeyItemOnField(u8 taskId) { - sub_8197434(0, 1); + ClearWindowAndWideBorder(0, 1); DestroyTask(taskId); ScriptUnfreezeEventObjects(); ScriptContext2_Disable(); @@ -350,7 +350,7 @@ void sub_80FD504(u8 taskId) void sub_80FD5CC(u8 taskId) { - sub_8197434(0, 1); + ClearWindowAndWideBorder(0, 1); ScriptUnfreezeEventObjects(); ScriptContext2_Disable(); DestroyTask(taskId); diff --git a/src/learn_move.c b/src/learn_move.c index 7a6916013a..d9ebe3f3b0 100644 --- a/src/learn_move.c +++ b/src/learn_move.c @@ -498,7 +498,7 @@ static void LearnMoveMain(void) case 27: if (!sub_81D2C3C()) { - FillWindowPixelBuffer(3, 0x11); + FillWindowPixelBuffer(3, PIXEL_BUFFER_WHITE); if (sLearnMoveStruct2.showContestInfo == FALSE) { sLearnMoveStruct->state = 3; @@ -631,7 +631,7 @@ static void HideSpritesAndPrintTeachText(bool8 a) if (!a) { StringExpandPlaceholders(gStringVar4, gText_TeachWhichMoveToPkmn); - FillWindowPixelBuffer(3, 0x11); + FillWindowPixelBuffer(3, PIXEL_BUFFER_WHITE); AddTextPrinterParameterized(3, 1, gStringVar4, 0, 1, 0, NULL); } } @@ -695,7 +695,7 @@ static void ShowTeachMoveText(bool8 showContest) if (showContest == FALSE) { StringExpandPlaceholders(gStringVar4, gText_TeachWhichMoveToPkmn); - FillWindowPixelBuffer(3, 0x11); + FillWindowPixelBuffer(3, PIXEL_BUFFER_WHITE); AddTextPrinterParameterized(3, 1, gStringVar4, 0, 1, 0, NULL); } } diff --git a/src/list_menu.c b/src/list_menu.c index 7a95476614..6442debba3 100644 --- a/src/list_menu.c +++ b/src/list_menu.c @@ -355,11 +355,11 @@ s32 DoMysteryGiftListMenu(struct WindowTemplate *windowTemplate, struct ListMenu switch (arg2) { case 0: // can never be reached, because of the if statement above - sub_819746C(sMysteryGiftLinkMenu.windowId, FALSE); + ClearWindowAndBorder(sMysteryGiftLinkMenu.windowId, FALSE); break; case 2: case 1: - sub_819746C(sMysteryGiftLinkMenu.windowId, FALSE); + ClearWindowAndBorder(sMysteryGiftLinkMenu.windowId, FALSE); break; } } diff --git a/src/mail.c b/src/mail.c index 45e96e85e5..6d9c98350b 100644 --- a/src/mail.c +++ b/src/mail.c @@ -477,8 +477,8 @@ static void sub_8121B1C(void) y = 0; PutWindowTilemap(0); PutWindowTilemap(1); - FillWindowPixelBuffer(0, 0); - FillWindowPixelBuffer(1, 0); + FillWindowPixelBuffer(0, PIXEL_BUFFER_TRANSPARENT); + FillWindowPixelBuffer(1, PIXEL_BUFFER_TRANSPARENT); for (i = 0; i < sMailRead->layout->numSubStructs; i ++) { if (sMailRead->strbuf[i][0] == EOS || sMailRead->strbuf[i][0] == CHAR_SPACE) diff --git a/src/main_menu.c b/src/main_menu.c index 4cd5c8e14c..9a320bcea1 100644 --- a/src/main_menu.c +++ b/src/main_menu.c @@ -39,6 +39,135 @@ #include "title_screen.h" #include "window.h" +/* + * Main menu state machine + * ----------------------- + * + * Entry point: CB2_InitMainMenu + * + * Note: States advance sequentially unless otherwise stated. + * + * CB2_InitMainMenu / CB2_ReinitMainMenu + * - Both of these states call InitMainMenu, which does all the work. + * - In the Reinit case, the init code will check if the user came from + * the options screen. If they did, then the options menu item is + * pre-selected. + * + * Task_MainMenuCheckSaveFile + * - Determines how many menu options to show based on whether + * the save file is Ok, empty, corrupted, etc. + * - If there was an error loading the save file, advance to + * Task_WaitForSaveFileErrorWindow. + * - If there were no errors, advance to Task_MainMenuCheckBattery. + * - Note that the check to enable Mystery Events would normally happen + * here, but this version of Emerald has them disabled. + * + * Task_WaitForSaveFileErrorWindow + * - Wait for the text to finish printing and then for the A button + * to be pressed. + * + * Task_MainMenuCheckBattery + * - If the battery is OK, advance to Task_DisplayMainMenu. + * - If the battery is dry, advance to Task_WaitForBatteryDryErrorWindow. + * + * Task_WaitForBatteryDryErrorWindow + * - Wait for the text to finish printing and then for the A button + * to be pressed. + * + * Task_DisplayMainWindow + * - Display the buttons to the user. If the menu is in HAS_MYSTERY_EVENTS + * mode, there are too many buttons for one screen and a scrollbar is added, + * and the scrollbar task is spawned (Task_ScrollIndicatorArrowPairOnMainMenu). + * + * Task_HighlightSelectedMainMenuItem + * - Update the UI to match the currently selected item. + * + * Task_HandleMainMenuInput + * - If A is pressed, advance to Task_HandleMainMenuAPressed. + * - If B is pressed, return to the title screen via CB2_InitTitleScreen. + * - If Up or Down is pressed, handle scrolling if there is a scroll bar, change + * the selection, then go back to Task_HighlightSelectedMainMenuItem. + * + * Task_HandleMainMenuAPressed + * - If the user selected New Game, advance to Task_NewGameBirchSpeech_Init. + * - If the user selected Continue, advance to CB2_ContinueSavedGame. + * - If the user selected the Options menu, advance to CB2_InitOptionMenu. + * - If the user selected Mystery Gift, advance to CB2_MysteryGift. However, + * if the wireless adapter was removed, instead advance to + * Task_DisplayMainMenuInvalidActionError. + * - Code to start a Mystery Event is present here, but is unreachable in this + * version. + * + * Task_HandleMainMenuBPressed + * - Clean up the main menu and go back to CB2_InitTitleScreen. + * + * Task_DisplayMainMenuInvalidActionError + * - Print one of three different error messages, wait for the text to stop + * printing, and then wait for A or B to be pressed. + * - Then advance to Task_HandleMainMenuBPressed. + * + * Task_NewGameBirchSpeechInit + * - Load the sprites for the intro speech, start playing music + * Task_NewGameBirchSpeech_WaitToShowBirch + * - Spawn Task_NewGameBirchSpeech_FadeInTarget1OutTarget2 + * - Spawn Task_NewGameBirchSpeech_FadePlatformOut + * - Both of these tasks destroy themselves when done. + * Task_NewGameBirchSpeech_WaitForSpriteFadeInWelcome + * Task_NewGameBirchSpeech_ThisIsAPokemon + * - When the text is done printing, spawns Task_NewGameBirchSpeechSub_InitPokeball + * Task_NewGameBirchSpeech_MainSpeech + * Task_NewGameBirchSpeech_AndYouAre + * Task_NewGameBirchSpeech_StartBirchLotadPlatformFade + * Task_NewGameBirchSpeech_StartBirchLotadPlatformFade + * Task_NewGameBirchSpeech_SlidePlatformAway + * Task_NewGameBirchSpeech_StartPlayerFadeIn + * Task_NewGameBirchSpeech_WaitForPlayerFadeIn + * Task_NewGameBirchSpeech_BoyOrGirl + * Task_NewGameBirchSpeech_WaitToShowGenderMenu + * Task_NewGameBirchSpeech_ChooseGender + * - Animates by advancing to Task_NewGameBirchSpeech_SlideOutOldGenderSprite + * whenever the player's selection changes. + * - Advances to Task_NewGameBirchSpeech_WhatsYourName when done. + * + * Task_NewGameBirchSpeech_SlideOutOldGenderSprite + * Task_NewGameBirchSpeech_SlideInNewGenderSprite + * - Returns back to Task_NewGameBirchSpeech_ChooseGender. + * + * Task_NewGameBirchSpeech_WhatsYourName + * Task_NewGameBirchSpeech_WaitForWhatsYourNameToPrint + * Task_NewGameBirchSpeech_WaitPressBeforeNameChoice + * Task_NewGameBirchSpeech_StartNamingScreen + * C2_NamingScreen + * - Returns to CB2_NewGameBirchSpeech_ReturnFromNamingScreen when done + * CB2_NewGameBirchSpeech_ReturnFromNamingScreen + * Task_NewGameBirchSpeech_ReturnFromNamingScreenShowTextbox + * Task_NewGameBirchSpeech_SoItsPlayerName + * Task_NewGameBirchSpeech_CreateNameYesNo + * Task_NewGameBirchSpeech_ProcessNameYesNoMenu + * - If confirmed, advance to Task_NewGameBirchSpeech_SlidePlatformAway2. + * - Otherwise, return to Task_NewGameBirchSpeech_BoyOrGirl. + * + * Task_NewGameBirchSpeech_SlidePlatformAway2 + * Task_NewGameBirchSpeech_ReshowBirchLotad + * Task_NewGameBirchSpeech_WaitForSpriteFadeInAndTextPrinter + * Task_NewGameBirchSpeech_AreYouReady + * Task_NewGameBirchSpeech_ShrinkPlayer + * Task_NewGameBirchSpeech_WaitForPlayerShrink + * Task_NewGameBirchSpeech_FadePlayerToWhite + * Task_NewGameBirchSpeech_Cleanup + * - Advances to CB2_NewGame. + * + * Task_NewGameBirchSpeechSub_InitPokeball + * - Advances to Task_NewGameBirchSpeechSub_WaitForLotad + * Task_NewGameBirchSpeechSub_WaitForLotad + * - Destroys itself when done. + */ + +// These two defines are used with the sCurrItemAndOptionsMenuCheck, +// to distinguish between its two parts. +#define OPTION_MENU_FLAG 0x8000 +#define CURRENT_ITEM_MASK 0x7FFF + // Static type declarations // Static RAM declarations @@ -112,7 +241,7 @@ static void SpriteCB_MovePlayerDownWhileShrinking(struct Sprite*); static void Task_NewGameBirchSpeech_WaitForPlayerShrink(u8); static void Task_NewGameBirchSpeech_FadePlayerToWhite(u8); static void Task_NewGameBirchSpeech_Cleanup(u8); -static void nullsub_11(); +static void SpriteCB_Null(); static void Task_NewGameBirchSpeech_ReturnFromNamingScreenShowTextbox(u8); static void MainMenu_FormatSavegamePlayer(void); static void MainMenu_FormatSavegamePokedex(void); @@ -247,7 +376,7 @@ static const struct WindowTemplate sWindowTemplates_MainMenu[] = DUMMY_WIN_TEMPLATE }; -static const struct WindowTemplate gUnknown_082FF080[] = +static const struct WindowTemplate gNewGameBirchSpeechTextWindows[] = { { .bg = 0, @@ -542,7 +671,7 @@ static void Task_MainMenuCheckSaveFile(u8 taskId) gTasks[taskId].func = Task_WaitForSaveFileErrorWindow; break; } - if (sCurrItemAndOptionMenuCheck & 0x8000) // are we returning from the options menu? + if (sCurrItemAndOptionMenuCheck & OPTION_MENU_FLAG) // are we returning from the options menu? { switch (tMenuType) // if so, highlight the OPTIONS item { @@ -558,7 +687,7 @@ static void Task_MainMenuCheckSaveFile(u8 taskId) break; } } - sCurrItemAndOptionMenuCheck &= 0x7FFF; // turn off the "returning from options menu" flag + sCurrItemAndOptionMenuCheck &= CURRENT_ITEM_MASK; // turn off the "returning from options menu" flag tCurrItem = sCurrItemAndOptionMenuCheck; tItemCount = tMenuType + 2; } @@ -637,6 +766,8 @@ static void Task_DisplayMainMenu(u8 taskId) palette = RGB(26, 26, 25); LoadPalette(&palette, 252, 2); + // Note: If there is no save file, the save block is zeroed out, + // so the default gender is MALE. if (gSaveBlock2Ptr->playerGender == MALE) { palette = RGB(4, 16, 31); @@ -813,14 +944,14 @@ static void Task_HandleMainMenuAPressed(u8 taskId) { if (gTasks[taskId].tMenuType == HAS_MYSTERY_EVENTS) RemoveScrollIndicatorArrowPair(gTasks[taskId].tScrollArrowTaskId); - sub_819746C(0, 1); - sub_819746C(1, 1); - sub_819746C(2, 1); - sub_819746C(3, 1); - sub_819746C(4, 1); - sub_819746C(5, 1); - sub_819746C(6, 1); - sub_819746C(7, 1); + ClearWindowAndBorder(0, TRUE); + ClearWindowAndBorder(1, TRUE); + ClearWindowAndBorder(2, TRUE); + ClearWindowAndBorder(3, TRUE); + ClearWindowAndBorder(4, TRUE); + ClearWindowAndBorder(5, TRUE); + ClearWindowAndBorder(6, TRUE); + ClearWindowAndBorder(7, TRUE); wirelessAdapterConnected = IsWirelessAdapterConnected(); switch (gTasks[taskId].tMenuType) { @@ -973,7 +1104,7 @@ static void Task_HandleMainMenuAPressed(u8 taskId) if (action != ACTION_OPTION) sCurrItemAndOptionMenuCheck = 0; else - sCurrItemAndOptionMenuCheck |= 0x8000; // entering the options menu + sCurrItemAndOptionMenuCheck |= OPTION_MENU_FLAG; // entering the options menu } } @@ -981,7 +1112,7 @@ static void Task_HandleMainMenuBPressed(u8 taskId) { if (!gPaletteFade.active) { - if (gTasks[taskId].tMenuType == 3) + if (gTasks[taskId].tMenuType == HAS_MYSTERY_EVENTS) RemoveScrollIndicatorArrowPair(gTasks[taskId].tScrollArrowTaskId); sCurrItemAndOptionMenuCheck = 0; FreeAllWindowBuffers(); @@ -1199,7 +1330,7 @@ static void Task_NewGameBirchSpeech_WaitForSpriteFadeInWelcome(u8 taskId) } else { - InitWindows(gUnknown_082FF080); + InitWindows(gNewGameBirchSpeechTextWindows); LoadMainMenuWindowFrameTiles(0, 0xF3); LoadMessageBoxGfx(0, 0xFC, 0xF0); NewGameBirchSpeech_ShowDialogueWindow(0, 1); @@ -1642,7 +1773,7 @@ static void Task_NewGameBirchSpeech_FadePlayerToWhite(u8 taskId) if (!gPaletteFade.active) { spriteId = gTasks[taskId].tPlayerSpriteId; - gSprites[spriteId].callback = nullsub_11; + gSprites[spriteId].callback = SpriteCB_Null; SetGpuReg(REG_OFFSET_DISPCNT, DISPCNT_OBJ_ON | DISPCNT_OBJ_1D_MAP); BeginNormalPaletteFade(0xFFFF0000, 0, 0, 16, RGB_WHITEALPHA); gTasks[taskId].func = Task_NewGameBirchSpeech_Cleanup; @@ -1730,14 +1861,14 @@ static void CB2_NewGameBirchSpeech_ReturnFromNamingScreen(void) REG_IME = savedIme; SetVBlankCallback(VBlankCB_MainMenu); SetMainCallback2(CB2_MainMenu); - InitWindows(gUnknown_082FF080); + InitWindows(gNewGameBirchSpeechTextWindows); LoadMainMenuWindowFrameTiles(0, 0xF3); LoadMessageBoxGfx(0, 0xFC, 0xF0); PutWindowTilemap(0); CopyWindowToVram(0, 3); } -static void nullsub_11(struct Sprite *sprite) +static void SpriteCB_Null(struct Sprite *sprite) { } @@ -1763,22 +1894,22 @@ static void AddBirchSpeechObjects(u8 taskId) u8 maySpriteId; birchSpriteId = AddNewGameBirchObject(0x88, 0x3C, 1); - gSprites[birchSpriteId].callback = nullsub_11; + gSprites[birchSpriteId].callback = SpriteCB_Null; gSprites[birchSpriteId].oam.priority = 0; gSprites[birchSpriteId].invisible = TRUE; gTasks[taskId].tBirchSpriteId = birchSpriteId; lotadSpriteId = NewGameBirchSpeech_CreateLotadSprite(100, 0x4B); - gSprites[lotadSpriteId].callback = nullsub_11; + gSprites[lotadSpriteId].callback = SpriteCB_Null; gSprites[lotadSpriteId].oam.priority = 0; gSprites[lotadSpriteId].invisible = TRUE; gTasks[taskId].tLotadSpriteId = lotadSpriteId; brendanSpriteId = CreateTrainerSprite(FacilityClassToPicIndex(FACILITY_CLASS_BRENDAN), 120, 60, 0, &gDecompressionBuffer[0]); - gSprites[brendanSpriteId].callback = nullsub_11; + gSprites[brendanSpriteId].callback = SpriteCB_Null; gSprites[brendanSpriteId].invisible = TRUE; gSprites[brendanSpriteId].oam.priority = 0; gTasks[taskId].tBrendanSpriteId = brendanSpriteId; maySpriteId = CreateTrainerSprite(FacilityClassToPicIndex(FACILITY_CLASS_MAY), 120, 60, 0, &gDecompressionBuffer[0x800]); - gSprites[maySpriteId].callback = nullsub_11; + gSprites[maySpriteId].callback = SpriteCB_Null; gSprites[maySpriteId].invisible = TRUE; gSprites[maySpriteId].oam.priority = 0; gTasks[taskId].tMaySpriteId = maySpriteId; @@ -1966,8 +2097,8 @@ static void NewGameBirchSpeech_StartFadePlatformOut(u8 taskId, u8 delay) static void NewGameBirchSpeech_ShowGenderMenu(void) { - DrawMainMenuWindowBorder(&gUnknown_082FF080[1], 0xF3); - FillWindowPixelBuffer(1, 17); + DrawMainMenuWindowBorder(&gNewGameBirchSpeechTextWindows[1], 0xF3); + FillWindowPixelBuffer(1, PIXEL_BUFFER_WHITE); PrintMenuTable(1, 2, sMenuActions_Gender); InitMenuInUpperLeftCornerPlaySoundWhenAPressed(1, 2, 0); PutWindowTilemap(1); @@ -1995,7 +2126,7 @@ static void NewGameBirchSpeech_SetDefaultPlayerName(u8 nameId) static void CreateMainMenuErrorWindow(const u8* str) { - FillWindowPixelBuffer(7, 17); + FillWindowPixelBuffer(7, PIXEL_BUFFER_WHITE); AddTextPrinterParameterized(7, 1, str, 0, 1, 2, 0); PutWindowTilemap(7); CopyWindowToVram(7, 2); @@ -2105,12 +2236,12 @@ static void NewGameBirchSpeech_ClearGenderWindowTilemap(u8 a, u8 b, u8 c, u8 d, FillBgTilemapBufferRect(a, 0, b + 0xFF, c + 0xFF, d + 2, e + 2, 2); } -static void NewGameBirchSpeech_ClearGenderWindow(u8 windowId, u8 a) +static void NewGameBirchSpeech_ClearGenderWindow(u8 windowId, bool8 copyToVram) { CallWindowFunction(windowId, NewGameBirchSpeech_ClearGenderWindowTilemap); - FillWindowPixelBuffer(windowId, 0x11); + FillWindowPixelBuffer(windowId, PIXEL_BUFFER_WHITE); ClearWindowTilemap(windowId); - if (a == 1) + if (copyToVram == TRUE) CopyWindowToVram(windowId, 3); } @@ -2146,7 +2277,7 @@ void CreateYesNoMenuParameterized(u8 a, u8 b, u16 c, u16 d, u8 e, u8 f) static void NewGameBirchSpeech_ShowDialogueWindow(u8 windowId, u8 copyToVram) { CallWindowFunction(windowId, NewGameBirchSpeech_CreateDialogueWindowBorder); - FillWindowPixelBuffer(windowId, 17); + FillWindowPixelBuffer(windowId, PIXEL_BUFFER_WHITE); PutWindowTilemap(windowId); if (copyToVram == TRUE) CopyWindowToVram(windowId, 3); diff --git a/src/map_name_popup.c b/src/map_name_popup.c index cdb4c3330d..30b04c21d0 100644 --- a/src/map_name_popup.c +++ b/src/map_name_popup.c @@ -276,7 +276,7 @@ static void Task_MapNamePopUpWindow(u8 taskId) } break; case 4: - sub_819746C(GetMapNamePopUpWindowId(), TRUE); + ClearWindowAndBorder(GetMapNamePopUpWindowId(), TRUE); task->data[0] = 5; break; case 5: @@ -290,7 +290,7 @@ void HideMapNamePopUpWindow(void) { if (FuncIsActiveTask(Task_MapNamePopUpWindow)) { - sub_819746C(GetMapNamePopUpWindowId(), TRUE); + ClearWindowAndBorder(GetMapNamePopUpWindowId(), TRUE); RemoveMapNamePopUpWindow(); SetGpuReg_ForcedBlank(REG_OFFSET_BG0VOFS, 0); DestroyTask(sPopupTaskId); diff --git a/src/menu.c b/src/menu.c index ae589dff4c..9a9cec9ddb 100644 --- a/src/menu.c +++ b/src/menu.c @@ -126,8 +126,8 @@ const struct MoveMenuInfoIcon gMoveMenuInfoIcons[] = extern void sub_81973A4(void); extern void DrawStandardFrame(u8, u8, u8, u8, u8, u8); extern void DrawDialogueFrame(u8, u8, u8, u8, u8, u8); -extern void sub_81977BC(u8, u8, u8, u8, u8, u8); -extern void sub_8197804(u8, u8, u8, u8, u8, u8); +extern void ClearWindowAndBorderTilemap(u8, u8, u8, u8, u8, u8); +extern void ClearWindowAndWideBorderTilemap(u8, u8, u8, u8, u8, u8); extern void sub_8197BB4(u8, u8, u8, u8, u8, u8); extern void sub_8197E30(u8, u8, u8, u8, u8, u8); extern void DrawWindowBorder(u8, u8, u8, u8, u8, u8); @@ -213,7 +213,7 @@ void sub_81973A4(void) void NewMenuHelpers_DrawDialogueFrame(u8 windowId, bool8 copyToVram) { CallWindowFunction(windowId, DrawDialogueFrame); - FillWindowPixelBuffer(windowId, 0x11); + FillWindowPixelBuffer(windowId, PIXEL_BUFFER_WHITE); PutWindowTilemap(windowId); if (copyToVram == TRUE) CopyWindowToVram(windowId, 3); @@ -222,25 +222,25 @@ void NewMenuHelpers_DrawDialogueFrame(u8 windowId, bool8 copyToVram) void NewMenuHelpers_DrawStdWindowFrame(u8 windowId, bool8 copyToVram) { CallWindowFunction(windowId, DrawStandardFrame); - FillWindowPixelBuffer(windowId, 0x11); + FillWindowPixelBuffer(windowId, PIXEL_BUFFER_WHITE); PutWindowTilemap(windowId); if (copyToVram == TRUE) CopyWindowToVram(windowId, 3); } -void sub_8197434(u8 windowId, bool8 copyToVram) +void ClearWindowAndWideBorder(u8 windowId, bool8 copyToVram) { - CallWindowFunction(windowId, sub_8197804); - FillWindowPixelBuffer(windowId, 0x11); + CallWindowFunction(windowId, ClearWindowAndWideBorderTilemap); + FillWindowPixelBuffer(windowId, PIXEL_BUFFER_WHITE); ClearWindowTilemap(windowId); if (copyToVram == TRUE) CopyWindowToVram(windowId, 3); } -void sub_819746C(u8 windowId, bool8 copyToVram) +void ClearWindowAndBorder(u8 windowId, bool8 copyToVram) { - CallWindowFunction(windowId, sub_81977BC); - FillWindowPixelBuffer(windowId, 0x11); + CallWindowFunction(windowId, ClearWindowAndBorderTilemap); + FillWindowPixelBuffer(windowId, PIXEL_BUFFER_WHITE); ClearWindowTilemap(windowId); if (copyToVram == TRUE) CopyWindowToVram(windowId, 3); @@ -408,14 +408,17 @@ void DrawDialogueFrame(u8 bg, u8 tilemapLeft, u8 tilemapTop, u8 width, u8 height DLG_WINDOW_PALETTE_NUM); } -void sub_81977BC(u8 bg, u8 tilemapLeft, u8 tilemapTop, u8 width, u8 height, u8 paletteNum) +// Clears the given window, and a 1-tile border around the window, to transparent tiles. +void ClearWindowAndBorderTilemap(u8 bg, u8 tilemapLeft, u8 tilemapTop, u8 width, u8 height, u8 paletteNum) { - FillBgTilemapBufferRect(bg, 0, tilemapLeft - 1, tilemapTop - 1, width + 2, height + 2, STD_WINDOW_PALETTE_NUM); + FillBgTilemapBufferRect(bg, TRANSPARENT_TILE_NUMBER, tilemapLeft - 1, tilemapTop - 1, width + 2, height + 2, STD_WINDOW_PALETTE_NUM); } -void sub_8197804(u8 bg, u8 tilemapLeft, u8 tilemapTop, u8 width, u8 height, u8 paletteNum) +// Clears the given window, and a 1-tile border the top and bottom, plus a 3-tile border on the left and right. +// Tiles are set to a transparent tile. +void ClearWindowAndWideBorderTilemap(u8 bg, u8 tilemapLeft, u8 tilemapTop, u8 width, u8 height, u8 paletteNum) { - FillBgTilemapBufferRect(bg, 0, tilemapLeft - 3, tilemapTop - 1, width + 6, height + 2, STD_WINDOW_PALETTE_NUM); + FillBgTilemapBufferRect(bg, TRANSPARENT_TILE_NUMBER, tilemapLeft - 3, tilemapTop - 1, width + 6, height + 2, STD_WINDOW_PALETTE_NUM); } void SetStandardWindowBorderStyle(u8 windowId, bool8 copyToVram) @@ -554,7 +557,7 @@ void sub_8197B1C(u8 windowId, bool8 copyToVram, u16 tileNum, u8 paletteNum) sTileNum = tileNum; sPaletteNum = paletteNum; CallWindowFunction(windowId, sub_8197BB4); - FillWindowPixelBuffer(windowId, 0x11); + FillWindowPixelBuffer(windowId, PIXEL_BUFFER_WHITE); PutWindowTilemap(windowId); if (copyToVram == TRUE) CopyWindowToVram(windowId, 3); @@ -565,7 +568,7 @@ void sub_8197B64(u8 windowId, bool8 copyToVram, u16 tileNum) sTileNum = tileNum; sPaletteNum = GetWindowAttribute(windowId, WINDOW_PALETTE_NUM); CallWindowFunction(windowId, sub_8197BB4); - FillWindowPixelBuffer(windowId, 0x11); + FillWindowPixelBuffer(windowId, PIXEL_BUFFER_WHITE); PutWindowTilemap(windowId); if (copyToVram == TRUE) CopyWindowToVram(windowId, 3); @@ -669,7 +672,7 @@ void sub_8197BB4(u8 bg, u8 tilemapLeft, u8 tilemapTop, u8 width, u8 height, u8 p void sub_8197DF8(u8 windowId, bool8 copyToVram) { CallWindowFunction(windowId, sub_8197E30); - FillWindowPixelBuffer(windowId, 0); + FillWindowPixelBuffer(windowId, PIXEL_BUFFER_TRANSPARENT); ClearWindowTilemap(windowId); if (copyToVram == TRUE) CopyWindowToVram(windowId, 3); @@ -685,7 +688,7 @@ void SetWindowBorderStyle(u8 windowId, bool8 copyToVram, u16 baseTileNum, u8 pal sTileNum = baseTileNum; sPaletteNum = paletteNum; CallWindowFunction(windowId, DrawWindowBorder); - FillWindowPixelBuffer(windowId, 0x11); + FillWindowPixelBuffer(windowId, PIXEL_BUFFER_WHITE); PutWindowTilemap(windowId); if (copyToVram == TRUE) CopyWindowToVram(windowId, 3); @@ -696,7 +699,7 @@ void sub_8197EC8(u8 windowId, bool8 copyToVram, u16 baseTileNum) sTileNum = baseTileNum; sPaletteNum = GetWindowAttribute(windowId, WINDOW_PALETTE_NUM); CallWindowFunction(windowId, DrawWindowBorder); - FillWindowPixelBuffer(windowId, 0x11); + FillWindowPixelBuffer(windowId, PIXEL_BUFFER_WHITE); PutWindowTilemap(windowId); if (copyToVram == TRUE) CopyWindowToVram(windowId, 3); @@ -765,7 +768,7 @@ void DrawWindowBorder(u8 bg, u8 tilemapLeft, u8 tilemapTop, u8 width, u8 height, void sub_8198070(u8 windowId, bool8 copyToVram) { CallWindowFunction(windowId, sub_81980A8); - FillWindowPixelBuffer(windowId, 0); + FillWindowPixelBuffer(windowId, PIXEL_BUFFER_TRANSPARENT); ClearWindowTilemap(windowId); if (copyToVram == TRUE) CopyWindowToVram(windowId, 3); @@ -811,7 +814,7 @@ void sub_8198180(const u8 *string, u8 a2, bool8 copyToVram) if (sWindowId != 0xFF) { PutWindowTilemap(sWindowId); - FillWindowPixelBuffer(sWindowId, 0xFF); + FillWindowPixelBuffer(sWindowId, PIXEL_BUFFER_UNKNOWN); width = GetStringWidth(0, string, 0); AddTextPrinterParameterized3(sWindowId, 0, @@ -845,7 +848,7 @@ void sub_8198204(const u8 *string, const u8 *string2, u8 a3, u8 a4, bool8 copyTo color[2] = 2; } PutWindowTilemap(sWindowId); - FillWindowPixelBuffer(sWindowId, 0xFF); + FillWindowPixelBuffer(sWindowId, PIXEL_BUFFER_UNKNOWN); if (string2 != NULL) { width = GetStringWidth(0, string2, 0); @@ -873,7 +876,7 @@ void sub_81982F0(void) { if (sWindowId != 0xFF) { - FillWindowPixelBuffer(sWindowId, 0xFF); + FillWindowPixelBuffer(sWindowId, PIXEL_BUFFER_UNKNOWN); CopyWindowToVram(sWindowId, 3); } } @@ -882,7 +885,7 @@ void sub_8198314(void) { if (sWindowId != 0xFF) { - FillWindowPixelBuffer(sWindowId, 0); + FillWindowPixelBuffer(sWindowId, PIXEL_BUFFER_TRANSPARENT); ClearWindowTilemap(sWindowId); CopyWindowToVram(sWindowId, 3); RemoveWindow(sWindowId); diff --git a/src/money.c b/src/money.c index faf830637a..33dffdc75d 100644 --- a/src/money.c +++ b/src/money.c @@ -169,7 +169,7 @@ void DrawMoneyBox(int amount, u8 x, u8 y) SetWindowTemplateFields(&template, 0, x + 1, y + 1, 10, 2, 15, 8); sMoneyBoxWindowId = AddWindow(&template); - FillWindowPixelBuffer(sMoneyBoxWindowId, 0); + FillWindowPixelBuffer(sMoneyBoxWindowId, PIXEL_BUFFER_TRANSPARENT); PutWindowTilemap(sMoneyBoxWindowId); CopyWindowToVram(sMoneyBoxWindowId, 1); PrintMoneyAmountInMoneyBoxWithBorder(sMoneyBoxWindowId, 0x214, 14, amount); diff --git a/src/mystery_event_menu.c b/src/mystery_event_menu.c index 0de4675d92..c30fb9c1a0 100644 --- a/src/mystery_event_menu.c +++ b/src/mystery_event_menu.c @@ -90,7 +90,7 @@ void CB2_InitMysteryEventMenu(void) DeactivateAllTextPrinters(); for (i = 0; i < 2; i++) - FillWindowPixelBuffer(i, 0); + FillWindowPixelBuffer(i, PIXEL_BUFFER_TRANSPARENT); FillBgTilemapBufferRect_Palette0(0, 0, 0, 0, 0x1E, 0x14); LoadUserWindowBorderGfx(0, 1u, 0xD0u); diff --git a/src/naming_screen.c b/src/naming_screen.c index c310ceb9fb..cb53604df9 100644 --- a/src/naming_screen.c +++ b/src/naming_screen.c @@ -1474,7 +1474,7 @@ static void HandleDpadMovement(struct Task *task) static void sub_80E4894(void) { - FillWindowPixelBuffer(gNamingScreenData->windows[3], 0x11); + FillWindowPixelBuffer(gNamingScreenData->windows[3], PIXEL_BUFFER_WHITE); AddTextPrinterParameterized(gNamingScreenData->windows[3], 1, gNamingScreenData->template->title, 8, 1, 0, 0); PutWindowTilemap(gNamingScreenData->windows[3]); } @@ -1485,7 +1485,7 @@ static void sub_80E48E8(void) StringCopy(buffer, gSpeciesNames[gNamingScreenData->monSpecies]); StringAppendN(buffer, gNamingScreenData->template->title, 15); - FillWindowPixelBuffer(gNamingScreenData->windows[3], 0x11); + FillWindowPixelBuffer(gNamingScreenData->windows[3], PIXEL_BUFFER_WHITE); AddTextPrinterParameterized(gNamingScreenData->windows[3], 1, buffer, 8, 1, 0, 0); PutWindowTilemap(gNamingScreenData->windows[3]); } @@ -1672,7 +1672,7 @@ static void sub_80E4D10(void) u8 maxChars = gNamingScreenData->template->maxChars; u16 unk = gNamingScreenData->inputCharBaseXPos - 0x40; - FillWindowPixelBuffer(gNamingScreenData->windows[2], 0x11); + FillWindowPixelBuffer(gNamingScreenData->windows[2], PIXEL_BUFFER_WHITE); for (i = 0; i < maxChars; i++) { @@ -1766,7 +1766,7 @@ static void sub_80E4EF0(void) { const u8 color[3] = { 15, 1, 2 }; - FillWindowPixelBuffer(gNamingScreenData->windows[4], 0xFF); + FillWindowPixelBuffer(gNamingScreenData->windows[4], PIXEL_BUFFER_UNKNOWN); AddTextPrinterParameterized3(gNamingScreenData->windows[4], 0, 2, 1, color, 0, gText_MoveOkBack); PutWindowTilemap(gNamingScreenData->windows[4]); CopyWindowToVram(gNamingScreenData->windows[4], 3); diff --git a/src/option_menu.c b/src/option_menu.c index 122ba8d8af..6ffc4de500 100644 --- a/src/option_menu.c +++ b/src/option_menu.c @@ -620,7 +620,7 @@ static void ButtonMode_DrawChoices(u8 selection) static void DrawTextOption(void) { - FillWindowPixelBuffer(WIN_TEXT_OPTION, 0x11); + FillWindowPixelBuffer(WIN_TEXT_OPTION, PIXEL_BUFFER_WHITE); AddTextPrinterParameterized(WIN_TEXT_OPTION, 1, gText_Option, 8, 1, TEXT_SPEED_FF, NULL); CopyWindowToVram(WIN_TEXT_OPTION, 3); } @@ -629,7 +629,7 @@ static void DrawOptionMenuTexts(void) { u8 i; - FillWindowPixelBuffer(WIN_OPTIONS, 0x11); + FillWindowPixelBuffer(WIN_OPTIONS, PIXEL_BUFFER_WHITE); for (i = 0; i < MENUITEM_COUNT; i++) { AddTextPrinterParameterized(WIN_OPTIONS, 1, sOptionMenuItemsNames[i], 8, (i * 16) + 1, TEXT_SPEED_FF, NULL); diff --git a/src/party_menu.c b/src/party_menu.c index 15b5d24d8e..d2a4d09f2e 100755 --- a/src/party_menu.c +++ b/src/party_menu.c @@ -3108,7 +3108,7 @@ static void sub_81B239C(u8 a) } DeactivateAllTextPrinters(); for (i = 0; i < PARTY_SIZE; i++) - FillWindowPixelBuffer(i, 0); + FillWindowPixelBuffer(i, PIXEL_BUFFER_TRANSPARENT); LoadUserWindowBorderGfx(0, 0x4F, 0xD0); LoadPalette(GetOverworldTextboxPalettePtr(), 0xE0, 0x20); LoadPalette(gUnknown_0860F074, 0xF0, 0x20); @@ -3126,7 +3126,7 @@ static void sub_81B2428(bool8 a) if (a == TRUE) { firstWindowId = AddWindow(&gUnknown_08615918); - FillWindowPixelBuffer(firstWindowId, 0); + FillWindowPixelBuffer(firstWindowId, PIXEL_BUFFER_TRANSPARENT); mainOffset = GetStringCenterAlignXOffset(0, gMenuText_Confirm, 48); AddTextPrinterParameterized4(firstWindowId, 0, mainOffset, 1, 0, 0, gUnknown_086157FC[0], -1, gMenuText_Confirm); PutWindowTilemap(firstWindowId); @@ -3139,7 +3139,7 @@ static void sub_81B2428(bool8 a) windowId = AddWindow(&gUnknown_08615908); offset = 3; } - FillWindowPixelBuffer(windowId, 0); + FillWindowPixelBuffer(windowId, PIXEL_BUFFER_TRANSPARENT); if (gUnknown_0203CEC8.unk8_0 != 10) { mainOffset = GetStringCenterAlignXOffset(0, gText_Cancel, 48); diff --git a/src/player_pc.c b/src/player_pc.c index 0d08a5e7b2..9d1b2f788a 100644 --- a/src/player_pc.c +++ b/src/player_pc.c @@ -403,7 +403,7 @@ static void PlayerPC_Mailbox(u8 taskId) ItemStorage_SetItemAndMailCount(taskId); if (sub_81D1C44(playerPCItemPageInfo.count) == TRUE) { - sub_8197434(0, 0); + ClearWindowAndWideBorder(0, 0); Mailbox_DrawMailboxMenu(taskId); gTasks[taskId].func = Mailbox_ProcessInput; } @@ -560,7 +560,7 @@ static void ItemStorage_WithdrawToss_Helper(u8 taskId, bool8 toss) FreeAndReserveObjectSpritePalettes(); LoadListMenuArrowsGfx(); sub_8122344(gUnknown_0203BCC4->spriteIds, 7); - sub_8197434(0,0); + ClearWindowAndWideBorder(0,0); gTasks[taskId].func = ItemStorage_ProcessWithdrawTossInput; } @@ -863,7 +863,7 @@ static void Mailbox_NoPokemonForMail(u8 taskId) static void Mailbox_Cancel(u8 taskId) { sub_81D1D04(2); - sub_8197434(0, 0); + ClearWindowAndWideBorder(0, 0); Mailbox_DrawMailboxMenu(taskId); schedule_bg_copy_tilemap_to_vram(0); gTasks[taskId].func = Mailbox_ProcessInput; @@ -977,7 +977,7 @@ static void sub_816BEF0(s32 id) description = (u8 *)ItemId_GetDescription(gSaveBlock1Ptr->pcItems[id].itemId); else description = ItemStorage_GetItemPcResponse(ITEMPC_GO_BACK_TO_PREV); - FillWindowPixelBuffer(windowId, 17); + FillWindowPixelBuffer(windowId, PIXEL_BUFFER_WHITE); AddTextPrinterParameterized(windowId, 1, description, 0, 1, 0, NULL); } @@ -1123,7 +1123,7 @@ static const u8* ItemStorage_GetItemPcResponse(u16 itemId) static void ItemStorage_PrintItemPcResponse(const u8 *string) { u8 windowId = gUnknown_0203BCC4->windowIds[1]; - FillWindowPixelBuffer(windowId, 0x11); + FillWindowPixelBuffer(windowId, PIXEL_BUFFER_WHITE); StringExpandPlaceholders(gStringVar4, string); AddTextPrinterParameterized(windowId, 1, gStringVar4, 0, 1, 0, NULL); } diff --git a/src/pokeblock.c b/src/pokeblock.c index 3fd4f34df4..31eaf3540c 100644 --- a/src/pokeblock.c +++ b/src/pokeblock.c @@ -665,7 +665,7 @@ static void HandleInitWindows(void) for (i = 0; i < ARRAY_COUNT(sWindowTemplatesForPokeblockMenu) - 1; i++) { - FillWindowPixelBuffer(i, 0); + FillWindowPixelBuffer(i, PIXEL_BUFFER_TRANSPARENT); } schedule_bg_copy_tilemap_to_vram(0); @@ -749,7 +749,7 @@ static void sub_8135FCC(s32 pkblId) struct Pokeblock *pokeblock; u16 rectTilemapSrc[2]; - FillWindowPixelBuffer(7, 0); + FillWindowPixelBuffer(7, PIXEL_BUFFER_TRANSPARENT); if (pkblId != LIST_B_PRESSED) { diff --git a/src/pokeblock_feed.c b/src/pokeblock_feed.c index b1f182b660..1ad0920d3f 100644 --- a/src/pokeblock_feed.c +++ b/src/pokeblock_feed.c @@ -704,7 +704,7 @@ static void HandleInitWindows(void) DeactivateAllTextPrinters(); LoadUserWindowBorderGfx(0, 1, 0xE0); LoadPalette(gUnknown_0860F074, 0xF0, 0x20); - FillWindowPixelBuffer(0, 0); + FillWindowPixelBuffer(0, PIXEL_BUFFER_TRANSPARENT); PutWindowTilemap(0); schedule_bg_copy_tilemap_to_vram(0); } diff --git a/src/pokedex.c b/src/pokedex.c index c47ada5b8b..3067771f2a 100644 --- a/src/pokedex.c +++ b/src/pokedex.c @@ -2926,7 +2926,7 @@ void sub_80BEA24(u8 taskId) case 1: DecompressAndLoadBgGfxUsingHeap(3, gPokedexMenu_Gfx, 0x2000, 0, 0); CopyToBgTilemapBuffer(3, gPokedexTilemap_DescriptionScreen, 0, 0); - FillWindowPixelBuffer(0, 0); + FillWindowPixelBuffer(0, PIXEL_BUFFER_TRANSPARENT); PutWindowTilemap(0); PutWindowTilemap(1); sub_80C0D30(1, sPokedexListItem->dexNum); @@ -3221,7 +3221,7 @@ void sub_80BF250(u8 taskId) case 1: DecompressAndLoadBgGfxUsingHeap(3, &gPokedexMenu_Gfx, 0x2000, 0, 0); CopyToBgTilemapBuffer(3, &gPokedexTilemap_CryScreen, 0, 0); - FillWindowPixelBuffer(0, 0); + FillWindowPixelBuffer(0, PIXEL_BUFFER_TRANSPARENT); PutWindowTilemap(0); PutWindowTilemap(3); PutWindowTilemap(2); @@ -3415,7 +3415,7 @@ void sub_80BF82C(u8 taskId) case 1: DecompressAndLoadBgGfxUsingHeap(3, gPokedexMenu_Gfx, 0x2000, 0, 0); CopyToBgTilemapBuffer(3, gPokedexTilemap_SizeScreen, 0, 0); - FillWindowPixelBuffer(0, 0); + FillWindowPixelBuffer(0, PIXEL_BUFFER_TRANSPARENT); PutWindowTilemap(0); gMain.state++; break; @@ -3762,7 +3762,7 @@ void sub_80BFE38(u8 taskId) case 1: DecompressAndLoadBgGfxUsingHeap(3, gPokedexMenu_Gfx, 0x2000, 0, 0); CopyToBgTilemapBuffer(3, gPokedexTilemap_DescriptionScreen, 0, 0); - FillWindowPixelBuffer(0, 0); + FillWindowPixelBuffer(0, PIXEL_BUFFER_TRANSPARENT); PutWindowTilemap(0); PutWindowTilemap(1); sub_80C0D30(1, gTasks[taskId].data[1]); diff --git a/src/pokemon_storage_system.c b/src/pokemon_storage_system.c index c0aec4dddd..12f41d4d01 100644 --- a/src/pokemon_storage_system.c +++ b/src/pokemon_storage_system.c @@ -1218,7 +1218,7 @@ static const u16 gWallpaperPalettes_Plain[][16] = static const u32 gWallpaperTiles_Plain[] = INCBIN_U32("graphics/pokemon_storage/plain.4bpp.lz"); static const u32 gWallpaperTilemap_Plain[] = INCBIN_U32("graphics/pokemon_storage/plain.bin.lz"); -// 12×18 tilemap +// 12�18 tilemap static const u32 gUnknown_085773C4[] = INCBIN_U32("graphics/unused/tilemap_5773C4.bin"); static const u16 gUnknown_08577574[][2] = @@ -1737,7 +1737,7 @@ static void Task_PokemonStorageSystemPC(u8 taskId) CreatePCMenu(task->data[1], &task->data[15]); sub_81973A4(); NewMenuHelpers_DrawDialogueFrame(0, 0); - FillWindowPixelBuffer(0, 0x11); + FillWindowPixelBuffer(0, PIXEL_BUFFER_WHITE); AddTextPrinterParameterized2(0, 1, gUnknown_085716C0[task->data[1]].desc, TEXT_SPEED_FF, NULL, 2, 1, 3); CopyWindowToVram(0, 3); CopyWindowToVram(task->data[15], 3); @@ -1763,13 +1763,13 @@ static void Task_PokemonStorageSystemPC(u8 taskId) if (task->data[1] != task->data[3]) { task->data[1] = task->data[3]; - FillWindowPixelBuffer(0, 0x11); + FillWindowPixelBuffer(0, PIXEL_BUFFER_WHITE); AddTextPrinterParameterized2(0, 1, gUnknown_085716C0[task->data[1]].desc, 0, NULL, 2, 1, 3); } break; case MENU_B_PRESSED: case 4: - sub_819746C(task->data[15], TRUE); + ClearWindowAndBorder(task->data[15], TRUE); ScriptContext2_Disable(); EnableBothScriptContexts(); RemoveWindow(task->data[15]); @@ -1778,13 +1778,13 @@ static void Task_PokemonStorageSystemPC(u8 taskId) default: if (task->data[2] == 0 && CountPartyMons() == PARTY_SIZE) { - FillWindowPixelBuffer(0, 0x11); + FillWindowPixelBuffer(0, PIXEL_BUFFER_WHITE); AddTextPrinterParameterized2(0, 1, gText_PartyFull, 0, NULL, 2, 1, 3); task->data[0] = 3; } else if (task->data[2] == 1 && CountPartyMons() == 1) { - FillWindowPixelBuffer(0, 0x11); + FillWindowPixelBuffer(0, PIXEL_BUFFER_WHITE); AddTextPrinterParameterized2(0, 1, gText_JustOnePkmn, 0, NULL, 2, 1, 3); task->data[0] = 3; } @@ -1799,7 +1799,7 @@ static void Task_PokemonStorageSystemPC(u8 taskId) case 3: if (gMain.newKeys & (A_BUTTON | B_BUTTON)) { - FillWindowPixelBuffer(0, 0x11); + FillWindowPixelBuffer(0, PIXEL_BUFFER_WHITE); AddTextPrinterParameterized2(0, 1, gUnknown_085716C0[task->data[1]].desc, 0, NULL, 2, 1, 3); task->data[0] = 2; } @@ -1809,7 +1809,7 @@ static void Task_PokemonStorageSystemPC(u8 taskId) task->data[1] = 4; Menu_MoveCursor(-1); task->data[1] = Menu_GetCursorPos(); - FillWindowPixelBuffer(0, 0x11); + FillWindowPixelBuffer(0, PIXEL_BUFFER_WHITE); AddTextPrinterParameterized2(0, 1, gUnknown_085716C0[task->data[1]].desc, 0, NULL, 2, 1, 3); task->data[0] = 2; } @@ -1819,7 +1819,7 @@ static void Task_PokemonStorageSystemPC(u8 taskId) task->data[1] = 0; Menu_MoveCursor(1); task->data[1] = Menu_GetCursorPos(); - FillWindowPixelBuffer(0, 0x11); + FillWindowPixelBuffer(0, PIXEL_BUFFER_WHITE); AddTextPrinterParameterized2(0, 1, gUnknown_085716C0[task->data[1]].desc, 0, NULL, 2, 1, 3); task->data[0] = 2; } @@ -4107,7 +4107,7 @@ static void LoadCursorMonGfx(u16 species, u32 pid) static void PrintCursorMonInfo(void) { - FillWindowPixelBuffer(0, 0x11); + FillWindowPixelBuffer(0, PIXEL_BUFFER_WHITE); if (sPSSData->boxOption != BOX_OPTION_MOVE_ITEMS) { AddTextPrinterParameterized(0, 1, sPSSData->cursorMonNickText, 6, 0, TEXT_SPEED_FF, NULL); @@ -4416,7 +4416,7 @@ static void PrintStorageActionText(u8 id) } DynamicPlaceholderTextUtil_ExpandPlaceholders(sPSSData->field_2190, gPCStorageActionTexts[id].text); - FillWindowPixelBuffer(1, 0x11); + FillWindowPixelBuffer(1, PIXEL_BUFFER_WHITE); AddTextPrinterParameterized(1, 1, sPSSData->field_2190, 0, 1, TEXT_SPEED_FF, NULL); sub_8098858(1, 2, 14); PutWindowTilemap(1); @@ -8835,7 +8835,7 @@ static bool8 sub_80D0164(void) sPSSData->field_2200 = AddWindow8Bit(&gUnknown_0857BB1C); if (sPSSData->field_2200 != 0xFF) { - FillWindowPixelBuffer(sPSSData->field_2200, 0); + FillWindowPixelBuffer(sPSSData->field_2200, PIXEL_BUFFER_TRANSPARENT); return TRUE; } } @@ -9911,7 +9911,7 @@ static void PrintItemDescription(void) else description = ItemId_GetDescription(sPSSData->cursorMonItem); - FillWindowPixelBuffer(2, 0x11); + FillWindowPixelBuffer(2, PIXEL_BUFFER_WHITE); AddTextPrinterParameterized5(2, 1, description, 4, 0, 0, NULL, 0, 1); } diff --git a/src/pokemon_summary_screen.c b/src/pokemon_summary_screen.c index 46bdc9ef36..7985a1964e 100644 --- a/src/pokemon_summary_screen.c +++ b/src/pokemon_summary_screen.c @@ -2631,7 +2631,7 @@ static void ResetWindows(void) for (i = 0; i < 20; i++) { - FillWindowPixelBuffer(i, 0); + FillWindowPixelBuffer(i, PIXEL_BUFFER_TRANSPARENT); } for (i = 0; i < ARRAY_COUNT(pssData->windowIds); i++) { @@ -2646,9 +2646,9 @@ static void SummaryScreen_PrintTextOnWindow(u8 windowId, const u8 *string, u8 x, static void sub_81C25E8(void) { - FillWindowPixelBuffer(17, 0); - FillWindowPixelBuffer(18, 0); - FillWindowPixelBuffer(19, 0); + FillWindowPixelBuffer(17, PIXEL_BUFFER_TRANSPARENT); + FillWindowPixelBuffer(18, PIXEL_BUFFER_TRANSPARENT); + FillWindowPixelBuffer(19, PIXEL_BUFFER_TRANSPARENT); if (!pssData->summary.isEgg) sub_81C2628(); else @@ -2899,7 +2899,7 @@ static u8 AddWindowFromTemplateList(const struct WindowTemplate *template, u8 te if (*windowIdPtr == 0xFF) { *windowIdPtr = AddWindow(&template[templateId]); - FillWindowPixelBuffer(*windowIdPtr, 0); + FillWindowPixelBuffer(*windowIdPtr, PIXEL_BUFFER_TRANSPARENT); } return *windowIdPtr; } @@ -2921,7 +2921,7 @@ static void PrintPageSpecificText(u8 pageIndex) for (i = 0; i < ARRAY_COUNT(pssData->windowIds); i++) { if (pssData->windowIds[i] != 0xFF) - FillWindowPixelBuffer(pssData->windowIds[i], 0); + FillWindowPixelBuffer(pssData->windowIds[i], PIXEL_BUFFER_TRANSPARENT); } sTextPrinterFunctions[pageIndex](); } @@ -3568,7 +3568,7 @@ static void PrintContestMoveDescription(u8 moveSlot) static void PrintMoveDetails(u16 move) { u8 windowId = AddWindowFromTemplateList(gUnknown_0861CD14, 2); - FillWindowPixelBuffer(windowId, 0); + FillWindowPixelBuffer(windowId, PIXEL_BUFFER_TRANSPARENT); if (move != MOVE_NONE) { if (pssData->currPageIndex == 2) @@ -3642,7 +3642,7 @@ static void sub_81C40A0(u8 moveIndex1, u8 moveIndex2) static void PrintHMMovesCantBeForgotten(void) { u8 windowId = AddWindowFromTemplateList(gUnknown_0861CD14, 2); - FillWindowPixelBuffer(windowId, 0); + FillWindowPixelBuffer(windowId, PIXEL_BUFFER_TRANSPARENT); SummaryScreen_PrintTextOnWindow(windowId, gText_HMMovesCantBeForgotten2, 6, 1, 0, 0); } diff --git a/src/record_mixing.c b/src/record_mixing.c index 1890336858..5b106a1842 100644 --- a/src/record_mixing.c +++ b/src/record_mixing.c @@ -370,7 +370,7 @@ static void Task_RecordMixing_Main(u8 taskId) { CreateTask(sub_80AF2B4, 10); } - sub_8197434(0, 1); + ClearWindowAndWideBorder(0, 1); DestroyTask(taskId); EnableBothScriptContexts(); } diff --git a/src/region_map.c b/src/region_map.c index ff0c191673..e69889584c 100644 --- a/src/region_map.c +++ b/src/region_map.c @@ -1707,7 +1707,7 @@ static void sub_8124904(void) } else { - FillWindowPixelBuffer(0, 0x11); + FillWindowPixelBuffer(0, PIXEL_BUFFER_WHITE); } AddTextPrinterParameterized(0, 1, sFlyMap->regionMap.mapSecName, 0, 1, 0, NULL); schedule_bg_copy_tilemap_to_vram(0); @@ -1721,7 +1721,7 @@ static void sub_8124904(void) sub_8198070(1, FALSE); SetWindowBorderStyle(0, FALSE, 0x65, 0x0d); } - FillWindowPixelBuffer(0, 0x11); + FillWindowPixelBuffer(0, PIXEL_BUFFER_WHITE); CopyWindowToVram(0, 2); schedule_bg_copy_tilemap_to_vram(0); gUnknown_03001180 = FALSE; diff --git a/src/rom_8011DC0.c b/src/rom_8011DC0.c index 9bdd861674..e3003b22e3 100644 --- a/src/rom_8011DC0.c +++ b/src/rom_8011DC0.c @@ -387,7 +387,7 @@ void nullsub_89(void) void sub_80124EC(u8 windowId, u8 arg1, u8 stringId) { - FillWindowPixelBuffer(windowId, 0x11); + FillWindowPixelBuffer(windowId, PIXEL_BUFFER_WHITE); switch (arg1 << 8) { case 0x200: @@ -786,10 +786,10 @@ void sub_8012780(u8 taskId) void sub_8012F64(struct UnkStruct_Leader *data) { ClearWindowTilemap(data->field_11); - sub_819746C(data->field_11, FALSE); + ClearWindowAndBorder(data->field_11, FALSE); DestroyListMenuTask(data->listTaskId, 0, 0); ClearWindowTilemap(data->field_10); - sub_819746C(data->listWindowId, FALSE); + ClearWindowAndBorder(data->listWindowId, FALSE); CopyBgTilemapBufferToVram(0); RemoveWindow(data->field_11); RemoveWindow(data->listWindowId); @@ -1254,10 +1254,10 @@ void sub_80134E8(u8 taskId) case 18: case 20: ClearWindowTilemap(data->field_D); - sub_819746C(data->field_D, FALSE); + ClearWindowAndBorder(data->field_D, FALSE); DestroyListMenuTask(data->listTaskId, 0, 0); ClearWindowTilemap(data->field_C); - sub_819746C(data->listWindowId, FALSE); + ClearWindowAndBorder(data->listWindowId, FALSE); CopyBgTilemapBufferToVram(0); RemoveWindow(data->field_D); RemoveWindow(data->listWindowId); @@ -2155,7 +2155,7 @@ void sub_8014F48(u8 taskId) data->listTaskId = ListMenuInit(&gMultiuseListMenuTemplate, 0, 0); sub_8018784(data->field_D); - FillWindowPixelBuffer(data->field_D, 0x11); + FillWindowPixelBuffer(data->field_D, PIXEL_BUFFER_WHITE); PutWindowTilemap(data->field_D); sub_80125BC(data->field_D); CopyWindowToVram(data->field_D, 2); diff --git a/src/roulette.c b/src/roulette.c index a6a020f396..7826c13531 100644 --- a/src/roulette.c +++ b/src/roulette.c @@ -1052,7 +1052,7 @@ static void sub_8140914(u8 taskId) static void sub_8140968(u8 taskId) { - sub_819746C(0, TRUE); + ClearWindowAndBorder(0, TRUE); gTasks[taskId].func = sub_8140BD0; } @@ -3272,7 +3272,7 @@ static void sub_81428E4(u8 taskId) static void sub_8142918(u8 taskId) { - sub_819746C(0, TRUE); + ClearWindowAndBorder(0, TRUE); HideCoinsWindow(); FreeAllWindowBuffers(); BeginNormalPaletteFade(0xFFFFFFFF, 0, 0, 16, RGB_BLACK); @@ -3283,7 +3283,7 @@ static void sub_8142918(u8 taskId) static void sub_814297C(u8 taskId) { - sub_819746C(0, FALSE); + ClearWindowAndBorder(0, FALSE); HideCoinsWindow(); ScriptContext2_Disable(); DestroyTask(taskId); @@ -3296,7 +3296,7 @@ static void sub_81429A0(u8 taskId) { gSpecialVar_0x8004 = 1; HideCoinsWindow(); - sub_819746C(0, TRUE); + ClearWindowAndBorder(0, TRUE); ScriptContext2_Disable(); DestroyTask(taskId); } diff --git a/src/save_failed_screen.c b/src/save_failed_screen.c index c668c1db08..4cd4cd4bfa 100644 --- a/src/save_failed_screen.c +++ b/src/save_failed_screen.c @@ -231,8 +231,8 @@ static void CB2_SaveFailedScreen(void) LoadPalette(gUnknown_0860F074, 0xF0, 0x20); SetWindowBorderStyle(gSaveFailedWindowIds[TEXT_WIN_ID], FALSE, 0x214, 0xE); SetWindowBorderStyle(gSaveFailedWindowIds[CLOCK_WIN_ID], FALSE, 0x214, 0xE); - FillWindowPixelBuffer(gSaveFailedWindowIds[CLOCK_WIN_ID], 0x11); // backwards? - FillWindowPixelBuffer(gSaveFailedWindowIds[TEXT_WIN_ID], 0x11); + FillWindowPixelBuffer(gSaveFailedWindowIds[CLOCK_WIN_ID], PIXEL_BUFFER_WHITE); // backwards? + FillWindowPixelBuffer(gSaveFailedWindowIds[TEXT_WIN_ID], PIXEL_BUFFER_WHITE); CopyWindowToVram(gSaveFailedWindowIds[CLOCK_WIN_ID], 2); // again? CopyWindowToVram(gSaveFailedWindowIds[TEXT_WIN_ID], 1); SaveFailedScreenTextPrint(gText_SaveFailedCheckingBackup, 1, 0); @@ -265,19 +265,19 @@ static void CB2_WipeSave(void) { if (WipeSectors(gDamagedSaveSectors) != FALSE) { - FillWindowPixelBuffer(gSaveFailedWindowIds[TEXT_WIN_ID], 0x11); + FillWindowPixelBuffer(gSaveFailedWindowIds[TEXT_WIN_ID], PIXEL_BUFFER_WHITE); SaveFailedScreenTextPrint(gText_BackupMemoryDamaged, 1, 0); SetMainCallback2(CB2_GameplayCannotBeContinued); return; } - FillWindowPixelBuffer(gSaveFailedWindowIds[TEXT_WIN_ID], 0x11); + FillWindowPixelBuffer(gSaveFailedWindowIds[TEXT_WIN_ID], PIXEL_BUFFER_WHITE); SaveFailedScreenTextPrint(gText_CheckCompleted, 1, 0); HandleSavingData(gSaveFailedType); if (gDamagedSaveSectors != 0) { - FillWindowPixelBuffer(gSaveFailedWindowIds[TEXT_WIN_ID], 0x11); + FillWindowPixelBuffer(gSaveFailedWindowIds[TEXT_WIN_ID], PIXEL_BUFFER_WHITE); SaveFailedScreenTextPrint(gText_SaveFailedCheckingBackup, 1, 0); } @@ -286,12 +286,12 @@ static void CB2_WipeSave(void) if (wipeTries == 3) { - FillWindowPixelBuffer(gSaveFailedWindowIds[TEXT_WIN_ID], 0x11); + FillWindowPixelBuffer(gSaveFailedWindowIds[TEXT_WIN_ID], PIXEL_BUFFER_WHITE); SaveFailedScreenTextPrint(gText_BackupMemoryDamaged, 1, 0); } else { - FillWindowPixelBuffer(gSaveFailedWindowIds[TEXT_WIN_ID], 0x11); + FillWindowPixelBuffer(gSaveFailedWindowIds[TEXT_WIN_ID], PIXEL_BUFFER_WHITE); if (gGameContinueCallback == NULL) SaveFailedScreenTextPrint(gText_SaveCompleteGameCannotContinue, 1, 0); @@ -308,7 +308,7 @@ static void CB2_GameplayCannotBeContinued(void) if (gMain.newKeys & A_BUTTON) { - FillWindowPixelBuffer(gSaveFailedWindowIds[TEXT_WIN_ID], 0x11); + FillWindowPixelBuffer(gSaveFailedWindowIds[TEXT_WIN_ID], PIXEL_BUFFER_WHITE); SaveFailedScreenTextPrint(gText_GamePlayCannotBeContinued, 1, 0); SetVBlankCallback(VBlankCB); SetMainCallback2(CB2_FadeAndReturnToTitleScreen); diff --git a/src/scrcmd.c b/src/scrcmd.c index 837259a7f6..4cc8df82e5 100644 --- a/src/scrcmd.c +++ b/src/scrcmd.c @@ -1519,7 +1519,7 @@ bool8 ScrCmd_braillemessage(struct ScriptContext *ctx) LoadUserWindowBorderGfx(gUnknown_03000F30, 0x214, 0xE0); NewMenuHelpers_DrawStdWindowFrame(gUnknown_03000F30, 0); PutWindowTilemap(gUnknown_03000F30); - FillWindowPixelBuffer(gUnknown_03000F30, 0x11); + FillWindowPixelBuffer(gUnknown_03000F30, PIXEL_BUFFER_WHITE); AddTextPrinterParameterized(gUnknown_03000F30, 6, gStringVar4, xText, yText, 0xFF, 0x0); CopyWindowToVram(gUnknown_03000F30, 3); return FALSE; @@ -2254,7 +2254,7 @@ bool8 ScrCmd_setmonmetlocation(struct ScriptContext *ctx) void sub_809BDB4(void) { - sub_819746C(gUnknown_03000F30, 1); + ClearWindowAndBorder(gUnknown_03000F30, 1); RemoveWindow(gUnknown_03000F30); } diff --git a/src/script_menu.c b/src/script_menu.c index 7180bfc607..98761fe342 100644 --- a/src/script_menu.c +++ b/src/script_menu.c @@ -1639,27 +1639,27 @@ static void sub_80E2A94(u8 multichoiceId) switch (multichoiceId) { case 77: - FillWindowPixelBuffer(0, 0x11); + FillWindowPixelBuffer(0, PIXEL_BUFFER_WHITE); AddTextPrinterParameterized2(0, 1, gUnknown_0858BBAC[Menu_GetCursorPos()], 0, NULL, 2, 1, 3); break; case 76: - FillWindowPixelBuffer(0, 0x11); + FillWindowPixelBuffer(0, PIXEL_BUFFER_WHITE); AddTextPrinterParameterized2(0, 1, gUnknown_0858BB9C[Menu_GetCursorPos()], 0, NULL, 2, 1, 3); break; case 78: - FillWindowPixelBuffer(0, 0x11); + FillWindowPixelBuffer(0, PIXEL_BUFFER_WHITE); AddTextPrinterParameterized2(0, 1, gUnknown_0858BBBC[Menu_GetCursorPos()], 0, NULL, 2, 1, 3); break; case 79: - FillWindowPixelBuffer(0, 0x11); + FillWindowPixelBuffer(0, PIXEL_BUFFER_WHITE); AddTextPrinterParameterized2(0, 1, gUnknown_0858BBCC[Menu_GetCursorPos()], 0, NULL, 2, 1, 3); break; case 75: - FillWindowPixelBuffer(0, 0x11); + FillWindowPixelBuffer(0, PIXEL_BUFFER_WHITE); AddTextPrinterParameterized2(0, 1, gUnknown_0858BBEC[Menu_GetCursorPos()], 0, NULL, 2, 1, 3); break; case 74: - FillWindowPixelBuffer(0, 0x11); + FillWindowPixelBuffer(0, PIXEL_BUFFER_WHITE); AddTextPrinterParameterized2(0, 1, gUnknown_0858BBE0[Menu_GetCursorPos()], 0, NULL, 2, 1, 3); break; } diff --git a/src/secret_base.c b/src/secret_base.c index adcab9cbc3..74d9ac9b00 100644 --- a/src/secret_base.c +++ b/src/secret_base.c @@ -871,7 +871,7 @@ void sub_80E9C9C(u8 taskId) { data[1] = 0; data[2] = 0; - sub_8197434(0, 0); + ClearWindowAndWideBorder(0, 0); gUnknown_0203A020 = calloc(1, sizeof(struct SecretBaseListMenuBuffer)); data[6] = AddWindow(&gUnknown_0858D06C[0]); game_continue(taskId); @@ -963,7 +963,7 @@ void sub_80E9E90(u8 taskId) PlaySE(SE_SELECT); DestroyListMenuTask(data[5], NULL, NULL); RemoveScrollIndicatorArrowPair(data[8]); - sub_819746C(data[6], 0); + ClearWindowAndBorder(data[6], 0); ClearWindowTilemap(data[6]); RemoveWindow(data[6]); schedule_bg_copy_tilemap_to_vram(0); @@ -1020,8 +1020,8 @@ void sub_80E9FFC(u8 taskId) s16 *data; data = gTasks[taskId].data; - sub_819746C(data[6], FALSE); - sub_819746C(data[7], FALSE); + ClearWindowAndBorder(data[6], FALSE); + ClearWindowAndBorder(data[7], FALSE); ClearWindowTilemap(data[6]); ClearWindowTilemap(data[7]); RemoveWindow(data[7]); @@ -1042,7 +1042,7 @@ void sub_80EA08C(u8 taskId) s16 *data; data = gTasks[taskId].data; - sub_8197434(0, 0); + ClearWindowAndWideBorder(0, 0); DestroyListMenuTask(data[5], &data[2], &data[1]); gSaveBlock1Ptr->secretBases[data[4]].sbr_field_1_6 = 0; game_continue(taskId); @@ -1061,7 +1061,7 @@ void sub_80EA13C(u8 taskId) s16 *data; data = gTasks[taskId].data; - sub_8197434(0, 0); + ClearWindowAndWideBorder(0, 0); DestroyListMenuTask(data[5], &data[2], &data[1]); sub_80E9E00(taskId); gTasks[taskId].func = sub_80E9E90; @@ -1073,7 +1073,7 @@ void sub_80EA18C(u8 taskId) data = gTasks[taskId].data; sub_80E9E44(taskId); - sub_819746C(data[7], 0); + ClearWindowAndBorder(data[7], 0); ClearWindowTilemap(data[7]); RemoveWindow(data[7]); schedule_bg_copy_tilemap_to_vram(0); diff --git a/src/shop.c b/src/shop.c index 8eefd5e97f..9c7c30feda 100755 --- a/src/shop.c +++ b/src/shop.c @@ -545,7 +545,7 @@ static void BuyMenuPrintItemDescriptionAndShowItemIcon(int item, bool8 onInit, s description = gText_QuitShopping; } - FillWindowPixelBuffer(2, 0); + FillWindowPixelBuffer(2, PIXEL_BUFFER_TRANSPARENT); BuyMenuPrint(2, description, 3, 1, 0, 0); } @@ -1144,7 +1144,7 @@ static void BuyMenuPrintItemQuantityAndPrice(u8 taskId) { s16 *data = gTasks[taskId].data; - FillWindowPixelBuffer(4, 0x11); + FillWindowPixelBuffer(4, PIXEL_BUFFER_WHITE); PrintMoneyAmount(4, 38, 1, gShopDataPtr->totalCost, TEXT_SPEED_FF); ConvertIntToDecimalStringN(gStringVar1, tItemCount, 2, 2); StringExpandPlaceholders(gStringVar4, gText_xVar1); diff --git a/src/slot_machine.c b/src/slot_machine.c index 0871506cd0..bf26de437a 100644 --- a/src/slot_machine.c +++ b/src/slot_machine.c @@ -1026,7 +1026,7 @@ void PlaySlotMachine(u8 arg0, MainCallback cb) { if (gMain.newKeys & (A_BUTTON | B_BUTTON)) { - sub_8197434(0, TRUE); + ClearWindowAndWideBorder(0, TRUE); sSlotMachine->state = 5; } return FALSE; @@ -1269,7 +1269,7 @@ void PlaySlotMachine(u8 arg0, MainCallback cb) s8 input = Menu_ProcessInputNoWrapClearOnChoose(); if (input == 0) { - sub_8197434(0, TRUE); + ClearWindowAndWideBorder(0, TRUE); sub_8103D8C(0); sub_8103D8C(1); sub_8103D8C(2); @@ -1278,7 +1278,7 @@ void PlaySlotMachine(u8 arg0, MainCallback cb) } else if (input == 1 || input == -1) { - sub_8197434(0, TRUE); + ClearWindowAndWideBorder(0, TRUE); sSlotMachine->state = 5; } return FALSE; @@ -1297,7 +1297,7 @@ void PlaySlotMachine(u8 arg0, MainCallback cb) { if (gMain.newKeys & (A_BUTTON | B_BUTTON)) { - sub_8197434(0, TRUE); + ClearWindowAndWideBorder(0, TRUE); sSlotMachine->state = 5; } return FALSE; @@ -1316,7 +1316,7 @@ void PlaySlotMachine(u8 arg0, MainCallback cb) { if (gMain.newKeys & (A_BUTTON | B_BUTTON)) { - sub_8197434(0, TRUE); + ClearWindowAndWideBorder(0, TRUE); sSlotMachine->state = 27; } return FALSE; @@ -3036,7 +3036,7 @@ s16 sub_8102D5C(s16 a0) sub_81065DC(); AddWindow(&gUnknown_085A7444); PutWindowTilemap(1); - FillWindowPixelBuffer(1, 0); + FillWindowPixelBuffer(1, PIXEL_BUFFER_TRANSPARENT); task->data[0]++; } @@ -3052,7 +3052,7 @@ s16 sub_8102D5C(s16 a0) { if (gMain.newKeys & (B_BUTTON | SELECT_BUTTON)) { - FillWindowPixelBuffer(1, 0); + FillWindowPixelBuffer(1, PIXEL_BUFFER_TRANSPARENT); ClearWindowTilemap(1); CopyWindowToVram(1, 1); RemoveWindow(1); diff --git a/src/start_menu.c b/src/start_menu.c index d5eec76d23..4231db7cc7 100644 --- a/src/start_menu.c +++ b/src/start_menu.c @@ -897,7 +897,7 @@ static void SaveGameTask(u8 taskId) static void sub_80A0014(void) { - sub_8197434(0, TRUE); + ClearWindowAndWideBorder(0, TRUE); } static void HideSaveInfoWindow(void) @@ -943,7 +943,7 @@ static bool8 SaveErrorTimer(void) static u8 SaveConfirmSaveCallback(void) { - sub_819746C(GetStartMenuWindowId(), FALSE); + ClearWindowAndBorder(GetStartMenuWindowId(), FALSE); RemoveStartMenuWindow(); ShowSaveInfoWindow(); @@ -1135,7 +1135,7 @@ static void InitBattlePyramidRetire(void) static u8 BattlePyramidConfirmRetireCallback(void) { - sub_819746C(GetStartMenuWindowId(), FALSE); + ClearWindowAndBorder(GetStartMenuWindowId(), FALSE); RemoveStartMenuWindow(); ShowSaveMessage(gText_BattlePyramidConfirmRetire, BattlePyramidRetireYesNoCallback); @@ -1232,7 +1232,7 @@ static void sub_80A0550(u8 taskId) switch (*step) { case 0: - FillWindowPixelBuffer(0, 17); + FillWindowPixelBuffer(0, PIXEL_BUFFER_WHITE); AddTextPrinterParameterized2(0, 1, gText_SavingDontTurnOffPower, @@ -1364,7 +1364,7 @@ static void ShowSaveInfoWindow(void) static void RemoveSaveInfoWindow(void) { - sub_819746C(sSaveInfoWindowId, FALSE); + ClearWindowAndBorder(sSaveInfoWindowId, FALSE); RemoveWindow(sSaveInfoWindowId); } @@ -1386,7 +1386,7 @@ void sub_80A08CC(void) // Referenced in data/specials.inc and data/scripts/maps/ static void HideStartMenuWindow(void) { - sub_819746C(GetStartMenuWindowId(), TRUE); + ClearWindowAndBorder(GetStartMenuWindowId(), TRUE); RemoveStartMenuWindow(); ScriptUnfreezeEventObjects(); ScriptContext2_Disable(); diff --git a/src/starter_choose.c b/src/starter_choose.c index 2d4a1b1e1c..f4067b3821 100644 --- a/src/starter_choose.c +++ b/src/starter_choose.c @@ -523,7 +523,7 @@ static void Task_StarterChoose3(u8 taskId) static void Task_StarterChoose4(u8 taskId) { PlayCry1(GetStarterPokemon(gTasks[taskId].tStarterSelection), 0); - FillWindowPixelBuffer(0, 0x11); + FillWindowPixelBuffer(0, PIXEL_BUFFER_WHITE); AddTextPrinterParameterized(0, 1, gText_ConfirmStarterChoice, 0, 1, 0, NULL); schedule_bg_copy_tilemap_to_vram(0); CreateYesNoMenu(&gUnknown_085B1DDC, 0x2A8, 0xD, 0); @@ -579,7 +579,7 @@ static void CreateStarterPokemonLabel(u8 selection) winTemplate.tilemapTop = gStarterChoose_LabelCoords[selection][1]; sStarterChooseWindowId = AddWindow(&winTemplate); - FillWindowPixelBuffer(sStarterChooseWindowId, 0); + FillWindowPixelBuffer(sStarterChooseWindowId, PIXEL_BUFFER_TRANSPARENT); width = GetStringCenterAlignXOffset(7, text, 0x68); AddTextPrinterParameterized3(sStarterChooseWindowId, 7, width, 1, gUnknown_085B1E0C, 0, text); @@ -600,7 +600,7 @@ static void CreateStarterPokemonLabel(u8 selection) static void sub_8134604(void) { - FillWindowPixelBuffer(sStarterChooseWindowId, 0); + FillWindowPixelBuffer(sStarterChooseWindowId, PIXEL_BUFFER_TRANSPARENT); ClearWindowTilemap(sStarterChooseWindowId); RemoveWindow(sStarterChooseWindowId); sStarterChooseWindowId = 0xFF; diff --git a/src/trade.c b/src/trade.c index 70b57fbc77..148ad2e265 100644 --- a/src/trade.c +++ b/src/trade.c @@ -1418,7 +1418,7 @@ static void sub_80772A4(void) for (i = 0; i < 18; i++) { ClearWindowTilemap(i); - FillWindowPixelBuffer(i, 0); + FillWindowPixelBuffer(i, PIXEL_BUFFER_TRANSPARENT); } FillBgTilemapBufferRect(0, 0, 0, 0, 30, 20, 15); @@ -2461,7 +2461,7 @@ static void sub_8078DBC(void) if (gUnknown_0203229C->tradeMenuCursorPosition < 6) { sub_8098858(1, 1, 14); - FillWindowPixelBuffer(1, 0x11); + FillWindowPixelBuffer(1, PIXEL_BUFFER_WHITE); PrintMenuTable(1, 2, gUnknown_0832DEAC); InitMenuInUpperLeftCornerPlaySoundWhenAPressed(1, 2, 0); PutWindowTilemap(1); @@ -2724,7 +2724,7 @@ static void sub_8079408(void) for (i = 0; i < 4; i++) { - FillWindowPixelBuffer(i + 14, 0); + FillWindowPixelBuffer(i + 14, PIXEL_BUFFER_TRANSPARENT); rbox_fill_rectangle(i + 14); } @@ -3256,7 +3256,7 @@ static void sub_807A0C4(void) static void sub_807A19C(u8 a0) { - FillWindowPixelBuffer(0, 0x11); + FillWindowPixelBuffer(0, PIXEL_BUFFER_WHITE); AddTextPrinterParameterized(0, 1, gUnknown_0832DEBC[a0], 0, 1, TEXT_SPEED_FF, NULL); sub_8098858(0, 20, 12); PutWindowTilemap(0); @@ -4185,7 +4185,7 @@ void sub_807B140(void) void sub_807B154(void) { - FillWindowPixelBuffer(0, 0xFF); + FillWindowPixelBuffer(0, PIXEL_BUFFER_UNKNOWN); PutWindowTilemap(0); CopyWindowToVram(0, 3); } @@ -4263,7 +4263,7 @@ static void sub_807B270(void) break; case 8: sub_807ACFC(1, 1); - FillWindowPixelBuffer(0, 0xFF); + FillWindowPixelBuffer(0, PIXEL_BUFFER_UNKNOWN); PutWindowTilemap(0); CopyWindowToVram(0, 3); gMain.state++; @@ -4654,7 +4654,7 @@ static bool8 sub_807BBEC(void) if (!gPaletteFade.active) { sub_807B62C(4); - FillWindowPixelBuffer(0, 0xFF); + FillWindowPixelBuffer(0, PIXEL_BUFFER_UNKNOWN); CopyWindowToVram(0, 3); gUnknown_020322A0->state++; } @@ -5146,7 +5146,7 @@ static bool8 sub_807CFC8(void) if (!gPaletteFade.active) { sub_807B62C(4); - FillWindowPixelBuffer(0, 0xFF); + FillWindowPixelBuffer(0, PIXEL_BUFFER_UNKNOWN); CopyWindowToVram(0, 3); gUnknown_020322A0->state++; } @@ -6085,7 +6085,7 @@ void sub_807F19C(void) void sub_807F1A8(u8 windowId, const u8 *str, u8 speed) { - FillWindowPixelBuffer(windowId, 0xFF); + FillWindowPixelBuffer(windowId, PIXEL_BUFFER_UNKNOWN); gUnknown_020322A0->unk_F6[0] = 15; gUnknown_020322A0->unk_F6[1] = 1; gUnknown_020322A0->unk_F6[2] = 6; diff --git a/src/trainer_card.c b/src/trainer_card.c index 49a62284f9..d6d3b31527 100755 --- a/src/trainer_card.c +++ b/src/trainer_card.c @@ -350,7 +350,7 @@ static void sub_80C2760(u8 taskId) case 0: if (!IsDma3ManagerBusyWithBgCopy()) { - FillWindowPixelBuffer(1, 0); + FillWindowPixelBuffer(1, PIXEL_BUFFER_TRANSPARENT); sData->var_0++; } break; @@ -363,7 +363,7 @@ static void sub_80C2760(u8 taskId) sData->var_0++; break; case 3: - FillWindowPixelBuffer(2, 0); + FillWindowPixelBuffer(2, PIXEL_BUFFER_TRANSPARENT); sub_80C4FF0(); sub_80C438C(2); sData->var_0++; @@ -1634,7 +1634,7 @@ static bool8 sub_80C4B08(struct Task* task) switch (sData->var_4) { case 0: - FillWindowPixelBuffer(1, 0); + FillWindowPixelBuffer(1, PIXEL_BUFFER_TRANSPARENT); FillBgTilemapBufferRect_Palette0(3, 0, 0, 0, 0x20, 0x20); break; case 1: @@ -1659,7 +1659,7 @@ static bool8 sub_80C4B08(struct Task* task) if (!sData->var_8) sub_80C474C(); else - FillWindowPixelBuffer(2, 0); + FillWindowPixelBuffer(2, PIXEL_BUFFER_TRANSPARENT); break; case 4: if (sData->var_8) diff --git a/src/trainer_hill.c b/src/trainer_hill.c index efe11b0c7d..5f351554e7 100644 --- a/src/trainer_hill.c +++ b/src/trainer_hill.c @@ -609,7 +609,7 @@ void PrintOnTrainerHillRecordsWindow(void) u32 total, minutes, secondsWhole, secondsFraction; SetUpDataStruct(); - FillWindowPixelBuffer(0, 0); + FillWindowPixelBuffer(0, PIXEL_BUFFER_TRANSPARENT); x = GetStringCenterAlignXOffset(1, gText_TimeBoard, 0xD0); AddTextPrinterParameterized3(0, 1, x, 2, sRecordWinColors, TEXT_SPEED_FF, gText_TimeBoard); diff --git a/src/window.c b/src/window.c index 3da5291789..1daf4b5fcb 100644 --- a/src/window.c +++ b/src/window.c @@ -6,7 +6,7 @@ u32 filler_03002F58; u32 filler_03002F5C; -u8 gUnknown_03002F60; +u8 gTransparentTileNumber; u32 filler_03002F64; void *gUnknown_03002F70[4]; extern u32 gUnneededFireRedVariable; @@ -106,7 +106,7 @@ bool16 InitWindows(const struct WindowTemplate *templates) } } - gUnknown_03002F60 = 0; + gTransparentTileNumber = TRANSPARENT_TILE_NUMBER; return TRUE; } @@ -359,13 +359,14 @@ void PutWindowRectTilemapOverridePalette(u8 windowId, u8 x, u8 y, u8 width, u8 h } } +// Fills a window with transparent tiles. void ClearWindowTilemap(u8 windowId) { struct Window windowLocal = gWindows[windowId]; FillBgTilemapBufferRect( windowLocal.window.bg, - gUnknown_03002F60, + gTransparentTileNumber, windowLocal.window.tilemapLeft, windowLocal.window.tilemapTop, windowLocal.window.width, @@ -451,6 +452,7 @@ void CopyToWindowPixelBuffer(u8 windowId, const void *src, u16 size, u16 tileOff LZ77UnCompWram(src, gWindows[windowId].tileData + (0x20 * tileOffset)); } +// Sets all pixels within the window to the fillValue color. void FillWindowPixelBuffer(u8 windowId, u8 fillValue) { int fillSize = gWindows[windowId].window.width * gWindows[windowId].window.height; From c96f8751cddf1a203bd5f310683ea35bf9cb8db2 Mon Sep 17 00:00:00 2001 From: Phlosioneer Date: Thu, 21 Feb 2019 23:27:12 -0500 Subject: [PATCH 02/20] Improve window palette macros --- include/window.h | 9 +--- src/battle_dome.c | 2 +- src/battle_factory_screen.c | 48 +++++++++--------- src/battle_interface.c | 2 +- src/battle_message.c | 94 ++++++++++++++++++------------------ src/battle_pyramid_bag.c | 18 +++---- src/battle_records.c | 4 +- src/berry_blender.c | 6 +-- src/berry_fix_program.c | 8 +-- src/berry_tag_screen.c | 14 +++--- src/clear_save_data_screen.c | 4 +- src/coins.c | 2 +- src/contest.c | 14 +++--- src/contest_link_80F57C4.c | 2 +- src/contest_painting.c | 2 +- src/credits.c | 2 +- src/decoration.c | 6 +-- src/diploma.c | 2 +- src/egg_hatch.c | 4 +- src/field_player_avatar.c | 6 +-- src/field_region_map.c | 4 +- src/field_specials.c | 4 +- src/frontier_pass.c | 8 +-- src/frontier_util.c | 20 ++++---- src/hall_of_fame.c | 8 +-- src/item_menu.c | 28 +++++------ src/learn_move.c | 6 +-- src/link.c | 8 +-- src/list_menu.c | 6 +-- src/mail.c | 4 +- src/main_menu.c | 36 +++++++------- src/match_call.c | 6 +-- src/menu.c | 32 ++++++------ src/money.c | 2 +- src/mystery_event_menu.c | 4 +- src/naming_screen.c | 8 +-- src/option_menu.c | 4 +- src/party_menu.c | 6 +-- src/player_pc.c | 4 +- src/pokeblock.c | 4 +- src/pokeblock_feed.c | 2 +- src/pokedex.c | 8 +-- src/pokemon_storage_system.c | 30 ++++++------ src/pokemon_summary_screen.c | 16 +++--- src/pokenav.c | 2 +- src/region_map.c | 6 +-- src/rom_8011DC0.c | 8 +-- src/save_failed_screen.c | 16 +++--- src/scrcmd.c | 2 +- src/script_menu.c | 12 ++--- src/shop.c | 4 +- src/slot_machine.c | 4 +- src/start_menu.c | 2 +- src/starter_choose.c | 6 +-- src/text.c | 4 +- src/trade.c | 18 +++---- src/trainer_card.c | 8 +-- src/trainer_hill.c | 2 +- src/unk_text_util_2.c | 4 +- src/window.c | 2 +- 60 files changed, 301 insertions(+), 306 deletions(-) diff --git a/include/window.h b/include/window.h index 4138ce948d..1daee39efc 100644 --- a/include/window.h +++ b/include/window.h @@ -1,12 +1,7 @@ #ifndef GUARD_WINDOW_H #define GUARD_WINDOW_H -// The tile ID for a transparent tile in the window tilesheet -#define TRANSPARENT_TILE_NUMBER 0 - -#define PIXEL_BUFFER_TRANSPARENT 0x00 -#define PIXEL_BUFFER_WHITE 0x11 -#define PIXEL_BUFFER_UNKNOWN 0xFF +#define PALETTE_NUM_TO_FILL_VALUE(num) ((num) | ((num) << 4)) enum { @@ -80,7 +75,7 @@ extern u32 filler_03002F58; extern u32 filler_03002F5C; extern u32 filler_03002F64; -// This global is set to TRANSPARENT_TILE_NUMBER and never changed. +// This global is set to 0 and never changed. extern u8 gTransparentTileNumber; #endif // GUARD_WINDOW_H diff --git a/src/battle_dome.c b/src/battle_dome.c index 2ec9f8f3d4..9ef66aac41 100644 --- a/src/battle_dome.c +++ b/src/battle_dome.c @@ -3794,7 +3794,7 @@ static void sub_8190CD4(u8 taskId) for (i = windowId; i < windowId + 9; i++) { CopyWindowToVram(i, 2); - FillWindowPixelBuffer(i, PIXEL_BUFFER_TRANSPARENT); + FillWindowPixelBuffer(i, PALETTE_NUM_TO_FILL_VALUE(0)); } gTasks[taskId].data[0] = 3; break; diff --git a/src/battle_factory_screen.c b/src/battle_factory_screen.c index 6d7ec3c45f..f30f256f28 100644 --- a/src/battle_factory_screen.c +++ b/src/battle_factory_screen.c @@ -1786,14 +1786,14 @@ static void sub_819B958(u8 windowId) { gSprites[sFactorySelectScreen->menuCursor1SpriteId].invisible = TRUE; gSprites[sFactorySelectScreen->menuCursor2SpriteId].invisible = TRUE; - FillWindowPixelBuffer(windowId, PIXEL_BUFFER_TRANSPARENT); + FillWindowPixelBuffer(windowId, PALETTE_NUM_TO_FILL_VALUE(0)); CopyWindowToVram(windowId, 2); ClearWindowTilemap(windowId); } static void Select_PrintRentalPkmnString(void) { - FillWindowPixelBuffer(0, PIXEL_BUFFER_TRANSPARENT); + FillWindowPixelBuffer(0, PALETTE_NUM_TO_FILL_VALUE(0)); AddTextPrinterParameterized(0, 1, gText_RentalPkmn2, 2, 1, 0, NULL); CopyWindowToVram(0, 3); } @@ -1804,7 +1804,7 @@ static void Select_PrintMonSpecies(void) u8 x; u8 monId = sFactorySelectScreen->cursorPos; - FillWindowPixelBuffer(1, PIXEL_BUFFER_TRANSPARENT); + FillWindowPixelBuffer(1, PALETTE_NUM_TO_FILL_VALUE(0)); species = GetMonData(&sFactorySelectScreen->mons[monId].monData, MON_DATA_SPECIES, NULL); StringCopy(gStringVar4, gSpeciesNames[species]); x = GetStringRightAlignXOffset(1, gStringVar4, 86); @@ -1816,7 +1816,7 @@ static void Select_PrintSelectMonString(void) { const u8 *str = NULL; - FillWindowPixelBuffer(2, PIXEL_BUFFER_TRANSPARENT); + FillWindowPixelBuffer(2, PALETTE_NUM_TO_FILL_VALUE(0)); if (sFactorySelectScreen->selectingMonsState == 1) str = gText_SelectFirstPkmn; else if (sFactorySelectScreen->selectingMonsState == 2) @@ -1832,7 +1832,7 @@ static void Select_PrintSelectMonString(void) static void Select_PrintCantSelectSameMon(void) { - FillWindowPixelBuffer(2, PIXEL_BUFFER_TRANSPARENT); + FillWindowPixelBuffer(2, PALETTE_NUM_TO_FILL_VALUE(0)); AddTextPrinterParameterized(2, 1, gText_CantSelectSamePkmn, 2, 5, 0, NULL); CopyWindowToVram(2, 2); } @@ -1842,7 +1842,7 @@ static void Select_PrintMenuOptions(void) u8 selectedId = sFactorySelectScreen->mons[sFactorySelectScreen->cursorPos].selectedId; PutWindowTilemap(3); - FillWindowPixelBuffer(3, PIXEL_BUFFER_TRANSPARENT); + FillWindowPixelBuffer(3, PALETTE_NUM_TO_FILL_VALUE(0)); AddTextPrinterParameterized3(3, 1, 7, 1, gUnknown_08610476, 0, gText_Summary); if (selectedId != 0) AddTextPrinterParameterized3(3, 1, 7, 17, gUnknown_08610476, 0, gText_Deselect); @@ -1856,7 +1856,7 @@ static void Select_PrintMenuOptions(void) static void Select_PrintYesNoOptions(void) { PutWindowTilemap(4); - FillWindowPixelBuffer(4, PIXEL_BUFFER_TRANSPARENT); + FillWindowPixelBuffer(4, PALETTE_NUM_TO_FILL_VALUE(0)); AddTextPrinterParameterized3(4, 1, 7, 1, gUnknown_08610476, 0, gText_Yes2); AddTextPrinterParameterized3(4, 1, 7, 17, gUnknown_08610476, 0, gText_No2); CopyWindowToVram(4, 3); @@ -1924,7 +1924,7 @@ static void Select_PrintMonCategory(void) if (monId < SELECTABLE_MONS_COUNT) { PutWindowTilemap(5); - FillWindowPixelBuffer(5, PIXEL_BUFFER_TRANSPARENT); + FillWindowPixelBuffer(5, PALETTE_NUM_TO_FILL_VALUE(0)); species = GetMonData(&sFactorySelectScreen->mons[monId].monData, MON_DATA_SPECIES, NULL); CopyMonCategoryText(SpeciesToNationalPokedexNum(species), text); x = GetStringRightAlignXOffset(1, text, 0x76); @@ -2873,7 +2873,7 @@ static void sub_819D588(u8 taskId) case 3: if (!gPaletteFade.active) { - FillWindowPixelBuffer(5, PIXEL_BUFFER_TRANSPARENT); + FillWindowPixelBuffer(5, PALETTE_NUM_TO_FILL_VALUE(0)); CopyWindowToVram(5, 2); if (sFactorySwapScreen->inEnemyScreen == TRUE) { @@ -3002,7 +3002,7 @@ static void sub_819D770(u8 taskId) gTasks[taskId].data[0]++; break; case 6: - FillWindowPixelBuffer(5, PIXEL_BUFFER_TRANSPARENT); + FillWindowPixelBuffer(5, PALETTE_NUM_TO_FILL_VALUE(0)); CopyWindowToVram(5, 2); gTasks[taskId].data[0]++; break; @@ -3546,7 +3546,7 @@ static void sub_819EA64(u8 windowId) { gSprites[sFactorySwapScreen->menuCursor1SpriteId].invisible = TRUE; gSprites[sFactorySwapScreen->menuCursor2SpriteId].invisible = TRUE; - FillWindowPixelBuffer(windowId, PIXEL_BUFFER_TRANSPARENT); + FillWindowPixelBuffer(windowId, PALETTE_NUM_TO_FILL_VALUE(0)); CopyWindowToVram(windowId, 2); ClearWindowTilemap(windowId); } @@ -3554,14 +3554,14 @@ static void sub_819EA64(u8 windowId) static void sub_819EAC0(void) { PutWindowTilemap(1); - FillWindowPixelBuffer(1, PIXEL_BUFFER_TRANSPARENT); + FillWindowPixelBuffer(1, PALETTE_NUM_TO_FILL_VALUE(0)); CopyWindowToVram(1, 2); } static void sub_819EADC(void) { PutWindowTilemap(7); - FillWindowPixelBuffer(7, PIXEL_BUFFER_TRANSPARENT); + FillWindowPixelBuffer(7, PALETTE_NUM_TO_FILL_VALUE(0)); CopyWindowToVram(7, 2); } @@ -3569,13 +3569,13 @@ static void sub_819EAF8(void) { sub_819EAC0(); PutWindowTilemap(5); - FillWindowPixelBuffer(5, PIXEL_BUFFER_TRANSPARENT); + FillWindowPixelBuffer(5, PALETTE_NUM_TO_FILL_VALUE(0)); CopyWindowToVram(5, 2); } static void Swap_PrintPkmnSwap(void) { - FillWindowPixelBuffer(0, PIXEL_BUFFER_WHITE); + FillWindowPixelBuffer(0, PALETTE_NUM_TO_FILL_VALUE(1)); AddTextPrinterParameterized(0, 1, gText_PkmnSwap, 2, 1, 0, NULL); CopyWindowToVram(0, 3); } @@ -3585,7 +3585,7 @@ static void Swap_PrintMonSpecies(void) u16 species; u8 x; - FillWindowPixelBuffer(1, PIXEL_BUFFER_TRANSPARENT); + FillWindowPixelBuffer(1, PALETTE_NUM_TO_FILL_VALUE(0)); if (sFactorySwapScreen->cursorPos > 2) { CopyWindowToVram(1, 2); @@ -3606,7 +3606,7 @@ static void Swap_PrintMonSpecies(void) static void Swap_PrintOnInfoWindow(const u8 *str) { - FillWindowPixelBuffer(2, PIXEL_BUFFER_TRANSPARENT); + FillWindowPixelBuffer(2, PALETTE_NUM_TO_FILL_VALUE(0)); AddTextPrinterParameterized(2, 1, str, 2, 5, 0, NULL); CopyWindowToVram(2, 2); } @@ -3614,7 +3614,7 @@ static void Swap_PrintOnInfoWindow(const u8 *str) static void Swap_PrintMenuOptions(void) { PutWindowTilemap(3); - FillWindowPixelBuffer(3, PIXEL_BUFFER_TRANSPARENT); + FillWindowPixelBuffer(3, PALETTE_NUM_TO_FILL_VALUE(0)); AddTextPrinterParameterized3(3, 1, 15, 1, gUnknown_08610922, 0, gText_Summary2); AddTextPrinterParameterized3(3, 1, 15, 17, gUnknown_08610922, 0, gText_Swap); AddTextPrinterParameterized3(3, 1, 15, 33, gUnknown_08610922, 0, gText_Rechoose); @@ -3624,7 +3624,7 @@ static void Swap_PrintMenuOptions(void) static void Swap_PrintYesNoOptions(void) { PutWindowTilemap(4); - FillWindowPixelBuffer(4, PIXEL_BUFFER_TRANSPARENT); + FillWindowPixelBuffer(4, PALETTE_NUM_TO_FILL_VALUE(0)); AddTextPrinterParameterized3(4, 1, 7, 1, gUnknown_08610922, 0, gText_Yes3); AddTextPrinterParameterized3(4, 1, 7, 17, gUnknown_08610922, 0, gText_No3); CopyWindowToVram(4, 3); @@ -3638,7 +3638,7 @@ static void Swap_PrintActionString(const u8 *str, u32 y, u32 windowId) static void Swap_PrintActionStrings(void) { - FillWindowPixelBuffer(5, PIXEL_BUFFER_TRANSPARENT); + FillWindowPixelBuffer(5, PALETTE_NUM_TO_FILL_VALUE(0)); switch (sFactorySwapScreen->inEnemyScreen) { case TRUE: @@ -3652,7 +3652,7 @@ static void Swap_PrintActionStrings(void) static void Swap_PrintActionStrings2(void) { - FillWindowPixelBuffer(3, PIXEL_BUFFER_TRANSPARENT); + FillWindowPixelBuffer(3, PALETTE_NUM_TO_FILL_VALUE(0)); switch (sFactorySwapScreen->inEnemyScreen) { case TRUE: @@ -3693,7 +3693,7 @@ static void Swap_PrintMonSpecies2(void) LoadPalette(pal, 0xF0, 0xA); PutWindowTilemap(7); - FillWindowPixelBuffer(7, PIXEL_BUFFER_TRANSPARENT); + FillWindowPixelBuffer(7, PALETTE_NUM_TO_FILL_VALUE(0)); if (sFactorySwapScreen->cursorPos > 2) { CopyWindowToVram(7, 3); @@ -3745,7 +3745,7 @@ static void Swap_PrintMonCategory(void) u8 x; u8 monId = sFactorySwapScreen->cursorPos; - FillWindowPixelBuffer(8, PIXEL_BUFFER_TRANSPARENT); + FillWindowPixelBuffer(8, PALETTE_NUM_TO_FILL_VALUE(0)); if (monId > 2) { CopyWindowToVram(8, 2); @@ -3940,7 +3940,7 @@ static void Task_SwapCantHaveSameMons(u8 taskId) case 2: if (sFactorySwapScreen->unk30 != TRUE) { - FillWindowPixelBuffer(5, PIXEL_BUFFER_TRANSPARENT); + FillWindowPixelBuffer(5, PALETTE_NUM_TO_FILL_VALUE(0)); CopyWindowToVram(5, 2); gTasks[taskId].data[0]++; } diff --git a/src/battle_interface.c b/src/battle_interface.c index 0eb494db4b..17d44dac3a 100644 --- a/src/battle_interface.c +++ b/src/battle_interface.c @@ -2578,7 +2578,7 @@ static u8* AddTextPrinterAndCreateWindowOnHealthbox(const u8 *str, u32 x, u32 y, struct WindowTemplate winTemplate = sHealthboxWindowTemplate; winId = AddWindow(&winTemplate); - FillWindowPixelBuffer(winId, (bgColor << 4) | (bgColor)); + FillWindowPixelBuffer(winId, PALETTE_NUM_TO_FILL_VALUE(bgColor)); color[0] = bgColor; color[1] = 1; diff --git a/src/battle_message.c b/src/battle_message.c index 164108dece..b203f0b3e1 100644 --- a/src/battle_message.c +++ b/src/battle_message.c @@ -1357,7 +1357,7 @@ static const struct BattleWindowText sTextOnWindowsInfo_Normal[] = { // The corresponding WindowTemplate is gStandardBattleWindowTemplates[] within src/battle_bg.c { // 0 Standard battle message - .fillValue = 0xFF, + .fillValue = PALETTE_NUM_TO_FILL_VALUE(0xF), .fontId = 1, .x = 0, .y = 1, @@ -1369,7 +1369,7 @@ static const struct BattleWindowText sTextOnWindowsInfo_Normal[] = .shadowColor = 6, }, { // 1 "What will (pokemon) do?" - .fillValue = 0xFF, + .fillValue = PALETTE_NUM_TO_FILL_VALUE(0xF), .fontId = 1, .x = 1, .y = 1, @@ -1381,7 +1381,7 @@ static const struct BattleWindowText sTextOnWindowsInfo_Normal[] = .shadowColor = 6, }, { // 2 "Fight/Pokemon/Bag/Run" - .fillValue = 0xEE, + .fillValue = PALETTE_NUM_TO_FILL_VALUE(0xE), .fontId = 1, .x = 0, .y = 1, @@ -1393,7 +1393,7 @@ static const struct BattleWindowText sTextOnWindowsInfo_Normal[] = .shadowColor = 15, }, { // 3 Top left move - .fillValue = 0xEE, + .fillValue = PALETTE_NUM_TO_FILL_VALUE(0xE), .fontId = 7, .x = 0, .y = 1, @@ -1405,7 +1405,7 @@ static const struct BattleWindowText sTextOnWindowsInfo_Normal[] = .shadowColor = 15, }, { // 4 Top right move - .fillValue = 0xEE, + .fillValue = PALETTE_NUM_TO_FILL_VALUE(0xE), .fontId = 7, .x = 0, .y = 1, @@ -1417,7 +1417,7 @@ static const struct BattleWindowText sTextOnWindowsInfo_Normal[] = .shadowColor = 15, }, { // 5 Bottom left move - .fillValue = 0xEE, + .fillValue = PALETTE_NUM_TO_FILL_VALUE(0xE), .fontId = 7, .x = 0, .y = 1, @@ -1429,7 +1429,7 @@ static const struct BattleWindowText sTextOnWindowsInfo_Normal[] = .shadowColor = 15, }, { // 6 Bottom right move - .fillValue = 0xEE, + .fillValue = PALETTE_NUM_TO_FILL_VALUE(0xE), .fontId = 7, .x = 0, .y = 1, @@ -1441,7 +1441,7 @@ static const struct BattleWindowText sTextOnWindowsInfo_Normal[] = .shadowColor = 15, }, { // 7 "PP" - .fillValue = 0xEE, + .fillValue = PALETTE_NUM_TO_FILL_VALUE(0xE), .fontId = 7, .x = 0, .y = 1, @@ -1453,7 +1453,7 @@ static const struct BattleWindowText sTextOnWindowsInfo_Normal[] = .shadowColor = 11, }, { // 8 - .fillValue = 0xEE, + .fillValue = PALETTE_NUM_TO_FILL_VALUE(0xE), .fontId = 1, .x = 0, .y = 1, @@ -1465,7 +1465,7 @@ static const struct BattleWindowText sTextOnWindowsInfo_Normal[] = .shadowColor = 15, }, { // 9 PP remaining - .fillValue = 0xEE, + .fillValue = PALETTE_NUM_TO_FILL_VALUE(0xE), .fontId = 1, .x = 2, .y = 1, @@ -1477,7 +1477,7 @@ static const struct BattleWindowText sTextOnWindowsInfo_Normal[] = .shadowColor = 11, }, { // 10 "type" - .fillValue = 0xEE, + .fillValue = PALETTE_NUM_TO_FILL_VALUE(0xE), .fontId = 7, .x = 0, .y = 1, @@ -1489,7 +1489,7 @@ static const struct BattleWindowText sTextOnWindowsInfo_Normal[] = .shadowColor = 15, }, { // 11 "switch which?" - .fillValue = 0xEE, + .fillValue = PALETTE_NUM_TO_FILL_VALUE(0xE), .fontId = 7, .x = 0, .y = 1, @@ -1501,7 +1501,7 @@ static const struct BattleWindowText sTextOnWindowsInfo_Normal[] = .shadowColor = 15, }, { // 12 "gText_BattleYesNoChoice" - .fillValue = 0xEE, + .fillValue = PALETTE_NUM_TO_FILL_VALUE(0xE), .fontId = 1, .x = 0, .y = 1, @@ -1513,7 +1513,7 @@ static const struct BattleWindowText sTextOnWindowsInfo_Normal[] = .shadowColor = 15, }, { // 13 - .fillValue = 0xEE, + .fillValue = PALETTE_NUM_TO_FILL_VALUE(0xE), .fontId = 1, .x = 0, .y = 1, @@ -1525,7 +1525,7 @@ static const struct BattleWindowText sTextOnWindowsInfo_Normal[] = .shadowColor = 15, }, { // 14 - .fillValue = 0x0, + .fillValue = PALETTE_NUM_TO_FILL_VALUE(0), .fontId = 1, .x = 32, .y = 1, @@ -1537,7 +1537,7 @@ static const struct BattleWindowText sTextOnWindowsInfo_Normal[] = .shadowColor = 2, }, { // 15 - .fillValue = 0xEE, + .fillValue = PALETTE_NUM_TO_FILL_VALUE(0xE), .fontId = 1, .x = -1, .y = 1, @@ -1549,7 +1549,7 @@ static const struct BattleWindowText sTextOnWindowsInfo_Normal[] = .shadowColor = 15, }, { // 16 - .fillValue = 0xEE, + .fillValue = PALETTE_NUM_TO_FILL_VALUE(0xE), .fontId = 1, .x = -1, .y = 1, @@ -1561,7 +1561,7 @@ static const struct BattleWindowText sTextOnWindowsInfo_Normal[] = .shadowColor = 15, }, { // 17 - .fillValue = 0xEE, + .fillValue = PALETTE_NUM_TO_FILL_VALUE(0xE), .fontId = 1, .x = -1, .y = 1, @@ -1573,7 +1573,7 @@ static const struct BattleWindowText sTextOnWindowsInfo_Normal[] = .shadowColor = 15, }, { // 18 - .fillValue = 0xEE, + .fillValue = PALETTE_NUM_TO_FILL_VALUE(0xE), .fontId = 1, .x = -1, .y = 1, @@ -1585,7 +1585,7 @@ static const struct BattleWindowText sTextOnWindowsInfo_Normal[] = .shadowColor = 15, }, { // 19 - .fillValue = 0xEE, + .fillValue = PALETTE_NUM_TO_FILL_VALUE(0xE), .fontId = 1, .x = -1, .y = 1, @@ -1597,7 +1597,7 @@ static const struct BattleWindowText sTextOnWindowsInfo_Normal[] = .shadowColor = 15, }, { // 20 - .fillValue = 0xEE, + .fillValue = PALETTE_NUM_TO_FILL_VALUE(0xE), .fontId = 1, .x = -1, .y = 1, @@ -1609,7 +1609,7 @@ static const struct BattleWindowText sTextOnWindowsInfo_Normal[] = .shadowColor = 15, }, { // 21 - .fillValue = 0x0, + .fillValue = PALETTE_NUM_TO_FILL_VALUE(0), .fontId = 1, .x = -1, .y = 1, @@ -1621,7 +1621,7 @@ static const struct BattleWindowText sTextOnWindowsInfo_Normal[] = .shadowColor = 6, }, { // 22 - .fillValue = 0x0, + .fillValue = PALETTE_NUM_TO_FILL_VALUE(0), .fontId = 1, .x = -1, .y = 1, @@ -1633,7 +1633,7 @@ static const struct BattleWindowText sTextOnWindowsInfo_Normal[] = .shadowColor = 6, }, { // 23 - .fillValue = 0x0, + .fillValue = PALETTE_NUM_TO_FILL_VALUE(0x0), .fontId = 1, .x = -1, .y = 1, @@ -1649,7 +1649,7 @@ static const struct BattleWindowText sTextOnWindowsInfo_Normal[] = static const struct BattleWindowText sTextOnWindowsInfo_Arena[] = { { // 0 - .fillValue = 0xFF, + .fillValue = PALETTE_NUM_TO_FILL_VALUE(0xF), .fontId = 1, .x = 0, .y = 1, @@ -1661,7 +1661,7 @@ static const struct BattleWindowText sTextOnWindowsInfo_Arena[] = .shadowColor = 6, }, { // 1 - .fillValue = 0xFF, + .fillValue = PALETTE_NUM_TO_FILL_VALUE(0xF), .fontId = 1, .x = 1, .y = 1, @@ -1673,7 +1673,7 @@ static const struct BattleWindowText sTextOnWindowsInfo_Arena[] = .shadowColor = 6, }, { // 2 - .fillValue = 0xEE, + .fillValue = PALETTE_NUM_TO_FILL_VALUE(0xE), .fontId = 1, .x = 0, .y = 1, @@ -1685,7 +1685,7 @@ static const struct BattleWindowText sTextOnWindowsInfo_Arena[] = .shadowColor = 15, }, { // 3 - .fillValue = 0xEE, + .fillValue = PALETTE_NUM_TO_FILL_VALUE(0xE), .fontId = 7, .x = 0, .y = 1, @@ -1697,7 +1697,7 @@ static const struct BattleWindowText sTextOnWindowsInfo_Arena[] = .shadowColor = 15, }, { // 4 - .fillValue = 0xEE, + .fillValue = PALETTE_NUM_TO_FILL_VALUE(0xE), .fontId = 7, .x = 0, .y = 1, @@ -1709,7 +1709,7 @@ static const struct BattleWindowText sTextOnWindowsInfo_Arena[] = .shadowColor = 15, }, { // 5 - .fillValue = 0xEE, + .fillValue = PALETTE_NUM_TO_FILL_VALUE(0xE), .fontId = 7, .x = 0, .y = 1, @@ -1721,7 +1721,7 @@ static const struct BattleWindowText sTextOnWindowsInfo_Arena[] = .shadowColor = 15, }, { // 6 - .fillValue = 0xEE, + .fillValue = PALETTE_NUM_TO_FILL_VALUE(0xE), .fontId = 7, .x = 0, .y = 1, @@ -1733,7 +1733,7 @@ static const struct BattleWindowText sTextOnWindowsInfo_Arena[] = .shadowColor = 15, }, { // 7 - .fillValue = 0xEE, + .fillValue = PALETTE_NUM_TO_FILL_VALUE(0xE), .fontId = 7, .x = 0, .y = 1, @@ -1745,7 +1745,7 @@ static const struct BattleWindowText sTextOnWindowsInfo_Arena[] = .shadowColor = 11, }, { // 8 - .fillValue = 0xEE, + .fillValue = PALETTE_NUM_TO_FILL_VALUE(0xE), .fontId = 1, .x = 0, .y = 1, @@ -1757,7 +1757,7 @@ static const struct BattleWindowText sTextOnWindowsInfo_Arena[] = .shadowColor = 15, }, { // 9 - .fillValue = 0xEE, + .fillValue = PALETTE_NUM_TO_FILL_VALUE(0xE), .fontId = 1, .x = 2, .y = 1, @@ -1769,7 +1769,7 @@ static const struct BattleWindowText sTextOnWindowsInfo_Arena[] = .shadowColor = 11, }, { // 10 - .fillValue = 0xEE, + .fillValue = PALETTE_NUM_TO_FILL_VALUE(0xE), .fontId = 7, .x = 0, .y = 1, @@ -1781,7 +1781,7 @@ static const struct BattleWindowText sTextOnWindowsInfo_Arena[] = .shadowColor = 15, }, { // 11 - .fillValue = 0xEE, + .fillValue = PALETTE_NUM_TO_FILL_VALUE(0xE), .fontId = 7, .x = 0, .y = 1, @@ -1793,7 +1793,7 @@ static const struct BattleWindowText sTextOnWindowsInfo_Arena[] = .shadowColor = 15, }, { // 12 - .fillValue = 0xEE, + .fillValue = PALETTE_NUM_TO_FILL_VALUE(0xE), .fontId = 1, .x = 0, .y = 1, @@ -1805,7 +1805,7 @@ static const struct BattleWindowText sTextOnWindowsInfo_Arena[] = .shadowColor = 15, }, { // 13 - .fillValue = 0xEE, + .fillValue = PALETTE_NUM_TO_FILL_VALUE(0xE), .fontId = 1, .x = 0, .y = 1, @@ -1817,7 +1817,7 @@ static const struct BattleWindowText sTextOnWindowsInfo_Arena[] = .shadowColor = 15, }, { // 14 - .fillValue = 0x0, + .fillValue = PALETTE_NUM_TO_FILL_VALUE(0), .fontId = 1, .x = 32, .y = 1, @@ -1829,7 +1829,7 @@ static const struct BattleWindowText sTextOnWindowsInfo_Arena[] = .shadowColor = 2, }, { // 15 - .fillValue = 0xEE, + .fillValue = PALETTE_NUM_TO_FILL_VALUE(0xE), .fontId = 1, .x = -1, .y = 1, @@ -1841,7 +1841,7 @@ static const struct BattleWindowText sTextOnWindowsInfo_Arena[] = .shadowColor = 15, }, { // 16 - .fillValue = 0xEE, + .fillValue = PALETTE_NUM_TO_FILL_VALUE(0xE), .fontId = 1, .x = -1, .y = 1, @@ -1853,7 +1853,7 @@ static const struct BattleWindowText sTextOnWindowsInfo_Arena[] = .shadowColor = 15, }, { // 17 - .fillValue = 0xEE, + .fillValue = PALETTE_NUM_TO_FILL_VALUE(0xE), .fontId = 1, .x = -1, .y = 1, @@ -1865,7 +1865,7 @@ static const struct BattleWindowText sTextOnWindowsInfo_Arena[] = .shadowColor = 15, }, { // 18 - .fillValue = 0xEE, + .fillValue = PALETTE_NUM_TO_FILL_VALUE(0xE), .fontId = 1, .x = -1, .y = 1, @@ -1877,7 +1877,7 @@ static const struct BattleWindowText sTextOnWindowsInfo_Arena[] = .shadowColor = 15, }, { // 19 - .fillValue = 0xEE, + .fillValue = PALETTE_NUM_TO_FILL_VALUE(0xE), .fontId = 1, .x = -1, .y = 1, @@ -1889,7 +1889,7 @@ static const struct BattleWindowText sTextOnWindowsInfo_Arena[] = .shadowColor = 15, }, { // 20 - .fillValue = 0xEE, + .fillValue = PALETTE_NUM_TO_FILL_VALUE(0xE), .fontId = 1, .x = -1, .y = 1, @@ -1901,7 +1901,7 @@ static const struct BattleWindowText sTextOnWindowsInfo_Arena[] = .shadowColor = 15, }, { // 21 - .fillValue = 0xEE, + .fillValue = PALETTE_NUM_TO_FILL_VALUE(0xE), .fontId = 1, .x = -1, .y = 1, @@ -1913,7 +1913,7 @@ static const struct BattleWindowText sTextOnWindowsInfo_Arena[] = .shadowColor = 15, }, { // 22 - .fillValue = 0x11, + .fillValue = PALETTE_NUM_TO_FILL_VALUE(0x1), .fontId = 1, .x = 0, .y = 1, diff --git a/src/battle_pyramid_bag.c b/src/battle_pyramid_bag.c index 3601c5ad2b..5103562155 100644 --- a/src/battle_pyramid_bag.c +++ b/src/battle_pyramid_bag.c @@ -651,7 +651,7 @@ static void PrintItemDescription(s32 listMenuId) StringExpandPlaceholders(gStringVar4, gText_ReturnToVar1); desc = gStringVar4; } - FillWindowPixelBuffer(1, PIXEL_BUFFER_TRANSPARENT); + FillWindowPixelBuffer(1, PALETTE_NUM_TO_FILL_VALUE(0)); PrintOnWindow_Font1(1, desc, 3, 0, 0, 1, 0, 0); } @@ -911,7 +911,7 @@ static void sub_81C5D20(u8 taskId) CopyItemName(gSpecialVar_ItemId, gStringVar1); StringExpandPlaceholders(gStringVar4, gText_Var1IsSelected); - FillWindowPixelBuffer(1, PIXEL_BUFFER_TRANSPARENT); + FillWindowPixelBuffer(1, PALETTE_NUM_TO_FILL_VALUE(0)); PrintOnWindow_Font1(1, gStringVar4, 3, 0, 0, 1, 0, 0); if (gPyramidBagResources->menuActionsCount == 1) sub_81C5EAC(sub_81C6D24(0)); @@ -1048,7 +1048,7 @@ static void BagAction_UseOnField(u8 taskId) else if (ItemId_GetFieldFunc(gSpecialVar_ItemId) != NULL) { sub_81C61A8(); - FillWindowPixelBuffer(1, PIXEL_BUFFER_TRANSPARENT); + FillWindowPixelBuffer(1, PALETTE_NUM_TO_FILL_VALUE(0)); schedule_bg_copy_tilemap_to_vram(0); ItemId_GetFieldFunc(gSpecialVar_ItemId)(taskId); } @@ -1086,7 +1086,7 @@ static void BagAction_Toss(u8 taskId) { CopyItemName(gSpecialVar_ItemId, gStringVar1); StringExpandPlaceholders(gStringVar4, gText_TossHowManyVar1s); - FillWindowPixelBuffer(1, PIXEL_BUFFER_TRANSPARENT); + FillWindowPixelBuffer(1, PALETTE_NUM_TO_FILL_VALUE(0)); PrintOnWindow_Font1(1, gStringVar4, 3, 0, 0, 1, 0, 0); sub_81C6404(); gTasks[taskId].func = sub_81C64B4; @@ -1100,7 +1100,7 @@ static void sub_81C6350(u8 taskId) CopyItemName(gSpecialVar_ItemId, gStringVar1); ConvertIntToDecimalStringN(gStringVar2, data[8], STR_CONV_MODE_LEFT_ALIGN, 2); StringExpandPlaceholders(gStringVar4, gText_ConfirmTossItems); - FillWindowPixelBuffer(1, PIXEL_BUFFER_TRANSPARENT); + FillWindowPixelBuffer(1, PALETTE_NUM_TO_FILL_VALUE(0)); PrintOnWindow_Font1(1, gStringVar4, 3, 0, 0, 1, 0, 0); sub_81C6DAC(taskId, &sYesNoTossFuncions); } @@ -1168,7 +1168,7 @@ static void TossItem(u8 taskId) CopyItemName(gSpecialVar_ItemId, gStringVar1); ConvertIntToDecimalStringN(gStringVar2, data[8], STR_CONV_MODE_LEFT_ALIGN, 2); StringExpandPlaceholders(gStringVar4, gText_ThrewAwayVar2Var1s); - FillWindowPixelBuffer(1, PIXEL_BUFFER_TRANSPARENT); + FillWindowPixelBuffer(1, PALETTE_NUM_TO_FILL_VALUE(0)); PrintOnWindow_Font1(1, gStringVar4, 3, 0, 0, 1, 0, 0); gTasks[taskId].func = sub_81C65CC; } @@ -1265,7 +1265,7 @@ static void Task_BeginItemSwap(u8 taskId) ListMenuSetUnkIndicatorsStructField(data[0], 0x10, 1); CopyItemName(gSaveBlock2Ptr->frontier.pyramidBag.itemId[gSaveBlock2Ptr->frontier.lvlMode][data[1]], gStringVar1); StringExpandPlaceholders(gStringVar4, gText_MoveVar1Where); - FillWindowPixelBuffer(1, PIXEL_BUFFER_TRANSPARENT); + FillWindowPixelBuffer(1, PALETTE_NUM_TO_FILL_VALUE(0)); PrintOnWindow_Font1(1, gStringVar4, 3, 0, 0, 1, 0, 0); sub_81C5A98(data[0], 1); sub_81C704C(data[1]); @@ -1395,7 +1395,7 @@ static void sub_81C6BD8(void) LoadPalette(gUnknown_0860F074, 0xF0, 0x20); for (i = 0; i < 5; i++) - FillWindowPixelBuffer(i, PIXEL_BUFFER_TRANSPARENT); + FillWindowPixelBuffer(i, PALETTE_NUM_TO_FILL_VALUE(0)); PutWindowTilemap(0); PutWindowTilemap(1); @@ -1456,7 +1456,7 @@ static void sub_81C6DAC(u8 taskId, const struct YesNoFuncTable *yesNoTable) void DisplayItemMessageInBattlePyramid(u8 taskId, const u8 *str, void (*callback)(u8 taskId)) { - FillWindowPixelBuffer(2, PIXEL_BUFFER_WHITE); + FillWindowPixelBuffer(2, PALETTE_NUM_TO_FILL_VALUE(1)); DisplayMessageAndContinueTask(taskId, 2, 0xA, 0xD, 1, GetPlayerTextSpeedDelay(), str, callback); schedule_bg_copy_tilemap_to_vram(1); } diff --git a/src/battle_records.c b/src/battle_records.c index 2ec0ee91e5..eb41dcc94a 100644 --- a/src/battle_records.c +++ b/src/battle_records.c @@ -321,7 +321,7 @@ void ShowLinkBattleRecords(void) gRecordsWindowId = AddWindow(&sLinkBattleRecordsWindow); NewMenuHelpers_DrawStdWindowFrame(gRecordsWindowId, FALSE); - FillWindowPixelBuffer(gRecordsWindowId, PIXEL_BUFFER_WHITE); + FillWindowPixelBuffer(gRecordsWindowId, PALETTE_NUM_TO_FILL_VALUE(1)); StringExpandPlaceholders(gStringVar4, gText_PlayersBattleResults); x = GetStringCenterAlignXOffset(1, gStringVar4, 208); @@ -383,7 +383,7 @@ static void Task_ExitTrainerHillRecords(u8 taskId) static void RemoveTrainerHillRecordsWindow(u8 windowId) { - FillWindowPixelBuffer(windowId, PIXEL_BUFFER_TRANSPARENT); + FillWindowPixelBuffer(windowId, PALETTE_NUM_TO_FILL_VALUE(0)); ClearWindowTilemap(windowId); CopyWindowToVram(windowId, 2); RemoveWindow(windowId); diff --git a/src/berry_blender.c b/src/berry_blender.c index 60a6f77a03..0a35c672f9 100644 --- a/src/berry_blender.c +++ b/src/berry_blender.c @@ -945,7 +945,7 @@ static void InitBerryBlenderWindows(void) DeactivateAllTextPrinters(); for (i = 0; i < 5; i++) - FillWindowPixelBuffer(i, PIXEL_BUFFER_TRANSPARENT); + FillWindowPixelBuffer(i, PALETTE_NUM_TO_FILL_VALUE(0)); FillBgTilemapBufferRect_Palette0(0, 0, 0, 0, 0x1E, 0x14); sub_81978B0(0xE0); @@ -3538,7 +3538,7 @@ void ShowBerryBlenderRecordWindow(void) winTemplate = sBlenderRecordWindowTemplate; gRecordsWindowId = AddWindow(&winTemplate); NewMenuHelpers_DrawStdWindowFrame(gRecordsWindowId, 0); - FillWindowPixelBuffer(gRecordsWindowId, PIXEL_BUFFER_WHITE); + FillWindowPixelBuffer(gRecordsWindowId, PALETTE_NUM_TO_FILL_VALUE(1)); xPos = GetStringCenterAlignXOffset(1, gText_BlenderMaxSpeedRecord, 0x90); AddTextPrinterParameterized(gRecordsWindowId, 1, gText_BlenderMaxSpeedRecord, xPos, 1, 0, NULL); @@ -3647,7 +3647,7 @@ static void Blender_AddTextPrinter(u8 windowId, const u8 *string, u8 x, u8 y, s3 if (caseId != 3) { - FillWindowPixelBuffer(windowId, txtColor[0] | (txtColor[0] << 4)); + FillWindowPixelBuffer(windowId, PALETTE_NUM_TO_FILL_VALUE(txtColor[0])); } AddTextPrinterParameterized4(windowId, 1, x, y, letterSpacing, 1, txtColor, speed, string); diff --git a/src/berry_fix_program.c b/src/berry_fix_program.c index 7e72a9f3ba..24198fc870 100644 --- a/src/berry_fix_program.c +++ b/src/berry_fix_program.c @@ -226,9 +226,9 @@ static void berry_fix_gpu_set(void) DmaCopy32(3, sUnknown_08618138, BG_PLTT + 0x1E0, 0x20); SetGpuReg(REG_OFFSET_DISPCNT, DISPCNT_OBJ_1D_MAP); - FillWindowPixelBuffer(2, PIXEL_BUFFER_TRANSPARENT); - FillWindowPixelBuffer(3, PIXEL_BUFFER_TRANSPARENT); - FillWindowPixelBuffer(0, 0xAA); + FillWindowPixelBuffer(2, PALETTE_NUM_TO_FILL_VALUE(0)); + FillWindowPixelBuffer(3, PALETTE_NUM_TO_FILL_VALUE(0)); + FillWindowPixelBuffer(0, PALETTE_NUM_TO_FILL_VALUE(0xA)); width = GetStringWidth(0, sUnknown_08617E9B, 0); left = (0x78 - width) / 2; @@ -273,7 +273,7 @@ static int berry_fix_text_update(int checkval) static void berry_fix_text_print(int scene) { FillBgTilemapBufferRect_Palette0(0, 0, 0, 0, 32, 32); - FillWindowPixelBuffer(1, 0xAA); + FillWindowPixelBuffer(1, PALETTE_NUM_TO_FILL_VALUE(0xA)); AddTextPrinterParameterized3(1, 1, 0, 0, sUnknown_08618158, -1, gUnknown_08618160[scene]); PutWindowTilemap(1); CopyWindowToVram(1, 2); diff --git a/src/berry_tag_screen.c b/src/berry_tag_screen.c index 6c08611add..7b69357786 100644 --- a/src/berry_tag_screen.c +++ b/src/berry_tag_screen.c @@ -381,7 +381,7 @@ static void PrintTextInBerryTagScreen(u8 windowId, const u8 *text, u8 x, u8 y, s static void AddBerryTagTextToBg0(void) { memcpy(GetBgTilemapBuffer(0), sBerryTag->tilemapBuffers[2], sizeof(sBerryTag->tilemapBuffers[2])); - FillWindowPixelBuffer(WIN_BERRY_TAG, PIXEL_BUFFER_UNKNOWN); + FillWindowPixelBuffer(WIN_BERRY_TAG, PALETTE_NUM_TO_FILL_VALUE(15)); PrintTextInBerryTagScreen(WIN_BERRY_TAG, gText_BerryTag, GetStringCenterAlignXOffset(1, gText_BerryTag, 0x40), 1, 0, 1); PutWindowTilemap(WIN_BERRY_TAG); schedule_bg_copy_tilemap_to_vram(0); @@ -598,7 +598,7 @@ static void Task_DisplayAnotherBerry(u8 taskId) switch (data[0]) { case 0x30: - FillWindowPixelBuffer(0, PIXEL_BUFFER_TRANSPARENT); + FillWindowPixelBuffer(0, PALETTE_NUM_TO_FILL_VALUE(0)); break; case 0x40: PrintBerryNumberAndName(); @@ -608,7 +608,7 @@ static void Task_DisplayAnotherBerry(u8 taskId) CreateBerrySprite(); break; case 0x60: - FillWindowPixelBuffer(1, PIXEL_BUFFER_TRANSPARENT); + FillWindowPixelBuffer(1, PALETTE_NUM_TO_FILL_VALUE(0)); break; case 0x70: PrintBerrySize(); @@ -620,7 +620,7 @@ static void Task_DisplayAnotherBerry(u8 taskId) SetFlavorCirclesVisiblity(); break; case 0xA0: - FillWindowPixelBuffer(2, PIXEL_BUFFER_TRANSPARENT); + FillWindowPixelBuffer(2, PALETTE_NUM_TO_FILL_VALUE(0)); break; case 0xB0: PrintBerryDescription1(); @@ -635,7 +635,7 @@ static void Task_DisplayAnotherBerry(u8 taskId) switch (data[0]) { case 0x30: - FillWindowPixelBuffer(2, PIXEL_BUFFER_TRANSPARENT); + FillWindowPixelBuffer(2, PALETTE_NUM_TO_FILL_VALUE(0)); break; case 0x40: PrintBerryDescription2(); @@ -647,7 +647,7 @@ static void Task_DisplayAnotherBerry(u8 taskId) SetFlavorCirclesVisiblity(); break; case 0x70: - FillWindowPixelBuffer(1, PIXEL_BUFFER_TRANSPARENT); + FillWindowPixelBuffer(1, PALETTE_NUM_TO_FILL_VALUE(0)); break; case 0x80: PrintBerryFirmness(); @@ -660,7 +660,7 @@ static void Task_DisplayAnotherBerry(u8 taskId) CreateBerrySprite(); break; case 0xB0: - FillWindowPixelBuffer(0, PIXEL_BUFFER_TRANSPARENT); + FillWindowPixelBuffer(0, PALETTE_NUM_TO_FILL_VALUE(0)); break; case 0xC0: PrintBerryNumberAndName(); diff --git a/src/clear_save_data_screen.c b/src/clear_save_data_screen.c index 2e4ac84275..7fdd101e22 100644 --- a/src/clear_save_data_screen.c +++ b/src/clear_save_data_screen.c @@ -90,7 +90,7 @@ static void Task_ClearSaveDataScreenYesNoChoice(u8 taskId) switch (Menu_ProcessInputNoWrapClearOnChoose()) { case 0: - FillWindowPixelBuffer(0, PIXEL_BUFFER_WHITE); + FillWindowPixelBuffer(0, PALETTE_NUM_TO_FILL_VALUE(1)); AddTextPrinterParameterized(0, 1, gText_ClearingData, 0, 1, 0, 0); gTasks[taskId].func = Task_ClearSaveData; break; @@ -203,7 +203,7 @@ static void InitClearSaveDataScreenWindows(void) { InitWindows(sClearSaveTextWindow); DeactivateAllTextPrinters(); - FillWindowPixelBuffer(0, PIXEL_BUFFER_TRANSPARENT); + FillWindowPixelBuffer(0, PALETTE_NUM_TO_FILL_VALUE(0)); LoadWindowGfx(0, 0, 2, 224); LoadPalette(gUnknown_0860F074, 0xF0, 0x20); } diff --git a/src/coins.c b/src/coins.c index 6ad80f80c7..c6fbf12169 100644 --- a/src/coins.c +++ b/src/coins.c @@ -27,7 +27,7 @@ void ShowCoinsWindow(u32 coinAmount, u8 x, u8 y) struct WindowTemplate template; SetWindowTemplateFields(&template, 0, x, y, 8, 2, 0xF, 0x141); sCoinsWindowId = AddWindow(&template); - FillWindowPixelBuffer(sCoinsWindowId, PIXEL_BUFFER_TRANSPARENT); + FillWindowPixelBuffer(sCoinsWindowId, PALETTE_NUM_TO_FILL_VALUE(0)); PutWindowTilemap(sCoinsWindowId); SetWindowBorderStyle(sCoinsWindowId, FALSE, 0x214, 0xE); PrintCoinsString(coinAmount); diff --git a/src/contest.c b/src/contest.c index aa6bd99902..f668baf922 100644 --- a/src/contest.c +++ b/src/contest.c @@ -819,7 +819,7 @@ static void sub_80D8490(u8 taskId) } r5 = StringCopy(r5, gMoveNames[move]); - FillWindowPixelBuffer(i + 5, PIXEL_BUFFER_TRANSPARENT); + FillWindowPixelBuffer(i + 5, PALETTE_NUM_TO_FILL_VALUE(0)); Contest_PrintTextToBg0WindowAt(i + 5, sp8, 5, 1, 7); } @@ -941,7 +941,7 @@ static void sub_80D895C(u8 taskId) for (i = 0; i < 4; i++) { - FillWindowPixelBuffer(5 + i, PIXEL_BUFFER_TRANSPARENT); + FillWindowPixelBuffer(5 + i, PALETTE_NUM_TO_FILL_VALUE(0)); PutWindowTilemap(5 + i); CopyWindowToVram(5 + i, 2); } @@ -2258,7 +2258,7 @@ static void sub_80DAEA4(void) for (i = 0; i < 4; i++) { - FillWindowPixelBuffer(gUnknown_02039F26[i], PIXEL_BUFFER_TRANSPARENT); + FillWindowPixelBuffer(gUnknown_02039F26[i], PALETTE_NUM_TO_FILL_VALUE(0)); sub_80DAF04(i); sub_80DAF88(i); } @@ -2478,7 +2478,7 @@ static void prints_contest_move_description(u16 a) ContestBG_FillBoxWithTile(0, 0x5036, 0x15, 0x20, 0x08, 0x01, 0x11); ContestBG_FillBoxWithTile(0, 0x5014, 0x15, 0x20, numHearts, 0x01, 0x11); - FillWindowPixelBuffer(10, PIXEL_BUFFER_TRANSPARENT); + FillWindowPixelBuffer(10, PALETTE_NUM_TO_FILL_VALUE(0)); Contest_PrintTextToBg0WindowStd(10, gContestEffectDescriptionPointers[gContestMoves[a].effect]); Contest_PrintTextToBg0WindowStd(9, gText_Slash); } @@ -2621,7 +2621,7 @@ static void sub_80DB884(void) static void sub_80DB89C(void) { - FillWindowPixelBuffer(4, PIXEL_BUFFER_TRANSPARENT); + FillWindowPixelBuffer(4, PALETTE_NUM_TO_FILL_VALUE(0)); CopyWindowToVram(4, 2); Contest_SetBgCopyFlags(0); } @@ -3456,7 +3456,7 @@ static void sub_80DCD48(void) break; default: for (i = 0; i < 4; i++) - FillWindowPixelBuffer(i, PIXEL_BUFFER_TRANSPARENT); + FillWindowPixelBuffer(i, PALETTE_NUM_TO_FILL_VALUE(0)); for (i = 0; i < 4; i++) { value = sContestantStatus[i].unk4; @@ -5038,7 +5038,7 @@ static void sub_80DF750(void) return; for (i = 0; i < 4; i++) - FillWindowPixelBuffer(i, PIXEL_BUFFER_TRANSPARENT); + FillWindowPixelBuffer(i, PALETTE_NUM_TO_FILL_VALUE(0)); if (gHeap[0x1A000] == 2) { diff --git a/src/contest_link_80F57C4.c b/src/contest_link_80F57C4.c index 4539d09a65..8e9c42f3d0 100644 --- a/src/contest_link_80F57C4.c +++ b/src/contest_link_80F57C4.c @@ -935,7 +935,7 @@ static void sub_80F6AE8(void) // windowTemplate.width = 30; // windowTemplate.height = 2; // windowId = AddWindow(&windowTemplate); -// FillWindowPixelBuffer(windowId, PIXEL_BUFFER_WHITE); +// FillWindowPixelBuffer(windowId, PALETTE_NUM_TO_FILL_VALUE(1)); // origWidth = GetStringWidth(1, text, 0) + 9; // strWidth = origWidth; // if (strWidth < 0) diff --git a/src/contest_painting.c b/src/contest_painting.c index dbd1933066..b961c7a659 100644 --- a/src/contest_painting.c +++ b/src/contest_painting.c @@ -279,7 +279,7 @@ static void InitContestPaintingWindow(void) SetBgTilemapBuffer(1, AllocZeroed(BG_SCREEN_SIZE)); gContestPaintingWindowId = AddWindow(&gUnknown_085B07EC); DeactivateAllTextPrinters(); - FillWindowPixelBuffer(gContestPaintingWindowId, PIXEL_BUFFER_TRANSPARENT); + FillWindowPixelBuffer(gContestPaintingWindowId, PALETTE_NUM_TO_FILL_VALUE(0)); PutWindowTilemap(gContestPaintingWindowId); CopyWindowToVram(gContestPaintingWindowId, 3); ShowBg(1); diff --git a/src/credits.c b/src/credits.c index 9aadc18aa7..66f9f7ea87 100644 --- a/src/credits.c +++ b/src/credits.c @@ -1592,7 +1592,7 @@ static void sub_8175DA0(u8 taskIdB) case 5: if (!gPaletteFade.active) { - FillWindowPixelBuffer(0, PIXEL_BUFFER_TRANSPARENT); + FillWindowPixelBuffer(0, PALETTE_NUM_TO_FILL_VALUE(0)); CopyWindowToVram(0, 2); gTasks[taskIdB].data[TDB_0] = 2; } diff --git a/src/decoration.c b/src/decoration.c index afbb4ad409..c3434522de 100644 --- a/src/decoration.c +++ b/src/decoration.c @@ -543,7 +543,7 @@ void sub_8126B80(u8 taskId) void sub_8126C08(void) { - FillWindowPixelBuffer(0, PIXEL_BUFFER_WHITE); + FillWindowPixelBuffer(0, PALETTE_NUM_TO_FILL_VALUE(1)); AddTextPrinterParameterized2(0, 1, sSecretBasePCMenuItemDescriptions[sSecretBasePCMenuCursorPos], 0, 0, 2, 1, 3); } @@ -634,7 +634,7 @@ void sub_8126DFC(u8 taskId) void sub_8126E44(u8 taskId) { - FillWindowPixelBuffer(sDecorMenuWindowIndices[1], PIXEL_BUFFER_WHITE); + FillWindowPixelBuffer(sDecorMenuWindowIndices[1], PALETTE_NUM_TO_FILL_VALUE(1)); sub_8126E8C(taskId); InitMenuInUpperLeftCornerPlaySoundWhenAPressed(sDecorMenuWindowIndices[1], 9, sCurDecorationCategory); gTasks[taskId].func = sub_8127088; @@ -968,7 +968,7 @@ void sub_8127744(u32 a0) const u8 *txt; winidx = sDecorMenuWindowIndices[3]; - FillWindowPixelBuffer(winidx, PIXEL_BUFFER_WHITE); + FillWindowPixelBuffer(winidx, PALETTE_NUM_TO_FILL_VALUE(1)); if (a0 >= sCurDecorCatCount) { txt = gText_GoBackPrevMenu; diff --git a/src/diploma.c b/src/diploma.c index 9194af7106..f2c2a965c1 100644 --- a/src/diploma.c +++ b/src/diploma.c @@ -197,7 +197,7 @@ static void InitDiplomaWindow(void) InitWindows(sDiplomaWinTemplates); DeactivateAllTextPrinters(); LoadPalette(gUnknown_0860F074, 0xF0, 0x20); - FillWindowPixelBuffer(0, PIXEL_BUFFER_TRANSPARENT); + FillWindowPixelBuffer(0, PALETTE_NUM_TO_FILL_VALUE(0)); PutWindowTilemap(0); } diff --git a/src/egg_hatch.c b/src/egg_hatch.c index f52f66a2aa..8fb21dbbed 100644 --- a/src/egg_hatch.c +++ b/src/egg_hatch.c @@ -606,7 +606,7 @@ static void CB2_EggHatch_1(void) case 1: if (!gPaletteFade.active) { - FillWindowPixelBuffer(sEggHatchData->windowId, PIXEL_BUFFER_TRANSPARENT); + FillWindowPixelBuffer(sEggHatchData->windowId, PALETTE_NUM_TO_FILL_VALUE(0)); sEggHatchData->CB2_PalCounter = 0; sEggHatchData->CB2_state++; } @@ -857,7 +857,7 @@ static void CreateEggShardSprite(u8 x, u8 y, s16 data1, s16 data2, s16 data3, u8 static void EggHatchPrintMessage(u8 windowId, u8* string, u8 x, u8 y, u8 speed) { - FillWindowPixelBuffer(windowId, PIXEL_BUFFER_UNKNOWN); + FillWindowPixelBuffer(windowId, PALETTE_NUM_TO_FILL_VALUE(15)); sEggHatchData->textColor[0] = 0; sEggHatchData->textColor[1] = 5; sEggHatchData->textColor[2] = 6; diff --git a/src/field_player_avatar.c b/src/field_player_avatar.c index dff010d13c..ddaaa208b2 100644 --- a/src/field_player_avatar.c +++ b/src/field_player_avatar.c @@ -1918,7 +1918,7 @@ static bool8 Fishing9(struct Task *task) static bool8 Fishing10(struct Task *task) { AlignFishingAnimationFrames(); - FillWindowPixelBuffer(0, PIXEL_BUFFER_WHITE); + FillWindowPixelBuffer(0, PALETTE_NUM_TO_FILL_VALUE(1)); AddTextPrinterParameterized2(0, 1, gText_PokemonOnHook, 1, 0, 2, 1, 3); task->tStep++; task->tFrameCounter = 0; @@ -1966,7 +1966,7 @@ static bool8 Fishing12(struct Task *task) { AlignFishingAnimationFrames(); StartSpriteAnim(&gSprites[gPlayerAvatar.spriteId], GetFishingNoCatchDirectionAnimNum(GetPlayerFacingDirection())); - FillWindowPixelBuffer(0, PIXEL_BUFFER_WHITE); + FillWindowPixelBuffer(0, PALETTE_NUM_TO_FILL_VALUE(1)); AddTextPrinterParameterized2(0, 1, gText_NotEvenANibble, 1, 0, 2, 1, 3); task->tStep = FISHING_SHOW_RESULT; return TRUE; @@ -1977,7 +1977,7 @@ static bool8 Fishing13(struct Task *task) { AlignFishingAnimationFrames(); StartSpriteAnim(&gSprites[gPlayerAvatar.spriteId], GetFishingNoCatchDirectionAnimNum(GetPlayerFacingDirection())); - FillWindowPixelBuffer(0, PIXEL_BUFFER_WHITE); + FillWindowPixelBuffer(0, PALETTE_NUM_TO_FILL_VALUE(1)); AddTextPrinterParameterized2(0, 1, gText_ItGotAway, 1, 0, 2, 1, 3); task->tStep++; return TRUE; diff --git a/src/field_region_map.c b/src/field_region_map.c index 6814b26bd3..e128c70849 100644 --- a/src/field_region_map.c +++ b/src/field_region_map.c @@ -196,13 +196,13 @@ static void PrintRegionMapSecName(void) { if (sFieldRegionMapHandler->regionMap.iconDrawType != MAPSECTYPE_NONE) { - FillWindowPixelBuffer(0, PIXEL_BUFFER_WHITE); + FillWindowPixelBuffer(0, PALETTE_NUM_TO_FILL_VALUE(1)); AddTextPrinterParameterized(0, 1, sFieldRegionMapHandler->regionMap.mapSecName, 0, 1, 0, NULL); schedule_bg_copy_tilemap_to_vram(0); } else { - FillWindowPixelBuffer(0, PIXEL_BUFFER_WHITE); + FillWindowPixelBuffer(0, PALETTE_NUM_TO_FILL_VALUE(1)); CopyWindowToVram(0, 3); } } diff --git a/src/field_specials.c b/src/field_specials.c index 9390eab87b..62d3b8e599 100644 --- a/src/field_specials.c +++ b/src/field_specials.c @@ -2645,7 +2645,7 @@ static void sub_813A570(u8 taskId) DestroyListMenuTask(task->data[14], NULL, NULL); Free(gUnknown_0203AB64); sub_8198070(task->data[13], 1); - FillWindowPixelBuffer(task->data[13], PIXEL_BUFFER_TRANSPARENT); + FillWindowPixelBuffer(task->data[13], PALETTE_NUM_TO_FILL_VALUE(0)); CopyWindowToVram(task->data[13], 2); RemoveWindow(task->data[13]); DestroyTask(taskId); @@ -3226,7 +3226,7 @@ void sub_813AF48(void) DestroyListMenuTask(task->data[14], NULL, NULL); Free(gUnknown_0203AB64); sub_8198070(task->data[13], TRUE); - FillWindowPixelBuffer(task->data[13], PIXEL_BUFFER_TRANSPARENT); + FillWindowPixelBuffer(task->data[13], PALETTE_NUM_TO_FILL_VALUE(0)); ClearWindowTilemap(task->data[13]); CopyWindowToVram(task->data[13], 2); RemoveWindow(task->data[13]); diff --git a/src/frontier_pass.c b/src/frontier_pass.c index 39442dcfd0..c449a50f0a 100644 --- a/src/frontier_pass.c +++ b/src/frontier_pass.c @@ -1090,7 +1090,7 @@ static void ShowAndPrintWindows(void) for (i = 0; i < WINDOW_COUNT; i++) { PutWindowTilemap(i); - FillWindowPixelBuffer(i, PIXEL_BUFFER_TRANSPARENT); + FillWindowPixelBuffer(i, PALETTE_NUM_TO_FILL_VALUE(0)); } x = GetStringCenterAlignXOffset(1, gText_SymbolsEarned, 96); @@ -1116,7 +1116,7 @@ static void ShowAndPrintWindows(void) static void PrintAreaDescription(u8 cursorArea) { - FillWindowPixelBuffer(WINDOW_DESCRIPTION, PIXEL_BUFFER_TRANSPARENT); + FillWindowPixelBuffer(WINDOW_DESCRIPTION, PALETTE_NUM_TO_FILL_VALUE(0)); if (cursorArea == CURSOR_AREA_RECORD && !sPassData->hasBattleRecord) AddTextPrinterParameterized3(WINDOW_DESCRIPTION, 1, 2, 0, sTextColors[1], 0, sPassAreaDescriptions[0]); else if (cursorArea != CURSOR_AREA_NOTHING) @@ -1656,7 +1656,7 @@ static void PrintOnFrontierMap(void) for (i = 0; i < MAP_WINDOW_COUNT; i++) { PutWindowTilemap(i); - FillWindowPixelBuffer(i, PIXEL_BUFFER_TRANSPARENT); + FillWindowPixelBuffer(i, PALETTE_NUM_TO_FILL_VALUE(0)); } for (i = 0; i < NUM_FRONTIER_FACILITIES; i++) @@ -1698,7 +1698,7 @@ static void HandleFrontierMapCursorMove(u8 direction) StartSpriteAnim(sMapData->mapIndicatorSprite, sMapLandmarks[sMapData->cursorPos].animNum); sMapData->mapIndicatorSprite->pos1.x = sMapLandmarks[sMapData->cursorPos].x; sMapData->mapIndicatorSprite->pos1.y = sMapLandmarks[sMapData->cursorPos].y; - FillWindowPixelBuffer(MAP_WINDOW_DESCRIPTION, PIXEL_BUFFER_TRANSPARENT); + FillWindowPixelBuffer(MAP_WINDOW_DESCRIPTION, PALETTE_NUM_TO_FILL_VALUE(0)); AddTextPrinterParameterized3(MAP_WINDOW_DESCRIPTION, 1, 4, 0, sTextColors[0], 0, sMapLandmarks[sMapData->cursorPos].description); for (i = 0; i < 3; i++) diff --git a/src/frontier_util.c b/src/frontier_util.c index 28c74ceaa9..5846616b71 100644 --- a/src/frontier_util.c +++ b/src/frontier_util.c @@ -1045,7 +1045,7 @@ static void ShowTowerResultsWindow(u8 battleMode) { gRecordsWindowId = AddWindow(&gUnknown_08611C74); NewMenuHelpers_DrawStdWindowFrame(gRecordsWindowId, FALSE); - FillWindowPixelBuffer(gRecordsWindowId, PIXEL_BUFFER_WHITE); + FillWindowPixelBuffer(gRecordsWindowId, PALETTE_NUM_TO_FILL_VALUE(1)); if (battleMode == FRONTIER_MODE_SINGLES) StringExpandPlaceholders(gStringVar4, gText_SingleBattleRoomResults); else if (battleMode == FRONTIER_MODE_DOUBLES) @@ -1116,7 +1116,7 @@ static void ShowDomeResultsWindow(u8 battleMode) { gRecordsWindowId = AddWindow(&gUnknown_08611C74); NewMenuHelpers_DrawStdWindowFrame(gRecordsWindowId, FALSE); - FillWindowPixelBuffer(gRecordsWindowId, PIXEL_BUFFER_WHITE); + FillWindowPixelBuffer(gRecordsWindowId, PALETTE_NUM_TO_FILL_VALUE(1)); if (battleMode == FRONTIER_MODE_SINGLES) StringExpandPlaceholders(gStringVar4, gText_SingleBattleTourneyResults); else @@ -1192,7 +1192,7 @@ static void ShowPalaceResultsWindow(u8 battleMode) { gRecordsWindowId = AddWindow(&gUnknown_08611C74); NewMenuHelpers_DrawStdWindowFrame(gRecordsWindowId, FALSE); - FillWindowPixelBuffer(gRecordsWindowId, PIXEL_BUFFER_WHITE); + FillWindowPixelBuffer(gRecordsWindowId, PALETTE_NUM_TO_FILL_VALUE(1)); if (battleMode == FRONTIER_MODE_SINGLES) StringExpandPlaceholders(gStringVar4, gText_SingleBattleHallResults); else @@ -1248,7 +1248,7 @@ static void ShowPikeResultsWindow(void) { gRecordsWindowId = AddWindow(&gUnknown_08611C74); NewMenuHelpers_DrawStdWindowFrame(gRecordsWindowId, FALSE); - FillWindowPixelBuffer(gRecordsWindowId, PIXEL_BUFFER_WHITE); + FillWindowPixelBuffer(gRecordsWindowId, PALETTE_NUM_TO_FILL_VALUE(1)); StringExpandPlaceholders(gStringVar4, gText_BattleChoiceResults); PrintAligned(gStringVar4, 0); AddTextPrinterParameterized(gRecordsWindowId, 1, gText_Lv502, 8, 33, TEXT_SPEED_FF, NULL); @@ -1310,7 +1310,7 @@ static void ShowArenaResultsWindow(void) { gRecordsWindowId = AddWindow(&gUnknown_08611C74); NewMenuHelpers_DrawStdWindowFrame(gRecordsWindowId, FALSE); - FillWindowPixelBuffer(gRecordsWindowId, PIXEL_BUFFER_WHITE); + FillWindowPixelBuffer(gRecordsWindowId, PALETTE_NUM_TO_FILL_VALUE(1)); PrintHyphens(10); StringExpandPlaceholders(gStringVar4, gText_SetKOTourneyResults); PrintAligned(gStringVar4, 2); @@ -1396,7 +1396,7 @@ static void ShowFactoryResultsWindow(u8 battleMode) { gRecordsWindowId = AddWindow(&gUnknown_08611C74); NewMenuHelpers_DrawStdWindowFrame(gRecordsWindowId, FALSE); - FillWindowPixelBuffer(gRecordsWindowId, PIXEL_BUFFER_WHITE); + FillWindowPixelBuffer(gRecordsWindowId, PALETTE_NUM_TO_FILL_VALUE(1)); if (battleMode == FRONTIER_MODE_SINGLES) StringExpandPlaceholders(gStringVar4, gText_BattleSwapSingleResults); else @@ -1461,7 +1461,7 @@ static void ShowPyramidResultsWindow(void) { gRecordsWindowId = AddWindow(&gUnknown_08611C74); NewMenuHelpers_DrawStdWindowFrame(gRecordsWindowId, FALSE); - FillWindowPixelBuffer(gRecordsWindowId, PIXEL_BUFFER_WHITE); + FillWindowPixelBuffer(gRecordsWindowId, PALETTE_NUM_TO_FILL_VALUE(1)); StringExpandPlaceholders(gStringVar4, gText_BattleQuestResults); PrintAligned(gStringVar4, 2); AddTextPrinterParameterized(gRecordsWindowId, 1, gText_Lv502, 8, 49, TEXT_SPEED_FF, NULL); @@ -1484,7 +1484,7 @@ static void ShowLinkContestResultsWindow(void) gRecordsWindowId = AddWindow(&gUnknown_08611C7C); NewMenuHelpers_DrawStdWindowFrame(gRecordsWindowId, FALSE); - FillWindowPixelBuffer(gRecordsWindowId, PIXEL_BUFFER_WHITE); + FillWindowPixelBuffer(gRecordsWindowId, PALETTE_NUM_TO_FILL_VALUE(1)); StringExpandPlaceholders(gStringVar4, gText_LinkContestResults); x = GetStringCenterAlignXOffset(1, gStringVar4, 208); @@ -2354,7 +2354,7 @@ void ShowRankingHallRecordsWindow(void) { gRecordsWindowId = AddWindow(&gUnknown_08611C84); NewMenuHelpers_DrawStdWindowFrame(gRecordsWindowId, FALSE); - FillWindowPixelBuffer(gRecordsWindowId, PIXEL_BUFFER_WHITE); + FillWindowPixelBuffer(gRecordsWindowId, PALETTE_NUM_TO_FILL_VALUE(1)); PrintHallRecords(gSpecialVar_0x8005, FRONTIER_LVL_50); PutWindowTilemap(gRecordsWindowId); CopyWindowToVram(gRecordsWindowId, 3); @@ -2362,7 +2362,7 @@ void ShowRankingHallRecordsWindow(void) void ScrollRankingHallRecordsWindow(void) { - FillWindowPixelBuffer(gRecordsWindowId, PIXEL_BUFFER_WHITE); + FillWindowPixelBuffer(gRecordsWindowId, PALETTE_NUM_TO_FILL_VALUE(1)); PrintHallRecords(gSpecialVar_0x8005, FRONTIER_LVL_OPEN); CopyWindowToVram(gRecordsWindowId, 2); } diff --git a/src/hall_of_fame.c b/src/hall_of_fame.c index b064c991ba..b25342021d 100644 --- a/src/hall_of_fame.c +++ b/src/hall_of_fame.c @@ -649,7 +649,7 @@ static void sub_8173DC0(u8 taskId) gSprites[gTasks[taskId].tMonSpriteId(i)].oam.priority = 1; } BeginNormalPaletteFade(sUnknown_0203BCD4, 0, 12, 12, RGB(16, 29, 24)); - FillWindowPixelBuffer(0, PIXEL_BUFFER_TRANSPARENT); + FillWindowPixelBuffer(0, PALETTE_NUM_TO_FILL_VALUE(0)); CopyWindowToVram(0, 3); gTasks[taskId].tFrameCount = 7; gTasks[taskId].func = sub_8173EA4; @@ -1086,7 +1086,7 @@ static void Task_HofPC_ExitOnButtonPress(u8 taskId) static void HallOfFame_PrintWelcomeText(u8 unusedPossiblyWindowId, u8 unused2) { - FillWindowPixelBuffer(0, PIXEL_BUFFER_TRANSPARENT); + FillWindowPixelBuffer(0, PALETTE_NUM_TO_FILL_VALUE(0)); PutWindowTilemap(0); AddTextPrinterParameterized3(0, 1, GetStringCenterAlignXOffset(1, gText_WelcomeToHOF, 0xD0), 1, sUnknown_085E5388, 0, gText_WelcomeToHOF); CopyWindowToVram(0, 3); @@ -1099,7 +1099,7 @@ static void HallOfFame_PrintMonInfo(struct HallofFameMon* currMon, u8 unused1, u s32 dexNumber; s32 width; - FillWindowPixelBuffer(0, PIXEL_BUFFER_TRANSPARENT); + FillWindowPixelBuffer(0, PALETTE_NUM_TO_FILL_VALUE(0)); PutWindowTilemap(0); // dex number @@ -1180,7 +1180,7 @@ static void HallOfFame_PrintPlayerInfo(u8 unused1, u8 unused2) u32 width; u16 trainerId; - FillWindowPixelBuffer(1, PIXEL_BUFFER_WHITE); + FillWindowPixelBuffer(1, PALETTE_NUM_TO_FILL_VALUE(1)); PutWindowTilemap(1); SetWindowBorderStyle(1, FALSE, 0x21D, 0xD); AddTextPrinterParameterized3(1, 1, 0, 1, sUnknown_085E538C, -1, gText_Name); diff --git a/src/item_menu.c b/src/item_menu.c index db16a887ec..ae24c8a03a 100755 --- a/src/item_menu.c +++ b/src/item_menu.c @@ -884,7 +884,7 @@ void bag_menu_print_description_box_text(int a) StringExpandPlaceholders(gStringVar4, gText_ReturnToVar1); str = gStringVar4; } - FillWindowPixelBuffer(1, PIXEL_BUFFER_TRANSPARENT); + FillWindowPixelBuffer(1, PALETTE_NUM_TO_FILL_VALUE(0)); bag_menu_print(1, 1, str, 3, 1, 0, 0, 0, 0); } @@ -1028,7 +1028,7 @@ void DisplayItemMessage(u8 taskId, u8 fontId, const u8 *str, void ( *callback)(u s16* data = gTasks[taskId].data; data[10] = AddItemMessageWindow(4); - FillWindowPixelBuffer(data[10], PIXEL_BUFFER_WHITE); + FillWindowPixelBuffer(data[10], PALETTE_NUM_TO_FILL_VALUE(1)); DisplayMessageAndContinueTask(taskId, data[10], 10, 13, fontId, GetPlayerTextSpeedDelay(), str, callback); schedule_bg_copy_tilemap_to_vram(1); } @@ -1293,7 +1293,7 @@ void bag_menu_swap_items(u8 taskId) gUnknown_0203CE54->unk81A = data[1]; CopyItemName(BagGetItemIdByPocketPosition(gUnknown_0203CE58.pocket + 1, data[1]), gStringVar1); StringExpandPlaceholders(gStringVar4, gText_MoveVar1Where); - FillWindowPixelBuffer(1, PIXEL_BUFFER_TRANSPARENT); + FillWindowPixelBuffer(1, PALETTE_NUM_TO_FILL_VALUE(0)); bag_menu_print(1, 1, gStringVar4, 3, 1, 0, 0, 0, 0); sub_80D4FEC(data[1]); sub_81AB89C(); @@ -1505,7 +1505,7 @@ void sub_81AC644(u8 unused) { CopyItemName(gSpecialVar_ItemId, gStringVar1); StringExpandPlaceholders(gStringVar4, gText_Var1IsSelected); - FillWindowPixelBuffer(1, PIXEL_BUFFER_TRANSPARENT); + FillWindowPixelBuffer(1, PALETTE_NUM_TO_FILL_VALUE(0)); bag_menu_print(1, 1, gStringVar4, 3, 1, 0, 0, 0, 0); } if (gUnknown_0203CE54->unk828 == 1) @@ -1646,7 +1646,7 @@ void ItemMenu_UseOutOfBattle(u8 taskId) bag_menu_print_there_is_no_pokemon(taskId); else { - FillWindowPixelBuffer(1, PIXEL_BUFFER_TRANSPARENT); + FillWindowPixelBuffer(1, PALETTE_NUM_TO_FILL_VALUE(0)); schedule_bg_copy_tilemap_to_vram(0); if (gUnknown_0203CE58.pocket != BERRIES_POCKET) ItemId_GetFieldFunc(gSpecialVar_ItemId)(taskId); @@ -1670,7 +1670,7 @@ void ItemMenu_Toss(u8 taskId) { CopyItemName(gSpecialVar_ItemId, gStringVar1); StringExpandPlaceholders(gStringVar4, gText_TossHowManyVar1s); - FillWindowPixelBuffer(1, PIXEL_BUFFER_TRANSPARENT); + FillWindowPixelBuffer(1, PALETTE_NUM_TO_FILL_VALUE(0)); bag_menu_print(1, 1, gStringVar4, 3, 1, 0, 0, 0, 0); sub_81ABC3C(7); gTasks[taskId].func = Task_ChooseHowManyToToss; @@ -1684,7 +1684,7 @@ void BagMenuConfirmToss(u8 taskId) CopyItemName(gSpecialVar_ItemId, gStringVar1); ConvertIntToDecimalStringN(gStringVar2, data[8], 0, 3); StringExpandPlaceholders(gStringVar4, gText_ConfirmTossItems); - FillWindowPixelBuffer(1, PIXEL_BUFFER_TRANSPARENT); + FillWindowPixelBuffer(1, PALETTE_NUM_TO_FILL_VALUE(0)); bag_menu_print(1, 1, gStringVar4, 3, 1, 0, 0, 0, 0); bag_menu_yes_no(taskId, 5, &gUnknown_08614084); } @@ -1727,7 +1727,7 @@ void BagMenuActuallyToss(u8 taskId) CopyItemName(gSpecialVar_ItemId, gStringVar1); ConvertIntToDecimalStringN(gStringVar2, data[8], 0, 3); StringExpandPlaceholders(gStringVar4, gText_ThrewAwayVar2Var1s); - FillWindowPixelBuffer(1, PIXEL_BUFFER_TRANSPARENT); + FillWindowPixelBuffer(1, PALETTE_NUM_TO_FILL_VALUE(0)); bag_menu_print(1, 1, gStringVar4, 3, 1, 0, 0, 0, 0); gTasks[taskId].func = Task_ActuallyToss; } @@ -2043,7 +2043,7 @@ void display_deposit_item_ask_str(u8 taskId) { CopyItemName(gSpecialVar_ItemId, gStringVar1); StringExpandPlaceholders(gStringVar4, gText_DepositHowManyVar1); - FillWindowPixelBuffer(1, PIXEL_BUFFER_TRANSPARENT); + FillWindowPixelBuffer(1, PALETTE_NUM_TO_FILL_VALUE(0)); bag_menu_print(1, 1, gStringVar4, 3, 1, 0, 0, 0, 0); sub_81ABC3C(7); gTasks[taskId].func = sub_81ADA7C; @@ -2078,7 +2078,7 @@ void sub_81ADB14(u8 taskId) { s16* data = gTasks[taskId].data; - FillWindowPixelBuffer(1, PIXEL_BUFFER_TRANSPARENT); + FillWindowPixelBuffer(1, PALETTE_NUM_TO_FILL_VALUE(0)); if (ItemId_GetImportance(gSpecialVar_ItemId)) { bag_menu_print(1, 1, gText_CantStoreImportantItems, 3, 1, 0, 0, 0, 0); @@ -2244,7 +2244,7 @@ void bag_menu_print_pocket_names(const u8 *pocketName1, const u8 *pocketName2) window.width = 16; window.height = 2; windowId = AddWindow(&window); - FillWindowPixelBuffer(windowId, PIXEL_BUFFER_TRANSPARENT); + FillWindowPixelBuffer(windowId, PALETTE_NUM_TO_FILL_VALUE(0)); offset = GetStringCenterAlignXOffset(1, pocketName1, 0x40); bag_menu_print(windowId, 1, pocketName1, offset, 1, 0, 0, -1, 1); if (pocketName2) @@ -2283,7 +2283,7 @@ void setup_bag_menu_textboxes(void) LoadPalette(&gUnknown_0860F074, 0xF0, 0x20); for (i = 0; i < 3; i++) { - FillWindowPixelBuffer(i, PIXEL_BUFFER_TRANSPARENT); + FillWindowPixelBuffer(i, PALETTE_NUM_TO_FILL_VALUE(0)); PutWindowTilemap(i); } schedule_bg_copy_tilemap_to_vram(0); @@ -2366,7 +2366,7 @@ void bag_menu_remove_money_window(void) void bag_menu_prepare_tmhm_move_window(void) { - FillWindowPixelBuffer(3, PIXEL_BUFFER_TRANSPARENT); + FillWindowPixelBuffer(3, PALETTE_NUM_TO_FILL_VALUE(0)); blit_move_info_icon(3, 19, 0, 0); blit_move_info_icon(3, 20, 0, 12); blit_move_info_icon(3, 21, 0, 24); @@ -2380,7 +2380,7 @@ void PrintTMHMMoveData(u16 itemId) u16 moveId; const u8* text; - FillWindowPixelBuffer(4, PIXEL_BUFFER_TRANSPARENT); + FillWindowPixelBuffer(4, PALETTE_NUM_TO_FILL_VALUE(0)); if (itemId == ITEM_NONE) { for (i = 0; i < 4; i++) diff --git a/src/learn_move.c b/src/learn_move.c index d9ebe3f3b0..5173525553 100644 --- a/src/learn_move.c +++ b/src/learn_move.c @@ -498,7 +498,7 @@ static void LearnMoveMain(void) case 27: if (!sub_81D2C3C()) { - FillWindowPixelBuffer(3, PIXEL_BUFFER_WHITE); + FillWindowPixelBuffer(3, PALETTE_NUM_TO_FILL_VALUE(1)); if (sLearnMoveStruct2.showContestInfo == FALSE) { sLearnMoveStruct->state = 3; @@ -631,7 +631,7 @@ static void HideSpritesAndPrintTeachText(bool8 a) if (!a) { StringExpandPlaceholders(gStringVar4, gText_TeachWhichMoveToPkmn); - FillWindowPixelBuffer(3, PIXEL_BUFFER_WHITE); + FillWindowPixelBuffer(3, PALETTE_NUM_TO_FILL_VALUE(1)); AddTextPrinterParameterized(3, 1, gStringVar4, 0, 1, 0, NULL); } } @@ -695,7 +695,7 @@ static void ShowTeachMoveText(bool8 showContest) if (showContest == FALSE) { StringExpandPlaceholders(gStringVar4, gText_TeachWhichMoveToPkmn); - FillWindowPixelBuffer(3, PIXEL_BUFFER_WHITE); + FillWindowPixelBuffer(3, PALETTE_NUM_TO_FILL_VALUE(1)); AddTextPrinterParameterized(3, 1, gStringVar4, 0, 1, 0, NULL); } } diff --git a/src/link.c b/src/link.c index bec9dddc6e..5c7614c1bf 100644 --- a/src/link.c +++ b/src/link.c @@ -1683,8 +1683,8 @@ static void sub_800B080(void) CopyToBgTilemapBuffer(1, gWirelessLinkDisplayTilemap, 0, 0); CopyBgTilemapBufferToVram(1); LoadPalette(gWirelessLinkDisplayPal, 0, 0x20); - FillWindowPixelBuffer(0, 0x00); - FillWindowPixelBuffer(2, 0x00); + FillWindowPixelBuffer(0, PALETTE_NUM_TO_FILL_VALUE(0)); + FillWindowPixelBuffer(2, PALETTE_NUM_TO_FILL_VALUE(0)); AddTextPrinterParameterized3(0, 3, 2, 6, gUnknown_082ED224, 0, gText_CommErrorEllipsis); AddTextPrinterParameterized3(2, 3, 2, 1, gUnknown_082ED224, 0, gText_MoveCloserToLinkPartner); PutWindowTilemap(0); @@ -1696,8 +1696,8 @@ static void sub_800B080(void) static void sub_800B138(void) { LoadBgTiles(0, g2BlankTilesGfx, 0x20, 0); - FillWindowPixelBuffer(1, 0x00); - FillWindowPixelBuffer(2, 0x00); + FillWindowPixelBuffer(1, PALETTE_NUM_TO_FILL_VALUE(0)); + FillWindowPixelBuffer(2, PALETTE_NUM_TO_FILL_VALUE(0)); AddTextPrinterParameterized3(1, 3, 2, 0, gUnknown_082ED224, 0, gText_CommErrorCheckConnections); PutWindowTilemap(1); PutWindowTilemap(2); diff --git a/src/list_menu.c b/src/list_menu.c index 6442debba3..83293890c0 100644 --- a/src/list_menu.c +++ b/src/list_menu.c @@ -486,7 +486,7 @@ void RedrawListMenu(u8 listTaskId) { struct ListMenu *list = (void*) gTasks[listTaskId].data; - FillWindowPixelBuffer(list->template.windowId, (list->template.fillValue << 4) | (list->template.fillValue)); + FillWindowPixelBuffer(list->template.windowId, PALETTE_NUM_TO_FILL_VALUE(list->template.fillValue)); ListMenuPrintEntries(list, list->scrollOffset, 0, list->template.maxShowed); ListMenuDrawCursor(list); CopyWindowToVram(list->template.windowId, 2); @@ -584,7 +584,7 @@ static u8 ListMenuInitInternal(struct ListMenuTemplate *listMenuTemplate, u16 sc if (list->template.totalItems < list->template.maxShowed) list->template.maxShowed = list->template.totalItems; - FillWindowPixelBuffer(list->template.windowId, (list->template.fillValue << 4) | (list->template.fillValue)); + FillWindowPixelBuffer(list->template.windowId, PALETTE_NUM_TO_FILL_VALUE(list->template.fillValue)); ListMenuPrintEntries(list, list->scrollOffset, 0, list->template.maxShowed); ListMenuDrawCursor(list); ListMenuCallSelectionChangedCallback(list, TRUE); @@ -795,7 +795,7 @@ static void ListMenuScroll(struct ListMenu *list, u8 count, bool8 movingDown) { if (count >= list->template.maxShowed) { - FillWindowPixelBuffer(list->template.windowId, (list->template.fillValue << 4) | (list->template.fillValue)); + FillWindowPixelBuffer(list->template.windowId, PALETTE_NUM_TO_FILL_VALUE(list->template.fillValue)); ListMenuPrintEntries(list, list->scrollOffset, 0, list->template.maxShowed); } else diff --git a/src/mail.c b/src/mail.c index 6d9c98350b..e8b750bfa5 100644 --- a/src/mail.c +++ b/src/mail.c @@ -477,8 +477,8 @@ static void sub_8121B1C(void) y = 0; PutWindowTilemap(0); PutWindowTilemap(1); - FillWindowPixelBuffer(0, PIXEL_BUFFER_TRANSPARENT); - FillWindowPixelBuffer(1, PIXEL_BUFFER_TRANSPARENT); + FillWindowPixelBuffer(0, PALETTE_NUM_TO_FILL_VALUE(0)); + FillWindowPixelBuffer(1, PALETTE_NUM_TO_FILL_VALUE(0)); for (i = 0; i < sMailRead->layout->numSubStructs; i ++) { if (sMailRead->strbuf[i][0] == EOS || sMailRead->strbuf[i][0] == CHAR_SPACE) diff --git a/src/main_menu.c b/src/main_menu.c index aa388df62d..cb39f036ec 100644 --- a/src/main_menu.c +++ b/src/main_menu.c @@ -783,8 +783,8 @@ static void Task_DisplayMainMenu(u8 taskId) { case HAS_NO_SAVED_GAME: default: - FillWindowPixelBuffer(0, 0xAA); - FillWindowPixelBuffer(1, 0xAA); + FillWindowPixelBuffer(0, PALETTE_NUM_TO_FILL_VALUE(0xA)); + FillWindowPixelBuffer(1, PALETTE_NUM_TO_FILL_VALUE(0xA)); AddTextPrinterParameterized3(0, 1, 0, 1, sTextColor_Headers, -1, gText_MainMenuNewGame); AddTextPrinterParameterized3(1, 1, 0, 1, sTextColor_Headers, -1, gText_MainMenuOption); PutWindowTilemap(0); @@ -795,9 +795,9 @@ static void Task_DisplayMainMenu(u8 taskId) DrawMainMenuWindowBorder(&sWindowTemplates_MainMenu[1], MAIN_MENU_BORDER_TILE); break; case HAS_SAVED_GAME: - FillWindowPixelBuffer(2, 0xAA); - FillWindowPixelBuffer(3, 0xAA); - FillWindowPixelBuffer(4, 0xAA); + FillWindowPixelBuffer(2, PALETTE_NUM_TO_FILL_VALUE(0xA)); + FillWindowPixelBuffer(3, PALETTE_NUM_TO_FILL_VALUE(0xA)); + FillWindowPixelBuffer(4, PALETTE_NUM_TO_FILL_VALUE(0xA)); AddTextPrinterParameterized3(2, 1, 0, 1, sTextColor_Headers, -1, gText_MainMenuContinue); AddTextPrinterParameterized3(3, 1, 0, 1, sTextColor_Headers, -1, gText_MainMenuNewGame); AddTextPrinterParameterized3(4, 1, 0, 1, sTextColor_Headers, -1, gText_MainMenuOption); @@ -813,10 +813,10 @@ static void Task_DisplayMainMenu(u8 taskId) DrawMainMenuWindowBorder(&sWindowTemplates_MainMenu[4], MAIN_MENU_BORDER_TILE); break; case HAS_MYSTERY_GIFT: - FillWindowPixelBuffer(2, 0xAA); - FillWindowPixelBuffer(3, 0xAA); - FillWindowPixelBuffer(4, 0xAA); - FillWindowPixelBuffer(5, 0xAA); + FillWindowPixelBuffer(2, PALETTE_NUM_TO_FILL_VALUE(0xA)); + FillWindowPixelBuffer(3, PALETTE_NUM_TO_FILL_VALUE(0xA)); + FillWindowPixelBuffer(4, PALETTE_NUM_TO_FILL_VALUE(0xA)); + FillWindowPixelBuffer(5, PALETTE_NUM_TO_FILL_VALUE(0xA)); AddTextPrinterParameterized3(2, 1, 0, 1, sTextColor_Headers, -1, gText_MainMenuContinue); AddTextPrinterParameterized3(3, 1, 0, 1, sTextColor_Headers, -1, gText_MainMenuNewGame); AddTextPrinterParameterized3(4, 1, 0, 1, sTextColor_Headers, -1, gText_MainMenuMysteryGift); @@ -836,11 +836,11 @@ static void Task_DisplayMainMenu(u8 taskId) DrawMainMenuWindowBorder(&sWindowTemplates_MainMenu[5], MAIN_MENU_BORDER_TILE); break; case HAS_MYSTERY_EVENTS: - FillWindowPixelBuffer(2, 0xAA); - FillWindowPixelBuffer(3, 0xAA); - FillWindowPixelBuffer(4, 0xAA); - FillWindowPixelBuffer(5, 0xAA); - FillWindowPixelBuffer(6, 0xAA); + FillWindowPixelBuffer(2, PALETTE_NUM_TO_FILL_VALUE(0xA)); + FillWindowPixelBuffer(3, PALETTE_NUM_TO_FILL_VALUE(0xA)); + FillWindowPixelBuffer(4, PALETTE_NUM_TO_FILL_VALUE(0xA)); + FillWindowPixelBuffer(5, PALETTE_NUM_TO_FILL_VALUE(0xA)); + FillWindowPixelBuffer(6, PALETTE_NUM_TO_FILL_VALUE(0xA)); AddTextPrinterParameterized3(2, 1, 0, 1, sTextColor_Headers, -1, gText_MainMenuContinue); AddTextPrinterParameterized3(3, 1, 0, 1, sTextColor_Headers, -1, gText_MainMenuNewGame); AddTextPrinterParameterized3(4, 1, 0, 1, sTextColor_Headers, -1, gText_MainMenuMysteryGift2); @@ -2098,7 +2098,7 @@ static void NewGameBirchSpeech_StartFadePlatformOut(u8 taskId, u8 delay) static void NewGameBirchSpeech_ShowGenderMenu(void) { DrawMainMenuWindowBorder(&gNewGameBirchSpeechTextWindows[1], 0xF3); - FillWindowPixelBuffer(1, PIXEL_BUFFER_WHITE); + FillWindowPixelBuffer(1, PALETTE_NUM_TO_FILL_VALUE(1)); PrintMenuTable(1, 2, sMenuActions_Gender); InitMenuInUpperLeftCornerPlaySoundWhenAPressed(1, 2, 0); PutWindowTilemap(1); @@ -2126,7 +2126,7 @@ static void NewGameBirchSpeech_SetDefaultPlayerName(u8 nameId) static void CreateMainMenuErrorWindow(const u8* str) { - FillWindowPixelBuffer(7, PIXEL_BUFFER_WHITE); + FillWindowPixelBuffer(7, PALETTE_NUM_TO_FILL_VALUE(1)); AddTextPrinterParameterized(7, 1, str, 0, 1, 2, 0); PutWindowTilemap(7); CopyWindowToVram(7, 2); @@ -2239,7 +2239,7 @@ static void NewGameBirchSpeech_ClearGenderWindowTilemap(u8 a, u8 b, u8 c, u8 d, static void NewGameBirchSpeech_ClearGenderWindow(u8 windowId, bool8 copyToVram) { CallWindowFunction(windowId, NewGameBirchSpeech_ClearGenderWindowTilemap); - FillWindowPixelBuffer(windowId, PIXEL_BUFFER_WHITE); + FillWindowPixelBuffer(windowId, PALETTE_NUM_TO_FILL_VALUE(1)); ClearWindowTilemap(windowId); if (copyToVram == TRUE) CopyWindowToVram(windowId, 3); @@ -2277,7 +2277,7 @@ void CreateYesNoMenuParameterized(u8 a, u8 b, u16 c, u16 d, u8 e, u8 f) static void NewGameBirchSpeech_ShowDialogueWindow(u8 windowId, u8 copyToVram) { CallWindowFunction(windowId, NewGameBirchSpeech_CreateDialogueWindowBorder); - FillWindowPixelBuffer(windowId, PIXEL_BUFFER_WHITE); + FillWindowPixelBuffer(windowId, PALETTE_NUM_TO_FILL_VALUE(1)); PutWindowTilemap(windowId); if (copyToVram == TRUE) CopyWindowToVram(windowId, 3); diff --git a/src/match_call.c b/src/match_call.c index e7e91969f1..76012e0767 100644 --- a/src/match_call.c +++ b/src/match_call.c @@ -1191,7 +1191,7 @@ static bool32 LoadMatchCallWindowGfx(u8 taskId) return FALSE; } - FillWindowPixelBuffer(taskData[2], 0x88); + FillWindowPixelBuffer(taskData[2], PALETTE_NUM_TO_FILL_VALUE(8)); LoadPalette(sUnknown_0860EA4C, 0xE0, 0x20); LoadPalette(sPokeNavIconPalette, 0xF0, 0x20); ChangeBgY(0, -0x2000, 0); @@ -1241,7 +1241,7 @@ static bool32 sub_81962D8(u8 taskId) s16 *taskData = gTasks[taskId].data; if (!ExecuteMatchCallTextPrinter(taskData[2])) { - FillWindowPixelBuffer(taskData[2], 0x88); + FillWindowPixelBuffer(taskData[2], PALETTE_NUM_TO_FILL_VALUE(8)); if (!gMatchCallState.triggeredFromScript) SelectMatchCallMessage(gMatchCallState.trainerId, gStringVar4); @@ -1257,7 +1257,7 @@ static bool32 sub_8196330(u8 taskId) s16 *taskData = gTasks[taskId].data; if (!ExecuteMatchCallTextPrinter(taskData[2]) && !IsSEPlaying() && gMain.newKeys & (A_BUTTON | B_BUTTON)) { - FillWindowPixelBuffer(taskData[2], 0x88); + FillWindowPixelBuffer(taskData[2], PALETTE_NUM_TO_FILL_VALUE(8)); CopyWindowToVram(taskData[2], 2); PlaySE(SE_TOREOFF); return TRUE; diff --git a/src/menu.c b/src/menu.c index 9a9cec9ddb..26ea99de22 100644 --- a/src/menu.c +++ b/src/menu.c @@ -213,7 +213,7 @@ void sub_81973A4(void) void NewMenuHelpers_DrawDialogueFrame(u8 windowId, bool8 copyToVram) { CallWindowFunction(windowId, DrawDialogueFrame); - FillWindowPixelBuffer(windowId, PIXEL_BUFFER_WHITE); + FillWindowPixelBuffer(windowId, PALETTE_NUM_TO_FILL_VALUE(1)); PutWindowTilemap(windowId); if (copyToVram == TRUE) CopyWindowToVram(windowId, 3); @@ -222,7 +222,7 @@ void NewMenuHelpers_DrawDialogueFrame(u8 windowId, bool8 copyToVram) void NewMenuHelpers_DrawStdWindowFrame(u8 windowId, bool8 copyToVram) { CallWindowFunction(windowId, DrawStandardFrame); - FillWindowPixelBuffer(windowId, PIXEL_BUFFER_WHITE); + FillWindowPixelBuffer(windowId, PALETTE_NUM_TO_FILL_VALUE(1)); PutWindowTilemap(windowId); if (copyToVram == TRUE) CopyWindowToVram(windowId, 3); @@ -231,7 +231,7 @@ void NewMenuHelpers_DrawStdWindowFrame(u8 windowId, bool8 copyToVram) void ClearWindowAndWideBorder(u8 windowId, bool8 copyToVram) { CallWindowFunction(windowId, ClearWindowAndWideBorderTilemap); - FillWindowPixelBuffer(windowId, PIXEL_BUFFER_WHITE); + FillWindowPixelBuffer(windowId, PALETTE_NUM_TO_FILL_VALUE(1)); ClearWindowTilemap(windowId); if (copyToVram == TRUE) CopyWindowToVram(windowId, 3); @@ -240,7 +240,7 @@ void ClearWindowAndWideBorder(u8 windowId, bool8 copyToVram) void ClearWindowAndBorder(u8 windowId, bool8 copyToVram) { CallWindowFunction(windowId, ClearWindowAndBorderTilemap); - FillWindowPixelBuffer(windowId, PIXEL_BUFFER_WHITE); + FillWindowPixelBuffer(windowId, PALETTE_NUM_TO_FILL_VALUE(1)); ClearWindowTilemap(windowId); if (copyToVram == TRUE) CopyWindowToVram(windowId, 3); @@ -411,14 +411,14 @@ void DrawDialogueFrame(u8 bg, u8 tilemapLeft, u8 tilemapTop, u8 width, u8 height // Clears the given window, and a 1-tile border around the window, to transparent tiles. void ClearWindowAndBorderTilemap(u8 bg, u8 tilemapLeft, u8 tilemapTop, u8 width, u8 height, u8 paletteNum) { - FillBgTilemapBufferRect(bg, TRANSPARENT_TILE_NUMBER, tilemapLeft - 1, tilemapTop - 1, width + 2, height + 2, STD_WINDOW_PALETTE_NUM); + FillBgTilemapBufferRect(bg, 0, tilemapLeft - 1, tilemapTop - 1, width + 2, height + 2, STD_WINDOW_PALETTE_NUM); } // Clears the given window, and a 1-tile border the top and bottom, plus a 3-tile border on the left and right. // Tiles are set to a transparent tile. void ClearWindowAndWideBorderTilemap(u8 bg, u8 tilemapLeft, u8 tilemapTop, u8 width, u8 height, u8 paletteNum) { - FillBgTilemapBufferRect(bg, TRANSPARENT_TILE_NUMBER, tilemapLeft - 3, tilemapTop - 1, width + 6, height + 2, STD_WINDOW_PALETTE_NUM); + FillBgTilemapBufferRect(bg, 0, tilemapLeft - 3, tilemapTop - 1, width + 6, height + 2, STD_WINDOW_PALETTE_NUM); } void SetStandardWindowBorderStyle(u8 windowId, bool8 copyToVram) @@ -557,7 +557,7 @@ void sub_8197B1C(u8 windowId, bool8 copyToVram, u16 tileNum, u8 paletteNum) sTileNum = tileNum; sPaletteNum = paletteNum; CallWindowFunction(windowId, sub_8197BB4); - FillWindowPixelBuffer(windowId, PIXEL_BUFFER_WHITE); + FillWindowPixelBuffer(windowId, PALETTE_NUM_TO_FILL_VALUE(1)); PutWindowTilemap(windowId); if (copyToVram == TRUE) CopyWindowToVram(windowId, 3); @@ -568,7 +568,7 @@ void sub_8197B64(u8 windowId, bool8 copyToVram, u16 tileNum) sTileNum = tileNum; sPaletteNum = GetWindowAttribute(windowId, WINDOW_PALETTE_NUM); CallWindowFunction(windowId, sub_8197BB4); - FillWindowPixelBuffer(windowId, PIXEL_BUFFER_WHITE); + FillWindowPixelBuffer(windowId, PALETTE_NUM_TO_FILL_VALUE(1)); PutWindowTilemap(windowId); if (copyToVram == TRUE) CopyWindowToVram(windowId, 3); @@ -672,7 +672,7 @@ void sub_8197BB4(u8 bg, u8 tilemapLeft, u8 tilemapTop, u8 width, u8 height, u8 p void sub_8197DF8(u8 windowId, bool8 copyToVram) { CallWindowFunction(windowId, sub_8197E30); - FillWindowPixelBuffer(windowId, PIXEL_BUFFER_TRANSPARENT); + FillWindowPixelBuffer(windowId, PALETTE_NUM_TO_FILL_VALUE(0)); ClearWindowTilemap(windowId); if (copyToVram == TRUE) CopyWindowToVram(windowId, 3); @@ -688,7 +688,7 @@ void SetWindowBorderStyle(u8 windowId, bool8 copyToVram, u16 baseTileNum, u8 pal sTileNum = baseTileNum; sPaletteNum = paletteNum; CallWindowFunction(windowId, DrawWindowBorder); - FillWindowPixelBuffer(windowId, PIXEL_BUFFER_WHITE); + FillWindowPixelBuffer(windowId, PALETTE_NUM_TO_FILL_VALUE(1)); PutWindowTilemap(windowId); if (copyToVram == TRUE) CopyWindowToVram(windowId, 3); @@ -699,7 +699,7 @@ void sub_8197EC8(u8 windowId, bool8 copyToVram, u16 baseTileNum) sTileNum = baseTileNum; sPaletteNum = GetWindowAttribute(windowId, WINDOW_PALETTE_NUM); CallWindowFunction(windowId, DrawWindowBorder); - FillWindowPixelBuffer(windowId, PIXEL_BUFFER_WHITE); + FillWindowPixelBuffer(windowId, PALETTE_NUM_TO_FILL_VALUE(1)); PutWindowTilemap(windowId); if (copyToVram == TRUE) CopyWindowToVram(windowId, 3); @@ -768,7 +768,7 @@ void DrawWindowBorder(u8 bg, u8 tilemapLeft, u8 tilemapTop, u8 width, u8 height, void sub_8198070(u8 windowId, bool8 copyToVram) { CallWindowFunction(windowId, sub_81980A8); - FillWindowPixelBuffer(windowId, PIXEL_BUFFER_TRANSPARENT); + FillWindowPixelBuffer(windowId, PALETTE_NUM_TO_FILL_VALUE(0)); ClearWindowTilemap(windowId); if (copyToVram == TRUE) CopyWindowToVram(windowId, 3); @@ -814,7 +814,7 @@ void sub_8198180(const u8 *string, u8 a2, bool8 copyToVram) if (sWindowId != 0xFF) { PutWindowTilemap(sWindowId); - FillWindowPixelBuffer(sWindowId, PIXEL_BUFFER_UNKNOWN); + FillWindowPixelBuffer(sWindowId, PALETTE_NUM_TO_FILL_VALUE(15)); width = GetStringWidth(0, string, 0); AddTextPrinterParameterized3(sWindowId, 0, @@ -848,7 +848,7 @@ void sub_8198204(const u8 *string, const u8 *string2, u8 a3, u8 a4, bool8 copyTo color[2] = 2; } PutWindowTilemap(sWindowId); - FillWindowPixelBuffer(sWindowId, PIXEL_BUFFER_UNKNOWN); + FillWindowPixelBuffer(sWindowId, PALETTE_NUM_TO_FILL_VALUE(15)); if (string2 != NULL) { width = GetStringWidth(0, string2, 0); @@ -876,7 +876,7 @@ void sub_81982F0(void) { if (sWindowId != 0xFF) { - FillWindowPixelBuffer(sWindowId, PIXEL_BUFFER_UNKNOWN); + FillWindowPixelBuffer(sWindowId, PALETTE_NUM_TO_FILL_VALUE(15)); CopyWindowToVram(sWindowId, 3); } } @@ -885,7 +885,7 @@ void sub_8198314(void) { if (sWindowId != 0xFF) { - FillWindowPixelBuffer(sWindowId, PIXEL_BUFFER_TRANSPARENT); + FillWindowPixelBuffer(sWindowId, PALETTE_NUM_TO_FILL_VALUE(0)); ClearWindowTilemap(sWindowId); CopyWindowToVram(sWindowId, 3); RemoveWindow(sWindowId); diff --git a/src/money.c b/src/money.c index 33dffdc75d..1b5e298f0e 100644 --- a/src/money.c +++ b/src/money.c @@ -169,7 +169,7 @@ void DrawMoneyBox(int amount, u8 x, u8 y) SetWindowTemplateFields(&template, 0, x + 1, y + 1, 10, 2, 15, 8); sMoneyBoxWindowId = AddWindow(&template); - FillWindowPixelBuffer(sMoneyBoxWindowId, PIXEL_BUFFER_TRANSPARENT); + FillWindowPixelBuffer(sMoneyBoxWindowId, PALETTE_NUM_TO_FILL_VALUE(0)); PutWindowTilemap(sMoneyBoxWindowId); CopyWindowToVram(sMoneyBoxWindowId, 1); PrintMoneyAmountInMoneyBoxWithBorder(sMoneyBoxWindowId, 0x214, 14, amount); diff --git a/src/mystery_event_menu.c b/src/mystery_event_menu.c index c30fb9c1a0..b0f0ba3028 100644 --- a/src/mystery_event_menu.c +++ b/src/mystery_event_menu.c @@ -90,7 +90,7 @@ void CB2_InitMysteryEventMenu(void) DeactivateAllTextPrinters(); for (i = 0; i < 2; i++) - FillWindowPixelBuffer(i, PIXEL_BUFFER_TRANSPARENT); + FillWindowPixelBuffer(i, PALETTE_NUM_TO_FILL_VALUE(0)); FillBgTilemapBufferRect_Palette0(0, 0, 0, 0, 0x1E, 0x14); LoadUserWindowBorderGfx(0, 1u, 0xD0u); @@ -313,6 +313,6 @@ static void PrintMysteryMenuText(u8 windowId, const u8 *text, u8 x, u8 y, s32 sp textColor[1] = 2; textColor[2] = 3; - FillWindowPixelBuffer(windowId, (textColor[0]) | (textColor[0] << 4)); + FillWindowPixelBuffer(windowId, PALETTE_NUM_TO_FILL_VALUE(textColor[0])); AddTextPrinterParameterized4(windowId, 1, x, y, letterSpacing, lineSpacing, textColor, speed, text); } diff --git a/src/naming_screen.c b/src/naming_screen.c index cb53604df9..a84cbd6576 100644 --- a/src/naming_screen.c +++ b/src/naming_screen.c @@ -1474,7 +1474,7 @@ static void HandleDpadMovement(struct Task *task) static void sub_80E4894(void) { - FillWindowPixelBuffer(gNamingScreenData->windows[3], PIXEL_BUFFER_WHITE); + FillWindowPixelBuffer(gNamingScreenData->windows[3], PALETTE_NUM_TO_FILL_VALUE(1)); AddTextPrinterParameterized(gNamingScreenData->windows[3], 1, gNamingScreenData->template->title, 8, 1, 0, 0); PutWindowTilemap(gNamingScreenData->windows[3]); } @@ -1485,7 +1485,7 @@ static void sub_80E48E8(void) StringCopy(buffer, gSpeciesNames[gNamingScreenData->monSpecies]); StringAppendN(buffer, gNamingScreenData->template->title, 15); - FillWindowPixelBuffer(gNamingScreenData->windows[3], PIXEL_BUFFER_WHITE); + FillWindowPixelBuffer(gNamingScreenData->windows[3], PALETTE_NUM_TO_FILL_VALUE(1)); AddTextPrinterParameterized(gNamingScreenData->windows[3], 1, buffer, 8, 1, 0, 0); PutWindowTilemap(gNamingScreenData->windows[3]); } @@ -1672,7 +1672,7 @@ static void sub_80E4D10(void) u8 maxChars = gNamingScreenData->template->maxChars; u16 unk = gNamingScreenData->inputCharBaseXPos - 0x40; - FillWindowPixelBuffer(gNamingScreenData->windows[2], PIXEL_BUFFER_WHITE); + FillWindowPixelBuffer(gNamingScreenData->windows[2], PALETTE_NUM_TO_FILL_VALUE(1)); for (i = 0; i < maxChars; i++) { @@ -1766,7 +1766,7 @@ static void sub_80E4EF0(void) { const u8 color[3] = { 15, 1, 2 }; - FillWindowPixelBuffer(gNamingScreenData->windows[4], PIXEL_BUFFER_UNKNOWN); + FillWindowPixelBuffer(gNamingScreenData->windows[4], PALETTE_NUM_TO_FILL_VALUE(15)); AddTextPrinterParameterized3(gNamingScreenData->windows[4], 0, 2, 1, color, 0, gText_MoveOkBack); PutWindowTilemap(gNamingScreenData->windows[4]); CopyWindowToVram(gNamingScreenData->windows[4], 3); diff --git a/src/option_menu.c b/src/option_menu.c index 6ffc4de500..94bbef3063 100644 --- a/src/option_menu.c +++ b/src/option_menu.c @@ -620,7 +620,7 @@ static void ButtonMode_DrawChoices(u8 selection) static void DrawTextOption(void) { - FillWindowPixelBuffer(WIN_TEXT_OPTION, PIXEL_BUFFER_WHITE); + FillWindowPixelBuffer(WIN_TEXT_OPTION, PALETTE_NUM_TO_FILL_VALUE(1)); AddTextPrinterParameterized(WIN_TEXT_OPTION, 1, gText_Option, 8, 1, TEXT_SPEED_FF, NULL); CopyWindowToVram(WIN_TEXT_OPTION, 3); } @@ -629,7 +629,7 @@ static void DrawOptionMenuTexts(void) { u8 i; - FillWindowPixelBuffer(WIN_OPTIONS, PIXEL_BUFFER_WHITE); + FillWindowPixelBuffer(WIN_OPTIONS, PALETTE_NUM_TO_FILL_VALUE(1)); for (i = 0; i < MENUITEM_COUNT; i++) { AddTextPrinterParameterized(WIN_OPTIONS, 1, sOptionMenuItemsNames[i], 8, (i * 16) + 1, TEXT_SPEED_FF, NULL); diff --git a/src/party_menu.c b/src/party_menu.c index d2a4d09f2e..15128ab0c3 100755 --- a/src/party_menu.c +++ b/src/party_menu.c @@ -3108,7 +3108,7 @@ static void sub_81B239C(u8 a) } DeactivateAllTextPrinters(); for (i = 0; i < PARTY_SIZE; i++) - FillWindowPixelBuffer(i, PIXEL_BUFFER_TRANSPARENT); + FillWindowPixelBuffer(i, PALETTE_NUM_TO_FILL_VALUE(0)); LoadUserWindowBorderGfx(0, 0x4F, 0xD0); LoadPalette(GetOverworldTextboxPalettePtr(), 0xE0, 0x20); LoadPalette(gUnknown_0860F074, 0xF0, 0x20); @@ -3126,7 +3126,7 @@ static void sub_81B2428(bool8 a) if (a == TRUE) { firstWindowId = AddWindow(&gUnknown_08615918); - FillWindowPixelBuffer(firstWindowId, PIXEL_BUFFER_TRANSPARENT); + FillWindowPixelBuffer(firstWindowId, PALETTE_NUM_TO_FILL_VALUE(0)); mainOffset = GetStringCenterAlignXOffset(0, gMenuText_Confirm, 48); AddTextPrinterParameterized4(firstWindowId, 0, mainOffset, 1, 0, 0, gUnknown_086157FC[0], -1, gMenuText_Confirm); PutWindowTilemap(firstWindowId); @@ -3139,7 +3139,7 @@ static void sub_81B2428(bool8 a) windowId = AddWindow(&gUnknown_08615908); offset = 3; } - FillWindowPixelBuffer(windowId, PIXEL_BUFFER_TRANSPARENT); + FillWindowPixelBuffer(windowId, PALETTE_NUM_TO_FILL_VALUE(0)); if (gUnknown_0203CEC8.unk8_0 != 10) { mainOffset = GetStringCenterAlignXOffset(0, gText_Cancel, 48); diff --git a/src/player_pc.c b/src/player_pc.c index 9d1b2f788a..607c2a7210 100644 --- a/src/player_pc.c +++ b/src/player_pc.c @@ -977,7 +977,7 @@ static void sub_816BEF0(s32 id) description = (u8 *)ItemId_GetDescription(gSaveBlock1Ptr->pcItems[id].itemId); else description = ItemStorage_GetItemPcResponse(ITEMPC_GO_BACK_TO_PREV); - FillWindowPixelBuffer(windowId, PIXEL_BUFFER_WHITE); + FillWindowPixelBuffer(windowId, PALETTE_NUM_TO_FILL_VALUE(1)); AddTextPrinterParameterized(windowId, 1, description, 0, 1, 0, NULL); } @@ -1123,7 +1123,7 @@ static const u8* ItemStorage_GetItemPcResponse(u16 itemId) static void ItemStorage_PrintItemPcResponse(const u8 *string) { u8 windowId = gUnknown_0203BCC4->windowIds[1]; - FillWindowPixelBuffer(windowId, PIXEL_BUFFER_WHITE); + FillWindowPixelBuffer(windowId, PALETTE_NUM_TO_FILL_VALUE(1)); StringExpandPlaceholders(gStringVar4, string); AddTextPrinterParameterized(windowId, 1, gStringVar4, 0, 1, 0, NULL); } diff --git a/src/pokeblock.c b/src/pokeblock.c index 31eaf3540c..95f91a74da 100644 --- a/src/pokeblock.c +++ b/src/pokeblock.c @@ -665,7 +665,7 @@ static void HandleInitWindows(void) for (i = 0; i < ARRAY_COUNT(sWindowTemplatesForPokeblockMenu) - 1; i++) { - FillWindowPixelBuffer(i, PIXEL_BUFFER_TRANSPARENT); + FillWindowPixelBuffer(i, PALETTE_NUM_TO_FILL_VALUE(0)); } schedule_bg_copy_tilemap_to_vram(0); @@ -749,7 +749,7 @@ static void sub_8135FCC(s32 pkblId) struct Pokeblock *pokeblock; u16 rectTilemapSrc[2]; - FillWindowPixelBuffer(7, PIXEL_BUFFER_TRANSPARENT); + FillWindowPixelBuffer(7, PALETTE_NUM_TO_FILL_VALUE(0)); if (pkblId != LIST_B_PRESSED) { diff --git a/src/pokeblock_feed.c b/src/pokeblock_feed.c index 1ad0920d3f..0a110120d3 100644 --- a/src/pokeblock_feed.c +++ b/src/pokeblock_feed.c @@ -704,7 +704,7 @@ static void HandleInitWindows(void) DeactivateAllTextPrinters(); LoadUserWindowBorderGfx(0, 1, 0xE0); LoadPalette(gUnknown_0860F074, 0xF0, 0x20); - FillWindowPixelBuffer(0, PIXEL_BUFFER_TRANSPARENT); + FillWindowPixelBuffer(0, PALETTE_NUM_TO_FILL_VALUE(0)); PutWindowTilemap(0); schedule_bg_copy_tilemap_to_vram(0); } diff --git a/src/pokedex.c b/src/pokedex.c index 1034fdbb9e..2e5e8f213d 100644 --- a/src/pokedex.c +++ b/src/pokedex.c @@ -2927,7 +2927,7 @@ void sub_80BEA24(u8 taskId) case 1: DecompressAndLoadBgGfxUsingHeap(3, gPokedexMenu_Gfx, 0x2000, 0, 0); CopyToBgTilemapBuffer(3, gPokedexTilemap_DescriptionScreen, 0, 0); - FillWindowPixelBuffer(0, PIXEL_BUFFER_TRANSPARENT); + FillWindowPixelBuffer(0, PALETTE_NUM_TO_FILL_VALUE(0)); PutWindowTilemap(0); PutWindowTilemap(1); sub_80C0D30(1, sPokedexListItem->dexNum); @@ -3222,7 +3222,7 @@ void sub_80BF250(u8 taskId) case 1: DecompressAndLoadBgGfxUsingHeap(3, &gPokedexMenu_Gfx, 0x2000, 0, 0); CopyToBgTilemapBuffer(3, &gPokedexTilemap_CryScreen, 0, 0); - FillWindowPixelBuffer(0, PIXEL_BUFFER_TRANSPARENT); + FillWindowPixelBuffer(0, PALETTE_NUM_TO_FILL_VALUE(0)); PutWindowTilemap(0); PutWindowTilemap(3); PutWindowTilemap(2); @@ -3416,7 +3416,7 @@ void sub_80BF82C(u8 taskId) case 1: DecompressAndLoadBgGfxUsingHeap(3, gPokedexMenu_Gfx, 0x2000, 0, 0); CopyToBgTilemapBuffer(3, gPokedexTilemap_SizeScreen, 0, 0); - FillWindowPixelBuffer(0, PIXEL_BUFFER_TRANSPARENT); + FillWindowPixelBuffer(0, PALETTE_NUM_TO_FILL_VALUE(0)); PutWindowTilemap(0); gMain.state++; break; @@ -3766,7 +3766,7 @@ void sub_80BFE38(u8 taskId) case 1: DecompressAndLoadBgGfxUsingHeap(3, gPokedexMenu_Gfx, 0x2000, 0, 0); CopyToBgTilemapBuffer(3, gPokedexTilemap_DescriptionScreen, 0, 0); - FillWindowPixelBuffer(0, PIXEL_BUFFER_TRANSPARENT); + FillWindowPixelBuffer(0, PALETTE_NUM_TO_FILL_VALUE(0)); PutWindowTilemap(0); PutWindowTilemap(1); sub_80C0D30(1, gTasks[taskId].data[1]); diff --git a/src/pokemon_storage_system.c b/src/pokemon_storage_system.c index d0a7ed80c3..8abb349ef5 100644 --- a/src/pokemon_storage_system.c +++ b/src/pokemon_storage_system.c @@ -1552,7 +1552,7 @@ void sub_80C6D80(const u8 *string, void *dst, u8 arg2, u8 arg3, s32 arg4) winTemplate.width = 24; winTemplate.height = 2; windowId = AddWindow(&winTemplate); - FillWindowPixelBuffer(windowId, (arg3 << 4) | arg3); + FillWindowPixelBuffer(windowId, PALETTE_NUM_TO_FILL_VALUE(arg3)); tileData1 = (u8*) GetWindowAttribute(windowId, WINDOW_TILE_DATA); tileData2 = (winTemplate.width * 32) + tileData1; @@ -1599,7 +1599,7 @@ void sub_80C6EAC(const u8 *string, void *dst, u16 arg2, u8 arg3, u8 clr2, u8 clr winTemplate.height = 2; var = winTemplate.width * 32; windowId = AddWindow(&winTemplate); - FillWindowPixelBuffer(windowId, (arg3 << 4) | arg3); + FillWindowPixelBuffer(windowId, PALETTE_NUM_TO_FILL_VALUE(arg3)); tileData1 = (u8*) GetWindowAttribute(windowId, WINDOW_TILE_DATA); tileData2 = (winTemplate.width * 32) + tileData1; txtColor[0] = arg3; @@ -1737,7 +1737,7 @@ static void Task_PokemonStorageSystemPC(u8 taskId) CreatePCMenu(task->data[1], &task->data[15]); sub_81973A4(); NewMenuHelpers_DrawDialogueFrame(0, 0); - FillWindowPixelBuffer(0, PIXEL_BUFFER_WHITE); + FillWindowPixelBuffer(0, PALETTE_NUM_TO_FILL_VALUE(1)); AddTextPrinterParameterized2(0, 1, gUnknown_085716C0[task->data[1]].desc, TEXT_SPEED_FF, NULL, 2, 1, 3); CopyWindowToVram(0, 3); CopyWindowToVram(task->data[15], 3); @@ -1763,7 +1763,7 @@ static void Task_PokemonStorageSystemPC(u8 taskId) if (task->data[1] != task->data[3]) { task->data[1] = task->data[3]; - FillWindowPixelBuffer(0, PIXEL_BUFFER_WHITE); + FillWindowPixelBuffer(0, PALETTE_NUM_TO_FILL_VALUE(1)); AddTextPrinterParameterized2(0, 1, gUnknown_085716C0[task->data[1]].desc, 0, NULL, 2, 1, 3); } break; @@ -1778,13 +1778,13 @@ static void Task_PokemonStorageSystemPC(u8 taskId) default: if (task->data[2] == 0 && CountPartyMons() == PARTY_SIZE) { - FillWindowPixelBuffer(0, PIXEL_BUFFER_WHITE); + FillWindowPixelBuffer(0, PALETTE_NUM_TO_FILL_VALUE(1)); AddTextPrinterParameterized2(0, 1, gText_PartyFull, 0, NULL, 2, 1, 3); task->data[0] = 3; } else if (task->data[2] == 1 && CountPartyMons() == 1) { - FillWindowPixelBuffer(0, PIXEL_BUFFER_WHITE); + FillWindowPixelBuffer(0, PALETTE_NUM_TO_FILL_VALUE(1)); AddTextPrinterParameterized2(0, 1, gText_JustOnePkmn, 0, NULL, 2, 1, 3); task->data[0] = 3; } @@ -1799,7 +1799,7 @@ static void Task_PokemonStorageSystemPC(u8 taskId) case 3: if (gMain.newKeys & (A_BUTTON | B_BUTTON)) { - FillWindowPixelBuffer(0, PIXEL_BUFFER_WHITE); + FillWindowPixelBuffer(0, PALETTE_NUM_TO_FILL_VALUE(1)); AddTextPrinterParameterized2(0, 1, gUnknown_085716C0[task->data[1]].desc, 0, NULL, 2, 1, 3); task->data[0] = 2; } @@ -1809,7 +1809,7 @@ static void Task_PokemonStorageSystemPC(u8 taskId) task->data[1] = 4; Menu_MoveCursor(-1); task->data[1] = Menu_GetCursorPos(); - FillWindowPixelBuffer(0, PIXEL_BUFFER_WHITE); + FillWindowPixelBuffer(0, PALETTE_NUM_TO_FILL_VALUE(1)); AddTextPrinterParameterized2(0, 1, gUnknown_085716C0[task->data[1]].desc, 0, NULL, 2, 1, 3); task->data[0] = 2; } @@ -1819,7 +1819,7 @@ static void Task_PokemonStorageSystemPC(u8 taskId) task->data[1] = 0; Menu_MoveCursor(1); task->data[1] = Menu_GetCursorPos(); - FillWindowPixelBuffer(0, PIXEL_BUFFER_WHITE); + FillWindowPixelBuffer(0, PALETTE_NUM_TO_FILL_VALUE(1)); AddTextPrinterParameterized2(0, 1, gUnknown_085716C0[task->data[1]].desc, 0, NULL, 2, 1, 3); task->data[0] = 2; } @@ -2103,7 +2103,7 @@ static void sub_80C7BE4(void) winTemplate.height = 4; windowId = AddWindow(&winTemplate); - FillWindowPixelBuffer(windowId, 0x44); + FillWindowPixelBuffer(windowId, PALETTE_NUM_TO_FILL_VALUE(4)); center = GetStringCenterAlignXOffset(1, boxName, 64); AddTextPrinterParameterized3(windowId, 1, center, 1, gUnknown_08571734, TEXT_SPEED_FF, boxName); @@ -4107,7 +4107,7 @@ static void LoadCursorMonGfx(u16 species, u32 pid) static void PrintCursorMonInfo(void) { - FillWindowPixelBuffer(0, PIXEL_BUFFER_WHITE); + FillWindowPixelBuffer(0, PALETTE_NUM_TO_FILL_VALUE(1)); if (sPSSData->boxOption != BOX_OPTION_MOVE_ITEMS) { AddTextPrinterParameterized(0, 1, sPSSData->cursorMonNickText, 6, 0, TEXT_SPEED_FF, NULL); @@ -4416,7 +4416,7 @@ static void PrintStorageActionText(u8 id) } DynamicPlaceholderTextUtil_ExpandPlaceholders(sPSSData->field_2190, gPCStorageActionTexts[id].text); - FillWindowPixelBuffer(1, PIXEL_BUFFER_WHITE); + FillWindowPixelBuffer(1, PALETTE_NUM_TO_FILL_VALUE(1)); AddTextPrinterParameterized(1, 1, sPSSData->field_2190, 0, 1, TEXT_SPEED_FF, NULL); sub_8098858(1, 2, 14); PutWindowTilemap(1); @@ -8835,7 +8835,7 @@ static bool8 sub_80D0164(void) sPSSData->field_2200 = AddWindow8Bit(&gUnknown_0857BB1C); if (sPSSData->field_2200 != 0xFF) { - FillWindowPixelBuffer(sPSSData->field_2200, PIXEL_BUFFER_TRANSPARENT); + FillWindowPixelBuffer(sPSSData->field_2200, PALETTE_NUM_TO_FILL_VALUE(0)); return TRUE; } } @@ -8892,7 +8892,7 @@ static bool8 sub_80D024C(void) ChangeBgX(0, -1024, 0); ChangeBgY(0, -1024, 0); FillBgTilemapBufferRect_Palette0(0, 0, 0, 0, 0x20, 0x20); - FillWindowPixelBuffer8Bit(sPSSData->field_2200, 0); + FillWindowPixelBuffer8Bit(sPSSData->field_2200, PALETTE_NUM_TO_FILL_VALUE(0)); sub_80D07B0(sMoveMonsPtr->fromRow, sMoveMonsPtr->fromColumn); SetBgAttribute(0, BG_ATTR_PALETTEMODE, 1); PutWindowTilemap(sPSSData->field_2200); @@ -9911,7 +9911,7 @@ static void PrintItemDescription(void) else description = ItemId_GetDescription(sPSSData->cursorMonItem); - FillWindowPixelBuffer(2, PIXEL_BUFFER_WHITE); + FillWindowPixelBuffer(2, PALETTE_NUM_TO_FILL_VALUE(1)); AddTextPrinterParameterized5(2, 1, description, 4, 0, 0, NULL, 0, 1); } diff --git a/src/pokemon_summary_screen.c b/src/pokemon_summary_screen.c index 7985a1964e..b34dcd9fb6 100644 --- a/src/pokemon_summary_screen.c +++ b/src/pokemon_summary_screen.c @@ -2631,7 +2631,7 @@ static void ResetWindows(void) for (i = 0; i < 20; i++) { - FillWindowPixelBuffer(i, PIXEL_BUFFER_TRANSPARENT); + FillWindowPixelBuffer(i, PALETTE_NUM_TO_FILL_VALUE(0)); } for (i = 0; i < ARRAY_COUNT(pssData->windowIds); i++) { @@ -2646,9 +2646,9 @@ static void SummaryScreen_PrintTextOnWindow(u8 windowId, const u8 *string, u8 x, static void sub_81C25E8(void) { - FillWindowPixelBuffer(17, PIXEL_BUFFER_TRANSPARENT); - FillWindowPixelBuffer(18, PIXEL_BUFFER_TRANSPARENT); - FillWindowPixelBuffer(19, PIXEL_BUFFER_TRANSPARENT); + FillWindowPixelBuffer(17, PALETTE_NUM_TO_FILL_VALUE(0)); + FillWindowPixelBuffer(18, PALETTE_NUM_TO_FILL_VALUE(0)); + FillWindowPixelBuffer(19, PALETTE_NUM_TO_FILL_VALUE(0)); if (!pssData->summary.isEgg) sub_81C2628(); else @@ -2899,7 +2899,7 @@ static u8 AddWindowFromTemplateList(const struct WindowTemplate *template, u8 te if (*windowIdPtr == 0xFF) { *windowIdPtr = AddWindow(&template[templateId]); - FillWindowPixelBuffer(*windowIdPtr, PIXEL_BUFFER_TRANSPARENT); + FillWindowPixelBuffer(*windowIdPtr, PALETTE_NUM_TO_FILL_VALUE(0)); } return *windowIdPtr; } @@ -2921,7 +2921,7 @@ static void PrintPageSpecificText(u8 pageIndex) for (i = 0; i < ARRAY_COUNT(pssData->windowIds); i++) { if (pssData->windowIds[i] != 0xFF) - FillWindowPixelBuffer(pssData->windowIds[i], PIXEL_BUFFER_TRANSPARENT); + FillWindowPixelBuffer(pssData->windowIds[i], PALETTE_NUM_TO_FILL_VALUE(0)); } sTextPrinterFunctions[pageIndex](); } @@ -3568,7 +3568,7 @@ static void PrintContestMoveDescription(u8 moveSlot) static void PrintMoveDetails(u16 move) { u8 windowId = AddWindowFromTemplateList(gUnknown_0861CD14, 2); - FillWindowPixelBuffer(windowId, PIXEL_BUFFER_TRANSPARENT); + FillWindowPixelBuffer(windowId, PALETTE_NUM_TO_FILL_VALUE(0)); if (move != MOVE_NONE) { if (pssData->currPageIndex == 2) @@ -3642,7 +3642,7 @@ static void sub_81C40A0(u8 moveIndex1, u8 moveIndex2) static void PrintHMMovesCantBeForgotten(void) { u8 windowId = AddWindowFromTemplateList(gUnknown_0861CD14, 2); - FillWindowPixelBuffer(windowId, PIXEL_BUFFER_TRANSPARENT); + FillWindowPixelBuffer(windowId, PALETTE_NUM_TO_FILL_VALUE(0)); SummaryScreen_PrintTextOnWindow(windowId, gText_HMMovesCantBeForgotten2, 6, 1, 0, 0); } diff --git a/src/pokenav.c b/src/pokenav.c index ff687e8dc5..f5b3d6e13c 100644 --- a/src/pokenav.c +++ b/src/pokenav.c @@ -1158,7 +1158,7 @@ bool8 sub_81C7BE8(void) void sub_81C7BF8(u32 a0) { - FillWindowPixelBuffer(a0, 0x44); + FillWindowPixelBuffer(a0, PALETTE_NUM_TO_FILL_VALUE(4)); FillWindowPixelRect(a0, 0x55, 0, 0, 0x80, 1); } diff --git a/src/region_map.c b/src/region_map.c index e69889584c..fa5e26b111 100644 --- a/src/region_map.c +++ b/src/region_map.c @@ -1622,7 +1622,7 @@ void MCB2_FlyMap(void) case 7: LoadPalette(sRegionMapFramePal, 0x10, 0x20); PutWindowTilemap(2); - FillWindowPixelBuffer(2, 0x00); + FillWindowPixelBuffer(2, PALETTE_NUM_TO_FILL_VALUE(0)); AddTextPrinterParameterized(2, 1, gText_FlyToWhere, 0, 1, 0, NULL); schedule_bg_copy_tilemap_to_vram(0); gMain.state++; @@ -1707,7 +1707,7 @@ static void sub_8124904(void) } else { - FillWindowPixelBuffer(0, PIXEL_BUFFER_WHITE); + FillWindowPixelBuffer(0, PALETTE_NUM_TO_FILL_VALUE(1)); } AddTextPrinterParameterized(0, 1, sFlyMap->regionMap.mapSecName, 0, 1, 0, NULL); schedule_bg_copy_tilemap_to_vram(0); @@ -1721,7 +1721,7 @@ static void sub_8124904(void) sub_8198070(1, FALSE); SetWindowBorderStyle(0, FALSE, 0x65, 0x0d); } - FillWindowPixelBuffer(0, PIXEL_BUFFER_WHITE); + FillWindowPixelBuffer(0, PALETTE_NUM_TO_FILL_VALUE(1)); CopyWindowToVram(0, 2); schedule_bg_copy_tilemap_to_vram(0); gUnknown_03001180 = FALSE; diff --git a/src/rom_8011DC0.c b/src/rom_8011DC0.c index d4047e26df..466ef430d0 100644 --- a/src/rom_8011DC0.c +++ b/src/rom_8011DC0.c @@ -387,7 +387,7 @@ void nullsub_89(void) void sub_80124EC(u8 windowId, u8 arg1, u8 stringId) { - FillWindowPixelBuffer(windowId, PIXEL_BUFFER_WHITE); + FillWindowPixelBuffer(windowId, PALETTE_NUM_TO_FILL_VALUE(1)); switch (arg1 << 8) { case 0x200: @@ -506,7 +506,7 @@ void sub_8012780(u8 taskId) } data->field_11 = AddWindow(&gUnknown_082F012C); - FillWindowPixelBuffer(data->field_10, 0x22); + FillWindowPixelBuffer(data->field_10, PALETTE_NUM_TO_FILL_VALUE(2)); sub_80173E0(data->field_10, 0, gUnknown_082EDBC4, 8, 1, 4); PutWindowTilemap(data->field_10); CopyWindowToVram(data->field_10, 2); @@ -1075,7 +1075,7 @@ void sub_80134E8(u8 taskId) data->listWindowId = AddWindow(&gUnknown_082F0174); data->field_D = AddWindow(&gUnknown_082F017C); - FillWindowPixelBuffer(data->field_C, 0x22); + FillWindowPixelBuffer(data->field_C, PALETTE_NUM_TO_FILL_VALUE(2)); sub_80173E0(data->field_C, 0, gUnknown_082EF7DC, 8, 1, 4); PutWindowTilemap(data->field_C); CopyWindowToVram(data->field_C, 2); @@ -2155,7 +2155,7 @@ void sub_8014F48(u8 taskId) data->listTaskId = ListMenuInit(&gMultiuseListMenuTemplate, 0, 0); sub_8018784(data->field_D); - FillWindowPixelBuffer(data->field_D, PIXEL_BUFFER_WHITE); + FillWindowPixelBuffer(data->field_D, PALETTE_NUM_TO_FILL_VALUE(1)); PutWindowTilemap(data->field_D); sub_80125BC(data->field_D); CopyWindowToVram(data->field_D, 2); diff --git a/src/save_failed_screen.c b/src/save_failed_screen.c index 411f3f3d90..62d6f9e3e7 100644 --- a/src/save_failed_screen.c +++ b/src/save_failed_screen.c @@ -231,8 +231,8 @@ static void CB2_SaveFailedScreen(void) LoadPalette(gUnknown_0860F074, 0xF0, 0x20); SetWindowBorderStyle(gSaveFailedWindowIds[TEXT_WIN_ID], FALSE, 0x214, 0xE); SetWindowBorderStyle(gSaveFailedWindowIds[CLOCK_WIN_ID], FALSE, 0x214, 0xE); - FillWindowPixelBuffer(gSaveFailedWindowIds[CLOCK_WIN_ID], PIXEL_BUFFER_WHITE); // backwards? - FillWindowPixelBuffer(gSaveFailedWindowIds[TEXT_WIN_ID], PIXEL_BUFFER_WHITE); + FillWindowPixelBuffer(gSaveFailedWindowIds[CLOCK_WIN_ID], PALETTE_NUM_TO_FILL_VALUE(1)); // backwards? + FillWindowPixelBuffer(gSaveFailedWindowIds[TEXT_WIN_ID], PALETTE_NUM_TO_FILL_VALUE(1)); CopyWindowToVram(gSaveFailedWindowIds[CLOCK_WIN_ID], 2); // again? CopyWindowToVram(gSaveFailedWindowIds[TEXT_WIN_ID], 1); SaveFailedScreenTextPrint(gText_SaveFailedCheckingBackup, 1, 0); @@ -265,19 +265,19 @@ static void CB2_WipeSave(void) { if (WipeSectors(gDamagedSaveSectors) != FALSE) { - FillWindowPixelBuffer(gSaveFailedWindowIds[TEXT_WIN_ID], PIXEL_BUFFER_WHITE); + FillWindowPixelBuffer(gSaveFailedWindowIds[TEXT_WIN_ID], PALETTE_NUM_TO_FILL_VALUE(1)); SaveFailedScreenTextPrint(gText_BackupMemoryDamaged, 1, 0); SetMainCallback2(CB2_GameplayCannotBeContinued); return; } - FillWindowPixelBuffer(gSaveFailedWindowIds[TEXT_WIN_ID], PIXEL_BUFFER_WHITE); + FillWindowPixelBuffer(gSaveFailedWindowIds[TEXT_WIN_ID], PALETTE_NUM_TO_FILL_VALUE(1)); SaveFailedScreenTextPrint(gText_CheckCompleted, 1, 0); HandleSavingData(gSaveFailedType); if (gDamagedSaveSectors != 0) { - FillWindowPixelBuffer(gSaveFailedWindowIds[TEXT_WIN_ID], PIXEL_BUFFER_WHITE); + FillWindowPixelBuffer(gSaveFailedWindowIds[TEXT_WIN_ID], PALETTE_NUM_TO_FILL_VALUE(1)); SaveFailedScreenTextPrint(gText_SaveFailedCheckingBackup, 1, 0); } @@ -286,12 +286,12 @@ static void CB2_WipeSave(void) if (wipeTries == 3) { - FillWindowPixelBuffer(gSaveFailedWindowIds[TEXT_WIN_ID], PIXEL_BUFFER_WHITE); + FillWindowPixelBuffer(gSaveFailedWindowIds[TEXT_WIN_ID], PALETTE_NUM_TO_FILL_VALUE(1)); SaveFailedScreenTextPrint(gText_BackupMemoryDamaged, 1, 0); } else { - FillWindowPixelBuffer(gSaveFailedWindowIds[TEXT_WIN_ID], PIXEL_BUFFER_WHITE); + FillWindowPixelBuffer(gSaveFailedWindowIds[TEXT_WIN_ID], PALETTE_NUM_TO_FILL_VALUE(1)); if (gGameContinueCallback == NULL) SaveFailedScreenTextPrint(gText_SaveCompleteGameCannotContinue, 1, 0); @@ -308,7 +308,7 @@ static void CB2_GameplayCannotBeContinued(void) if (gMain.newKeys & A_BUTTON) { - FillWindowPixelBuffer(gSaveFailedWindowIds[TEXT_WIN_ID], PIXEL_BUFFER_WHITE); + FillWindowPixelBuffer(gSaveFailedWindowIds[TEXT_WIN_ID], PALETTE_NUM_TO_FILL_VALUE(1)); SaveFailedScreenTextPrint(gText_GamePlayCannotBeContinued, 1, 0); SetVBlankCallback(VBlankCB); SetMainCallback2(CB2_FadeAndReturnToTitleScreen); diff --git a/src/scrcmd.c b/src/scrcmd.c index a1e391b4af..145437a2a8 100644 --- a/src/scrcmd.c +++ b/src/scrcmd.c @@ -1519,7 +1519,7 @@ bool8 ScrCmd_braillemessage(struct ScriptContext *ctx) LoadUserWindowBorderGfx(gUnknown_03000F30, 0x214, 0xE0); NewMenuHelpers_DrawStdWindowFrame(gUnknown_03000F30, 0); PutWindowTilemap(gUnknown_03000F30); - FillWindowPixelBuffer(gUnknown_03000F30, PIXEL_BUFFER_WHITE); + FillWindowPixelBuffer(gUnknown_03000F30, PALETTE_NUM_TO_FILL_VALUE(1)); AddTextPrinterParameterized(gUnknown_03000F30, 6, gStringVar4, xText, yText, 0xFF, 0x0); CopyWindowToVram(gUnknown_03000F30, 3); return FALSE; diff --git a/src/script_menu.c b/src/script_menu.c index 98761fe342..8831d65c66 100644 --- a/src/script_menu.c +++ b/src/script_menu.c @@ -1639,27 +1639,27 @@ static void sub_80E2A94(u8 multichoiceId) switch (multichoiceId) { case 77: - FillWindowPixelBuffer(0, PIXEL_BUFFER_WHITE); + FillWindowPixelBuffer(0, PALETTE_NUM_TO_FILL_VALUE(1)); AddTextPrinterParameterized2(0, 1, gUnknown_0858BBAC[Menu_GetCursorPos()], 0, NULL, 2, 1, 3); break; case 76: - FillWindowPixelBuffer(0, PIXEL_BUFFER_WHITE); + FillWindowPixelBuffer(0, PALETTE_NUM_TO_FILL_VALUE(1)); AddTextPrinterParameterized2(0, 1, gUnknown_0858BB9C[Menu_GetCursorPos()], 0, NULL, 2, 1, 3); break; case 78: - FillWindowPixelBuffer(0, PIXEL_BUFFER_WHITE); + FillWindowPixelBuffer(0, PALETTE_NUM_TO_FILL_VALUE(1)); AddTextPrinterParameterized2(0, 1, gUnknown_0858BBBC[Menu_GetCursorPos()], 0, NULL, 2, 1, 3); break; case 79: - FillWindowPixelBuffer(0, PIXEL_BUFFER_WHITE); + FillWindowPixelBuffer(0, PALETTE_NUM_TO_FILL_VALUE(1)); AddTextPrinterParameterized2(0, 1, gUnknown_0858BBCC[Menu_GetCursorPos()], 0, NULL, 2, 1, 3); break; case 75: - FillWindowPixelBuffer(0, PIXEL_BUFFER_WHITE); + FillWindowPixelBuffer(0, PALETTE_NUM_TO_FILL_VALUE(1)); AddTextPrinterParameterized2(0, 1, gUnknown_0858BBEC[Menu_GetCursorPos()], 0, NULL, 2, 1, 3); break; case 74: - FillWindowPixelBuffer(0, PIXEL_BUFFER_WHITE); + FillWindowPixelBuffer(0, PALETTE_NUM_TO_FILL_VALUE(1)); AddTextPrinterParameterized2(0, 1, gUnknown_0858BBE0[Menu_GetCursorPos()], 0, NULL, 2, 1, 3); break; } diff --git a/src/shop.c b/src/shop.c index 9c7c30feda..8c530e0d33 100755 --- a/src/shop.c +++ b/src/shop.c @@ -545,7 +545,7 @@ static void BuyMenuPrintItemDescriptionAndShowItemIcon(int item, bool8 onInit, s description = gText_QuitShopping; } - FillWindowPixelBuffer(2, PIXEL_BUFFER_TRANSPARENT); + FillWindowPixelBuffer(2, PALETTE_NUM_TO_FILL_VALUE(0)); BuyMenuPrint(2, description, 3, 1, 0, 0); } @@ -1144,7 +1144,7 @@ static void BuyMenuPrintItemQuantityAndPrice(u8 taskId) { s16 *data = gTasks[taskId].data; - FillWindowPixelBuffer(4, PIXEL_BUFFER_WHITE); + FillWindowPixelBuffer(4, PALETTE_NUM_TO_FILL_VALUE(1)); PrintMoneyAmount(4, 38, 1, gShopDataPtr->totalCost, TEXT_SPEED_FF); ConvertIntToDecimalStringN(gStringVar1, tItemCount, 2, 2); StringExpandPlaceholders(gStringVar4, gText_xVar1); diff --git a/src/slot_machine.c b/src/slot_machine.c index bf26de437a..f603f468c3 100644 --- a/src/slot_machine.c +++ b/src/slot_machine.c @@ -3036,7 +3036,7 @@ s16 sub_8102D5C(s16 a0) sub_81065DC(); AddWindow(&gUnknown_085A7444); PutWindowTilemap(1); - FillWindowPixelBuffer(1, PIXEL_BUFFER_TRANSPARENT); + FillWindowPixelBuffer(1, PALETTE_NUM_TO_FILL_VALUE(0)); task->data[0]++; } @@ -3052,7 +3052,7 @@ s16 sub_8102D5C(s16 a0) { if (gMain.newKeys & (B_BUTTON | SELECT_BUTTON)) { - FillWindowPixelBuffer(1, PIXEL_BUFFER_TRANSPARENT); + FillWindowPixelBuffer(1, PALETTE_NUM_TO_FILL_VALUE(0)); ClearWindowTilemap(1); CopyWindowToVram(1, 1); RemoveWindow(1); diff --git a/src/start_menu.c b/src/start_menu.c index 4231db7cc7..c61269c9cd 100644 --- a/src/start_menu.c +++ b/src/start_menu.c @@ -1232,7 +1232,7 @@ static void sub_80A0550(u8 taskId) switch (*step) { case 0: - FillWindowPixelBuffer(0, PIXEL_BUFFER_WHITE); + FillWindowPixelBuffer(0, PALETTE_NUM_TO_FILL_VALUE(1)); AddTextPrinterParameterized2(0, 1, gText_SavingDontTurnOffPower, diff --git a/src/starter_choose.c b/src/starter_choose.c index fda1d95fa9..4e21c1845a 100644 --- a/src/starter_choose.c +++ b/src/starter_choose.c @@ -523,7 +523,7 @@ static void Task_StarterChoose3(u8 taskId) static void Task_StarterChoose4(u8 taskId) { PlayCry1(GetStarterPokemon(gTasks[taskId].tStarterSelection), 0); - FillWindowPixelBuffer(0, PIXEL_BUFFER_WHITE); + FillWindowPixelBuffer(0, PALETTE_NUM_TO_FILL_VALUE(1)); AddTextPrinterParameterized(0, 1, gText_ConfirmStarterChoice, 0, 1, 0, NULL); schedule_bg_copy_tilemap_to_vram(0); CreateYesNoMenu(&gUnknown_085B1DDC, 0x2A8, 0xD, 0); @@ -579,7 +579,7 @@ static void CreateStarterPokemonLabel(u8 selection) winTemplate.tilemapTop = gStarterChoose_LabelCoords[selection][1]; sStarterChooseWindowId = AddWindow(&winTemplate); - FillWindowPixelBuffer(sStarterChooseWindowId, PIXEL_BUFFER_TRANSPARENT); + FillWindowPixelBuffer(sStarterChooseWindowId, PALETTE_NUM_TO_FILL_VALUE(0)); width = GetStringCenterAlignXOffset(7, text, 0x68); AddTextPrinterParameterized3(sStarterChooseWindowId, 7, width, 1, gUnknown_085B1E0C, 0, text); @@ -600,7 +600,7 @@ static void CreateStarterPokemonLabel(u8 selection) static void sub_8134604(void) { - FillWindowPixelBuffer(sStarterChooseWindowId, PIXEL_BUFFER_TRANSPARENT); + FillWindowPixelBuffer(sStarterChooseWindowId, PALETTE_NUM_TO_FILL_VALUE(0)); ClearWindowTilemap(sStarterChooseWindowId); RemoveWindow(sStarterChooseWindowId); sStarterChooseWindowId = 0xFF; diff --git a/src/text.c b/src/text.c index a439d3ced8..c3ae315d0a 100644 --- a/src/text.c +++ b/src/text.c @@ -1581,7 +1581,7 @@ u16 RenderText(struct TextPrinter *textPrinter) textPrinter->printerTemplate.currentChar++; return 2; case 15: - FillWindowPixelBuffer(textPrinter->printerTemplate.windowId, textPrinter->printerTemplate.bgColor | textPrinter->printerTemplate.bgColor << 4); + FillWindowPixelBuffer(textPrinter->printerTemplate.windowId, PALETTE_NUM_TO_FILL_VALUE(textPrinter->printerTemplate.bgColor)); textPrinter->printerTemplate.currentX = textPrinter->printerTemplate.x; textPrinter->printerTemplate.currentY = textPrinter->printerTemplate.y; return 2; @@ -1702,7 +1702,7 @@ u16 RenderText(struct TextPrinter *textPrinter) case 2: if (TextPrinterWaitWithDownArrow(textPrinter)) { - FillWindowPixelBuffer(textPrinter->printerTemplate.windowId, (textPrinter->printerTemplate.bgColor << 4) | textPrinter->printerTemplate.bgColor); + FillWindowPixelBuffer(textPrinter->printerTemplate.windowId, PALETTE_NUM_TO_FILL_VALUE(textPrinter->printerTemplate.bgColor)); textPrinter->printerTemplate.currentX = textPrinter->printerTemplate.x; textPrinter->printerTemplate.currentY = textPrinter->printerTemplate.y; textPrinter->state = 0; diff --git a/src/trade.c b/src/trade.c index 148ad2e265..1b1b4670bd 100644 --- a/src/trade.c +++ b/src/trade.c @@ -1418,7 +1418,7 @@ static void sub_80772A4(void) for (i = 0; i < 18; i++) { ClearWindowTilemap(i); - FillWindowPixelBuffer(i, PIXEL_BUFFER_TRANSPARENT); + FillWindowPixelBuffer(i, PALETTE_NUM_TO_FILL_VALUE(0)); } FillBgTilemapBufferRect(0, 0, 0, 0, 30, 20, 15); @@ -2461,7 +2461,7 @@ static void sub_8078DBC(void) if (gUnknown_0203229C->tradeMenuCursorPosition < 6) { sub_8098858(1, 1, 14); - FillWindowPixelBuffer(1, PIXEL_BUFFER_WHITE); + FillWindowPixelBuffer(1, PALETTE_NUM_TO_FILL_VALUE(1)); PrintMenuTable(1, 2, gUnknown_0832DEAC); InitMenuInUpperLeftCornerPlaySoundWhenAPressed(1, 2, 0); PutWindowTilemap(1); @@ -2724,7 +2724,7 @@ static void sub_8079408(void) for (i = 0; i < 4; i++) { - FillWindowPixelBuffer(i + 14, PIXEL_BUFFER_TRANSPARENT); + FillWindowPixelBuffer(i + 14, PALETTE_NUM_TO_FILL_VALUE(0)); rbox_fill_rectangle(i + 14); } @@ -3256,7 +3256,7 @@ static void sub_807A0C4(void) static void sub_807A19C(u8 a0) { - FillWindowPixelBuffer(0, PIXEL_BUFFER_WHITE); + FillWindowPixelBuffer(0, PALETTE_NUM_TO_FILL_VALUE(1)); AddTextPrinterParameterized(0, 1, gUnknown_0832DEBC[a0], 0, 1, TEXT_SPEED_FF, NULL); sub_8098858(0, 20, 12); PutWindowTilemap(0); @@ -4185,7 +4185,7 @@ void sub_807B140(void) void sub_807B154(void) { - FillWindowPixelBuffer(0, PIXEL_BUFFER_UNKNOWN); + FillWindowPixelBuffer(0, PALETTE_NUM_TO_FILL_VALUE(15)); PutWindowTilemap(0); CopyWindowToVram(0, 3); } @@ -4263,7 +4263,7 @@ static void sub_807B270(void) break; case 8: sub_807ACFC(1, 1); - FillWindowPixelBuffer(0, PIXEL_BUFFER_UNKNOWN); + FillWindowPixelBuffer(0, PALETTE_NUM_TO_FILL_VALUE(15)); PutWindowTilemap(0); CopyWindowToVram(0, 3); gMain.state++; @@ -4654,7 +4654,7 @@ static bool8 sub_807BBEC(void) if (!gPaletteFade.active) { sub_807B62C(4); - FillWindowPixelBuffer(0, PIXEL_BUFFER_UNKNOWN); + FillWindowPixelBuffer(0, PALETTE_NUM_TO_FILL_VALUE(15)); CopyWindowToVram(0, 3); gUnknown_020322A0->state++; } @@ -5146,7 +5146,7 @@ static bool8 sub_807CFC8(void) if (!gPaletteFade.active) { sub_807B62C(4); - FillWindowPixelBuffer(0, PIXEL_BUFFER_UNKNOWN); + FillWindowPixelBuffer(0, PALETTE_NUM_TO_FILL_VALUE(15)); CopyWindowToVram(0, 3); gUnknown_020322A0->state++; } @@ -6085,7 +6085,7 @@ void sub_807F19C(void) void sub_807F1A8(u8 windowId, const u8 *str, u8 speed) { - FillWindowPixelBuffer(windowId, PIXEL_BUFFER_UNKNOWN); + FillWindowPixelBuffer(windowId, PALETTE_NUM_TO_FILL_VALUE(15)); gUnknown_020322A0->unk_F6[0] = 15; gUnknown_020322A0->unk_F6[1] = 1; gUnknown_020322A0->unk_F6[2] = 6; diff --git a/src/trainer_card.c b/src/trainer_card.c index d6d3b31527..c8f0df0db3 100755 --- a/src/trainer_card.c +++ b/src/trainer_card.c @@ -350,7 +350,7 @@ static void sub_80C2760(u8 taskId) case 0: if (!IsDma3ManagerBusyWithBgCopy()) { - FillWindowPixelBuffer(1, PIXEL_BUFFER_TRANSPARENT); + FillWindowPixelBuffer(1, PALETTE_NUM_TO_FILL_VALUE(0)); sData->var_0++; } break; @@ -363,7 +363,7 @@ static void sub_80C2760(u8 taskId) sData->var_0++; break; case 3: - FillWindowPixelBuffer(2, PIXEL_BUFFER_TRANSPARENT); + FillWindowPixelBuffer(2, PALETTE_NUM_TO_FILL_VALUE(0)); sub_80C4FF0(); sub_80C438C(2); sData->var_0++; @@ -1634,7 +1634,7 @@ static bool8 sub_80C4B08(struct Task* task) switch (sData->var_4) { case 0: - FillWindowPixelBuffer(1, PIXEL_BUFFER_TRANSPARENT); + FillWindowPixelBuffer(1, PALETTE_NUM_TO_FILL_VALUE(0)); FillBgTilemapBufferRect_Palette0(3, 0, 0, 0, 0x20, 0x20); break; case 1: @@ -1659,7 +1659,7 @@ static bool8 sub_80C4B08(struct Task* task) if (!sData->var_8) sub_80C474C(); else - FillWindowPixelBuffer(2, PIXEL_BUFFER_TRANSPARENT); + FillWindowPixelBuffer(2, PALETTE_NUM_TO_FILL_VALUE(0)); break; case 4: if (sData->var_8) diff --git a/src/trainer_hill.c b/src/trainer_hill.c index 5f351554e7..821068fef5 100644 --- a/src/trainer_hill.c +++ b/src/trainer_hill.c @@ -609,7 +609,7 @@ void PrintOnTrainerHillRecordsWindow(void) u32 total, minutes, secondsWhole, secondsFraction; SetUpDataStruct(); - FillWindowPixelBuffer(0, PIXEL_BUFFER_TRANSPARENT); + FillWindowPixelBuffer(0, PALETTE_NUM_TO_FILL_VALUE(0)); x = GetStringCenterAlignXOffset(1, gText_TimeBoard, 0xD0); AddTextPrinterParameterized3(0, 1, x, 2, sRecordWinColors, TEXT_SPEED_FF, gText_TimeBoard); diff --git a/src/unk_text_util_2.c b/src/unk_text_util_2.c index bbc256915f..08fdf2e84e 100644 --- a/src/unk_text_util_2.c +++ b/src/unk_text_util_2.c @@ -114,7 +114,7 @@ u16 Font6Func(struct TextPrinter *textPrinter) textPrinter->printerTemplate.currentY = textPrinter->printerTemplate.y + *textPrinter->printerTemplate.currentChar++; return 2; case 15: - FillWindowPixelBuffer(textPrinter->printerTemplate.windowId, textPrinter->printerTemplate.bgColor | (textPrinter->printerTemplate.bgColor << 4)); + FillWindowPixelBuffer(textPrinter->printerTemplate.windowId, PALETTE_NUM_TO_FILL_VALUE(textPrinter->printerTemplate.bgColor)); return 2; } break; @@ -146,7 +146,7 @@ u16 Font6Func(struct TextPrinter *textPrinter) case 2: if (TextPrinterWaitWithDownArrow(textPrinter)) { - FillWindowPixelBuffer(textPrinter->printerTemplate.windowId, textPrinter->printerTemplate.bgColor | (textPrinter->printerTemplate.bgColor << 4)); + FillWindowPixelBuffer(textPrinter->printerTemplate.windowId, PALETTE_NUM_TO_FILL_VALUE(textPrinter->printerTemplate.bgColor)); textPrinter->printerTemplate.currentX = textPrinter->printerTemplate.x; textPrinter->printerTemplate.currentY = textPrinter->printerTemplate.y; textPrinter->state = 0; diff --git a/src/window.c b/src/window.c index 1daf4b5fcb..94e68cae5f 100644 --- a/src/window.c +++ b/src/window.c @@ -106,7 +106,7 @@ bool16 InitWindows(const struct WindowTemplate *templates) } } - gTransparentTileNumber = TRANSPARENT_TILE_NUMBER; + gTransparentTileNumber = 0; return TRUE; } From 199863f21f41b3a51d9a6302ca7c3c2864ee1c17 Mon Sep 17 00:00:00 2001 From: Phlosioneer Date: Thu, 21 Feb 2019 23:56:22 -0500 Subject: [PATCH 03/20] Replace more instances of fill values --- src/list_menu.c | 10 +++++----- src/naming_screen.c | 4 +++- src/pokemon_storage_system.c | 2 +- src/text.c | 4 ++-- src/unk_text_util_2.c | 4 ++-- 5 files changed, 13 insertions(+), 11 deletions(-) diff --git a/src/list_menu.c b/src/list_menu.c index 83293890c0..656ab7a157 100644 --- a/src/list_menu.c +++ b/src/list_menu.c @@ -698,7 +698,7 @@ static void ListMenuErasePrintedCursor(struct ListMenu *list, u16 selectedRow) u8 width = GetMenuCursorDimensionByFont(list->template.fontId, 0); u8 height = GetMenuCursorDimensionByFont(list->template.fontId, 1); FillWindowPixelRect(list->template.windowId, - (list->template.fillValue << 4) | (list->template.fillValue), + PALETTE_NUM_TO_FILL_VALUE(list->template.fillValue), list->template.cursor_X, selectedRow * yMultiplier + list->template.upText_Y, width, @@ -806,26 +806,26 @@ static void ListMenuScroll(struct ListMenu *list, u8 count, bool8 movingDown) { u16 y, width, height; - ScrollWindow(list->template.windowId, 1, count * yMultiplier, (list->template.fillValue << 4) | (list->template.fillValue)); + ScrollWindow(list->template.windowId, 1, count * yMultiplier, PALETTE_NUM_TO_FILL_VALUE(list->template.fillValue)); ListMenuPrintEntries(list, list->scrollOffset, 0, count); y = (list->template.maxShowed * yMultiplier) + list->template.upText_Y; width = GetWindowAttribute(list->template.windowId, WINDOW_WIDTH) * 8; height = (GetWindowAttribute(list->template.windowId, WINDOW_HEIGHT) * 8) - y; FillWindowPixelRect(list->template.windowId, - (list->template.fillValue << 4) | (list->template.fillValue), + PALETTE_NUM_TO_FILL_VALUE(list->template.fillValue), 0, y, width, height); } else { u16 width; - ScrollWindow(list->template.windowId, 0, count * yMultiplier, (list->template.fillValue << 4) | (list->template.fillValue)); + ScrollWindow(list->template.windowId, 0, count * yMultiplier, PALETTE_NUM_TO_FILL_VALUE(list->template.fillValue)); ListMenuPrintEntries(list, list->scrollOffset + (list->template.maxShowed - count), list->template.maxShowed - count, count); width = GetWindowAttribute(list->template.windowId, WINDOW_WIDTH) * 8; FillWindowPixelRect(list->template.windowId, - (list->template.fillValue << 4) | (list->template.fillValue), + PALETTE_NUM_TO_FILL_VALUE(list->template.fillValue), 0, 0, width, list->template.upText_Y); } } diff --git a/src/naming_screen.c b/src/naming_screen.c index a84cbd6576..013eb37ca9 100644 --- a/src/naming_screen.c +++ b/src/naming_screen.c @@ -1704,7 +1704,9 @@ static const struct TextColorThing sUnkColorStruct = static const u8 sFillValues[3] = { - 0xEE, 0xDD, 0xFF + PALETTE_NUM_TO_FILL_VALUE(0xE), + PALETTE_NUM_TO_FILL_VALUE(0xD), + PALETTE_NUM_TO_FILL_VALUE(0xF) }; static const u8 *const sUnkColors[3] = diff --git a/src/pokemon_storage_system.c b/src/pokemon_storage_system.c index 8abb349ef5..d4c4c52248 100644 --- a/src/pokemon_storage_system.c +++ b/src/pokemon_storage_system.c @@ -9194,7 +9194,7 @@ static void sub_80D0834(u8 arg0, u8 arg1) if (species != SPECIES_NONE) { FillWindowPixelRect8Bit(sPSSData->field_2200, - 0, + PALETTE_NUM_TO_FILL_VALUE(0), 24 * arg0, 24 * arg1, 32, diff --git a/src/text.c b/src/text.c index c3ae315d0a..dc28d71c89 100644 --- a/src/text.c +++ b/src/text.c @@ -1724,12 +1724,12 @@ u16 RenderText(struct TextPrinter *textPrinter) int speed = gWindowVerticalScrollSpeeds[scrollSpeed]; if (textPrinter->scrollDistance < speed) { - ScrollWindow(textPrinter->printerTemplate.windowId, 0, textPrinter->scrollDistance, textPrinter->printerTemplate.bgColor << 4 | textPrinter->printerTemplate.bgColor); + ScrollWindow(textPrinter->printerTemplate.windowId, 0, textPrinter->scrollDistance, PALETTE_NUM_TO_FILL_VALUE(textPrinter->printerTemplate.bgColor)); textPrinter->scrollDistance = 0; } else { - ScrollWindow(textPrinter->printerTemplate.windowId, 0, speed, textPrinter->printerTemplate.bgColor << 4 | textPrinter->printerTemplate.bgColor); + ScrollWindow(textPrinter->printerTemplate.windowId, 0, speed, PALETTE_NUM_TO_FILL_VALUE(textPrinter->printerTemplate.bgColor)); textPrinter->scrollDistance -= speed; } CopyWindowToVram(textPrinter->printerTemplate.windowId, 2); diff --git a/src/unk_text_util_2.c b/src/unk_text_util_2.c index 08fdf2e84e..6fbe6d04f5 100644 --- a/src/unk_text_util_2.c +++ b/src/unk_text_util_2.c @@ -166,12 +166,12 @@ u16 Font6Func(struct TextPrinter *textPrinter) { if (textPrinter->scrollDistance < sUnknown_08616124[gSaveBlock2Ptr->optionsTextSpeed]) { - ScrollWindow(textPrinter->printerTemplate.windowId, 0, textPrinter->scrollDistance, textPrinter->printerTemplate.bgColor | (textPrinter->printerTemplate.bgColor << 4)); + ScrollWindow(textPrinter->printerTemplate.windowId, 0, textPrinter->scrollDistance, PALETTE_NUM_TO_FILL_VALUE(textPrinter->printerTemplate.bgColor)); textPrinter->scrollDistance = 0; } else { - ScrollWindow(textPrinter->printerTemplate.windowId, 0, sUnknown_08616124[gSaveBlock2Ptr->optionsTextSpeed], textPrinter->printerTemplate.bgColor | (textPrinter->printerTemplate.bgColor << 4)); + ScrollWindow(textPrinter->printerTemplate.windowId, 0, sUnknown_08616124[gSaveBlock2Ptr->optionsTextSpeed], PALETTE_NUM_TO_FILL_VALUE(textPrinter->printerTemplate.bgColor)); textPrinter->scrollDistance -= sUnknown_08616124[gSaveBlock2Ptr->optionsTextSpeed]; } CopyWindowToVram(textPrinter->printerTemplate.windowId, 2); From 44e92ce2596981c8d42b70922e5ae84d6b321ab1 Mon Sep 17 00:00:00 2001 From: Phlosioneer Date: Fri, 22 Feb 2019 01:40:11 -0500 Subject: [PATCH 04/20] Give window drawing functions better names --- asm/rom_8011DC0.s | 52 ++++++++++---------- asm/rom_81D1C44.s | 10 ++-- include/menu.h | 20 ++++---- include/window.h | 3 -- src/apprentice.c | 4 +- src/battle_pyramid_bag.c | 13 ++--- src/battle_records.c | 4 +- src/berry_blender.c | 10 ++-- src/cable_club.c | 4 +- src/clear_save_data_screen.c | 2 +- src/coins.c | 4 +- src/daycare.c | 6 +-- src/decoration.c | 42 ++++++++-------- src/field_message_box.c | 6 +-- src/field_player_avatar.c | 4 +- src/field_region_map.c | 4 +- src/field_specials.c | 12 ++--- src/fldeff_softboiled.c | 2 +- src/frontier_util.c | 18 +++---- src/hall_of_fame.c | 10 ++-- src/item_menu.c | 7 +-- src/item_use.c | 4 +- src/list_menu.c | 4 +- src/main_menu.c | 16 +++---- src/map_name_popup.c | 4 +- src/mauville_old_man.c | 2 +- src/menu.c | 92 ++++++++++++++++++------------------ src/menu_helpers.c | 2 +- src/money.c | 4 +- src/mystery_event_menu.c | 4 +- src/naming_screen.c | 2 +- src/party_menu.c | 14 +++--- src/player_pc.c | 24 +++++----- src/pokeblock.c | 8 ++-- src/pokeblock_feed.c | 2 +- src/pokemon_storage_system.c | 14 +++--- src/record_mixing.c | 4 +- src/region_map.c | 12 ++--- src/reset_rtc_screen.c | 10 ++-- src/rom_8011DC0.c | 16 +++---- src/roulette.c | 40 ++++++++-------- src/save_failed_screen.c | 4 +- src/scrcmd.c | 6 +-- src/script_menu.c | 4 +- src/secret_base.c | 16 +++---- src/shop.c | 16 +++---- src/slot_machine.c | 18 +++---- src/start_menu.c | 44 ++++++++--------- src/starter_choose.c | 2 +- src/trader.c | 4 +- src/trainer_card.c | 2 +- src/wallclock.c | 4 +- src/window.c | 1 + 53 files changed, 318 insertions(+), 318 deletions(-) diff --git a/asm/rom_8011DC0.s b/asm/rom_8011DC0.s index 7d43b18151..9a77545a7a 100644 --- a/asm/rom_8011DC0.s +++ b/asm/rom_8011DC0.s @@ -472,7 +472,7 @@ sub_8017020: @ 8017020 bl sub_81973A4 movs r0, 0 movs r1, 0x1 - bl NewMenuHelpers_DrawDialogueFrame + bl DrawDialogueFrame ldr r0, =gStringVar4 adds r1, r4, 0 bl StringExpandPlaceholders @@ -517,7 +517,7 @@ _08017076: bl sub_81973A4 movs r0, 0 movs r1, 0x1 - bl NewMenuHelpers_DrawDialogueFrame + bl DrawDialogueFrame ldr r0, =gStringVar4 adds r1, r5, 0 bl StringExpandPlaceholders @@ -563,7 +563,7 @@ _080170CA: negs r0, r0 b _08017110 _080170D4: - bl DisplayYesNoMenu + bl DisplayYesNoMenuWithDefault ldrb r0, [r4] adds r0, 0x1 strb r0, [r4] @@ -609,7 +609,7 @@ sub_8017118: @ 8017118 lsrs r4, 24 adds r0, r4, 0 movs r1, 0 - bl NewMenuHelpers_DrawStdWindowFrame + bl DrawStdWindowFrame adds r0, r4, 0 movs r1, 0xFF bl FillWindowPixelBuffer @@ -705,7 +705,7 @@ _080171DC: strb r0, [r5] ldrb r0, [r5] movs r1, 0 - bl NewMenuHelpers_DrawStdWindowFrame + bl DrawStdWindowFrame ldr r0, =gMultiuseListMenuTemplate adds r2, r0, 0 ldr r1, [sp, 0x24] @@ -745,7 +745,7 @@ _08017228: bl DestroyListMenuTask ldrb r0, [r5] movs r1, 0x1 - bl ClearWindowAndBorder + bl ClearStdWindowAndFrame ldrb r0, [r5] bl RemoveWindow movs r0, 0 @@ -765,7 +765,7 @@ _08017264: bl DestroyListMenuTask ldrb r0, [r5] movs r1, 0x1 - bl ClearWindowAndBorder + bl ClearStdWindowAndFrame ldrb r0, [r5] bl RemoveWindow strb r4, [r7] @@ -818,7 +818,7 @@ _080172C8: strb r0, [r6] ldrb r0, [r6] movs r1, 0 - bl NewMenuHelpers_DrawStdWindowFrame + bl DrawStdWindowFrame ldr r0, =gMultiuseListMenuTemplate adds r2, r0, 0 ldr r1, [sp, 0x24] @@ -18242,7 +18242,7 @@ sub_801FEBC: @ 801FEBC lsls r0, 24 lsrs r0, 24 movs r1, 0 - bl sub_8198070 + bl ClearStdWindowAndFrameToTransparent ldr r0, [r4] ldrb r0, [r0, 0x18] bl ClearWindowTilemap @@ -18470,7 +18470,7 @@ sub_8020094: @ 8020094 lsls r0, 24 lsrs r0, 24 movs r1, 0 - bl sub_8198070 + bl ClearStdWindowAndFrameToTransparent ldr r0, [r4] ldrb r0, [r0, 0x1E] bl ClearWindowTilemap @@ -18913,7 +18913,7 @@ sub_802040C: @ 802040C push {lr} movs r0, 0x3 movs r1, 0 - bl sub_8198070 + bl ClearStdWindowAndFrameToTransparent movs r0, 0x3 bl ClearWindowTilemap pop {r0} @@ -22378,7 +22378,7 @@ _0802210C: movs r1, 0 adds r2, r4, 0 movs r3, 0xD - bl SetWindowBorderStyle + bl DrawStdFrameWithCustomTileAndPalette b _08022218 .pool _08022130: @@ -22509,7 +22509,7 @@ sub_802222C: @ 802222C adds r5, r4, r0 ldrb r0, [r5] movs r1, 0x1 - bl sub_8198070 + bl ClearStdWindowAndFrameToTransparent ldrb r0, [r5] bl RemoveWindow adds r0, r4, 0 @@ -22577,7 +22577,7 @@ _08022296: movs r1, 0 adds r2, r4, 0 movs r3, 0xD - bl SetWindowBorderStyle + bl DrawStdFrameWithCustomTileAndPalette b _080224BA .pool _080222D0: @@ -22773,7 +22773,7 @@ _08022480: _08022494: ldrb r0, [r6, 0x2] movs r1, 0x1 - bl sub_8198070 + bl ClearStdWindowAndFrameToTransparent ldrb r0, [r6, 0x2] bl ClearWindowTilemap ldrb r0, [r6, 0x2] @@ -23864,7 +23864,7 @@ _08022D38: _08022D42: movs r0, 0 movs r1, 0 - bl NewMenuHelpers_DrawDialogueFrame + bl DrawDialogueFrame ldrb r1, [r5, 0x1] movs r0, 0x2 mov r8, r0 @@ -23946,7 +23946,7 @@ _08022DE8: beq _08022DFA movs r0, 0 movs r1, 0x1 - bl ClearWindowAndWideBorder + bl ClearDialogWindowAndFrame _08022DFA: ldrb r0, [r7, 0xE] movs r1, 0x1 @@ -24250,7 +24250,7 @@ _0802301E: _08023044: movs r0, 0 movs r1, 0x1 - bl ClearWindowAndWideBorder + bl ClearDialogWindowAndFrame movs r0, 0xA movs r1, 0x1 movs r2, 0 @@ -26462,7 +26462,7 @@ _080241A6: beq _0802421E movs r0, 0 movs r1, 0 - bl NewMenuHelpers_DrawDialogueFrame + bl DrawDialogueFrame ldr r2, =gText_SavingDontTurnOffPower movs r0, 0 str r0, [sp] @@ -26550,7 +26550,7 @@ _08024246: strb r0, [r5, 0xC] b _080242D8 _0802426A: - bl DisplayYesNoMenu + bl DisplayYesNoMenuWithDefault b _080242D0 _08024270: bl Menu_ProcessInputNoWrapClearOnChoose @@ -26583,7 +26583,7 @@ _080242A4: _080242A6: movs r0, 0 movs r1, 0x1 - bl ClearWindowAndWideBorder + bl ClearDialogWindowAndFrame movs r4, 0 str r4, [sp] adds r0, r6, 0 @@ -26761,7 +26761,7 @@ _080243EA: _080243F6: movs r0, 0 movs r1, 0x1 - bl ClearWindowAndWideBorder + bl ClearDialogWindowAndFrame adds r0, r5, 0 bl sub_8021488 movs r0, 0x1 @@ -26819,7 +26819,7 @@ _0802445A: _08024460: movs r0, 0 movs r1, 0 - bl NewMenuHelpers_DrawDialogueFrame + bl DrawDialogueFrame ldrh r1, [r5, 0x14] cmp r1, 0x3 bne _08024490 @@ -27347,7 +27347,7 @@ sub_802482C: @ 802482C movs r1, 0 adds r2, r4, 0 adds r3, r5, 0 - bl SetWindowBorderStyle + bl DrawStdFrameWithCustomTileAndPalette ldr r2, =gText_Powder movs r0, 0x1 str r0, [sp] @@ -27446,7 +27446,7 @@ sub_8024918: @ 8024918 bl ClearWindowTilemap ldrb r0, [r4] movs r1, 0x1 - bl sub_8198070 + bl ClearStdWindowAndFrameToTransparent ldrb r0, [r4] bl RemoveWindow pop {r4} @@ -38552,7 +38552,7 @@ _0802A3A4: _0802A3AE: movs r0, 0 movs r1, 0 - bl NewMenuHelpers_DrawDialogueFrame + bl DrawDialogueFrame ldr r2, =gText_SavingDontTurnOffPower str r4, [sp] movs r0, 0x2 diff --git a/asm/rom_81D1C44.s b/asm/rom_81D1C44.s index 13664a4b2b..eab52bbf46 100644 --- a/asm/rom_81D1C44.s +++ b/asm/rom_81D1C44.s @@ -108,7 +108,7 @@ sub_81D1D04: @ 81D1D04 adds r4, r0 ldrb r0, [r4] movs r1, 0 - bl sub_8198070 + bl ClearStdWindowAndFrameToTransparent ldrb r0, [r4] bl ClearWindowTilemap ldrb r0, [r4] @@ -1613,7 +1613,7 @@ _081D284A: movs r1, 0 movs r2, 0x1 movs r3, 0xE - bl SetWindowBorderStyle + bl DrawStdFrameWithCustomTileAndPalette b _081D288E .pool _081D287C: @@ -1623,7 +1623,7 @@ _081D287C: movs r1, 0 movs r2, 0x1 movs r3, 0xE - bl SetWindowBorderStyle + bl DrawStdFrameWithCustomTileAndPalette _081D288E: movs r0, 0x2 bl PutWindowTilemap @@ -1633,12 +1633,12 @@ _081D288E: movs r1, 0 movs r2, 0x1 movs r3, 0xE - bl SetWindowBorderStyle + bl DrawStdFrameWithCustomTileAndPalette movs r0, 0x3 movs r1, 0 movs r2, 0x1 movs r3, 0xE - bl SetWindowBorderStyle + bl DrawStdFrameWithCustomTileAndPalette bl nullsub_79 movs r0, 0x1 bl schedule_bg_copy_tilemap_to_vram diff --git a/include/menu.h b/include/menu.h index cb017187a1..ae89a1ab46 100644 --- a/include/menu.h +++ b/include/menu.h @@ -25,23 +25,23 @@ void InitStandardTextBoxWindows(void); void sub_8197200(void); u16 RunTextPrintersAndIsPrinter0Active(void); void sub_81973A4(void); -void NewMenuHelpers_DrawDialogueFrame(u8, u8); -void ClearWindowAndBorder(u8 windowId, bool8 copyToVram); +void DrawDialogueFrame(u8, u8); +void ClearStdWindowAndFrame(u8 windowId, bool8 copyToVram); u16 AddTextPrinterParameterized2(u8 windowId, u8 fontId, const u8 *str, u8 speed, void (*callback)(struct TextPrinterTemplate *, u16), u8 fgColor, u8 bgColor, u8 shadowColor); void PrintPlayerNameOnWindow(u8, const u8*, u16, u16); void DisplayItemMessageOnField(u8 taskId, const u8 *src, TaskFunc callback); -void ClearWindowAndWideBorder(u8 windowId, bool8 copyToVram); +void ClearDialogWindowAndFrame(u8 windowId, bool8 copyToVram); void SetStandardWindowBorderStyle(u8 a0, u8 a1); -void DisplayYesNoMenu(void); +void DisplayYesNoMenuWithDefault(void); u32 GetPlayerTextSpeed(void); u8 GetPlayerTextSpeedDelay(void); void sub_81978B0(u16 arg0); void AddTextPrinterWithCallbackForMessage(bool8 a1, void (*callback)(struct TextPrinterTemplate *, u16)); void sub_8199DF0(u32 bg, u8 a1, int a2, int a3); void AddTextPrinterParameterized3(u8 windowId, u8 fontId, u8 left, u8 top, const u8 *color, s8 speed, const u8 *str); -void sub_8198070(u8 windowId, bool8 copyToVram); +void ClearStdWindowAndFrameToTransparent(u8 windowId, bool8 copyToVram); void SetWindowTemplateFields(struct WindowTemplate* template, u8 priority, u8 tilemapLeft, u8 tilemapTop, u8 width, u8 height, u8 palNum, u16 baseBlock); -void SetWindowBorderStyle(u8 windowId, bool8 copyToVram, u16 tileStart, u8 palette); +void DrawStdFrameWithCustomTileAndPalette(u8 windowId, bool8 copyToVram, u16 tileStart, u8 palette); void schedule_bg_copy_tilemap_to_vram(u8 bgNum); void PrintMenuTable(u8 windowId, u8 itemCount, const struct MenuAction *strs); u8 InitMenuInUpperLeftCornerPlaySoundWhenAPressed(u8 windowId, u8 numItems, u8 initialCursorPos); @@ -60,9 +60,9 @@ s8 ProcessMenuInput_other(void); void do_scheduled_bg_tilemap_copies_to_vram(void); void clear_scheduled_bg_copies_to_vram(void); void AddTextPrinterParameterized4(u8 windowId, u8 fontId, u8 x, u8 y, u8 letterSpacing, u8 lineSpacing, const u8 *color, s8 speed, const u8 *str); -void sub_8197B1C(u8 windowId, bool8 copyToVram, u16 a2, u8 a3); +void DrawDialogFrameWithCustomTileAndPalette(u8 windowId, bool8 copyToVram, u16 a2, u8 a3); void sub_81995E4(u8 windowId, u8 optionsNo, const struct MenuAction *actions, const u8 *actionIds); -void sub_8197DF8(u8 windowId, bool8 copyToVram); +void ClearDialogWindowAndFrameToTransparent(u8 windowId, bool8 copyToVram); u16 sub_8198AA4(u8, u8, u8, u8, u8, u8, u16); void *malloc_and_decompress(const void *src, u32 *sizeOut); u16 copy_decompressed_tile_data_to_vram(u8 bgId, const void *src, u16 size, u16 offset, u8 mode); @@ -75,13 +75,13 @@ u8 GetStartMenuWindowId(void); void sub_819A2BC(u8, u8); u8 Menu_MoveCursor(s8 cursorDelta); u8 Menu_MoveCursorNoWrapAround(s8 cursorDelta); -void NewMenuHelpers_DrawStdWindowFrame(u8 windowId, bool8 CopyToVram); +void DrawStdWindowFrame(u8 windowId, bool8 CopyToVram); u8 sub_81979C4(u8 a1); u8 sub_81983AC(u8 windowId, u8 fontId, u8 left, u8 top, u8 cursorHeight, u8 numChoices, u8 initialCursorPos); void sub_819786C(u8 windowId, bool8 copyToVram); void AddTextPrinterForMessage_2(bool8 allowSkippingDelayWithButtonPress); void RemoveStartMenuWindow(void); -void sub_8197948(u8 initialCursorPos); +void DisplayYesNoMenuWithDefaultDefaultNo(u8 initialCursorPos); void sub_819A344(u8 a0, u8 *dest, u8 color); void RemoveMapNamePopUpWindow(void); u8 GetMapNamePopUpWindowId(void); diff --git a/include/window.h b/include/window.h index 1daee39efc..ece1ecd21e 100644 --- a/include/window.h +++ b/include/window.h @@ -75,7 +75,4 @@ extern u32 filler_03002F58; extern u32 filler_03002F5C; extern u32 filler_03002F64; -// This global is set to 0 and never changed. -extern u8 gTransparentTileNumber; - #endif // GUARD_WINDOW_H diff --git a/src/apprentice.c b/src/apprentice.c index 9cf8cd4b46..27ff8e36e7 100644 --- a/src/apprentice.c +++ b/src/apprentice.c @@ -1619,7 +1619,7 @@ static u8 CreateAndShowWindow(u8 left, u8 top, u8 width, u8 height) static void RemoveAndHideWindow(u8 windowId) { - sub_8198070(windowId, TRUE); + ClearStdWindowAndFrameToTransparent(windowId, TRUE); RemoveWindow(windowId); } @@ -1826,7 +1826,7 @@ static void Script_PrintMessage(void) FreezeEventObjects(); sub_808B864(); sub_808BCF4(); - NewMenuHelpers_DrawDialogueFrame(0, 1); + DrawDialogueFrame(0, 1); PrintMessage(); } diff --git a/src/battle_pyramid_bag.c b/src/battle_pyramid_bag.c index 5103562155..20029b2845 100644 --- a/src/battle_pyramid_bag.c +++ b/src/battle_pyramid_bag.c @@ -1146,7 +1146,7 @@ static void sub_81C64B4(u8 taskId) else if (gMain.newKeys & A_BUTTON) { PlaySE(SE_SELECT); - sub_8198070(3, 0); + ClearStdWindowAndFrameToTransparent(3, 0); ClearWindowTilemap(3); schedule_bg_copy_tilemap_to_vram(1); sub_81C6350(taskId); @@ -1154,7 +1154,7 @@ static void sub_81C64B4(u8 taskId) else if (gMain.newKeys & B_BUTTON) { PlaySE(SE_SELECT); - sub_8198070(3, 0); + ClearStdWindowAndFrameToTransparent(3, 0); ClearWindowTilemap(3); schedule_bg_copy_tilemap_to_vram(1); DontTossItem(taskId); @@ -1415,7 +1415,7 @@ static void PrintOnWindow_Font7(u8 windowId, const u8 *src, u8 x, u8 y, u8 lette static void sub_81C6CEC(u8 windowId) { - SetWindowBorderStyle(windowId, 0, 1, 0xE); + DrawStdFrameWithCustomTileAndPalette(windowId, 0, 1, 0xE); schedule_bg_copy_tilemap_to_vram(1); } @@ -1430,7 +1430,7 @@ static u8 sub_81C6D24(u8 windowArrayId) if (*windowId == 0xFF) { *windowId = AddWindow(&gUnknown_0861F350[windowArrayId]); - SetWindowBorderStyle(*windowId, FALSE, 1, 0xE); + DrawStdFrameWithCustomTileAndPalette(*windowId, FALSE, 1, 0xE); schedule_bg_copy_tilemap_to_vram(1); } return *windowId; @@ -1441,7 +1441,7 @@ static void sub_81C6D6C(u8 windowArrayId) u8 *windowId = &gPyramidBagResources->windowIds[windowArrayId]; if (*windowId != 0xFF) { - sub_8198070(*windowId, FALSE); + ClearStdWindowAndFrameToTransparent(*windowId, FALSE); ClearWindowTilemap(*windowId); RemoveWindow(*windowId); schedule_bg_copy_tilemap_to_vram(1); @@ -1463,7 +1463,8 @@ void DisplayItemMessageInBattlePyramid(u8 taskId, const u8 *str, void (*callback static void sub_81C6E1C(void) { - sub_8197DF8(2, FALSE); + ClearDialogWindowAndFrameToTransparent(2, FALSE); + // This ClearWindowTilemap call is redundant, since ClearDialogWindowAndFrameToTransparent already calls it. ClearWindowTilemap(2); schedule_bg_copy_tilemap_to_vram(1); } diff --git a/src/battle_records.c b/src/battle_records.c index eb41dcc94a..03d2088b4f 100644 --- a/src/battle_records.c +++ b/src/battle_records.c @@ -320,7 +320,7 @@ void ShowLinkBattleRecords(void) s32 i, x; gRecordsWindowId = AddWindow(&sLinkBattleRecordsWindow); - NewMenuHelpers_DrawStdWindowFrame(gRecordsWindowId, FALSE); + DrawStdWindowFrame(gRecordsWindowId, FALSE); FillWindowPixelBuffer(gRecordsWindowId, PALETTE_NUM_TO_FILL_VALUE(1)); StringExpandPlaceholders(gStringVar4, gText_PlayersBattleResults); @@ -342,7 +342,7 @@ void ShowLinkBattleRecords(void) void RemoveRecordsWindow(void) { - ClearWindowAndBorder(gRecordsWindowId, FALSE); + ClearStdWindowAndFrame(gRecordsWindowId, FALSE); RemoveWindow(gRecordsWindowId); } diff --git a/src/berry_blender.c b/src/berry_blender.c index 0a35c672f9..35749db544 100644 --- a/src/berry_blender.c +++ b/src/berry_blender.c @@ -1251,7 +1251,7 @@ static void sub_8080018(void) case 10: if (++sBerryBlenderData->framesToWait > 20) { - sub_8197DF8(4, TRUE); + ClearDialogWindowAndFrameToTransparent(4, TRUE); if (GetBlockReceivedStatus() == sub_800A9D8()) { for (i = 0; i < GetLinkPlayerCount(); i++) @@ -3325,7 +3325,7 @@ static bool8 Blender_PrintBlendingResults(void) sBerryBlenderData->mainState++; break; case 5: - sub_8198070(5, 1); + ClearStdWindowAndFrameToTransparent(5, 1); for (i = 0; i < BLENDER_MAX_PLAYERS; i++) { @@ -3466,7 +3466,7 @@ static bool8 Blender_PrintBlendingRanking(void) } break; case 3: - SetWindowBorderStyle(5, 0, 1, 0xD); + DrawStdFrameWithCustomTileAndPalette(5, 0, 1, 0xD); xPos = GetStringCenterAlignXOffset(1, sText_Ranking, 0xA8); Blender_AddTextPrinter(5, sText_Ranking, xPos, 1, TEXT_SPEED_FF, 0); @@ -3537,7 +3537,7 @@ void ShowBerryBlenderRecordWindow(void) winTemplate = sBlenderRecordWindowTemplate; gRecordsWindowId = AddWindow(&winTemplate); - NewMenuHelpers_DrawStdWindowFrame(gRecordsWindowId, 0); + DrawStdWindowFrame(gRecordsWindowId, 0); FillWindowPixelBuffer(gRecordsWindowId, PALETTE_NUM_TO_FILL_VALUE(1)); xPos = GetStringCenterAlignXOffset(1, gText_BlenderMaxSpeedRecord, 0x90); @@ -3658,7 +3658,7 @@ static bool32 Blender_PrintText(s16 *textState, const u8 *string, s32 textSpeed) switch (*textState) { case 0: - sub_8197B1C(4, FALSE, 0x14, 0xF); + DrawDialogFrameWithCustomTileAndPalette(4, FALSE, 0x14, 0xF); Blender_AddTextPrinter(4, string, 0, 1, textSpeed, 0); PutWindowTilemap(4); CopyWindowToVram(4, 3); diff --git a/src/cable_club.c b/src/cable_club.c index f8137fd8fa..dfef399751 100644 --- a/src/cable_club.c +++ b/src/cable_club.c @@ -93,8 +93,8 @@ static void sub_80B23B0(u16 windowId, u32 value) static void sub_80B241C(u16 windowId) { // Following this call with a copy-to-vram with mode 3 is identical to - // calling ClearWindowAndBorder(windowId, TRUE). - ClearWindowAndBorder(windowId, FALSE); + // calling ClearStdWindowAndFrame(windowId, TRUE). + ClearStdWindowAndFrame(windowId, FALSE); CopyWindowToVram(windowId, 3); } diff --git a/src/clear_save_data_screen.c b/src/clear_save_data_screen.c index 7fdd101e22..619b394105 100644 --- a/src/clear_save_data_screen.c +++ b/src/clear_save_data_screen.c @@ -79,7 +79,7 @@ void CB2_InitClearSaveDataScreen(void) static void Task_DoClearSaveDataScreenYesNo(u8 taskId) { - SetWindowBorderStyle(0, 0, 2, 14); + DrawStdFrameWithCustomTileAndPalette(0, 0, 2, 14); AddTextPrinterParameterized(0, 1, gText_ClearAllSaveData, 0, 1, 0, 0); CreateYesNoMenu(sClearSaveYesNo, 2, 14, 1); gTasks[taskId].func = Task_ClearSaveDataScreenYesNoChoice; diff --git a/src/coins.c b/src/coins.c index c6fbf12169..a8d8eae065 100644 --- a/src/coins.c +++ b/src/coins.c @@ -29,13 +29,13 @@ void ShowCoinsWindow(u32 coinAmount, u8 x, u8 y) sCoinsWindowId = AddWindow(&template); FillWindowPixelBuffer(sCoinsWindowId, PALETTE_NUM_TO_FILL_VALUE(0)); PutWindowTilemap(sCoinsWindowId); - SetWindowBorderStyle(sCoinsWindowId, FALSE, 0x214, 0xE); + DrawStdFrameWithCustomTileAndPalette(sCoinsWindowId, FALSE, 0x214, 0xE); PrintCoinsString(coinAmount); } void HideCoinsWindow(void) { - ClearWindowAndBorder(sCoinsWindowId, TRUE); + ClearStdWindowAndFrame(sCoinsWindowId, TRUE); RemoveWindow(sCoinsWindowId); } diff --git a/src/daycare.c b/src/daycare.c index 14120f20bf..885ac31a1a 100644 --- a/src/daycare.c +++ b/src/daycare.c @@ -1259,7 +1259,7 @@ static void Task_HandleDaycareLevelMenuInput(u8 taskId) break; } DestroyListMenuTask(gTasks[taskId].tMenuListTaskId, NULL, NULL); - ClearWindowAndBorder(gTasks[taskId].tWindowId, TRUE); + ClearStdWindowAndFrame(gTasks[taskId].tWindowId, TRUE); RemoveWindow(gTasks[taskId].tWindowId); DestroyTask(taskId); EnableBothScriptContexts(); @@ -1268,7 +1268,7 @@ static void Task_HandleDaycareLevelMenuInput(u8 taskId) { gSpecialVar_Result = 2; DestroyListMenuTask(gTasks[taskId].tMenuListTaskId, NULL, NULL); - ClearWindowAndBorder(gTasks[taskId].tWindowId, TRUE); + ClearStdWindowAndFrame(gTasks[taskId].tWindowId, TRUE); RemoveWindow(gTasks[taskId].tWindowId); DestroyTask(taskId); EnableBothScriptContexts(); @@ -1283,7 +1283,7 @@ void ShowDaycareLevelMenu(void) u8 daycareMenuTaskId; windowId = AddWindow(&sDaycareLevelMenuWindowTemplate); - NewMenuHelpers_DrawStdWindowFrame(windowId, FALSE); + DrawStdWindowFrame(windowId, FALSE); menuTemplate = sDaycareListMenuLevelTemplate; menuTemplate.windowId = windowId; diff --git a/src/decoration.c b/src/decoration.c index c3434522de..98c3ef0289 100644 --- a/src/decoration.c +++ b/src/decoration.c @@ -463,14 +463,14 @@ u8 sub_81269D4(u8 idx) { *winidx = AddWindow(&gUnknown_085A6B90[idx]); } - SetWindowBorderStyle(*winidx, 0, 0x214, 0xe); + DrawStdFrameWithCustomTileAndPalette(*winidx, 0, 0x214, 0xe); schedule_bg_copy_tilemap_to_vram(0); return *winidx; } void sub_8126A58(u8 idx) { - sub_8198070(sDecorMenuWindowIndices[idx], FALSE); + ClearStdWindowAndFrameToTransparent(sDecorMenuWindowIndices[idx], FALSE); ClearWindowTilemap(sDecorMenuWindowIndices[idx]); RemoveWindow(sDecorMenuWindowIndices[idx]); schedule_bg_copy_tilemap_to_vram(0); @@ -572,7 +572,7 @@ void SecretBasePC_PutAway(u8 taskId) else { sub_8126A58(0); - ClearWindowAndWideBorder(0, 0); + ClearDialogWindowAndFrame(0, 0); FadeScreen(1, 0); gTasks[taskId].data[2] = 0; gTasks[taskId].func = sub_8129ABC; @@ -617,7 +617,7 @@ void sub_8126DA4(u8 taskId) void SecretBasePC_PrepMenuForSelectingStoredDecors(u8 taskId) { LoadPalette(gUnknown_085A6BB0, 0xd0, 0x20); - ClearWindowAndWideBorder(0, 0); + ClearDialogWindowAndFrame(0, 0); sub_8126A58(0); sub_8126DFC(taskId); } @@ -751,7 +751,7 @@ void sub_81270E8(u8 taskId) void sub_8127180(u8 taskId) { - ClearWindowAndWideBorder(0, 0); + ClearDialogWindowAndFrame(0, 0); sub_8126DFC(taskId); } @@ -771,7 +771,7 @@ void sub_81271CC(u8 taskId) { sub_8126A58(1); sub_8126A88(); - NewMenuHelpers_DrawDialogueFrame(0, 0); + DrawDialogueFrame(0, 0); sub_8126C08(); gTasks[taskId].func = sub_8126B80; } @@ -779,7 +779,7 @@ void sub_81271CC(u8 taskId) void sub_8127208(u8 taskId) { LoadPalette(gUnknown_085A6BB0, 0xd0, 0x20); - ClearWindowAndWideBorder(0, 0); + ClearDialogWindowAndFrame(0, 0); gTasks[taskId].data[11] = 2; sCurDecorationCategory = DECORCAT_DESK; sub_8126DFC(taskId); @@ -1095,7 +1095,7 @@ void sub_8127A14(u8 taskId) void sub_8127A30(u8 taskId) { - ClearWindowAndWideBorder(0, 0); + ClearDialogWindowAndFrame(0, 0); gTasks[taskId].func = sub_8127A14; } @@ -1103,7 +1103,7 @@ void sub_8127A5C(u8 taskId) { if (gMain.newKeys & (A_BUTTON | B_BUTTON)) { - ClearWindowAndWideBorder(0, 0); + ClearDialogWindowAndFrame(0, 0); sub_81269D4(1); sub_8127620(taskId); } @@ -1628,13 +1628,13 @@ void sub_8128950(u8 taskId) void sub_81289D0(u8 taskId) { - DisplayYesNoMenu(); + DisplayYesNoMenuWithDefault(); DoYesNoFuncWithChoice(taskId, &gUnknown_085A72C4); } void sub_81289F0(u8 taskId) { - ClearWindowAndWideBorder(0, 0); + ClearDialogWindowAndFrame(0, 0); sub_8128AAC(taskId); if (gDecorations[gCurDecorInventoryItems[gCurDecorationIndex]].permission != DECORPERM_SOLID_MAT) { @@ -1693,13 +1693,13 @@ void sub_8128AAC(u8 taskId) void sub_8128B80(u8 taskId) { - DisplayYesNoMenu(); + DisplayYesNoMenuWithDefault(); DoYesNoFuncWithChoice(taskId, &gUnknown_085A72CC); } void sub_8128BA0(u8 taskId) { - ClearWindowAndWideBorder(0, 0); + ClearDialogWindowAndFrame(0, 0); sub_8128BBC(taskId); } @@ -1887,7 +1887,7 @@ void sub_8128E18(u8 taskId) void sub_8128FD8(u8 taskId) { - ClearWindowAndWideBorder(0, 1); + ClearDialogWindowAndFrame(0, 1); gSprites[sDecor_CameraSpriteObjectIdx1].data[7] = 0; gTasks[taskId].data[10] = 0; gTasks[taskId].func = sub_8128E18; @@ -2251,7 +2251,7 @@ void sub_81298EC(u8 taskId) if (!gPaletteFade.active) { DrawWholeMapView(); ScriptContext1_SetupScript(EventScript_275D2E); - ClearWindowAndWideBorder(0, 1); + ClearDialogWindowAndFrame(0, 1); gTasks[taskId].data[2] = 2; } break; @@ -2343,7 +2343,7 @@ void sub_8129ABC(u8 taskId) void sub_8129B34(u8 taskId) { - ClearWindowAndWideBorder(0, 1); + ClearDialogWindowAndFrame(0, 1); gSprites[sDecor_CameraSpriteObjectIdx1].data[7] = 0; gSprites[sDecor_CameraSpriteObjectIdx1].invisible = FALSE; gSprites[sDecor_CameraSpriteObjectIdx1].callback = sub_812A36C; @@ -2588,7 +2588,7 @@ void sub_812A0E8(u8 taskId) void sub_812A1A0(u8 taskId) { - DisplayYesNoMenu(); + DisplayYesNoMenuWithDefault(); DoYesNoFuncWithChoice(taskId, &gUnknown_085A7348); } @@ -2601,13 +2601,13 @@ void sub_812A1C0(u8 taskId) void sub_812A1F0(u8 taskId) { - DisplayYesNoMenu(); + DisplayYesNoMenuWithDefault(); DoYesNoFuncWithChoice(taskId, &gUnknown_085A7350); } void sub_812A210(u8 taskId) { - ClearWindowAndWideBorder(0, 0); + ClearDialogWindowAndFrame(0, 0); sub_812A22C(taskId); } @@ -2671,7 +2671,7 @@ void sub_812A334(void) u8 taskId; pal_fill_black(); - NewMenuHelpers_DrawDialogueFrame(0, 1); + DrawDialogueFrame(0, 1); sub_8126ABC(); taskId = CreateTask(sub_812A2C4, 8); gTasks[taskId].data[2] = 0; @@ -2725,7 +2725,7 @@ void sub_812A3D4(u8 taskId) void sub_812A458(u8 taskId) { - DisplayYesNoMenu(); + DisplayYesNoMenuWithDefault(); DoYesNoFuncWithChoice(taskId, &gUnknown_085A741C); } diff --git a/src/field_message_box.c b/src/field_message_box.c index 111807240b..ac5e7a4bb7 100755 --- a/src/field_message_box.c +++ b/src/field_message_box.c @@ -33,7 +33,7 @@ static void sub_8098154(u8 taskId) task->data[0]++; break; case 1: - NewMenuHelpers_DrawDialogueFrame(0, 1); + DrawDialogueFrame(0, 1); task->data[0]++; break; case 2: @@ -127,7 +127,7 @@ static void textbox_auto_and_task_add(void) void HideFieldMessageBox(void) { task_del_textbox(); - ClearWindowAndWideBorder(0, 1); + ClearDialogWindowAndFrame(0, 1); sFieldMessageBoxMode = 0; } @@ -146,7 +146,7 @@ bool8 IsFieldMessageBoxHidden(void) void sub_8098358(void) { task_del_textbox(); - NewMenuHelpers_DrawStdWindowFrame(0, 1); + DrawStdWindowFrame(0, 1); sFieldMessageBoxMode = 0; } diff --git a/src/field_player_avatar.c b/src/field_player_avatar.c index ddaaa208b2..4ab3cb21ef 100644 --- a/src/field_player_avatar.c +++ b/src/field_player_avatar.c @@ -1944,7 +1944,7 @@ static bool8 Fishing11(struct Task *task) sub_8155604(gEventObjects[gPlayerAvatar.eventObjectId].fieldEffectSpriteId, 0, 0); gSprites[gPlayerAvatar.spriteId].pos2.x = 0; gSprites[gPlayerAvatar.spriteId].pos2.y = 0; - ClearWindowAndWideBorder(0, TRUE); + ClearDialogWindowAndFrame(0, TRUE); task->tFrameCounter++; return FALSE; } @@ -2017,7 +2017,7 @@ static bool8 Fishing16(struct Task *task) gPlayerAvatar.preventStep = FALSE; ScriptContext2_Disable(); UnfreezeEventObjects(); - ClearWindowAndWideBorder(0, TRUE); + ClearDialogWindowAndFrame(0, TRUE); sub_80ED950(0); DestroyTask(FindTaskIdByFunc(Task_Fishing)); } diff --git a/src/field_region_map.c b/src/field_region_map.c index e128c70849..850e845543 100644 --- a/src/field_region_map.c +++ b/src/field_region_map.c @@ -139,11 +139,11 @@ static void FieldUpdateRegionMap(void) sFieldRegionMapHandler->state++; break; case 1: - SetWindowBorderStyle(1, 0, 0x27, 0xd); + DrawStdFrameWithCustomTileAndPalette(1, 0, 0x27, 0xd); offset = GetStringCenterAlignXOffset(1, gText_Hoenn, 0x38); AddTextPrinterParameterized(1, 1, gText_Hoenn, offset, 1, 0, NULL); schedule_bg_copy_tilemap_to_vram(0); - SetWindowBorderStyle(0, 0, 0x27, 0xd); + DrawStdFrameWithCustomTileAndPalette(0, 0, 0x27, 0xd); PrintRegionMapSecName(); BeginNormalPaletteFade(0xFFFFFFFF, 0, 16, 0, 0); sFieldRegionMapHandler->state++; diff --git a/src/field_specials.c b/src/field_specials.c index 62d3b8e599..bdac426bd2 100644 --- a/src/field_specials.c +++ b/src/field_specials.c @@ -1859,7 +1859,7 @@ void sub_8139B60(void) void sub_8139C10(void) { - sub_8198070(gUnknown_0203AB5E, TRUE); + ClearStdWindowAndFrameToTransparent(gUnknown_0203AB5E, TRUE); RemoveWindow(gUnknown_0203AB5E); } @@ -2644,7 +2644,7 @@ static void sub_813A570(u8 taskId) sub_813A738(taskId); DestroyListMenuTask(task->data[14], NULL, NULL); Free(gUnknown_0203AB64); - sub_8198070(task->data[13], 1); + ClearStdWindowAndFrameToTransparent(task->data[13], 1); FillWindowPixelBuffer(task->data[13], PALETTE_NUM_TO_FILL_VALUE(0)); CopyWindowToVram(task->data[13], 2); RemoveWindow(task->data[13]); @@ -2889,7 +2889,7 @@ void sub_813A958(void) void sub_813A988(void) { - sub_8198070(gUnknown_0203AB6D, TRUE); + ClearStdWindowAndFrameToTransparent(gUnknown_0203AB6D, TRUE); RemoveWindow(gUnknown_0203AB6D); } @@ -2941,7 +2941,7 @@ void sub_813AA18(void) void sub_813AA44(void) { - sub_8198070(gUnknown_0203AB6E, TRUE); + ClearStdWindowAndFrameToTransparent(gUnknown_0203AB6E, TRUE); RemoveWindow(gUnknown_0203AB6E); } @@ -3153,7 +3153,7 @@ static void sub_813AD34(u8 a0, u16 a1) void sub_813ADB8(void) { - sub_8198070(gUnknown_0203AB5E, TRUE); + ClearStdWindowAndFrameToTransparent(gUnknown_0203AB5E, TRUE); RemoveWindow(gUnknown_0203AB5E); } @@ -3225,7 +3225,7 @@ void sub_813AF48(void) struct Task *task = &gTasks[taskId]; DestroyListMenuTask(task->data[14], NULL, NULL); Free(gUnknown_0203AB64); - sub_8198070(task->data[13], TRUE); + ClearStdWindowAndFrameToTransparent(task->data[13], TRUE); FillWindowPixelBuffer(task->data[13], PALETTE_NUM_TO_FILL_VALUE(0)); ClearWindowTilemap(task->data[13]); CopyWindowToVram(task->data[13], 2); diff --git a/src/fldeff_softboiled.c b/src/fldeff_softboiled.c index adec780b31..eca7d045b8 100644 --- a/src/fldeff_softboiled.c +++ b/src/fldeff_softboiled.c @@ -86,7 +86,7 @@ static void sub_8161724(u8 taskId) sub_81B0FCC(gUnknown_0203CEC8.unk9, 0); gUnknown_0203CEC8.unk9 = gUnknown_0203CEC8.unkA; sub_81B0FCC(gUnknown_0203CEC8.unkA, 1); - sub_8198070(0x6, FALSE); + ClearStdWindowAndFrameToTransparent(0x6, FALSE); ClearWindowTilemap(0x6); display_pokemon_menu_message(0); gTasks[taskId].func = sub_81B1370; diff --git a/src/frontier_util.c b/src/frontier_util.c index 5846616b71..ec7327ca3f 100644 --- a/src/frontier_util.c +++ b/src/frontier_util.c @@ -1044,7 +1044,7 @@ static void TowerPrintPrevOrCurrentStreak(u8 battleMode, u8 lvlMode, u8 x1, u8 x static void ShowTowerResultsWindow(u8 battleMode) { gRecordsWindowId = AddWindow(&gUnknown_08611C74); - NewMenuHelpers_DrawStdWindowFrame(gRecordsWindowId, FALSE); + DrawStdWindowFrame(gRecordsWindowId, FALSE); FillWindowPixelBuffer(gRecordsWindowId, PALETTE_NUM_TO_FILL_VALUE(1)); if (battleMode == FRONTIER_MODE_SINGLES) StringExpandPlaceholders(gStringVar4, gText_SingleBattleRoomResults); @@ -1115,7 +1115,7 @@ static void DomePrintPrevOrCurrentStreak(u8 battleMode, u8 lvlMode, u8 x1, u8 x2 static void ShowDomeResultsWindow(u8 battleMode) { gRecordsWindowId = AddWindow(&gUnknown_08611C74); - NewMenuHelpers_DrawStdWindowFrame(gRecordsWindowId, FALSE); + DrawStdWindowFrame(gRecordsWindowId, FALSE); FillWindowPixelBuffer(gRecordsWindowId, PALETTE_NUM_TO_FILL_VALUE(1)); if (battleMode == FRONTIER_MODE_SINGLES) StringExpandPlaceholders(gStringVar4, gText_SingleBattleTourneyResults); @@ -1191,7 +1191,7 @@ static void PalacePrintPrevOrCurrentStreak(u8 battleMode, u8 lvlMode, u8 x1, u8 static void ShowPalaceResultsWindow(u8 battleMode) { gRecordsWindowId = AddWindow(&gUnknown_08611C74); - NewMenuHelpers_DrawStdWindowFrame(gRecordsWindowId, FALSE); + DrawStdWindowFrame(gRecordsWindowId, FALSE); FillWindowPixelBuffer(gRecordsWindowId, PALETTE_NUM_TO_FILL_VALUE(1)); if (battleMode == FRONTIER_MODE_SINGLES) StringExpandPlaceholders(gStringVar4, gText_SingleBattleHallResults); @@ -1247,7 +1247,7 @@ static void PikePrintPrevOrCurrentStreak(u8 lvlMode, u8 x1, u8 x2, u8 y) static void ShowPikeResultsWindow(void) { gRecordsWindowId = AddWindow(&gUnknown_08611C74); - NewMenuHelpers_DrawStdWindowFrame(gRecordsWindowId, FALSE); + DrawStdWindowFrame(gRecordsWindowId, FALSE); FillWindowPixelBuffer(gRecordsWindowId, PALETTE_NUM_TO_FILL_VALUE(1)); StringExpandPlaceholders(gStringVar4, gText_BattleChoiceResults); PrintAligned(gStringVar4, 0); @@ -1309,7 +1309,7 @@ static void ArenaPrintPrevOrCurrentStreak(u8 lvlMode, u8 x1, u8 x2, u8 y) static void ShowArenaResultsWindow(void) { gRecordsWindowId = AddWindow(&gUnknown_08611C74); - NewMenuHelpers_DrawStdWindowFrame(gRecordsWindowId, FALSE); + DrawStdWindowFrame(gRecordsWindowId, FALSE); FillWindowPixelBuffer(gRecordsWindowId, PALETTE_NUM_TO_FILL_VALUE(1)); PrintHyphens(10); StringExpandPlaceholders(gStringVar4, gText_SetKOTourneyResults); @@ -1395,7 +1395,7 @@ static void FactoryPrintPrevOrCurrentStreak(u8 battleMode, u8 lvlMode, u8 x1, u8 static void ShowFactoryResultsWindow(u8 battleMode) { gRecordsWindowId = AddWindow(&gUnknown_08611C74); - NewMenuHelpers_DrawStdWindowFrame(gRecordsWindowId, FALSE); + DrawStdWindowFrame(gRecordsWindowId, FALSE); FillWindowPixelBuffer(gRecordsWindowId, PALETTE_NUM_TO_FILL_VALUE(1)); if (battleMode == FRONTIER_MODE_SINGLES) StringExpandPlaceholders(gStringVar4, gText_BattleSwapSingleResults); @@ -1460,7 +1460,7 @@ static void PyramidPrintPrevOrCurrentStreak(u8 lvlMode, u8 x1, u8 x2, u8 y) static void ShowPyramidResultsWindow(void) { gRecordsWindowId = AddWindow(&gUnknown_08611C74); - NewMenuHelpers_DrawStdWindowFrame(gRecordsWindowId, FALSE); + DrawStdWindowFrame(gRecordsWindowId, FALSE); FillWindowPixelBuffer(gRecordsWindowId, PALETTE_NUM_TO_FILL_VALUE(1)); StringExpandPlaceholders(gStringVar4, gText_BattleQuestResults); PrintAligned(gStringVar4, 2); @@ -1483,7 +1483,7 @@ static void ShowLinkContestResultsWindow(void) s32 x; gRecordsWindowId = AddWindow(&gUnknown_08611C7C); - NewMenuHelpers_DrawStdWindowFrame(gRecordsWindowId, FALSE); + DrawStdWindowFrame(gRecordsWindowId, FALSE); FillWindowPixelBuffer(gRecordsWindowId, PALETTE_NUM_TO_FILL_VALUE(1)); StringExpandPlaceholders(gStringVar4, gText_LinkContestResults); @@ -2353,7 +2353,7 @@ static void PrintHallRecords(s32 hallFacilityId, s32 lvlMode) void ShowRankingHallRecordsWindow(void) { gRecordsWindowId = AddWindow(&gUnknown_08611C84); - NewMenuHelpers_DrawStdWindowFrame(gRecordsWindowId, FALSE); + DrawStdWindowFrame(gRecordsWindowId, FALSE); FillWindowPixelBuffer(gRecordsWindowId, PALETTE_NUM_TO_FILL_VALUE(1)); PrintHallRecords(gSpecialVar_0x8005, FRONTIER_LVL_50); PutWindowTilemap(gRecordsWindowId); diff --git a/src/hall_of_fame.c b/src/hall_of_fame.c index b25342021d..d3b94cff65 100644 --- a/src/hall_of_fame.c +++ b/src/hall_of_fame.c @@ -490,7 +490,7 @@ static void Task_Hof_InitTeamSaveData(u8 taskId) } *lastSavedTeam = *sHofMonPtr; - NewMenuHelpers_DrawDialogueFrame(0, 0); + DrawDialogueFrame(0, 0); AddTextPrinterParameterized2(0, 1, gText_SavingDontTurnOffPower, 0, NULL, 2, 1, 3); CopyWindowToVram(0, 3); gTasks[taskId].func = Task_Hof_TrySaveData; @@ -570,7 +570,7 @@ static void Task_Hof_DisplayMon(u8 taskId) gSprites[spriteId].tSpecies = currMon->species; gSprites[spriteId].callback = SpriteCB_GetOnScreenAndAnimate; gTasks[taskId].tMonSpriteId(currMonId) = spriteId; - ClearWindowAndWideBorder(0, TRUE); + ClearDialogWindowAndFrame(0, TRUE); gTasks[taskId].func = Task_Hof_PrintMonInfoAfterAnimating; } @@ -697,7 +697,7 @@ static void Task_Hof_WaitAndPrintPlayerInfo(u8 taskId) { FillBgTilemapBufferRect_Palette0(0, 0, 0, 0, 0x20, 0x20); HallOfFame_PrintPlayerInfo(1, 2); - NewMenuHelpers_DrawDialogueFrame(0, 0); + DrawDialogueFrame(0, 0); AddTextPrinterParameterized2(0, 1, gText_LeagueChamp, 0, NULL, 2, 1, 3); CopyWindowToVram(0, 3); gTasks[taskId].func = Task_Hof_ExitOnKeyPressed; @@ -1066,7 +1066,7 @@ static void Task_HofPC_HandleExit(u8 taskId) static void Task_HofPC_PrintDataIsCorrupted(u8 taskId) { sub_8198180(gText_UnkCtrlF800Exit, 8, TRUE); - NewMenuHelpers_DrawDialogueFrame(0, 0); + DrawDialogueFrame(0, 0); AddTextPrinterParameterized2(0, 1, gText_HOFCorrupted, 0, NULL, 2, 1, 3); CopyWindowToVram(0, 3); gTasks[taskId].func = Task_HofPC_ExitOnButtonPress; @@ -1182,7 +1182,7 @@ static void HallOfFame_PrintPlayerInfo(u8 unused1, u8 unused2) FillWindowPixelBuffer(1, PALETTE_NUM_TO_FILL_VALUE(1)); PutWindowTilemap(1); - SetWindowBorderStyle(1, FALSE, 0x21D, 0xD); + DrawStdFrameWithCustomTileAndPalette(1, FALSE, 0x21D, 0xD); AddTextPrinterParameterized3(1, 1, 0, 1, sUnknown_085E538C, -1, gText_Name); width = GetStringRightAlignXOffset(1, gSaveBlock2Ptr->playerName, 0x70); diff --git a/src/item_menu.c b/src/item_menu.c index ae24c8a03a..f561ebb366 100755 --- a/src/item_menu.c +++ b/src/item_menu.c @@ -2306,7 +2306,7 @@ u8 bag_menu_add_window(u8 a) if (*ptr == 0xFF) { *ptr = AddWindow(&gUnknown_086141AC[a]); - SetWindowBorderStyle(*ptr, 0, 1, 14); + DrawStdFrameWithCustomTileAndPalette(*ptr, 0, 1, 14); schedule_bg_copy_tilemap_to_vram(1); } return *ptr; @@ -2317,7 +2317,7 @@ void bag_menu_remove_window(u8 a) u8 *ptr = &gUnknown_0203CE54->windowPointers[a]; if (*ptr != 0xFF) { - sub_8198070(*ptr, 0); + ClearStdWindowAndFrameToTransparent(*ptr, 0); ClearWindowTilemap(*ptr); RemoveWindow(*ptr); schedule_bg_copy_tilemap_to_vram(1); @@ -2338,7 +2338,8 @@ void bag_menu_RemoveBagItem_message_window(u8 a) u8 *ptr = &gUnknown_0203CE54->windowPointers[a]; if (*ptr != 0xFF) { - sub_8197DF8(*ptr, 0); + ClearDialogWindowAndFrameToTransparent(*ptr, FALSE); + // This ClearWindowTilemap call is redundant, since ClearDialogWindowAndFrameToTransparent already calls it. ClearWindowTilemap(*ptr); RemoveWindow(*ptr); schedule_bg_copy_tilemap_to_vram(1); diff --git a/src/item_use.c b/src/item_use.c index 81f4b7b542..2281cc1983 100755 --- a/src/item_use.c +++ b/src/item_use.c @@ -188,7 +188,7 @@ void DisplayCannotDismountBikeMessage(u8 taskId, bool8 isUsingRegisteredKeyItemO void CleanUpAfterFailingToUseRegisteredKeyItemOnField(u8 taskId) { - ClearWindowAndWideBorder(0, 1); + ClearDialogWindowAndFrame(0, 1); DestroyTask(taskId); ScriptUnfreezeEventObjects(); ScriptContext2_Disable(); @@ -350,7 +350,7 @@ void sub_80FD504(u8 taskId) void sub_80FD5CC(u8 taskId) { - ClearWindowAndWideBorder(0, 1); + ClearDialogWindowAndFrame(0, 1); ScriptUnfreezeEventObjects(); ScriptContext2_Disable(); DestroyTask(taskId); diff --git a/src/list_menu.c b/src/list_menu.c index 656ab7a157..b8e1863482 100644 --- a/src/list_menu.c +++ b/src/list_menu.c @@ -355,11 +355,11 @@ s32 DoMysteryGiftListMenu(struct WindowTemplate *windowTemplate, struct ListMenu switch (arg2) { case 0: // can never be reached, because of the if statement above - ClearWindowAndBorder(sMysteryGiftLinkMenu.windowId, FALSE); + ClearStdWindowAndFrame(sMysteryGiftLinkMenu.windowId, FALSE); break; case 2: case 1: - ClearWindowAndBorder(sMysteryGiftLinkMenu.windowId, FALSE); + ClearStdWindowAndFrame(sMysteryGiftLinkMenu.windowId, FALSE); break; } } diff --git a/src/main_menu.c b/src/main_menu.c index cb39f036ec..6ad1776f8c 100644 --- a/src/main_menu.c +++ b/src/main_menu.c @@ -944,14 +944,14 @@ static void Task_HandleMainMenuAPressed(u8 taskId) { if (gTasks[taskId].tMenuType == HAS_MYSTERY_EVENTS) RemoveScrollIndicatorArrowPair(gTasks[taskId].tScrollArrowTaskId); - ClearWindowAndBorder(0, TRUE); - ClearWindowAndBorder(1, TRUE); - ClearWindowAndBorder(2, TRUE); - ClearWindowAndBorder(3, TRUE); - ClearWindowAndBorder(4, TRUE); - ClearWindowAndBorder(5, TRUE); - ClearWindowAndBorder(6, TRUE); - ClearWindowAndBorder(7, TRUE); + ClearStdWindowAndFrame(0, TRUE); + ClearStdWindowAndFrame(1, TRUE); + ClearStdWindowAndFrame(2, TRUE); + ClearStdWindowAndFrame(3, TRUE); + ClearStdWindowAndFrame(4, TRUE); + ClearStdWindowAndFrame(5, TRUE); + ClearStdWindowAndFrame(6, TRUE); + ClearStdWindowAndFrame(7, TRUE); wirelessAdapterConnected = IsWirelessAdapterConnected(); switch (gTasks[taskId].tMenuType) { diff --git a/src/map_name_popup.c b/src/map_name_popup.c index 30b04c21d0..8936198aeb 100644 --- a/src/map_name_popup.c +++ b/src/map_name_popup.c @@ -276,7 +276,7 @@ static void Task_MapNamePopUpWindow(u8 taskId) } break; case 4: - ClearWindowAndBorder(GetMapNamePopUpWindowId(), TRUE); + ClearStdWindowAndFrame(GetMapNamePopUpWindowId(), TRUE); task->data[0] = 5; break; case 5: @@ -290,7 +290,7 @@ void HideMapNamePopUpWindow(void) { if (FuncIsActiveTask(Task_MapNamePopUpWindow)) { - ClearWindowAndBorder(GetMapNamePopUpWindowId(), TRUE); + ClearStdWindowAndFrame(GetMapNamePopUpWindowId(), TRUE); RemoveMapNamePopUpWindow(); SetGpuReg_ForcedBlank(REG_OFFSET_BG0VOFS, 0); DestroyTask(sPopupTaskId); diff --git a/src/mauville_old_man.c b/src/mauville_old_man.c index fd8e74c0a7..ec5cb238bc 100644 --- a/src/mauville_old_man.c +++ b/src/mauville_old_man.c @@ -437,7 +437,7 @@ static void BardSong_TextSubPrinter(struct TextPrinterTemplate * printer, u16 a1 static void sub_8120708(const u8 * src) { - NewMenuHelpers_DrawDialogueFrame(0, 0); + DrawDialogueFrame(0, 0); AddTextPrinterParameterized(0, 1, src, 0, 1, 1, BardSong_TextSubPrinter); gUnknown_03002F84 = TRUE; CopyWindowToVram(0, 3); diff --git a/src/menu.c b/src/menu.c index 26ea99de22..39d6f3fd16 100644 --- a/src/menu.c +++ b/src/menu.c @@ -124,14 +124,14 @@ const struct MoveMenuInfoIcon gMoveMenuInfoIcons[] = // Forward declarations extern void sub_81973A4(void); -extern void DrawStandardFrame(u8, u8, u8, u8, u8, u8); -extern void DrawDialogueFrame(u8, u8, u8, u8, u8, u8); -extern void ClearWindowAndBorderTilemap(u8, u8, u8, u8, u8, u8); -extern void ClearWindowAndWideBorderTilemap(u8, u8, u8, u8, u8, u8); -extern void sub_8197BB4(u8, u8, u8, u8, u8, u8); -extern void sub_8197E30(u8, u8, u8, u8, u8, u8); -extern void DrawWindowBorder(u8, u8, u8, u8, u8, u8); -extern void sub_81980A8(u8, u8, u8, u8, u8, u8); +extern void WindowFunc_DrawStandardFrame(u8, u8, u8, u8, u8, u8); +extern void WindowFunc_DrawDialogueFrame(u8, u8, u8, u8, u8, u8); +extern void WindowFunc_ClearStdWindowAndFrame(u8, u8, u8, u8, u8, u8); +extern void WindowFunc_ClearDialogWindowAndFrame(u8, u8, u8, u8, u8, u8); +extern void WindowFunc_DrawDialogFrameWithCustomTileAndPalette(u8, u8, u8, u8, u8, u8); +extern void WindowFunc_ClearDialogWindowAndFrameNullPalette(u8, u8, u8, u8, u8, u8); +extern void WindowFunc_DrawStdFrameWithCustomTileAndPalette(u8, u8, u8, u8, u8, u8); +extern void WindowFunc_ClearStdWindowAndFrameToTransparent(u8, u8, u8, u8, u8, u8); extern u8 Menu_MoveCursor(s8); extern u8 sub_8199134(s8, s8); extern void sub_8198C78(void); @@ -210,43 +210,43 @@ void sub_81973A4(void) LoadUserWindowBorderGfx(0, STD_WINDOW_BASE_TILE_NUM, STD_WINDOW_PALETTE_NUM * 0x10); } -void NewMenuHelpers_DrawDialogueFrame(u8 windowId, bool8 copyToVram) +void DrawDialogueFrame(u8 windowId, bool8 copyToVram) { - CallWindowFunction(windowId, DrawDialogueFrame); + CallWindowFunction(windowId, WindowFunc_DrawDialogueFrame); FillWindowPixelBuffer(windowId, PALETTE_NUM_TO_FILL_VALUE(1)); PutWindowTilemap(windowId); if (copyToVram == TRUE) CopyWindowToVram(windowId, 3); } -void NewMenuHelpers_DrawStdWindowFrame(u8 windowId, bool8 copyToVram) +void DrawStdWindowFrame(u8 windowId, bool8 copyToVram) { - CallWindowFunction(windowId, DrawStandardFrame); + CallWindowFunction(windowId, WindowFunc_DrawStandardFrame); FillWindowPixelBuffer(windowId, PALETTE_NUM_TO_FILL_VALUE(1)); PutWindowTilemap(windowId); if (copyToVram == TRUE) CopyWindowToVram(windowId, 3); } -void ClearWindowAndWideBorder(u8 windowId, bool8 copyToVram) +void ClearDialogWindowAndFrame(u8 windowId, bool8 copyToVram) { - CallWindowFunction(windowId, ClearWindowAndWideBorderTilemap); + CallWindowFunction(windowId, WindowFunc_ClearDialogWindowAndFrame); FillWindowPixelBuffer(windowId, PALETTE_NUM_TO_FILL_VALUE(1)); ClearWindowTilemap(windowId); if (copyToVram == TRUE) CopyWindowToVram(windowId, 3); } -void ClearWindowAndBorder(u8 windowId, bool8 copyToVram) +void ClearStdWindowAndFrame(u8 windowId, bool8 copyToVram) { - CallWindowFunction(windowId, ClearWindowAndBorderTilemap); + CallWindowFunction(windowId, WindowFunc_ClearStdWindowAndFrame); FillWindowPixelBuffer(windowId, PALETTE_NUM_TO_FILL_VALUE(1)); ClearWindowTilemap(windowId); if (copyToVram == TRUE) CopyWindowToVram(windowId, 3); } -void DrawStandardFrame(u8 bg, u8 tilemapLeft, u8 tilemapTop, u8 width, u8 height, u8 paletteNum) +void WindowFunc_DrawStandardFrame(u8 bg, u8 tilemapLeft, u8 tilemapTop, u8 width, u8 height, u8 paletteNum) { int i; @@ -313,7 +313,7 @@ void DrawStandardFrame(u8 bg, u8 tilemapLeft, u8 tilemapTop, u8 width, u8 height STD_WINDOW_PALETTE_NUM); } -void DrawDialogueFrame(u8 bg, u8 tilemapLeft, u8 tilemapTop, u8 width, u8 height, u8 paletteNum) +void WindowFunc_DrawDialogueFrame(u8 bg, u8 tilemapLeft, u8 tilemapTop, u8 width, u8 height, u8 paletteNum) { FillBgTilemapBufferRect(bg, DLG_WINDOW_BASE_TILE_NUM + 1, @@ -408,28 +408,25 @@ void DrawDialogueFrame(u8 bg, u8 tilemapLeft, u8 tilemapTop, u8 width, u8 height DLG_WINDOW_PALETTE_NUM); } -// Clears the given window, and a 1-tile border around the window, to transparent tiles. -void ClearWindowAndBorderTilemap(u8 bg, u8 tilemapLeft, u8 tilemapTop, u8 width, u8 height, u8 paletteNum) +void WindowFunc_ClearStdWindowAndFrame(u8 bg, u8 tilemapLeft, u8 tilemapTop, u8 width, u8 height, u8 paletteNum) { FillBgTilemapBufferRect(bg, 0, tilemapLeft - 1, tilemapTop - 1, width + 2, height + 2, STD_WINDOW_PALETTE_NUM); } -// Clears the given window, and a 1-tile border the top and bottom, plus a 3-tile border on the left and right. -// Tiles are set to a transparent tile. -void ClearWindowAndWideBorderTilemap(u8 bg, u8 tilemapLeft, u8 tilemapTop, u8 width, u8 height, u8 paletteNum) +void WindowFunc_ClearDialogWindowAndFrame(u8 bg, u8 tilemapLeft, u8 tilemapTop, u8 width, u8 height, u8 paletteNum) { FillBgTilemapBufferRect(bg, 0, tilemapLeft - 3, tilemapTop - 1, width + 6, height + 2, STD_WINDOW_PALETTE_NUM); } void SetStandardWindowBorderStyle(u8 windowId, bool8 copyToVram) { - SetWindowBorderStyle(windowId, copyToVram, STD_WINDOW_BASE_TILE_NUM, STD_WINDOW_PALETTE_NUM); + DrawStdFrameWithCustomTileAndPalette(windowId, copyToVram, STD_WINDOW_BASE_TILE_NUM, STD_WINDOW_PALETTE_NUM); } void sub_819786C(u8 windowId, bool8 copyToVram) { LoadMessageBoxGfx(windowId, DLG_WINDOW_BASE_TILE_NUM, DLG_WINDOW_PALETTE_NUM * 0x10); - sub_8197B1C(windowId, copyToVram, DLG_WINDOW_BASE_TILE_NUM, 0xF); + DrawDialogFrameWithCustomTileAndPalette(windowId, copyToVram, DLG_WINDOW_BASE_TILE_NUM, 0xF); } void sub_819789C(void) @@ -461,12 +458,12 @@ void DisplayItemMessageOnField(u8 taskId, const u8 *string, TaskFunc callback) CopyWindowToVram(0, 3); } -void DisplayYesNoMenu(void) +void DisplayYesNoMenuWithDefault(void) { CreateYesNoMenu(&sYesNo_WindowTemplates, STD_WINDOW_BASE_TILE_NUM, STD_WINDOW_PALETTE_NUM, 0); } -void sub_8197948(u8 initialCursorPos) +void DisplayYesNoMenuWithDefaultDefaultNo(u8 initialCursorPos) { CreateYesNoMenu(&sYesNo_WindowTemplates, STD_WINDOW_BASE_TILE_NUM, STD_WINDOW_PALETTE_NUM, initialCursorPos); } @@ -552,29 +549,30 @@ void sub_8197AE8(bool8 copyToVram) CopyBgTilemapBufferToVram(0); } -void sub_8197B1C(u8 windowId, bool8 copyToVram, u16 tileNum, u8 paletteNum) +void DrawDialogFrameWithCustomTileAndPalette(u8 windowId, bool8 copyToVram, u16 tileNum, u8 paletteNum) { sTileNum = tileNum; sPaletteNum = paletteNum; - CallWindowFunction(windowId, sub_8197BB4); + CallWindowFunction(windowId, WindowFunc_DrawDialogFrameWithCustomTileAndPalette); FillWindowPixelBuffer(windowId, PALETTE_NUM_TO_FILL_VALUE(1)); PutWindowTilemap(windowId); if (copyToVram == TRUE) CopyWindowToVram(windowId, 3); } -void sub_8197B64(u8 windowId, bool8 copyToVram, u16 tileNum) +// Never used. +void DrawDialogFrameWithCustomTile(u8 windowId, bool8 copyToVram, u16 tileNum) { sTileNum = tileNum; sPaletteNum = GetWindowAttribute(windowId, WINDOW_PALETTE_NUM); - CallWindowFunction(windowId, sub_8197BB4); + CallWindowFunction(windowId, WindowFunc_DrawDialogFrameWithCustomTileAndPalette); FillWindowPixelBuffer(windowId, PALETTE_NUM_TO_FILL_VALUE(1)); PutWindowTilemap(windowId); if (copyToVram == TRUE) CopyWindowToVram(windowId, 3); } -void sub_8197BB4(u8 bg, u8 tilemapLeft, u8 tilemapTop, u8 width, u8 height, u8 paletteNum) +void WindowFunc_DrawDialogFrameWithCustomTileAndPalette(u8 bg, u8 tilemapLeft, u8 tilemapTop, u8 width, u8 height, u8 paletteNum) { FillBgTilemapBufferRect(bg, sTileNum + 1, @@ -669,43 +667,45 @@ void sub_8197BB4(u8 bg, u8 tilemapLeft, u8 tilemapTop, u8 width, u8 height, u8 p sPaletteNum); } -void sub_8197DF8(u8 windowId, bool8 copyToVram) +void ClearDialogWindowAndFrameToTransparent(u8 windowId, bool8 copyToVram) { - CallWindowFunction(windowId, sub_8197E30); + // The palette slot doesn't matter, since the tiles are transparent. + CallWindowFunction(windowId, WindowFunc_ClearDialogWindowAndFrameNullPalette); FillWindowPixelBuffer(windowId, PALETTE_NUM_TO_FILL_VALUE(0)); ClearWindowTilemap(windowId); if (copyToVram == TRUE) CopyWindowToVram(windowId, 3); } -void sub_8197E30(u8 bg, u8 tilemapLeft, u8 tilemapTop, u8 width, u8 height, u8 paletteNum) +void WindowFunc_ClearDialogWindowAndFrameNullPalette(u8 bg, u8 tilemapLeft, u8 tilemapTop, u8 width, u8 height, u8 paletteNum) { FillBgTilemapBufferRect(bg, 0, tilemapLeft - 3, tilemapTop - 1, width + 6, height + 2, 0); } -void SetWindowBorderStyle(u8 windowId, bool8 copyToVram, u16 baseTileNum, u8 paletteNum) +void DrawStdFrameWithCustomTileAndPalette(u8 windowId, bool8 copyToVram, u16 baseTileNum, u8 paletteNum) { sTileNum = baseTileNum; sPaletteNum = paletteNum; - CallWindowFunction(windowId, DrawWindowBorder); + CallWindowFunction(windowId, WindowFunc_DrawStdFrameWithCustomTileAndPalette); FillWindowPixelBuffer(windowId, PALETTE_NUM_TO_FILL_VALUE(1)); PutWindowTilemap(windowId); if (copyToVram == TRUE) CopyWindowToVram(windowId, 3); } -void sub_8197EC8(u8 windowId, bool8 copyToVram, u16 baseTileNum) +// Never used. +void DrawStdFrameWithCustomTile(u8 windowId, bool8 copyToVram, u16 baseTileNum) { sTileNum = baseTileNum; sPaletteNum = GetWindowAttribute(windowId, WINDOW_PALETTE_NUM); - CallWindowFunction(windowId, DrawWindowBorder); + CallWindowFunction(windowId, WindowFunc_DrawStdFrameWithCustomTileAndPalette); FillWindowPixelBuffer(windowId, PALETTE_NUM_TO_FILL_VALUE(1)); PutWindowTilemap(windowId); if (copyToVram == TRUE) CopyWindowToVram(windowId, 3); } -void DrawWindowBorder(u8 bg, u8 tilemapLeft, u8 tilemapTop, u8 width, u8 height, u8 paletteNum) +void WindowFunc_DrawStdFrameWithCustomTileAndPalette(u8 bg, u8 tilemapLeft, u8 tilemapTop, u8 width, u8 height, u8 paletteNum) { FillBgTilemapBufferRect(bg, sTileNum + 0, @@ -765,16 +765,16 @@ void DrawWindowBorder(u8 bg, u8 tilemapLeft, u8 tilemapTop, u8 width, u8 height, sPaletteNum); } -void sub_8198070(u8 windowId, bool8 copyToVram) +void ClearStdWindowAndFrameToTransparent(u8 windowId, bool8 copyToVram) { - CallWindowFunction(windowId, sub_81980A8); + CallWindowFunction(windowId, WindowFunc_ClearStdWindowAndFrameToTransparent); FillWindowPixelBuffer(windowId, PALETTE_NUM_TO_FILL_VALUE(0)); ClearWindowTilemap(windowId); if (copyToVram == TRUE) CopyWindowToVram(windowId, 3); } -void sub_81980A8(u8 bg, u8 tilemapLeft, u8 tilemapTop, u8 width, u8 height, u8 paletteNum) +void WindowFunc_ClearStdWindowAndFrameToTransparent(u8 bg, u8 tilemapLeft, u8 tilemapTop, u8 width, u8 height, u8 paletteNum) { FillBgTilemapBufferRect(bg, 0, tilemapLeft - 1, tilemapTop - 1, width + 2, height + 2, 0); } @@ -1178,7 +1178,7 @@ void sub_8198AF8(const struct WindowTemplate *window, u8 fontId, u8 left, u8 top struct TextPrinterTemplate printer; sYesNoWindowId = AddWindow(window); - SetWindowBorderStyle(sYesNoWindowId, TRUE, baseTileNum, paletteNum); + DrawStdFrameWithCustomTileAndPalette(sYesNoWindowId, TRUE, baseTileNum, paletteNum); printer.currentChar = gText_YesNo; printer.windowId = sYesNoWindowId; @@ -1214,7 +1214,7 @@ s8 Menu_ProcessInputNoWrapClearOnChoose(void) void sub_8198C78(void) { - sub_8198070(sYesNoWindowId, TRUE); + ClearStdWindowAndFrameToTransparent(sYesNoWindowId, TRUE); RemoveWindow(sYesNoWindowId); } @@ -1643,7 +1643,7 @@ void CreateYesNoMenu(const struct WindowTemplate *window, u16 baseTileNum, u8 pa struct TextPrinterTemplate printer; sYesNoWindowId = AddWindow(window); - SetWindowBorderStyle(sYesNoWindowId, TRUE, baseTileNum, paletteNum); + DrawStdFrameWithCustomTileAndPalette(sYesNoWindowId, TRUE, baseTileNum, paletteNum); printer.currentChar = gText_YesNo; printer.windowId = sYesNoWindowId; diff --git a/src/menu_helpers.c b/src/menu_helpers.c index e6547b3000..49da6bda3c 100644 --- a/src/menu_helpers.c +++ b/src/menu_helpers.c @@ -129,7 +129,7 @@ void SetVBlankHBlankCallbacksToNull(void) void DisplayMessageAndContinueTask(u8 taskId, u8 windowId, u16 arg2, u8 arg3, u8 fontId, u8 textSpeed, const u8 *string, void *taskFunc) { gUnknown_0203A140 = windowId; - sub_8197B1C(windowId, TRUE, arg2, arg3); + DrawDialogFrameWithCustomTileAndPalette(windowId, TRUE, arg2, arg3); if (string != gStringVar4) StringExpandPlaceholders(gStringVar4, string); diff --git a/src/money.c b/src/money.c index 1b5e298f0e..e7ae6080ce 100644 --- a/src/money.c +++ b/src/money.c @@ -154,7 +154,7 @@ void PrintMoneyAmount(u8 windowId, u8 x, u8 y, int amount, u8 speed) void PrintMoneyAmountInMoneyBoxWithBorder(u8 windowId, u16 tileStart, u8 pallete, int amount) { - SetWindowBorderStyle(windowId, FALSE, tileStart, pallete); + DrawStdFrameWithCustomTileAndPalette(windowId, FALSE, tileStart, pallete); PrintMoneyAmountInMoneyBox(windowId, amount, 0); } @@ -179,7 +179,7 @@ void DrawMoneyBox(int amount, u8 x, u8 y) void HideMoneyBox(void) { RemoveMoneyLabelObject(); - sub_8198070(sMoneyBoxWindowId, FALSE); + ClearStdWindowAndFrameToTransparent(sMoneyBoxWindowId, FALSE); CopyWindowToVram(sMoneyBoxWindowId, 2); RemoveWindow(sMoneyBoxWindowId); } diff --git a/src/mystery_event_menu.c b/src/mystery_event_menu.c index b0f0ba3028..2a16175927 100644 --- a/src/mystery_event_menu.c +++ b/src/mystery_event_menu.c @@ -133,7 +133,7 @@ static void CB2_MysteryEventMenu(void) switch (gMain.state) { case 0: - SetWindowBorderStyle(0, 1, 1, 0xD); + DrawStdFrameWithCustomTileAndPalette(0, 1, 1, 0xD); PutWindowTilemap(0); CopyWindowToVram(0, 3); ShowBg(0); @@ -180,7 +180,7 @@ static void CB2_MysteryEventMenu(void) { PlaySE(SE_SELECT); sub_800A620(); - SetWindowBorderStyle(1, 1, 1, 0xD); + DrawStdFrameWithCustomTileAndPalette(1, 1, 1, 0xD); PrintMysteryMenuText(1, gText_LoadingEvent, 1, 2, 0); PutWindowTilemap(1); CopyWindowToVram(1, 3); diff --git a/src/naming_screen.c b/src/naming_screen.c index 013eb37ca9..e4159e3beb 100644 --- a/src/naming_screen.c +++ b/src/naming_screen.c @@ -557,7 +557,7 @@ static void DisplaySentToPCMessage(void) stringToDisplay++; StringExpandPlaceholders(gStringVar4, gUnknown_0858BDB8[stringToDisplay]); - NewMenuHelpers_DrawDialogueFrame(0, 0); + DrawDialogueFrame(0, 0); gTextFlags.canABSpeedUpPrint = TRUE; AddTextPrinterParameterized2(0, 1, gStringVar4, GetPlayerTextSpeedDelay(), 0, 2, 1, 3); CopyWindowToVram(0, 3); diff --git a/src/party_menu.c b/src/party_menu.c index 15128ab0c3..51088af5f3 100755 --- a/src/party_menu.c +++ b/src/party_menu.c @@ -2753,7 +2753,7 @@ static void sub_81B1B8C(u8 taskId) { if (gTasks[taskId].data[0] == 0) { - sub_8198070(6, 0); + ClearStdWindowAndFrameToTransparent(6, 0); ClearWindowTilemap(6); } DestroyTask(taskId); @@ -2778,7 +2778,7 @@ static void sub_81B1C1C(u8 taskId) { if (sub_81B1BD4() != TRUE) { - sub_8198070(6, 0); + ClearStdWindowAndFrameToTransparent(6, 0); ClearWindowTilemap(6); if (sub_81221AC() == TRUE) { @@ -3501,7 +3501,7 @@ static void sub_81B302C(u8 *ptr) { if (*ptr != 0xFF) { - sub_8198070(*ptr, 0); + ClearStdWindowAndFrameToTransparent(*ptr, 0); RemoveWindow(*ptr); *ptr = 0xFF; schedule_bg_copy_tilemap_to_vram(2); @@ -3546,7 +3546,7 @@ void display_pokemon_menu_message(u32 stringID) else if (sub_81B314C() == FALSE) stringID = 1; } - SetWindowBorderStyle(*windowPtr, FALSE, 0x4F, 0xD); + DrawStdFrameWithCustomTileAndPalette(*windowPtr, FALSE, 0x4F, 0xD); StringExpandPlaceholders(gStringVar4, gUnknown_08615AF4[stringID]); AddTextPrinterParameterized(*windowPtr, 1, gStringVar4, 0, 1, 0, 0); schedule_bg_copy_tilemap_to_vram(2); @@ -3596,7 +3596,7 @@ static u8 sub_81B31B0(u8 a) } gUnknown_0203CEC4->unkC[0] = AddWindow(&window); - SetWindowBorderStyle(gUnknown_0203CEC4->unkC[0], FALSE, 0x4F, 13); + DrawStdFrameWithCustomTileAndPalette(gUnknown_0203CEC4->unkC[0], FALSE, 0x4F, 13); if (a == 3) return gUnknown_0203CEC4->unkC[0]; cursorDimension = GetMenuCursorDimensionByFont(1, 0); @@ -3616,7 +3616,7 @@ static u8 sub_81B31B0(u8 a) static void sub_81B3300(const u8 *text) { - SetWindowBorderStyle(6, FALSE, 0x4F, 13); + DrawStdFrameWithCustomTileAndPalette(6, FALSE, 0x4F, 13); gTextFlags.canABSpeedUpPrint = TRUE; AddTextPrinterParameterized2(6, 1, text, GetPlayerTextSpeedDelay(), 0, 2, 1, 3); } @@ -3629,7 +3629,7 @@ static void sub_81B334C(void) static u8 sub_81B3364(void) { gUnknown_0203CEC4->unkC[0] = AddWindow(&gUnknown_08615970); - SetWindowBorderStyle(gUnknown_0203CEC4->unkC[0], FALSE, 0x4F, 13); + DrawStdFrameWithCustomTileAndPalette(gUnknown_0203CEC4->unkC[0], FALSE, 0x4F, 13); return gUnknown_0203CEC4->unkC[0]; } diff --git a/src/player_pc.c b/src/player_pc.c index 607c2a7210..6ba5999ce8 100644 --- a/src/player_pc.c +++ b/src/player_pc.c @@ -361,14 +361,14 @@ static void PlayerPCProcessMenuInput(u8 taskId) break; case MENU_B_PRESSED: PlaySE(SE_SELECT); - sub_8198070(data[4], FALSE); + ClearStdWindowAndFrameToTransparent(data[4], FALSE); ClearWindowTilemap(data[4]); RemoveWindow(data[4]); schedule_bg_copy_tilemap_to_vram(0); gTasks[taskId].func = PlayerPC_TurnOff; break; default: - sub_8198070(data[4], FALSE); + ClearStdWindowAndFrameToTransparent(data[4], FALSE); ClearWindowTilemap(data[4]); RemoveWindow(data[4]); schedule_bg_copy_tilemap_to_vram(0); @@ -403,7 +403,7 @@ static void PlayerPC_Mailbox(u8 taskId) ItemStorage_SetItemAndMailCount(taskId); if (sub_81D1C44(playerPCItemPageInfo.count) == TRUE) { - ClearWindowAndWideBorder(0, 0); + ClearDialogWindowAndFrame(0, 0); Mailbox_DrawMailboxMenu(taskId); gTasks[taskId].func = Mailbox_ProcessInput; } @@ -451,7 +451,7 @@ static void InitItemStorageMenu(u8 taskId, u8 var) static void ItemStorageMenuPrint(const u8 *textPtr) { - NewMenuHelpers_DrawDialogueFrame(0, 0); + DrawDialogueFrame(0, 0); AddTextPrinterParameterized(0, 1, textPtr, 0, 1, 0, 0); } @@ -506,7 +506,7 @@ void sub_816B31C(void) void Mailbox_DoRedrawMailboxMenuAfterReturn(void) { sub_81973A4(); - NewMenuHelpers_DrawDialogueFrame(0, 1); + DrawDialogueFrame(0, 1); InitItemStorageMenu(CreateTask(ItemStorage_HandleReturnToProcessInput, 0), 1); pal_fill_black(); } @@ -560,7 +560,7 @@ static void ItemStorage_WithdrawToss_Helper(u8 taskId, bool8 toss) FreeAndReserveObjectSpritePalettes(); LoadListMenuArrowsGfx(); sub_8122344(gUnknown_0203BCC4->spriteIds, 7); - ClearWindowAndWideBorder(0,0); + ClearDialogWindowAndFrame(0,0); gTasks[taskId].func = ItemStorage_ProcessWithdrawTossInput; } @@ -583,7 +583,7 @@ static void sub_816B4DC(u8 taskId) { u16 *data = gTasks[taskId].data; - sub_8198070(data[4], FALSE); + ClearStdWindowAndFrameToTransparent(data[4], FALSE); ClearWindowTilemap(data[4]); RemoveWindow(data[4]); schedule_bg_copy_tilemap_to_vram(0); @@ -761,7 +761,7 @@ static void Mailbox_MoveToBag(u8 taskId) static void Mailbox_DrawYesNoBeforeMove(u8 taskId) { - DisplayYesNoMenu(); + DisplayYesNoMenuWithDefault(); gTasks[taskId].func = Mailbox_MoveToBagYesNoPrompt; } @@ -863,7 +863,7 @@ static void Mailbox_NoPokemonForMail(u8 taskId) static void Mailbox_Cancel(u8 taskId) { sub_81D1D04(2); - ClearWindowAndWideBorder(0, 0); + ClearDialogWindowAndFrame(0, 0); Mailbox_DrawMailboxMenu(taskId); schedule_bg_copy_tilemap_to_vram(0); gTasks[taskId].func = Mailbox_ProcessInput; @@ -892,7 +892,7 @@ static u8 sub_816BC7C(u8 a) if (*windowIdLoc == 0xFF) { *windowIdLoc = AddWindow(&gUnknown_085DFF5C[a]); - SetWindowBorderStyle(*windowIdLoc, FALSE, 0x214, 0xE); + DrawStdFrameWithCustomTileAndPalette(*windowIdLoc, FALSE, 0x214, 0xE); schedule_bg_copy_tilemap_to_vram(0); } return *windowIdLoc; @@ -903,7 +903,7 @@ static void sub_816BCC4(u8 a) u8 *windowIdLoc = &(gUnknown_0203BCC4->windowIds[a]); if (*windowIdLoc != 0xFF) { - sub_8198070(*windowIdLoc, FALSE); + ClearStdWindowAndFrameToTransparent(*windowIdLoc, FALSE); ClearWindowTilemap(*windowIdLoc); schedule_bg_copy_tilemap_to_vram(0); RemoveWindow(*windowIdLoc); @@ -1170,7 +1170,7 @@ static void ItemStorage_GoBackToPlayerPCMenu_InitStorage(u8 taskId) data = gTasks[taskId].data; if (!IsDma3ManagerBusyWithBgCopy()) { - NewMenuHelpers_DrawDialogueFrame(0, 0); + DrawDialogueFrame(0, 0); if (!data[3]) InitItemStorageMenu(taskId, ITEMPC_MENU_WITHDRAW); else diff --git a/src/pokeblock.c b/src/pokeblock.c index 95f91a74da..4bd4a8ccb1 100644 --- a/src/pokeblock.c +++ b/src/pokeblock.c @@ -1120,7 +1120,7 @@ static void PutPokeblockOptionsWindow(u8 taskId) data[1] = 9; sub_8136418(); - SetWindowBorderStyle(data[1], 0, 1, 0xE); + DrawStdFrameWithCustomTileAndPalette(data[1], 0, 1, 0xE); sub_81995E4(data[1], sPokeblockMenu->optionsNo, sPokeblockMenuActions, sPokeblockMenu->pokeblockOptionsIds); InitMenuInUpperLeftCornerPlaySoundWhenAPressed(data[1], sPokeblockMenu->optionsNo, 0); PutWindowTilemap(data[1]); @@ -1173,7 +1173,7 @@ static void PokeblockAction_Toss(u8 taskId) { s16 *data = gTasks[taskId].data; - sub_8198070(data[1], FALSE); + ClearStdWindowAndFrameToTransparent(data[1], FALSE); StringCopy(gStringVar1, gPokeblockNames[gSaveBlock1Ptr->pokeblocks[gSpecialVar_ItemId].color]); StringExpandPlaceholders(gStringVar4, gText_ThrowAwayVar1); DisplayMessageAndContinueTask(taskId, 10, 10, 13, 1, GetPlayerTextSpeedDelay(), gStringVar4, CreateTossPokeblockYesNoMenu); @@ -1219,7 +1219,7 @@ static void HandleErasePokeblock(u8 taskId) static void TossPokeblockChoice_No(u8 taskId) { - sub_8197DF8(10, FALSE); + ClearDialogWindowAndFrameToTransparent(10, FALSE); schedule_bg_copy_tilemap_to_vram(1); sub_81363BC(); gTasks[taskId].func = Task_HandlePokeblockMenuInput; @@ -1266,7 +1266,7 @@ static void PokeblockAction_Cancel(u8 taskId) { s16 *data = gTasks[taskId].data; - sub_8198070(data[1], FALSE); + ClearStdWindowAndFrameToTransparent(data[1], FALSE); schedule_bg_copy_tilemap_to_vram(1); sub_81363BC(); gTasks[taskId].func = Task_HandlePokeblockMenuInput; diff --git a/src/pokeblock_feed.c b/src/pokeblock_feed.c index 0a110120d3..908aec1c09 100644 --- a/src/pokeblock_feed.c +++ b/src/pokeblock_feed.c @@ -581,7 +581,7 @@ static bool8 TransitionToPokeblockFeedScene(void) gMain.state++; break; case 10: - SetWindowBorderStyle(0, 1, 1, 14); + DrawStdFrameWithCustomTileAndPalette(0, 1, 1, 14); gMain.state++; break; case 11: diff --git a/src/pokemon_storage_system.c b/src/pokemon_storage_system.c index d4c4c52248..a99a473eba 100644 --- a/src/pokemon_storage_system.c +++ b/src/pokemon_storage_system.c @@ -1218,7 +1218,7 @@ static const u16 gWallpaperPalettes_Plain[][16] = static const u32 gWallpaperTiles_Plain[] = INCBIN_U32("graphics/pokemon_storage/plain.4bpp.lz"); static const u32 gWallpaperTilemap_Plain[] = INCBIN_U32("graphics/pokemon_storage/plain.bin.lz"); -// 12�18 tilemap +// 12x18 tilemap static const u32 gUnknown_085773C4[] = INCBIN_U32("graphics/unused/tilemap_5773C4.bin"); static const u16 gUnknown_08577574[][2] = @@ -1736,7 +1736,7 @@ static void Task_PokemonStorageSystemPC(u8 taskId) case 0: CreatePCMenu(task->data[1], &task->data[15]); sub_81973A4(); - NewMenuHelpers_DrawDialogueFrame(0, 0); + DrawDialogueFrame(0, 0); FillWindowPixelBuffer(0, PALETTE_NUM_TO_FILL_VALUE(1)); AddTextPrinterParameterized2(0, 1, gUnknown_085716C0[task->data[1]].desc, TEXT_SPEED_FF, NULL, 2, 1, 3); CopyWindowToVram(0, 3); @@ -1769,7 +1769,7 @@ static void Task_PokemonStorageSystemPC(u8 taskId) break; case MENU_B_PRESSED: case 4: - ClearWindowAndBorder(task->data[15], TRUE); + ClearStdWindowAndFrame(task->data[15], TRUE); ScriptContext2_Disable(); EnableBothScriptContexts(); RemoveWindow(task->data[15]); @@ -1865,7 +1865,7 @@ static void CreatePCMenu(u8 whichMenu, s16 *windowIdPtr) winTemplate.width = GetMaxWidthInMenuTable((void *)gUnknown_085716C0, ARRAY_COUNT(gUnknown_085716C0)); windowId = AddWindow(&winTemplate); - NewMenuHelpers_DrawStdWindowFrame(windowId, FALSE); + DrawStdWindowFrame(windowId, FALSE); PrintMenuTable(windowId, ARRAY_COUNT(gUnknown_085716C0), (void *)gUnknown_085716C0); InitMenuInUpperLeftCornerPlaySoundWhenAPressed(windowId, ARRAY_COUNT(gUnknown_085716C0), whichMenu); *windowIdPtr = windowId; @@ -4432,7 +4432,7 @@ static void ShowYesNoWindow(s8 cursorPos) static void ClearBottomWindow(void) { - sub_8198070(1, FALSE); + ClearStdWindowAndFrameToTransparent(1, FALSE); schedule_bg_copy_tilemap_to_vram(0); } @@ -8733,7 +8733,7 @@ static void AddMenu(void) sPSSData->menuWindow.tilemapTop = 15 - sPSSData->menuWindow.height; sPSSData->field_CB0 = AddWindow(&sPSSData->menuWindow); ClearWindowTilemap(sPSSData->field_CB0); - SetWindowBorderStyle(sPSSData->field_CB0, FALSE, 11, 14); + DrawStdFrameWithCustomTileAndPalette(sPSSData->field_CB0, FALSE, 11, 14); PrintMenuTable(sPSSData->field_CB0, sPSSData->menuItemsCount, (void*)sPSSData->menuItems); InitMenuInUpperLeftCornerPlaySoundWhenAPressed(sPSSData->field_CB0, sPSSData->menuItemsCount, 0); schedule_bg_copy_tilemap_to_vram(0); @@ -8787,7 +8787,7 @@ static s16 sub_80D00AC(void) static void sub_80D013C(void) { - sub_8198070(sPSSData->field_CB0, TRUE); + ClearStdWindowAndFrameToTransparent(sPSSData->field_CB0, TRUE); RemoveWindow(sPSSData->field_CB0); } diff --git a/src/record_mixing.c b/src/record_mixing.c index 7f091c4dfc..2ac5f9e4c7 100644 --- a/src/record_mixing.c +++ b/src/record_mixing.c @@ -292,7 +292,7 @@ static void ReceiveExchangePacket(u32 which) static void PrintTextOnRecordMixing(const u8 *src) { - NewMenuHelpers_DrawDialogueFrame(0, 0); + DrawDialogueFrame(0, 0); AddTextPrinterParameterized(0, 1, src, 0, 1, 0, NULL); CopyWindowToVram(0, 3); } @@ -370,7 +370,7 @@ static void Task_RecordMixing_Main(u8 taskId) { CreateTask(sub_80AF2B4, 10); } - ClearWindowAndWideBorder(0, 1); + ClearDialogWindowAndFrame(0, 1); DestroyTask(taskId); EnableBothScriptContexts(); } diff --git a/src/region_map.c b/src/region_map.c index fa5e26b111..6d5224821c 100644 --- a/src/region_map.c +++ b/src/region_map.c @@ -1687,8 +1687,8 @@ static void sub_8124904(void) { StringLength(gUnknown_085A1EDC[i].name[sFlyMap->regionMap.posWithinMapSec]); flag = TRUE; - sub_8198070(0, FALSE); - SetWindowBorderStyle(1, FALSE, 0x65, 0x0d); + ClearStdWindowAndFrameToTransparent(0, FALSE); + DrawStdFrameWithCustomTileAndPalette(1, FALSE, 0x65, 0x0d); AddTextPrinterParameterized(1, 1, sFlyMap->regionMap.mapSecName, 0, 1, 0, NULL); name = gUnknown_085A1EDC[i].name[sFlyMap->regionMap.posWithinMapSec]; AddTextPrinterParameterized(1, 1, name, GetStringRightAlignXOffset(1, name, 0x60), 0x11, 0, NULL); @@ -1702,8 +1702,8 @@ static void sub_8124904(void) { if (gUnknown_03001180 == TRUE) { - sub_8198070(1, FALSE); - SetWindowBorderStyle(0, FALSE, 0x65, 0x0d); + ClearStdWindowAndFrameToTransparent(1, FALSE); + DrawStdFrameWithCustomTileAndPalette(0, FALSE, 0x65, 0x0d); } else { @@ -1718,8 +1718,8 @@ static void sub_8124904(void) { if (gUnknown_03001180 == TRUE) { - sub_8198070(1, FALSE); - SetWindowBorderStyle(0, FALSE, 0x65, 0x0d); + ClearStdWindowAndFrameToTransparent(1, FALSE); + DrawStdFrameWithCustomTileAndPalette(0, FALSE, 0x65, 0x0d); } FillWindowPixelBuffer(0, PALETTE_NUM_TO_FILL_VALUE(1)); CopyWindowToVram(0, 2); diff --git a/src/reset_rtc_screen.c b/src/reset_rtc_screen.c index 34444cbf49..ce9f5b98b3 100644 --- a/src/reset_rtc_screen.c +++ b/src/reset_rtc_screen.c @@ -290,7 +290,7 @@ static void FreeCursorPalette(void) static void HideChooseTimeWindow(u8 windowId) { - sub_8198070(windowId, FALSE); + ClearStdWindowAndFrameToTransparent(windowId, FALSE); RemoveWindow(windowId); schedule_bg_copy_tilemap_to_vram(0); } @@ -319,7 +319,7 @@ static void PrintTime(u8 windowId, u8 x, u8 y, u16 days, u8 hours, u8 minutes, u static void ShowChooseTimeWindow(u8 windowId, u16 days, u8 hours, u8 minutes, u8 seconds) { - SetWindowBorderStyle(windowId, FALSE, 0x214, 0xE); + DrawStdFrameWithCustomTileAndPalette(windowId, FALSE, 0x214, 0xE); PrintTime(windowId, 0, 1, days, hours, minutes, seconds); AddTextPrinterParameterized(windowId, 1, gText_Confirm2, 126, 1, 0, NULL); schedule_bg_copy_tilemap_to_vram(0); @@ -495,7 +495,7 @@ static void VBlankCB(void) static void ShowMessage(const u8 *str) { - sub_8197B1C(1, FALSE, 0x200, 0xF); + DrawDialogFrameWithCustomTileAndPalette(1, FALSE, 0x200, 0xF); AddTextPrinterParameterized(1, 1, str, 0, 1, 0, NULL); schedule_bg_copy_tilemap_to_vram(0); } @@ -507,7 +507,7 @@ static void Task_ShowResetRtcPrompt(u8 taskId) switch (data[0]) { case 0: - SetWindowBorderStyle(0, FALSE, 0x214, 0xE); + DrawStdFrameWithCustomTileAndPalette(0, FALSE, 0x214, 0xE); AddTextPrinterParameterized(0, 1, gText_PresentTime, 0, 1, TEXT_SPEED_FF, 0); PrintTime( 0, @@ -574,7 +574,7 @@ static void Task_ResetRtcScreen(u8 taskId) case 2: if (gTasks[data[1]].isActive != TRUE) { - sub_8198070(0, FALSE); + ClearStdWindowAndFrameToTransparent(0, FALSE); ShowMessage(gText_PleaseResetTime); gLocalTime = gSaveBlock2Ptr->lastBerryTreeUpdate; data[1] = CreateTask(Task_ResetRtc_0, 80); diff --git a/src/rom_8011DC0.c b/src/rom_8011DC0.c index 466ef430d0..88e0bf4acb 100644 --- a/src/rom_8011DC0.c +++ b/src/rom_8011DC0.c @@ -511,12 +511,12 @@ void sub_8012780(u8 taskId) PutWindowTilemap(data->field_10); CopyWindowToVram(data->field_10, 2); - NewMenuHelpers_DrawStdWindowFrame(data->listWindowId, FALSE); + DrawStdWindowFrame(data->listWindowId, FALSE); gMultiuseListMenuTemplate = gUnknown_082F015C; gMultiuseListMenuTemplate.windowId = data->listWindowId; data->listTaskId = ListMenuInit(&gMultiuseListMenuTemplate, 0, 0); - NewMenuHelpers_DrawStdWindowFrame(data->field_11, FALSE); + DrawStdWindowFrame(data->field_11, FALSE); PutWindowTilemap(data->field_11); CopyWindowToVram(data->field_11, 2); @@ -786,10 +786,10 @@ void sub_8012780(u8 taskId) void sub_8012F64(struct UnkStruct_Leader *data) { ClearWindowTilemap(data->field_11); - ClearWindowAndBorder(data->field_11, FALSE); + ClearStdWindowAndFrame(data->field_11, FALSE); DestroyListMenuTask(data->listTaskId, 0, 0); ClearWindowTilemap(data->field_10); - ClearWindowAndBorder(data->listWindowId, FALSE); + ClearStdWindowAndFrame(data->listWindowId, FALSE); CopyBgTilemapBufferToVram(0); RemoveWindow(data->field_11); RemoveWindow(data->listWindowId); @@ -1080,12 +1080,12 @@ void sub_80134E8(u8 taskId) PutWindowTilemap(data->field_C); CopyWindowToVram(data->field_C, 2); - NewMenuHelpers_DrawStdWindowFrame(data->listWindowId, FALSE); + DrawStdWindowFrame(data->listWindowId, FALSE); gMultiuseListMenuTemplate = gUnknown_082F0204; gMultiuseListMenuTemplate.windowId = data->listWindowId; data->listTaskId = ListMenuInit(&gMultiuseListMenuTemplate, 0, 0); - NewMenuHelpers_DrawStdWindowFrame(data->field_D, FALSE); + DrawStdWindowFrame(data->field_D, FALSE); PutWindowTilemap(data->field_D); sub_80125BC(data->field_D); CopyWindowToVram(data->field_D, 2); @@ -1254,10 +1254,10 @@ void sub_80134E8(u8 taskId) case 18: case 20: ClearWindowTilemap(data->field_D); - ClearWindowAndBorder(data->field_D, FALSE); + ClearStdWindowAndFrame(data->field_D, FALSE); DestroyListMenuTask(data->listTaskId, 0, 0); ClearWindowTilemap(data->field_C); - ClearWindowAndBorder(data->listWindowId, FALSE); + ClearStdWindowAndFrame(data->listWindowId, FALSE); CopyBgTilemapBufferToVram(0); RemoveWindow(data->field_D); RemoveWindow(data->listWindowId); diff --git a/src/roulette.c b/src/roulette.c index 7826c13531..4723e06878 100644 --- a/src/roulette.c +++ b/src/roulette.c @@ -973,7 +973,7 @@ static void sub_81405CC(void) sub_814372C(6); sub_81436D0(0); sub_81424FC(0); - NewMenuHelpers_DrawStdWindowFrame(gUnknown_0203AB8C, FALSE); + DrawStdWindowFrame(gUnknown_0203AB8C, FALSE); AddTextPrinterParameterized(gUnknown_0203AB8C, 1, gUnknown_082A5B89, 0, 1, TEXT_SPEED_FF, NULL); CopyWindowToVram(gUnknown_0203AB8C, 3); gSpriteCoordOffsetX = -60; @@ -1043,8 +1043,8 @@ static void sub_81408A8(u8 taskId) static void sub_8140914(u8 taskId) { - DisplayYesNoMenu(); - NewMenuHelpers_DrawStdWindowFrame(gUnknown_0203AB8C, 0); + DisplayYesNoMenuWithDefault(); + DrawStdWindowFrame(gUnknown_0203AB8C, 0); AddTextPrinterParameterized(gUnknown_0203AB8C, 1, gUnknown_082A5C13, 0, 1, TEXT_SPEED_FF, 0); CopyWindowToVram(gUnknown_0203AB8C, 3); DoYesNoFuncWithChoice(taskId, &gUnknown_085B6410); @@ -1052,7 +1052,7 @@ static void sub_8140914(u8 taskId) static void sub_8140968(u8 taskId) { - ClearWindowAndBorder(0, TRUE); + ClearStdWindowAndFrame(0, TRUE); gTasks[taskId].func = sub_8140BD0; } @@ -1808,14 +1808,14 @@ static void sub_814189C(u8 taskId) if (gTasks[taskId].data[2] == 12) { PlayFanfare(MUS_ME_B_BIG); - NewMenuHelpers_DrawStdWindowFrame(gUnknown_0203AB8C, FALSE); + DrawStdWindowFrame(gUnknown_0203AB8C, FALSE); AddTextPrinterParameterized(gUnknown_0203AB8C, 1, gUnknown_082A5BD7, 0, 1, TEXT_SPEED_FF, NULL); CopyWindowToVram(gUnknown_0203AB8C, 3); } else { PlayFanfare(MUS_ME_B_SMALL); - NewMenuHelpers_DrawStdWindowFrame(gUnknown_0203AB8C, FALSE); + DrawStdWindowFrame(gUnknown_0203AB8C, FALSE); AddTextPrinterParameterized(gUnknown_0203AB8C, 1, gUnknown_082A5BCB, 0, 1, TEXT_SPEED_FF, NULL); CopyWindowToVram(gUnknown_0203AB8C, 3); } @@ -1823,7 +1823,7 @@ static void sub_814189C(u8 taskId) case 0: default: m4aSongNumStart(SE_HAZURE); - NewMenuHelpers_DrawStdWindowFrame(gUnknown_0203AB8C, FALSE); + DrawStdWindowFrame(gUnknown_0203AB8C, FALSE); AddTextPrinterParameterized(gUnknown_0203AB8C, 1, gUnknown_082A5BE0, 0, 1, TEXT_SPEED_FF, NULL); CopyWindowToVram(gUnknown_0203AB8C, 3); break; @@ -1867,7 +1867,7 @@ static void sub_8141A18(u8 taskId) { ConvertIntToDecimalStringN(gStringVar1, (gUnknown_0203AB88->var19 * gTasks[taskId].data[2]), STR_CONV_MODE_LEFT_ALIGN, 2); StringExpandPlaceholders(gStringVar4, gUnknown_082A5BEF); - NewMenuHelpers_DrawStdWindowFrame(gUnknown_0203AB8C, FALSE); + DrawStdWindowFrame(gUnknown_0203AB8C, FALSE); AddTextPrinterParameterized(gUnknown_0203AB8C, 1, gStringVar4, 0, 1, TEXT_SPEED_FF, NULL); CopyWindowToVram(gUnknown_0203AB8C, 3); gTasks[taskId].data[1] = (gUnknown_0203AB88->var19 * gTasks[taskId].data[2]); @@ -1900,14 +1900,14 @@ static void sub_8141B58(u8 taskId) { if (gTasks[taskId].data[6] == 6) { - NewMenuHelpers_DrawStdWindowFrame(gUnknown_0203AB8C, FALSE); + DrawStdWindowFrame(gUnknown_0203AB8C, FALSE); AddTextPrinterParameterized(gUnknown_0203AB8C, 1, gUnknown_082A5C21, 0, 1, TEXT_SPEED_FF, NULL); CopyWindowToVram(gUnknown_0203AB8C, 3); sub_8141F7C(taskId, dp01t_12_3_battle_menu, 0xFFFF, 3); } else if (gTasks[taskId].data[13] == 9999) { - NewMenuHelpers_DrawStdWindowFrame(gUnknown_0203AB8C, FALSE); + DrawStdWindowFrame(gUnknown_0203AB8C, FALSE); AddTextPrinterParameterized(gUnknown_0203AB8C, 1, gUnknown_082A5C61, 0, 1, TEXT_SPEED_FF, NULL); CopyWindowToVram(gUnknown_0203AB8C, 3); sub_8141F7C(taskId, sub_8140914, 0xFFFF, 0x3); @@ -1919,7 +1919,7 @@ static void sub_8141B58(u8 taskId) } else { - NewMenuHelpers_DrawStdWindowFrame(gUnknown_0203AB8C, FALSE); + DrawStdWindowFrame(gUnknown_0203AB8C, FALSE); AddTextPrinterParameterized(gUnknown_0203AB8C, 1, gUnknown_082A5C04, 0, 1, TEXT_SPEED_FF, NULL); CopyWindowToVram(gUnknown_0203AB8C, 3); sub_8141F7C(taskId, sub_8140994, 0x3C, 0x3); @@ -1944,7 +1944,7 @@ static void dp01t_12_3_battle_menu(u8 taskId) if (gTasks[taskId].data[13] == 9999) { - NewMenuHelpers_DrawStdWindowFrame(gUnknown_0203AB8C, FALSE); + DrawStdWindowFrame(gUnknown_0203AB8C, FALSE); AddTextPrinterParameterized(gUnknown_0203AB8C, 1, gUnknown_082A5C61, 0, 1, TEXT_SPEED_FF, NULL); CopyWindowToVram(gUnknown_0203AB8C, 3); sub_8141F7C(taskId, sub_8140914, 0xFFFF, 3); @@ -3256,7 +3256,7 @@ static const struct SpriteTemplate gUnknown_085B7AEC = static void sub_81428C4(u8 r0) { - DisplayYesNoMenu(); + DisplayYesNoMenuWithDefault(); DoYesNoFuncWithChoice(r0, &gUnknown_085B6408); } @@ -3272,7 +3272,7 @@ static void sub_81428E4(u8 taskId) static void sub_8142918(u8 taskId) { - ClearWindowAndBorder(0, TRUE); + ClearStdWindowAndFrame(0, TRUE); HideCoinsWindow(); FreeAllWindowBuffers(); BeginNormalPaletteFade(0xFFFFFFFF, 0, 0, 16, RGB_BLACK); @@ -3283,7 +3283,7 @@ static void sub_8142918(u8 taskId) static void sub_814297C(u8 taskId) { - ClearWindowAndBorder(0, FALSE); + ClearStdWindowAndFrame(0, FALSE); HideCoinsWindow(); ScriptContext2_Disable(); DestroyTask(taskId); @@ -3296,7 +3296,7 @@ static void sub_81429A0(u8 taskId) { gSpecialVar_0x8004 = 1; HideCoinsWindow(); - ClearWindowAndBorder(0, TRUE); + ClearStdWindowAndFrame(0, TRUE); ScriptContext2_Disable(); DestroyTask(taskId); } @@ -3309,7 +3309,7 @@ static void sub_81429F0(u8 taskId) u32 temp = gUnknown_085B6344[(gSpecialVar_0x8004 & 1) + (gSpecialVar_0x8004 >> 7 << 1)]; ConvertIntToDecimalStringN(gStringVar1, temp, STR_CONV_MODE_LEADING_ZEROS, 1); StringExpandPlaceholders(gStringVar4, gUnknown_082A5B12); - NewMenuHelpers_DrawStdWindowFrame(0, FALSE); + DrawStdWindowFrame(0, FALSE); AddTextPrinterParameterized(0, 1, gStringVar4, 0, 1, TEXT_SPEED_FF, NULL); CopyWindowToVram(0, 3); gTasks[taskId].func = sub_81428C4; @@ -3326,7 +3326,7 @@ static void Task_Roulette_0(u8 taskId) { if ((gSpecialVar_0x8004 & 0x80) && (gSpecialVar_0x8004 & 1)) { - NewMenuHelpers_DrawStdWindowFrame(0, FALSE); + DrawStdWindowFrame(0, FALSE); AddTextPrinterParameterized(0, 1, gUnknown_082A5B6B, 0, 1, TEXT_SPEED_FF, NULL); CopyWindowToVram(0, 3); gTasks[taskId].func = sub_81429F0; @@ -3334,7 +3334,7 @@ static void Task_Roulette_0(u8 taskId) else { StringExpandPlaceholders(gStringVar4, gUnknown_082A5B12); - NewMenuHelpers_DrawStdWindowFrame(0, FALSE); + DrawStdWindowFrame(0, FALSE); AddTextPrinterParameterized(0, 1, gStringVar4, 0, 1, TEXT_SPEED_FF, NULL); CopyWindowToVram(0, 3); gTasks[taskId].func = sub_81428C4; @@ -3343,7 +3343,7 @@ static void Task_Roulette_0(u8 taskId) else { StringExpandPlaceholders(gStringVar4, gUnknown_082A5B4E); - NewMenuHelpers_DrawStdWindowFrame(0, FALSE); + DrawStdWindowFrame(0, FALSE); AddTextPrinterParameterized(0, 1, gStringVar4, 0, 1, TEXT_SPEED_FF, NULL); CopyWindowToVram(0, 3); gTasks[taskId].func = sub_81429A0; diff --git a/src/save_failed_screen.c b/src/save_failed_screen.c index 62d6f9e3e7..1f0fe69c99 100644 --- a/src/save_failed_screen.c +++ b/src/save_failed_screen.c @@ -229,8 +229,8 @@ static void CB2_SaveFailedScreen(void) LoadPalette(sSaveFailedClockPal, 0x100, 0x20); LoadPalette(gTextWindowFrame1_Pal, 0xE0, 0x20); LoadPalette(gUnknown_0860F074, 0xF0, 0x20); - SetWindowBorderStyle(gSaveFailedWindowIds[TEXT_WIN_ID], FALSE, 0x214, 0xE); - SetWindowBorderStyle(gSaveFailedWindowIds[CLOCK_WIN_ID], FALSE, 0x214, 0xE); + DrawStdFrameWithCustomTileAndPalette(gSaveFailedWindowIds[TEXT_WIN_ID], FALSE, 0x214, 0xE); + DrawStdFrameWithCustomTileAndPalette(gSaveFailedWindowIds[CLOCK_WIN_ID], FALSE, 0x214, 0xE); FillWindowPixelBuffer(gSaveFailedWindowIds[CLOCK_WIN_ID], PALETTE_NUM_TO_FILL_VALUE(1)); // backwards? FillWindowPixelBuffer(gSaveFailedWindowIds[TEXT_WIN_ID], PALETTE_NUM_TO_FILL_VALUE(1)); CopyWindowToVram(gSaveFailedWindowIds[CLOCK_WIN_ID], 2); // again? diff --git a/src/scrcmd.c b/src/scrcmd.c index 145437a2a8..b42b3e5f7b 100644 --- a/src/scrcmd.c +++ b/src/scrcmd.c @@ -1302,7 +1302,7 @@ bool8 ScrCmd_cmdDB(struct ScriptContext *ctx) if (msg == NULL) msg = (const u8 *)ctx->data[0]; sub_81973A4(); - NewMenuHelpers_DrawDialogueFrame(0, 1); + DrawDialogueFrame(0, 1); AddTextPrinterParameterized(0, 1, msg, 0, 1, 0, 0); return FALSE; } @@ -1517,7 +1517,7 @@ bool8 ScrCmd_braillemessage(struct ScriptContext *ctx) winTemplate = CreateWindowTemplate(0, xWindow, yWindow + 1, width, height, 0xF, 0x1); gUnknown_03000F30 = AddWindow(&winTemplate); LoadUserWindowBorderGfx(gUnknown_03000F30, 0x214, 0xE0); - NewMenuHelpers_DrawStdWindowFrame(gUnknown_03000F30, 0); + DrawStdWindowFrame(gUnknown_03000F30, 0); PutWindowTilemap(gUnknown_03000F30); FillWindowPixelBuffer(gUnknown_03000F30, PALETTE_NUM_TO_FILL_VALUE(1)); AddTextPrinterParameterized(gUnknown_03000F30, 6, gStringVar4, xText, yText, 0xFF, 0x0); @@ -2254,7 +2254,7 @@ bool8 ScrCmd_setmonmetlocation(struct ScriptContext *ctx) void sub_809BDB4(void) { - ClearWindowAndBorder(gUnknown_03000F30, 1); + ClearStdWindowAndFrame(gUnknown_03000F30, 1); RemoveWindow(gUnknown_03000F30); } diff --git a/src/script_menu.c b/src/script_menu.c index 8831d65c66..ccbbcdfe16 100644 --- a/src/script_menu.c +++ b/src/script_menu.c @@ -1202,7 +1202,7 @@ bool8 ScriptMenu_YesNo(u8 left, u8 top) else { gSpecialVar_Result = 0xFF; - DisplayYesNoMenu(); + DisplayYesNoMenuWithDefault(); taskId = CreateTask(Task_HandleYesNoInput, 0x50); return TRUE; } @@ -1630,7 +1630,7 @@ u8 CreateWindowFromRect(u8 x, u8 y, u8 width, u8 height) void sub_80E2A78(u8 windowId) { - sub_8198070(windowId, TRUE); + ClearStdWindowAndFrameToTransparent(windowId, TRUE); RemoveWindow(windowId); } diff --git a/src/secret_base.c b/src/secret_base.c index 74d9ac9b00..342a9960ad 100644 --- a/src/secret_base.c +++ b/src/secret_base.c @@ -871,7 +871,7 @@ void sub_80E9C9C(u8 taskId) { data[1] = 0; data[2] = 0; - ClearWindowAndWideBorder(0, 0); + ClearDialogWindowAndFrame(0, 0); gUnknown_0203A020 = calloc(1, sizeof(struct SecretBaseListMenuBuffer)); data[6] = AddWindow(&gUnknown_0858D06C[0]); game_continue(taskId); @@ -963,7 +963,7 @@ void sub_80E9E90(u8 taskId) PlaySE(SE_SELECT); DestroyListMenuTask(data[5], NULL, NULL); RemoveScrollIndicatorArrowPair(data[8]); - ClearWindowAndBorder(data[6], 0); + ClearStdWindowAndFrame(data[6], 0); ClearWindowTilemap(data[6]); RemoveWindow(data[6]); schedule_bg_copy_tilemap_to_vram(0); @@ -1020,8 +1020,8 @@ void sub_80E9FFC(u8 taskId) s16 *data; data = gTasks[taskId].data; - ClearWindowAndBorder(data[6], FALSE); - ClearWindowAndBorder(data[7], FALSE); + ClearStdWindowAndFrame(data[6], FALSE); + ClearStdWindowAndFrame(data[7], FALSE); ClearWindowTilemap(data[6]); ClearWindowTilemap(data[7]); RemoveWindow(data[7]); @@ -1033,7 +1033,7 @@ void sub_80E9FFC(u8 taskId) void sub_80EA06C(u8 taskId) { - DisplayYesNoMenu(); + DisplayYesNoMenuWithDefault(); DoYesNoFuncWithChoice(taskId, &gUnknown_0858D058); } @@ -1042,7 +1042,7 @@ void sub_80EA08C(u8 taskId) s16 *data; data = gTasks[taskId].data; - ClearWindowAndWideBorder(0, 0); + ClearDialogWindowAndFrame(0, 0); DestroyListMenuTask(data[5], &data[2], &data[1]); gSaveBlock1Ptr->secretBases[data[4]].sbr_field_1_6 = 0; game_continue(taskId); @@ -1061,7 +1061,7 @@ void sub_80EA13C(u8 taskId) s16 *data; data = gTasks[taskId].data; - ClearWindowAndWideBorder(0, 0); + ClearDialogWindowAndFrame(0, 0); DestroyListMenuTask(data[5], &data[2], &data[1]); sub_80E9E00(taskId); gTasks[taskId].func = sub_80E9E90; @@ -1073,7 +1073,7 @@ void sub_80EA18C(u8 taskId) data = gTasks[taskId].data; sub_80E9E44(taskId); - ClearWindowAndBorder(data[7], 0); + ClearStdWindowAndFrame(data[7], 0); ClearWindowTilemap(data[7]); RemoveWindow(data[7]); schedule_bg_copy_tilemap_to_vram(0); diff --git a/src/shop.c b/src/shop.c index 8c530e0d33..55a7a20f76 100755 --- a/src/shop.c +++ b/src/shop.c @@ -366,7 +366,7 @@ void CB2_ExitSellMenu(void) static void Task_HandleShopMenuQuit(u8 taskId) { - sub_8198070(gMartInfo.windowId, 2); + ClearStdWindowAndFrameToTransparent(gMartInfo.windowId, 2); RemoveWindow(gMartInfo.windowId); SaveRecordedItemPurchasesForTVShow(); ScriptContext2_Disable(); @@ -981,12 +981,12 @@ static void Task_BuyHowManyDialogueInit(u8 taskId) u16 quantityInBag = CountTotalItemQuantityInBag(tItemId); u16 maxQuantity; - SetWindowBorderStyle(3, FALSE, 1, 13); + DrawStdFrameWithCustomTileAndPalette(3, FALSE, 1, 13); ConvertIntToDecimalStringN(gStringVar1, quantityInBag, STR_CONV_MODE_RIGHT_ALIGN, 4); StringExpandPlaceholders(gStringVar4, gText_InBagVar1); BuyMenuPrint(3, gStringVar4, 0, 1, 0, 0); tItemCount = 1; - SetWindowBorderStyle(4, FALSE, 1, 13); + DrawStdFrameWithCustomTileAndPalette(4, FALSE, 1, 13); BuyMenuPrintItemQuantityAndPrice(taskId); schedule_bg_copy_tilemap_to_vram(0); @@ -1018,8 +1018,8 @@ static void Task_BuyHowManyDialogueHandleInput(u8 taskId) if (gMain.newKeys & A_BUTTON) { PlaySE(SE_SELECT); - sub_8198070(4, 0); - sub_8198070(3, 0); + ClearStdWindowAndFrameToTransparent(4, 0); + ClearStdWindowAndFrameToTransparent(3, 0); ClearWindowTilemap(4); ClearWindowTilemap(3); PutWindowTilemap(1); @@ -1031,8 +1031,8 @@ static void Task_BuyHowManyDialogueHandleInput(u8 taskId) else if (gMain.newKeys & B_BUTTON) { PlaySE(SE_SELECT); - sub_8198070(4, 0); - sub_8198070(3, 0); + ClearStdWindowAndFrameToTransparent(4, 0); + ClearStdWindowAndFrameToTransparent(3, 0); ClearWindowTilemap(4); ClearWindowTilemap(3); BuyMenuReturnToItemList(taskId); @@ -1131,7 +1131,7 @@ static void BuyMenuReturnToItemList(u8 taskId) { s16 *data = gTasks[taskId].data; - sub_8197DF8(5, 0); + ClearDialogWindowAndFrameToTransparent(5, 0); BuyMenuPrintCursor(tListTaskId, 1); PutWindowTilemap(1); PutWindowTilemap(2); diff --git a/src/slot_machine.c b/src/slot_machine.c index f603f468c3..189bca80f4 100644 --- a/src/slot_machine.c +++ b/src/slot_machine.c @@ -1015,7 +1015,7 @@ void PlaySlotMachine(u8 arg0, MainCallback cb) /*static */bool8 sub_8101F44(struct Task *task) { - NewMenuHelpers_DrawDialogueFrame(0, 0); + DrawDialogueFrame(0, 0); AddTextPrinterParameterized(0, 1, gText_YouDontHaveThreeCoins, 0, 1, 0, 0); CopyWindowToVram(0, 3); sSlotMachine->state = 7; @@ -1026,7 +1026,7 @@ void PlaySlotMachine(u8 arg0, MainCallback cb) { if (gMain.newKeys & (A_BUTTON | B_BUTTON)) { - ClearWindowAndWideBorder(0, TRUE); + ClearDialogWindowAndFrame(0, TRUE); sSlotMachine->state = 5; } return FALSE; @@ -1256,7 +1256,7 @@ void PlaySlotMachine(u8 arg0, MainCallback cb) /*static */bool8 sub_8102318(struct Task *task) { - NewMenuHelpers_DrawDialogueFrame(0, 0); + DrawDialogueFrame(0, 0); AddTextPrinterParameterized(0, 1, gText_QuitTheGame, 0, 1, 0, 0); CopyWindowToVram(0, 3); CreateYesNoMenuParameterized(0x15, 7, 0x214, 0x180, 0xE, 0xF); @@ -1269,7 +1269,7 @@ void PlaySlotMachine(u8 arg0, MainCallback cb) s8 input = Menu_ProcessInputNoWrapClearOnChoose(); if (input == 0) { - ClearWindowAndWideBorder(0, TRUE); + ClearDialogWindowAndFrame(0, TRUE); sub_8103D8C(0); sub_8103D8C(1); sub_8103D8C(2); @@ -1278,7 +1278,7 @@ void PlaySlotMachine(u8 arg0, MainCallback cb) } else if (input == 1 || input == -1) { - ClearWindowAndWideBorder(0, TRUE); + ClearDialogWindowAndFrame(0, TRUE); sSlotMachine->state = 5; } return FALSE; @@ -1286,7 +1286,7 @@ void PlaySlotMachine(u8 arg0, MainCallback cb) /*static */bool8 sub_810239C(struct Task *task) { - NewMenuHelpers_DrawDialogueFrame(0, 0); + DrawDialogueFrame(0, 0); AddTextPrinterParameterized(0, 1, gText_YouveGot9999Coins, 0, 1, 0, 0); CopyWindowToVram(0, 3); sSlotMachine->state = 24; @@ -1297,7 +1297,7 @@ void PlaySlotMachine(u8 arg0, MainCallback cb) { if (gMain.newKeys & (A_BUTTON | B_BUTTON)) { - ClearWindowAndWideBorder(0, TRUE); + ClearDialogWindowAndFrame(0, TRUE); sSlotMachine->state = 5; } return FALSE; @@ -1305,7 +1305,7 @@ void PlaySlotMachine(u8 arg0, MainCallback cb) /*static */bool8 sub_81023E0_(struct Task *task) { - NewMenuHelpers_DrawDialogueFrame(0, 0); + DrawDialogueFrame(0, 0); AddTextPrinterParameterized(0, 1, gText_YouveRunOutOfCoins, 0, 1, 0, 0); CopyWindowToVram(0, 3); sSlotMachine->state = 26; @@ -1316,7 +1316,7 @@ void PlaySlotMachine(u8 arg0, MainCallback cb) { if (gMain.newKeys & (A_BUTTON | B_BUTTON)) { - ClearWindowAndWideBorder(0, TRUE); + ClearDialogWindowAndFrame(0, TRUE); sSlotMachine->state = 27; } return FALSE; diff --git a/src/start_menu.c b/src/start_menu.c index c61269c9cd..f88630aee7 100644 --- a/src/start_menu.c +++ b/src/start_menu.c @@ -123,7 +123,7 @@ static u8 SaveConfirmSaveCallback(void); static u8 SaveYesNoCallback(void); static u8 SaveConfirmInputCallback(void); static u8 SaveFileExistsCallback(void); -static u8 SaveConfirmOverwriteNoCallback(void); +static u8 SaveConfirmOverwriteDefaultNoCallback(void); static u8 SaveConfirmOverwriteCallback(void); static u8 SaveOverwriteInputCallback(void); static u8 SaveSavingMessageCallback(void); @@ -376,7 +376,7 @@ static void ShowSafariBallsWindow(void) { sSafariBallsWindowId = AddWindow(&sSafariBallsWindowTemplate); PutWindowTilemap(sSafariBallsWindowId); - NewMenuHelpers_DrawStdWindowFrame(sSafariBallsWindowId, FALSE); + DrawStdWindowFrame(sSafariBallsWindowId, FALSE); ConvertIntToDecimalStringN(gStringVar1, gNumSafariBalls, STR_CONV_MODE_RIGHT_ALIGN, 2); StringExpandPlaceholders(gStringVar4, gText_SafariBallStock); AddTextPrinterParameterized(sSafariBallsWindowId, 1, gStringVar4, 0, 1, 0xFF, NULL); @@ -391,7 +391,7 @@ static void ShowPyramidFloorWindow(void) sBattlePyramidFloorWindowId = AddWindow(&sPyramidFloorWindowTemplate_2); PutWindowTilemap(sBattlePyramidFloorWindowId); - NewMenuHelpers_DrawStdWindowFrame(sBattlePyramidFloorWindowId, FALSE); + DrawStdWindowFrame(sBattlePyramidFloorWindowId, FALSE); StringCopy(gStringVar1, sPyramindFloorNames[gSaveBlock2Ptr->frontier.curChallengeBattleNum]); StringExpandPlaceholders(gStringVar4, gText_BattlePyramidFloor); AddTextPrinterParameterized(sBattlePyramidFloorWindowId, 1, gStringVar4, 0, 1, 0xFF, NULL); @@ -402,13 +402,13 @@ static void RemoveExtraStartMenuWindows(void) { if (GetSafariZoneFlag()) { - sub_8198070(sSafariBallsWindowId, FALSE); + ClearStdWindowAndFrameToTransparent(sSafariBallsWindowId, FALSE); CopyWindowToVram(sSafariBallsWindowId, 2); RemoveWindow(sSafariBallsWindowId); } if (InBattlePyramid()) { - sub_8198070(sBattlePyramidFloorWindowId, FALSE); + ClearStdWindowAndFrameToTransparent(sBattlePyramidFloorWindowId, FALSE); RemoveWindow(sBattlePyramidFloorWindowId); } } @@ -459,7 +459,7 @@ static bool32 InitStartMenuStep(void) break; case 2: sub_81973A4(); - NewMenuHelpers_DrawStdWindowFrame(sub_81979C4(sNumStartMenuActions), FALSE); + DrawStdWindowFrame(sub_81979C4(sNumStartMenuActions), FALSE); sUnknown_02037619[1] = 0; sUnknown_02037619[0]++; break; @@ -751,7 +751,7 @@ static bool8 StartMenuBattlePyramidRetireCallback(void) void sub_809FDD4(void) { - sub_8197DF8(0, FALSE); + ClearDialogWindowAndFrameToTransparent(0, FALSE); ScriptUnfreezeEventObjects(); CreateStartMenuTask(sub_809FA34); ScriptContext2_Enable(); @@ -787,13 +787,13 @@ static bool8 SaveCallback(void) case SAVE_IN_PROGRESS: return FALSE; case SAVE_CANCELED: // Back to start menu - sub_8197DF8(0, FALSE); + ClearDialogWindowAndFrameToTransparent(0, FALSE); InitStartMenu(); gMenuCallback = HandleStartMenuInput; return FALSE; case SAVE_SUCCESS: case SAVE_ERROR: // Close start menu - sub_8197DF8(0, TRUE); + ClearDialogWindowAndFrameToTransparent(0, TRUE); ScriptUnfreezeEventObjects(); ScriptContext2_Disable(); SoftResetInBattlePyramid(); @@ -830,7 +830,7 @@ static bool8 BattlePyramidRetireCallback(void) case SAVE_IN_PROGRESS: return FALSE; case SAVE_CANCELED: // Yes (Retire from battle pyramid) - sub_8197DF8(0, TRUE); + ClearDialogWindowAndFrameToTransparent(0, TRUE); ScriptUnfreezeEventObjects(); ScriptContext2_Disable(); ScriptContext1_SetupScript(BattleFrontier_BattlePyramidEmptySquare_EventScript_252C88); @@ -897,7 +897,7 @@ static void SaveGameTask(u8 taskId) static void sub_80A0014(void) { - ClearWindowAndWideBorder(0, TRUE); + ClearDialogWindowAndFrame(0, TRUE); } static void HideSaveInfoWindow(void) @@ -943,7 +943,7 @@ static bool8 SaveErrorTimer(void) static u8 SaveConfirmSaveCallback(void) { - ClearWindowAndBorder(GetStartMenuWindowId(), FALSE); + ClearStdWindowAndFrame(GetStartMenuWindowId(), FALSE); RemoveStartMenuWindow(); ShowSaveInfoWindow(); @@ -961,7 +961,7 @@ static u8 SaveConfirmSaveCallback(void) static u8 SaveYesNoCallback(void) { - DisplayYesNoMenu(); // Show Yes/No menu + DisplayYesNoMenuWithDefault(); // Show Yes/No menu sSaveDialogCallback = SaveConfirmInputCallback; return SAVE_IN_PROGRESS; } @@ -1002,7 +1002,7 @@ static u8 SaveFileExistsCallback(void) { if (gDifferentSaveFile == TRUE) { - ShowSaveMessage(gText_DifferentSaveFile, SaveConfirmOverwriteNoCallback); + ShowSaveMessage(gText_DifferentSaveFile, SaveConfirmOverwriteDefaultNoCallback); } else { @@ -1012,16 +1012,16 @@ static u8 SaveFileExistsCallback(void) return SAVE_IN_PROGRESS; } -static u8 SaveConfirmOverwriteNoCallback(void) +static u8 SaveConfirmOverwriteDefaultNoCallback(void) { - sub_8197948(1); // Show Yes/No menu (No selected as default) + DisplayYesNoMenuWithDefaultDefaultNo(1); // Show Yes/No menu (No selected as default) sSaveDialogCallback = SaveOverwriteInputCallback; return SAVE_IN_PROGRESS; } static u8 SaveConfirmOverwriteCallback(void) { - DisplayYesNoMenu(); // Show Yes/No menu + DisplayYesNoMenuWithDefault(); // Show Yes/No menu sSaveDialogCallback = SaveOverwriteInputCallback; return SAVE_IN_PROGRESS; } @@ -1135,7 +1135,7 @@ static void InitBattlePyramidRetire(void) static u8 BattlePyramidConfirmRetireCallback(void) { - ClearWindowAndBorder(GetStartMenuWindowId(), FALSE); + ClearStdWindowAndFrame(GetStartMenuWindowId(), FALSE); RemoveStartMenuWindow(); ShowSaveMessage(gText_BattlePyramidConfirmRetire, BattlePyramidRetireYesNoCallback); @@ -1144,7 +1144,7 @@ static u8 BattlePyramidConfirmRetireCallback(void) static u8 BattlePyramidRetireYesNoCallback(void) { - sub_8197948(1); // Show Yes/No menu (No selected as default) + DisplayYesNoMenuWithDefaultDefaultNo(1); // Show Yes/No menu (No selected as default) sSaveDialogCallback = BattlePyramidRetireInputCallback; return SAVE_IN_PROGRESS; @@ -1313,7 +1313,7 @@ static void ShowSaveInfoWindow(void) } sSaveInfoWindowId = AddWindow(&saveInfoWindow); - NewMenuHelpers_DrawStdWindowFrame(sSaveInfoWindowId, FALSE); + DrawStdWindowFrame(sSaveInfoWindowId, FALSE); gender = gSaveBlock2Ptr->playerGender; color = TEXT_COLOR_RED; // Red when female, blue when male. @@ -1364,7 +1364,7 @@ static void ShowSaveInfoWindow(void) static void RemoveSaveInfoWindow(void) { - ClearWindowAndBorder(sSaveInfoWindowId, FALSE); + ClearStdWindowAndFrame(sSaveInfoWindowId, FALSE); RemoveWindow(sSaveInfoWindowId); } @@ -1386,7 +1386,7 @@ void sub_80A08CC(void) // Referenced in data/specials.inc and data/scripts/maps/ static void HideStartMenuWindow(void) { - ClearWindowAndBorder(GetStartMenuWindowId(), TRUE); + ClearStdWindowAndFrame(GetStartMenuWindowId(), TRUE); RemoveStartMenuWindow(); ScriptUnfreezeEventObjects(); ScriptContext2_Disable(); diff --git a/src/starter_choose.c b/src/starter_choose.c index 4e21c1845a..3ffc8e2860 100644 --- a/src/starter_choose.c +++ b/src/starter_choose.c @@ -469,7 +469,7 @@ static void MainCallback2_StarterChoose(void) static void Task_StarterChoose1(u8 taskId) { CreateStarterPokemonLabel(gTasks[taskId].tStarterSelection); - SetWindowBorderStyle(0, FALSE, 0x2A8, 0xD); + DrawStdFrameWithCustomTileAndPalette(0, FALSE, 0x2A8, 0xD); AddTextPrinterParameterized(0, 1, gText_BirchInTrouble, 0, 1, 0, NULL); PutWindowTilemap(0); schedule_bg_copy_tilemap_to_vram(0); diff --git a/src/trader.c b/src/trader.c index b5c159fb96..97bc4626f1 100644 --- a/src/trader.c +++ b/src/trader.c @@ -73,7 +73,7 @@ void CreateAvailableDecorationsMenu(u8 taskId) } windowTemplate.width = convert_pixel_width_to_tile_width(windowWidth); data[3] = AddWindow(&windowTemplate); - SetWindowBorderStyle(data[3], FALSE, 0x214, 14); + DrawStdFrameWithCustomTileAndPalette(data[3], FALSE, 0x214, 14); for (i = 0; i < 4; i++) { if (trader->decorIds[i] > NUM_DECORATIONS) @@ -98,7 +98,7 @@ void sub_8133BE4(u8 taskId, u8 decorationId) gSpecialVar_0x8004 = decorationId; } - sub_8198070(data[3], FALSE); + ClearStdWindowAndFrameToTransparent(data[3], FALSE); ClearWindowTilemap(data[3]); RemoveWindow(data[3]); schedule_bg_copy_tilemap_to_vram(0); diff --git a/src/trainer_card.c b/src/trainer_card.c index c8f0df0db3..1f91916320 100755 --- a/src/trainer_card.c +++ b/src/trainer_card.c @@ -469,7 +469,7 @@ static void sub_80C2760(u8 taskId) break; case 15: sub_800AC34(); - NewMenuHelpers_DrawDialogueFrame(0, 1); + DrawDialogueFrame(0, 1); AddTextPrinterParameterized(0, 1, gText_WaitingTrainerFinishReading, 0, 1, 255, 0); CopyWindowToVram(0, 3); sData->var_0 = 16; diff --git a/src/wallclock.c b/src/wallclock.c index 546750ba66..d3bbcf7a20 100644 --- a/src/wallclock.c +++ b/src/wallclock.c @@ -793,7 +793,7 @@ static void Task_SetClock2(u8 taskId) static void Task_SetClock3(u8 taskId) { - SetWindowBorderStyle(0, FALSE, 0x250, 0x0d); + DrawStdFrameWithCustomTileAndPalette(0, FALSE, 0x250, 0x0d); AddTextPrinterParameterized(0, 1, gText_IsThisTheCorrectTime, 0, 1, 0, NULL); PutWindowTilemap(0); schedule_bg_copy_tilemap_to_vram(0); @@ -812,7 +812,7 @@ static void Task_SetClock4(u8 taskId) case 1: //B button case -1: //NO PlaySE(SE_SELECT); - sub_8198070(0, FALSE); + ClearStdWindowAndFrameToTransparent(0, FALSE); ClearWindowTilemap(0); gTasks[taskId].func = Task_SetClock2; break; diff --git a/src/window.c b/src/window.c index 94e68cae5f..fbce57743d 100644 --- a/src/window.c +++ b/src/window.c @@ -6,6 +6,7 @@ u32 filler_03002F58; u32 filler_03002F5C; +// This global is set to 0 and never changed. u8 gTransparentTileNumber; u32 filler_03002F64; void *gUnknown_03002F70[4]; From 6cb4c677cdf156d9d78f5f27bf3168882c1447ec Mon Sep 17 00:00:00 2001 From: Phlosioneer Date: Tue, 26 Feb 2019 22:30:40 -0500 Subject: [PATCH 05/20] Fix backwards names --- asm/rom_8011DC0.s | 4 ++-- include/menu.h | 4 ++-- src/decoration.c | 10 +++++----- src/menu.c | 4 ++-- src/player_pc.c | 2 +- src/roulette.c | 4 ++-- src/script_menu.c | 2 +- src/secret_base.c | 2 +- src/start_menu.c | 8 ++++---- 9 files changed, 20 insertions(+), 20 deletions(-) diff --git a/asm/rom_8011DC0.s b/asm/rom_8011DC0.s index 9a77545a7a..c13ab9a96e 100644 --- a/asm/rom_8011DC0.s +++ b/asm/rom_8011DC0.s @@ -563,7 +563,7 @@ _080170CA: negs r0, r0 b _08017110 _080170D4: - bl DisplayYesNoMenuWithDefault + bl DisplayYesNoMenuDefaultYes ldrb r0, [r4] adds r0, 0x1 strb r0, [r4] @@ -26550,7 +26550,7 @@ _08024246: strb r0, [r5, 0xC] b _080242D8 _0802426A: - bl DisplayYesNoMenuWithDefault + bl DisplayYesNoMenuDefaultYes b _080242D0 _08024270: bl Menu_ProcessInputNoWrapClearOnChoose diff --git a/include/menu.h b/include/menu.h index ae89a1ab46..947f97a688 100644 --- a/include/menu.h +++ b/include/menu.h @@ -32,7 +32,7 @@ void PrintPlayerNameOnWindow(u8, const u8*, u16, u16); void DisplayItemMessageOnField(u8 taskId, const u8 *src, TaskFunc callback); void ClearDialogWindowAndFrame(u8 windowId, bool8 copyToVram); void SetStandardWindowBorderStyle(u8 a0, u8 a1); -void DisplayYesNoMenuWithDefault(void); +void DisplayYesNoMenuDefaultYes(void); u32 GetPlayerTextSpeed(void); u8 GetPlayerTextSpeedDelay(void); void sub_81978B0(u16 arg0); @@ -81,7 +81,7 @@ u8 sub_81983AC(u8 windowId, u8 fontId, u8 left, u8 top, u8 cursorHeight, u8 numC void sub_819786C(u8 windowId, bool8 copyToVram); void AddTextPrinterForMessage_2(bool8 allowSkippingDelayWithButtonPress); void RemoveStartMenuWindow(void); -void DisplayYesNoMenuWithDefaultDefaultNo(u8 initialCursorPos); +void DisplayYesNoMenuWithDefault(u8 initialCursorPos); void sub_819A344(u8 a0, u8 *dest, u8 color); void RemoveMapNamePopUpWindow(void); u8 GetMapNamePopUpWindowId(void); diff --git a/src/decoration.c b/src/decoration.c index 98c3ef0289..207cb1bf00 100644 --- a/src/decoration.c +++ b/src/decoration.c @@ -1628,7 +1628,7 @@ void sub_8128950(u8 taskId) void sub_81289D0(u8 taskId) { - DisplayYesNoMenuWithDefault(); + DisplayYesNoMenuDefaultYes(); DoYesNoFuncWithChoice(taskId, &gUnknown_085A72C4); } @@ -1693,7 +1693,7 @@ void sub_8128AAC(u8 taskId) void sub_8128B80(u8 taskId) { - DisplayYesNoMenuWithDefault(); + DisplayYesNoMenuDefaultYes(); DoYesNoFuncWithChoice(taskId, &gUnknown_085A72CC); } @@ -2588,7 +2588,7 @@ void sub_812A0E8(u8 taskId) void sub_812A1A0(u8 taskId) { - DisplayYesNoMenuWithDefault(); + DisplayYesNoMenuDefaultYes(); DoYesNoFuncWithChoice(taskId, &gUnknown_085A7348); } @@ -2601,7 +2601,7 @@ void sub_812A1C0(u8 taskId) void sub_812A1F0(u8 taskId) { - DisplayYesNoMenuWithDefault(); + DisplayYesNoMenuDefaultYes(); DoYesNoFuncWithChoice(taskId, &gUnknown_085A7350); } @@ -2725,7 +2725,7 @@ void sub_812A3D4(u8 taskId) void sub_812A458(u8 taskId) { - DisplayYesNoMenuWithDefault(); + DisplayYesNoMenuDefaultYes(); DoYesNoFuncWithChoice(taskId, &gUnknown_085A741C); } diff --git a/src/menu.c b/src/menu.c index 39d6f3fd16..753bd52a97 100644 --- a/src/menu.c +++ b/src/menu.c @@ -458,12 +458,12 @@ void DisplayItemMessageOnField(u8 taskId, const u8 *string, TaskFunc callback) CopyWindowToVram(0, 3); } -void DisplayYesNoMenuWithDefault(void) +void DisplayYesNoMenuDefaultYes(void) { CreateYesNoMenu(&sYesNo_WindowTemplates, STD_WINDOW_BASE_TILE_NUM, STD_WINDOW_PALETTE_NUM, 0); } -void DisplayYesNoMenuWithDefaultDefaultNo(u8 initialCursorPos) +void DisplayYesNoMenuWithDefault(u8 initialCursorPos) { CreateYesNoMenu(&sYesNo_WindowTemplates, STD_WINDOW_BASE_TILE_NUM, STD_WINDOW_PALETTE_NUM, initialCursorPos); } diff --git a/src/player_pc.c b/src/player_pc.c index 6ba5999ce8..028101edb9 100644 --- a/src/player_pc.c +++ b/src/player_pc.c @@ -761,7 +761,7 @@ static void Mailbox_MoveToBag(u8 taskId) static void Mailbox_DrawYesNoBeforeMove(u8 taskId) { - DisplayYesNoMenuWithDefault(); + DisplayYesNoMenuDefaultYes(); gTasks[taskId].func = Mailbox_MoveToBagYesNoPrompt; } diff --git a/src/roulette.c b/src/roulette.c index 4723e06878..e099e878cb 100644 --- a/src/roulette.c +++ b/src/roulette.c @@ -1043,7 +1043,7 @@ static void sub_81408A8(u8 taskId) static void sub_8140914(u8 taskId) { - DisplayYesNoMenuWithDefault(); + DisplayYesNoMenuDefaultYes(); DrawStdWindowFrame(gUnknown_0203AB8C, 0); AddTextPrinterParameterized(gUnknown_0203AB8C, 1, gUnknown_082A5C13, 0, 1, TEXT_SPEED_FF, 0); CopyWindowToVram(gUnknown_0203AB8C, 3); @@ -3256,7 +3256,7 @@ static const struct SpriteTemplate gUnknown_085B7AEC = static void sub_81428C4(u8 r0) { - DisplayYesNoMenuWithDefault(); + DisplayYesNoMenuDefaultYes(); DoYesNoFuncWithChoice(r0, &gUnknown_085B6408); } diff --git a/src/script_menu.c b/src/script_menu.c index ccbbcdfe16..4091918037 100644 --- a/src/script_menu.c +++ b/src/script_menu.c @@ -1202,7 +1202,7 @@ bool8 ScriptMenu_YesNo(u8 left, u8 top) else { gSpecialVar_Result = 0xFF; - DisplayYesNoMenuWithDefault(); + DisplayYesNoMenuDefaultYes(); taskId = CreateTask(Task_HandleYesNoInput, 0x50); return TRUE; } diff --git a/src/secret_base.c b/src/secret_base.c index 342a9960ad..f8480fef0b 100644 --- a/src/secret_base.c +++ b/src/secret_base.c @@ -1033,7 +1033,7 @@ void sub_80E9FFC(u8 taskId) void sub_80EA06C(u8 taskId) { - DisplayYesNoMenuWithDefault(); + DisplayYesNoMenuDefaultYes(); DoYesNoFuncWithChoice(taskId, &gUnknown_0858D058); } diff --git a/src/start_menu.c b/src/start_menu.c index f88630aee7..3fe1b7d614 100644 --- a/src/start_menu.c +++ b/src/start_menu.c @@ -961,7 +961,7 @@ static u8 SaveConfirmSaveCallback(void) static u8 SaveYesNoCallback(void) { - DisplayYesNoMenuWithDefault(); // Show Yes/No menu + DisplayYesNoMenuDefaultYes(); // Show Yes/No menu sSaveDialogCallback = SaveConfirmInputCallback; return SAVE_IN_PROGRESS; } @@ -1014,14 +1014,14 @@ static u8 SaveFileExistsCallback(void) static u8 SaveConfirmOverwriteDefaultNoCallback(void) { - DisplayYesNoMenuWithDefaultDefaultNo(1); // Show Yes/No menu (No selected as default) + DisplayYesNoMenuWithDefault(1); // Show Yes/No menu (No selected as default) sSaveDialogCallback = SaveOverwriteInputCallback; return SAVE_IN_PROGRESS; } static u8 SaveConfirmOverwriteCallback(void) { - DisplayYesNoMenuWithDefault(); // Show Yes/No menu + DisplayYesNoMenuDefaultYes(); // Show Yes/No menu sSaveDialogCallback = SaveOverwriteInputCallback; return SAVE_IN_PROGRESS; } @@ -1144,7 +1144,7 @@ static u8 BattlePyramidConfirmRetireCallback(void) static u8 BattlePyramidRetireYesNoCallback(void) { - DisplayYesNoMenuWithDefaultDefaultNo(1); // Show Yes/No menu (No selected as default) + DisplayYesNoMenuWithDefault(1); // Show Yes/No menu (No selected as default) sSaveDialogCallback = BattlePyramidRetireInputCallback; return SAVE_IN_PROGRESS; From b2c92ee8c5d8ea934b5c6c36cc4b06b66779d0fe Mon Sep 17 00:00:00 2001 From: Phlosioneer Date: Tue, 26 Feb 2019 22:45:39 -0500 Subject: [PATCH 06/20] Missed some fill values Must have forgotten to check FillWindowPixelRect. --- src/battle_pyramid_bag.c | 2 +- src/easy_chat.c | 4 ++-- src/field_specials.c | 4 ++-- src/item_menu.c | 2 +- src/menu.c | 4 ++-- src/party_menu.c | 5 +++-- src/player_pc.c | 2 +- src/pokedex.c | 6 +++--- src/pokemon_summary_screen.c | 12 ++++++------ src/trainer_card.c | 2 +- 10 files changed, 22 insertions(+), 21 deletions(-) diff --git a/src/battle_pyramid_bag.c b/src/battle_pyramid_bag.c index 20029b2845..dec8d4bcad 100644 --- a/src/battle_pyramid_bag.c +++ b/src/battle_pyramid_bag.c @@ -804,7 +804,7 @@ static void sub_81C5A98(u8 listMenuTaskId, u8 arg1) static void sub_81C5AB8(u8 y, u8 arg1) { if (arg1 == 0xFF) - FillWindowPixelRect(0, 0, 0, y, GetMenuCursorDimensionByFont(1, 0), GetMenuCursorDimensionByFont(1, 1)); + FillWindowPixelRect(0, PALETTE_NUM_TO_FILL_VALUE(0), 0, y, GetMenuCursorDimensionByFont(1, 0), GetMenuCursorDimensionByFont(1, 1)); else PrintOnWindow_Font1(0, gText_SelectorArrow2, 0, y, 0, 0, 0, arg1); } diff --git a/src/easy_chat.c b/src/easy_chat.c index afc4c6c5b5..5a3ebf69c9 100644 --- a/src/easy_chat.c +++ b/src/easy_chat.c @@ -4106,9 +4106,9 @@ static void sub_811D950(u8 arg0, u8 arg1) var1 = 0; } - FillWindowPixelRect(2, 0x11, 0, y, 224, var2); + FillWindowPixelRect(2, PALETTE_NUM_TO_FILL_VALUE(1), 0, y, 224, var2); if (var1) - FillWindowPixelRect(2, 0x11, 0, 0, 224, var1); + FillWindowPixelRect(2, PALETTE_NUM_TO_FILL_VALUE(1), 0, 0, 224, var1); } static void sub_811D9B4(void) diff --git a/src/field_specials.c b/src/field_specials.c index 1cf16e74ca..b4017f0ef5 100644 --- a/src/field_specials.c +++ b/src/field_specials.c @@ -3001,7 +3001,7 @@ static void sub_813AA60(u16 a0, u16 a1) if (a0 > 2 && a0 < 7) { - FillWindowPixelRect(0, 0x11, 0, 0, 216, 32); + FillWindowPixelRect(0, PALETTE_NUM_TO_FILL_VALUE(1), 0, 0, 216, 32); switch (a0) { case 3: @@ -3140,7 +3140,7 @@ static void sub_813AD34(u8 a0, u16 a1) if (a0 == 9 || a0 == 10) { - FillWindowPixelRect(gUnknown_0203AB5E, 0x11, 0, 0, 96, 48); + FillWindowPixelRect(gUnknown_0203AB5E, PALETTE_NUM_TO_FILL_VALUE(1), 0, 0, 96, 48); if (a0 == 10) { AddTextPrinterParameterized(gUnknown_0203AB5E, 1, gUnknown_085B3254[a1], 0, 1, 0, NULL); diff --git a/src/item_menu.c b/src/item_menu.c index f561ebb366..8ade67614d 100755 --- a/src/item_menu.c +++ b/src/item_menu.c @@ -896,7 +896,7 @@ void bag_menu_print_cursor_(u8 a, u8 b) void bag_menu_print_cursor(u8 a, u8 b) { if (b == 0xFF) - FillWindowPixelRect(0, 0, 0, a, GetMenuCursorDimensionByFont(1, 0), GetMenuCursorDimensionByFont(1, 1)); + FillWindowPixelRect(0, PALETTE_NUM_TO_FILL_VALUE(0), 0, a, GetMenuCursorDimensionByFont(1, 0), GetMenuCursorDimensionByFont(1, 1)); else bag_menu_print(0, 1, gText_SelectorArrow2, 0, a, 0, 0, 0, b); diff --git a/src/menu.c b/src/menu.c index 753bd52a97..6a181532ed 100644 --- a/src/menu.c +++ b/src/menu.c @@ -934,7 +934,7 @@ void RedrawMenuCursor(u8 oldPos, u8 newPos) width = GetMenuCursorDimensionByFont(sMenu.fontId, 0); height = GetMenuCursorDimensionByFont(sMenu.fontId, 1); - FillWindowPixelRect(sMenu.windowId, 0x11, sMenu.left, sMenu.optionHeight * oldPos + sMenu.top, width, height); + FillWindowPixelRect(sMenu.windowId, PALETTE_NUM_TO_FILL_VALUE(1), sMenu.left, sMenu.optionHeight * oldPos + sMenu.top, width, height); AddTextPrinterParameterized(sMenu.windowId, sMenu.fontId, gText_SelectorArrow3, sMenu.left, sMenu.optionHeight * newPos + sMenu.top, 0, 0); } @@ -1313,7 +1313,7 @@ void sub_8199060(u8 oldCursorPos, u8 newCursorPos) u8 xPos = (oldCursorPos % sMenu.horizontalCount) * sMenu.optionWidth + sMenu.left; u8 yPos = (oldCursorPos / sMenu.horizontalCount) * sMenu.optionHeight + sMenu.top; FillWindowPixelRect(sMenu.windowId, - 0x11, + PALETTE_NUM_TO_FILL_VALUE(1), xPos, yPos, cursorWidth, diff --git a/src/party_menu.c b/src/party_menu.c index ceb89ae305..03e267e74f 100755 --- a/src/party_menu.c +++ b/src/party_menu.c @@ -3479,8 +3479,9 @@ static void DisplayPartyPokemonHPBar(u16 hp, u16 maxhp, struct Struct203CEDC *pt FillWindowPixelRect(ptr->windowId, gUnknown_08615AB8[0], ptr->unk0->unk4[20], ptr->unk0->unk4[21] + 1, hpFraction, 2); if (hpFraction != ptr->unk0->unk4[22]) { - FillWindowPixelRect(ptr->windowId, 13, ptr->unk0->unk4[20] + hpFraction, ptr->unk0->unk4[21], ptr->unk0->unk4[22] - hpFraction, 1); - FillWindowPixelRect(ptr->windowId, 2, ptr->unk0->unk4[20] + hpFraction, ptr->unk0->unk4[21] + 1, ptr->unk0->unk4[22] - hpFraction, 2); + // This appears to be an alternating fill + FillWindowPixelRect(ptr->windowId, 0x0D, ptr->unk0->unk4[20] + hpFraction, ptr->unk0->unk4[21], ptr->unk0->unk4[22] - hpFraction, 1); + FillWindowPixelRect(ptr->windowId, 0x02, ptr->unk0->unk4[20] + hpFraction, ptr->unk0->unk4[21] + 1, ptr->unk0->unk4[22] - hpFraction, 2); } CopyWindowToVram(ptr->windowId, 2); } diff --git a/src/player_pc.c b/src/player_pc.c index 028101edb9..c088a6ce7f 100644 --- a/src/player_pc.c +++ b/src/player_pc.c @@ -1005,7 +1005,7 @@ static void sub_816BFE0(u8 y, u8 b, u8 speed) { u8 windowId = gUnknown_0203BCC4->windowIds[0]; if (b == 0xFF) - FillWindowPixelRect(windowId, 17, 0, y, GetMenuCursorDimensionByFont(1, 0), GetMenuCursorDimensionByFont(1, 1)); + FillWindowPixelRect(windowId, PALETTE_NUM_TO_FILL_VALUE(1), 0, y, GetMenuCursorDimensionByFont(1, 0), GetMenuCursorDimensionByFont(1, 1)); else AddTextPrinterParameterized4(windowId, 1, 0, y, 0, 0, gUnknown_085DFF8C, speed, gText_SelectorArrow2); } diff --git a/src/pokedex.c b/src/pokedex.c index 2e5e8f213d..f54fdbd295 100644 --- a/src/pokedex.c +++ b/src/pokedex.c @@ -2152,7 +2152,7 @@ static void CreateCaughtBall(u16 a, u8 x, u8 y, u16 unused) if (a) BlitBitmapToWindow(0, gUnknown_0855D2BE, x * 8, y * 8, 8, 16); else - FillWindowPixelRect(0, 0, x * 8, y * 8, 8, 16); + FillWindowPixelRect(0, PALETTE_NUM_TO_FILL_VALUE(0), x * 8, y * 8, 8, 16); } static u8 CreateMonName(u16 num, u8 left, u8 top) @@ -2170,7 +2170,7 @@ static u8 CreateMonName(u16 num, u8 left, u8 top) void sub_80BD28C(u8 x, u8 y, u16 unused) { - FillWindowPixelRect(0, 0, x * 8, y * 8, 0x60, 16); + FillWindowPixelRect(0, PALETTE_NUM_TO_FILL_VALUE(0), x * 8, y * 8, 0x60, 16); } static void CreateInitialPokemonSprites(u16 selectedMon, u16 b) @@ -4784,7 +4784,7 @@ void sub_80C1270(const u8 *str, u32 left, u32 top) void sub_80C12B0(u32 x, u32 y, u32 width, u32 height) { - FillWindowPixelRect(0, 0, x, y, width, height); + FillWindowPixelRect(0, PALETTE_NUM_TO_FILL_VALUE(0), x, y, width, height); } void sub_80C12E0(u8 taskId) diff --git a/src/pokemon_summary_screen.c b/src/pokemon_summary_screen.c index 0f88b7d732..f0c68e7d0e 100644 --- a/src/pokemon_summary_screen.c +++ b/src/pokemon_summary_screen.c @@ -3469,7 +3469,7 @@ static void PrintMovePowerAndAccuracy(u16 moveIndex) const u8 *text; if (moveIndex != 0) { - FillWindowPixelRect(14, 0, 53, 0, 19, 32); + FillWindowPixelRect(14, PALETTE_NUM_TO_FILL_VALUE(0), 53, 0, 19, 32); if (gBattleMoves[moveIndex].power < 2) { @@ -3619,7 +3619,7 @@ static void PrintNewMoveDetailsOrCancelText(void) static void sub_81C4064(void) { u8 windowId = AddWindowFromTemplateList(sPageMovesTemplate, 0); - FillWindowPixelRect(windowId, 0, 0, 66, 72, 16); + FillWindowPixelRect(windowId, PALETTE_NUM_TO_FILL_VALUE(0), 0, 66, 72, 16); CopyWindowToVram(windowId, 2); } @@ -3628,11 +3628,11 @@ static void sub_81C40A0(u8 moveIndex1, u8 moveIndex2) u8 windowId1 = AddWindowFromTemplateList(sPageMovesTemplate, 0); u8 windowId2 = AddWindowFromTemplateList(sPageMovesTemplate, 1); - FillWindowPixelRect(windowId1, 0, 0, moveIndex1 * 16, 0x48, 0x10); - FillWindowPixelRect(windowId1, 0, 0, moveIndex2 * 16, 0x48, 0x10); + FillWindowPixelRect(windowId1, PALETTE_NUM_TO_FILL_VALUE(0), 0, moveIndex1 * 16, 0x48, 0x10); + FillWindowPixelRect(windowId1, PALETTE_NUM_TO_FILL_VALUE(0), 0, moveIndex2 * 16, 0x48, 0x10); - FillWindowPixelRect(windowId2, 0, 0, moveIndex1 * 16, 0x30, 0x10); - FillWindowPixelRect(windowId2, 0, 0, moveIndex2 * 16, 0x30, 0x10); + FillWindowPixelRect(windowId2, PALETTE_NUM_TO_FILL_VALUE(0), 0, moveIndex1 * 16, 0x30, 0x10); + FillWindowPixelRect(windowId2, PALETTE_NUM_TO_FILL_VALUE(0), 0, moveIndex2 * 16, 0x30, 0x10); PrintMoveNameAndPP(moveIndex1); PrintMoveNameAndPP(moveIndex2); diff --git a/src/trainer_card.c b/src/trainer_card.c index 1f91916320..8d244d6563 100755 --- a/src/trainer_card.c +++ b/src/trainer_card.c @@ -1103,7 +1103,7 @@ static void PrintTimeOnCard(void) r10 = width + 30; r7 -= r10; - FillWindowPixelRect(1, 0, r7, r4, r10, 15); + FillWindowPixelRect(1, PALETTE_NUM_TO_FILL_VALUE(0), r7, r4, r10, 15); ConvertIntToDecimalStringN(gStringVar4, hours, 1, 3); AddTextPrinterParameterized3(1, 1, r7, r4, gUnknown_0856FB0C, TEXT_SPEED_FF, gStringVar4); r7 += 18; From 3716da5430a976d05afecdf82f43f14fc2584949 Mon Sep 17 00:00:00 2001 From: Phlosioneer Date: Sat, 2 Mar 2019 17:25:39 -0500 Subject: [PATCH 07/20] Rename macro with correct name for pixel values --- include/window.h | 2 +- src/battle_dome.c | 2 +- src/battle_factory_screen.c | 48 +++++++++--------- src/battle_interface.c | 2 +- src/battle_message.c | 94 ++++++++++++++++++------------------ src/battle_pyramid_bag.c | 20 ++++---- src/battle_records.c | 4 +- src/berry_blender.c | 6 +-- src/berry_fix_program.c | 8 +-- src/berry_tag_screen.c | 14 +++--- src/clear_save_data_screen.c | 4 +- src/coins.c | 2 +- src/contest.c | 14 +++--- src/contest_link_80F57C4.c | 2 +- src/contest_painting.c | 2 +- src/credits.c | 2 +- src/decoration.c | 6 +-- src/diploma.c | 2 +- src/easy_chat.c | 16 +++--- src/egg_hatch.c | 4 +- src/field_player_avatar.c | 6 +-- src/field_region_map.c | 4 +- src/field_specials.c | 8 +-- src/frontier_pass.c | 8 +-- src/frontier_util.c | 20 ++++---- src/hall_of_fame.c | 8 +-- src/item_menu.c | 30 ++++++------ src/learn_move.c | 6 +-- src/link.c | 8 +-- src/list_menu.c | 16 +++--- src/mail.c | 4 +- src/main_menu.c | 36 +++++++------- src/match_call.c | 6 +-- src/menu.c | 32 ++++++------ src/money.c | 2 +- src/mystery_event_menu.c | 4 +- src/naming_screen.c | 14 +++--- src/option_menu.c | 4 +- src/party_menu.c | 6 +-- src/player_pc.c | 6 +-- src/pokeblock.c | 4 +- src/pokeblock_feed.c | 2 +- src/pokedex.c | 14 +++--- src/pokemon_storage_system.c | 32 ++++++------ src/pokemon_summary_screen.c | 28 +++++------ src/pokenav.c | 4 +- src/region_map.c | 6 +-- src/rom_8011DC0.c | 8 +-- src/save_failed_screen.c | 16 +++--- src/scrcmd.c | 2 +- src/script_menu.c | 12 ++--- src/shop.c | 4 +- src/slot_machine.c | 4 +- src/start_menu.c | 2 +- src/starter_choose.c | 6 +-- src/text.c | 8 +-- src/trade.c | 18 +++---- src/trainer_card.c | 10 ++-- src/trainer_hill.c | 2 +- src/unk_text_util_2.c | 8 +-- 60 files changed, 336 insertions(+), 336 deletions(-) diff --git a/include/window.h b/include/window.h index ece1ecd21e..10e447789a 100644 --- a/include/window.h +++ b/include/window.h @@ -1,7 +1,7 @@ #ifndef GUARD_WINDOW_H #define GUARD_WINDOW_H -#define PALETTE_NUM_TO_FILL_VALUE(num) ((num) | ((num) << 4)) +#define PIXEL_FILL(num) ((num) | ((num) << 4)) enum { diff --git a/src/battle_dome.c b/src/battle_dome.c index 9ef66aac41..f86faeffb4 100644 --- a/src/battle_dome.c +++ b/src/battle_dome.c @@ -3794,7 +3794,7 @@ static void sub_8190CD4(u8 taskId) for (i = windowId; i < windowId + 9; i++) { CopyWindowToVram(i, 2); - FillWindowPixelBuffer(i, PALETTE_NUM_TO_FILL_VALUE(0)); + FillWindowPixelBuffer(i, PIXEL_FILL(0)); } gTasks[taskId].data[0] = 3; break; diff --git a/src/battle_factory_screen.c b/src/battle_factory_screen.c index d4abe3c96c..5cbe97702a 100644 --- a/src/battle_factory_screen.c +++ b/src/battle_factory_screen.c @@ -1786,14 +1786,14 @@ static void sub_819B958(u8 windowId) { gSprites[sFactorySelectScreen->menuCursor1SpriteId].invisible = TRUE; gSprites[sFactorySelectScreen->menuCursor2SpriteId].invisible = TRUE; - FillWindowPixelBuffer(windowId, PALETTE_NUM_TO_FILL_VALUE(0)); + FillWindowPixelBuffer(windowId, PIXEL_FILL(0)); CopyWindowToVram(windowId, 2); ClearWindowTilemap(windowId); } static void Select_PrintRentalPkmnString(void) { - FillWindowPixelBuffer(0, PALETTE_NUM_TO_FILL_VALUE(0)); + FillWindowPixelBuffer(0, PIXEL_FILL(0)); AddTextPrinterParameterized(0, 1, gText_RentalPkmn2, 2, 1, 0, NULL); CopyWindowToVram(0, 3); } @@ -1804,7 +1804,7 @@ static void Select_PrintMonSpecies(void) u8 x; u8 monId = sFactorySelectScreen->cursorPos; - FillWindowPixelBuffer(1, PALETTE_NUM_TO_FILL_VALUE(0)); + FillWindowPixelBuffer(1, PIXEL_FILL(0)); species = GetMonData(&sFactorySelectScreen->mons[monId].monData, MON_DATA_SPECIES, NULL); StringCopy(gStringVar4, gSpeciesNames[species]); x = GetStringRightAlignXOffset(1, gStringVar4, 86); @@ -1816,7 +1816,7 @@ static void Select_PrintSelectMonString(void) { const u8 *str = NULL; - FillWindowPixelBuffer(2, PALETTE_NUM_TO_FILL_VALUE(0)); + FillWindowPixelBuffer(2, PIXEL_FILL(0)); if (sFactorySelectScreen->selectingMonsState == 1) str = gText_SelectFirstPkmn; else if (sFactorySelectScreen->selectingMonsState == 2) @@ -1832,7 +1832,7 @@ static void Select_PrintSelectMonString(void) static void Select_PrintCantSelectSameMon(void) { - FillWindowPixelBuffer(2, PALETTE_NUM_TO_FILL_VALUE(0)); + FillWindowPixelBuffer(2, PIXEL_FILL(0)); AddTextPrinterParameterized(2, 1, gText_CantSelectSamePkmn, 2, 5, 0, NULL); CopyWindowToVram(2, 2); } @@ -1842,7 +1842,7 @@ static void Select_PrintMenuOptions(void) u8 selectedId = sFactorySelectScreen->mons[sFactorySelectScreen->cursorPos].selectedId; PutWindowTilemap(3); - FillWindowPixelBuffer(3, PALETTE_NUM_TO_FILL_VALUE(0)); + FillWindowPixelBuffer(3, PIXEL_FILL(0)); AddTextPrinterParameterized3(3, 1, 7, 1, gUnknown_08610476, 0, gText_Summary); if (selectedId != 0) AddTextPrinterParameterized3(3, 1, 7, 17, gUnknown_08610476, 0, gText_Deselect); @@ -1856,7 +1856,7 @@ static void Select_PrintMenuOptions(void) static void Select_PrintYesNoOptions(void) { PutWindowTilemap(4); - FillWindowPixelBuffer(4, PALETTE_NUM_TO_FILL_VALUE(0)); + FillWindowPixelBuffer(4, PIXEL_FILL(0)); AddTextPrinterParameterized3(4, 1, 7, 1, gUnknown_08610476, 0, gText_Yes2); AddTextPrinterParameterized3(4, 1, 7, 17, gUnknown_08610476, 0, gText_No2); CopyWindowToVram(4, 3); @@ -1924,7 +1924,7 @@ static void Select_PrintMonCategory(void) if (monId < SELECTABLE_MONS_COUNT) { PutWindowTilemap(5); - FillWindowPixelBuffer(5, PALETTE_NUM_TO_FILL_VALUE(0)); + FillWindowPixelBuffer(5, PIXEL_FILL(0)); species = GetMonData(&sFactorySelectScreen->mons[monId].monData, MON_DATA_SPECIES, NULL); CopyMonCategoryText(SpeciesToNationalPokedexNum(species), text); x = GetStringRightAlignXOffset(1, text, 0x76); @@ -2873,7 +2873,7 @@ static void sub_819D588(u8 taskId) case 3: if (!gPaletteFade.active) { - FillWindowPixelBuffer(5, PALETTE_NUM_TO_FILL_VALUE(0)); + FillWindowPixelBuffer(5, PIXEL_FILL(0)); CopyWindowToVram(5, 2); if (sFactorySwapScreen->inEnemyScreen == TRUE) { @@ -3002,7 +3002,7 @@ static void sub_819D770(u8 taskId) gTasks[taskId].data[0]++; break; case 6: - FillWindowPixelBuffer(5, PALETTE_NUM_TO_FILL_VALUE(0)); + FillWindowPixelBuffer(5, PIXEL_FILL(0)); CopyWindowToVram(5, 2); gTasks[taskId].data[0]++; break; @@ -3546,7 +3546,7 @@ static void sub_819EA64(u8 windowId) { gSprites[sFactorySwapScreen->menuCursor1SpriteId].invisible = TRUE; gSprites[sFactorySwapScreen->menuCursor2SpriteId].invisible = TRUE; - FillWindowPixelBuffer(windowId, PALETTE_NUM_TO_FILL_VALUE(0)); + FillWindowPixelBuffer(windowId, PIXEL_FILL(0)); CopyWindowToVram(windowId, 2); ClearWindowTilemap(windowId); } @@ -3554,14 +3554,14 @@ static void sub_819EA64(u8 windowId) static void sub_819EAC0(void) { PutWindowTilemap(1); - FillWindowPixelBuffer(1, PALETTE_NUM_TO_FILL_VALUE(0)); + FillWindowPixelBuffer(1, PIXEL_FILL(0)); CopyWindowToVram(1, 2); } static void sub_819EADC(void) { PutWindowTilemap(7); - FillWindowPixelBuffer(7, PALETTE_NUM_TO_FILL_VALUE(0)); + FillWindowPixelBuffer(7, PIXEL_FILL(0)); CopyWindowToVram(7, 2); } @@ -3569,13 +3569,13 @@ static void sub_819EAF8(void) { sub_819EAC0(); PutWindowTilemap(5); - FillWindowPixelBuffer(5, PALETTE_NUM_TO_FILL_VALUE(0)); + FillWindowPixelBuffer(5, PIXEL_FILL(0)); CopyWindowToVram(5, 2); } static void Swap_PrintPkmnSwap(void) { - FillWindowPixelBuffer(0, PALETTE_NUM_TO_FILL_VALUE(1)); + FillWindowPixelBuffer(0, PIXEL_FILL(1)); AddTextPrinterParameterized(0, 1, gText_PkmnSwap, 2, 1, 0, NULL); CopyWindowToVram(0, 3); } @@ -3585,7 +3585,7 @@ static void Swap_PrintMonSpecies(void) u16 species; u8 x; - FillWindowPixelBuffer(1, PALETTE_NUM_TO_FILL_VALUE(0)); + FillWindowPixelBuffer(1, PIXEL_FILL(0)); if (sFactorySwapScreen->cursorPos > 2) { CopyWindowToVram(1, 2); @@ -3606,7 +3606,7 @@ static void Swap_PrintMonSpecies(void) static void Swap_PrintOnInfoWindow(const u8 *str) { - FillWindowPixelBuffer(2, PALETTE_NUM_TO_FILL_VALUE(0)); + FillWindowPixelBuffer(2, PIXEL_FILL(0)); AddTextPrinterParameterized(2, 1, str, 2, 5, 0, NULL); CopyWindowToVram(2, 2); } @@ -3614,7 +3614,7 @@ static void Swap_PrintOnInfoWindow(const u8 *str) static void Swap_PrintMenuOptions(void) { PutWindowTilemap(3); - FillWindowPixelBuffer(3, PALETTE_NUM_TO_FILL_VALUE(0)); + FillWindowPixelBuffer(3, PIXEL_FILL(0)); AddTextPrinterParameterized3(3, 1, 15, 1, gUnknown_08610922, 0, gText_Summary2); AddTextPrinterParameterized3(3, 1, 15, 17, gUnknown_08610922, 0, gText_Swap); AddTextPrinterParameterized3(3, 1, 15, 33, gUnknown_08610922, 0, gText_Rechoose); @@ -3624,7 +3624,7 @@ static void Swap_PrintMenuOptions(void) static void Swap_PrintYesNoOptions(void) { PutWindowTilemap(4); - FillWindowPixelBuffer(4, PALETTE_NUM_TO_FILL_VALUE(0)); + FillWindowPixelBuffer(4, PIXEL_FILL(0)); AddTextPrinterParameterized3(4, 1, 7, 1, gUnknown_08610922, 0, gText_Yes3); AddTextPrinterParameterized3(4, 1, 7, 17, gUnknown_08610922, 0, gText_No3); CopyWindowToVram(4, 3); @@ -3638,7 +3638,7 @@ static void Swap_PrintActionString(const u8 *str, u32 y, u32 windowId) static void Swap_PrintActionStrings(void) { - FillWindowPixelBuffer(5, PALETTE_NUM_TO_FILL_VALUE(0)); + FillWindowPixelBuffer(5, PIXEL_FILL(0)); switch (sFactorySwapScreen->inEnemyScreen) { case TRUE: @@ -3652,7 +3652,7 @@ static void Swap_PrintActionStrings(void) static void Swap_PrintActionStrings2(void) { - FillWindowPixelBuffer(3, PALETTE_NUM_TO_FILL_VALUE(0)); + FillWindowPixelBuffer(3, PIXEL_FILL(0)); switch (sFactorySwapScreen->inEnemyScreen) { case TRUE: @@ -3693,7 +3693,7 @@ static void Swap_PrintMonSpecies2(void) LoadPalette(pal, 0xF0, 0xA); PutWindowTilemap(7); - FillWindowPixelBuffer(7, PALETTE_NUM_TO_FILL_VALUE(0)); + FillWindowPixelBuffer(7, PIXEL_FILL(0)); if (sFactorySwapScreen->cursorPos > 2) { CopyWindowToVram(7, 3); @@ -3745,7 +3745,7 @@ static void Swap_PrintMonCategory(void) u8 x; u8 monId = sFactorySwapScreen->cursorPos; - FillWindowPixelBuffer(8, PALETTE_NUM_TO_FILL_VALUE(0)); + FillWindowPixelBuffer(8, PIXEL_FILL(0)); if (monId > 2) { CopyWindowToVram(8, 2); @@ -3940,7 +3940,7 @@ static void Task_SwapCantHaveSameMons(u8 taskId) case 2: if (sFactorySwapScreen->unk30 != TRUE) { - FillWindowPixelBuffer(5, PALETTE_NUM_TO_FILL_VALUE(0)); + FillWindowPixelBuffer(5, PIXEL_FILL(0)); CopyWindowToVram(5, 2); gTasks[taskId].data[0]++; } diff --git a/src/battle_interface.c b/src/battle_interface.c index a86f0ea842..f2916012e1 100644 --- a/src/battle_interface.c +++ b/src/battle_interface.c @@ -2579,7 +2579,7 @@ static u8* AddTextPrinterAndCreateWindowOnHealthbox(const u8 *str, u32 x, u32 y, struct WindowTemplate winTemplate = sHealthboxWindowTemplate; winId = AddWindow(&winTemplate); - FillWindowPixelBuffer(winId, PALETTE_NUM_TO_FILL_VALUE(bgColor)); + FillWindowPixelBuffer(winId, PIXEL_FILL(bgColor)); color[0] = bgColor; color[1] = 1; diff --git a/src/battle_message.c b/src/battle_message.c index b203f0b3e1..6762cd4168 100644 --- a/src/battle_message.c +++ b/src/battle_message.c @@ -1357,7 +1357,7 @@ static const struct BattleWindowText sTextOnWindowsInfo_Normal[] = { // The corresponding WindowTemplate is gStandardBattleWindowTemplates[] within src/battle_bg.c { // 0 Standard battle message - .fillValue = PALETTE_NUM_TO_FILL_VALUE(0xF), + .fillValue = PIXEL_FILL(0xF), .fontId = 1, .x = 0, .y = 1, @@ -1369,7 +1369,7 @@ static const struct BattleWindowText sTextOnWindowsInfo_Normal[] = .shadowColor = 6, }, { // 1 "What will (pokemon) do?" - .fillValue = PALETTE_NUM_TO_FILL_VALUE(0xF), + .fillValue = PIXEL_FILL(0xF), .fontId = 1, .x = 1, .y = 1, @@ -1381,7 +1381,7 @@ static const struct BattleWindowText sTextOnWindowsInfo_Normal[] = .shadowColor = 6, }, { // 2 "Fight/Pokemon/Bag/Run" - .fillValue = PALETTE_NUM_TO_FILL_VALUE(0xE), + .fillValue = PIXEL_FILL(0xE), .fontId = 1, .x = 0, .y = 1, @@ -1393,7 +1393,7 @@ static const struct BattleWindowText sTextOnWindowsInfo_Normal[] = .shadowColor = 15, }, { // 3 Top left move - .fillValue = PALETTE_NUM_TO_FILL_VALUE(0xE), + .fillValue = PIXEL_FILL(0xE), .fontId = 7, .x = 0, .y = 1, @@ -1405,7 +1405,7 @@ static const struct BattleWindowText sTextOnWindowsInfo_Normal[] = .shadowColor = 15, }, { // 4 Top right move - .fillValue = PALETTE_NUM_TO_FILL_VALUE(0xE), + .fillValue = PIXEL_FILL(0xE), .fontId = 7, .x = 0, .y = 1, @@ -1417,7 +1417,7 @@ static const struct BattleWindowText sTextOnWindowsInfo_Normal[] = .shadowColor = 15, }, { // 5 Bottom left move - .fillValue = PALETTE_NUM_TO_FILL_VALUE(0xE), + .fillValue = PIXEL_FILL(0xE), .fontId = 7, .x = 0, .y = 1, @@ -1429,7 +1429,7 @@ static const struct BattleWindowText sTextOnWindowsInfo_Normal[] = .shadowColor = 15, }, { // 6 Bottom right move - .fillValue = PALETTE_NUM_TO_FILL_VALUE(0xE), + .fillValue = PIXEL_FILL(0xE), .fontId = 7, .x = 0, .y = 1, @@ -1441,7 +1441,7 @@ static const struct BattleWindowText sTextOnWindowsInfo_Normal[] = .shadowColor = 15, }, { // 7 "PP" - .fillValue = PALETTE_NUM_TO_FILL_VALUE(0xE), + .fillValue = PIXEL_FILL(0xE), .fontId = 7, .x = 0, .y = 1, @@ -1453,7 +1453,7 @@ static const struct BattleWindowText sTextOnWindowsInfo_Normal[] = .shadowColor = 11, }, { // 8 - .fillValue = PALETTE_NUM_TO_FILL_VALUE(0xE), + .fillValue = PIXEL_FILL(0xE), .fontId = 1, .x = 0, .y = 1, @@ -1465,7 +1465,7 @@ static const struct BattleWindowText sTextOnWindowsInfo_Normal[] = .shadowColor = 15, }, { // 9 PP remaining - .fillValue = PALETTE_NUM_TO_FILL_VALUE(0xE), + .fillValue = PIXEL_FILL(0xE), .fontId = 1, .x = 2, .y = 1, @@ -1477,7 +1477,7 @@ static const struct BattleWindowText sTextOnWindowsInfo_Normal[] = .shadowColor = 11, }, { // 10 "type" - .fillValue = PALETTE_NUM_TO_FILL_VALUE(0xE), + .fillValue = PIXEL_FILL(0xE), .fontId = 7, .x = 0, .y = 1, @@ -1489,7 +1489,7 @@ static const struct BattleWindowText sTextOnWindowsInfo_Normal[] = .shadowColor = 15, }, { // 11 "switch which?" - .fillValue = PALETTE_NUM_TO_FILL_VALUE(0xE), + .fillValue = PIXEL_FILL(0xE), .fontId = 7, .x = 0, .y = 1, @@ -1501,7 +1501,7 @@ static const struct BattleWindowText sTextOnWindowsInfo_Normal[] = .shadowColor = 15, }, { // 12 "gText_BattleYesNoChoice" - .fillValue = PALETTE_NUM_TO_FILL_VALUE(0xE), + .fillValue = PIXEL_FILL(0xE), .fontId = 1, .x = 0, .y = 1, @@ -1513,7 +1513,7 @@ static const struct BattleWindowText sTextOnWindowsInfo_Normal[] = .shadowColor = 15, }, { // 13 - .fillValue = PALETTE_NUM_TO_FILL_VALUE(0xE), + .fillValue = PIXEL_FILL(0xE), .fontId = 1, .x = 0, .y = 1, @@ -1525,7 +1525,7 @@ static const struct BattleWindowText sTextOnWindowsInfo_Normal[] = .shadowColor = 15, }, { // 14 - .fillValue = PALETTE_NUM_TO_FILL_VALUE(0), + .fillValue = PIXEL_FILL(0), .fontId = 1, .x = 32, .y = 1, @@ -1537,7 +1537,7 @@ static const struct BattleWindowText sTextOnWindowsInfo_Normal[] = .shadowColor = 2, }, { // 15 - .fillValue = PALETTE_NUM_TO_FILL_VALUE(0xE), + .fillValue = PIXEL_FILL(0xE), .fontId = 1, .x = -1, .y = 1, @@ -1549,7 +1549,7 @@ static const struct BattleWindowText sTextOnWindowsInfo_Normal[] = .shadowColor = 15, }, { // 16 - .fillValue = PALETTE_NUM_TO_FILL_VALUE(0xE), + .fillValue = PIXEL_FILL(0xE), .fontId = 1, .x = -1, .y = 1, @@ -1561,7 +1561,7 @@ static const struct BattleWindowText sTextOnWindowsInfo_Normal[] = .shadowColor = 15, }, { // 17 - .fillValue = PALETTE_NUM_TO_FILL_VALUE(0xE), + .fillValue = PIXEL_FILL(0xE), .fontId = 1, .x = -1, .y = 1, @@ -1573,7 +1573,7 @@ static const struct BattleWindowText sTextOnWindowsInfo_Normal[] = .shadowColor = 15, }, { // 18 - .fillValue = PALETTE_NUM_TO_FILL_VALUE(0xE), + .fillValue = PIXEL_FILL(0xE), .fontId = 1, .x = -1, .y = 1, @@ -1585,7 +1585,7 @@ static const struct BattleWindowText sTextOnWindowsInfo_Normal[] = .shadowColor = 15, }, { // 19 - .fillValue = PALETTE_NUM_TO_FILL_VALUE(0xE), + .fillValue = PIXEL_FILL(0xE), .fontId = 1, .x = -1, .y = 1, @@ -1597,7 +1597,7 @@ static const struct BattleWindowText sTextOnWindowsInfo_Normal[] = .shadowColor = 15, }, { // 20 - .fillValue = PALETTE_NUM_TO_FILL_VALUE(0xE), + .fillValue = PIXEL_FILL(0xE), .fontId = 1, .x = -1, .y = 1, @@ -1609,7 +1609,7 @@ static const struct BattleWindowText sTextOnWindowsInfo_Normal[] = .shadowColor = 15, }, { // 21 - .fillValue = PALETTE_NUM_TO_FILL_VALUE(0), + .fillValue = PIXEL_FILL(0), .fontId = 1, .x = -1, .y = 1, @@ -1621,7 +1621,7 @@ static const struct BattleWindowText sTextOnWindowsInfo_Normal[] = .shadowColor = 6, }, { // 22 - .fillValue = PALETTE_NUM_TO_FILL_VALUE(0), + .fillValue = PIXEL_FILL(0), .fontId = 1, .x = -1, .y = 1, @@ -1633,7 +1633,7 @@ static const struct BattleWindowText sTextOnWindowsInfo_Normal[] = .shadowColor = 6, }, { // 23 - .fillValue = PALETTE_NUM_TO_FILL_VALUE(0x0), + .fillValue = PIXEL_FILL(0x0), .fontId = 1, .x = -1, .y = 1, @@ -1649,7 +1649,7 @@ static const struct BattleWindowText sTextOnWindowsInfo_Normal[] = static const struct BattleWindowText sTextOnWindowsInfo_Arena[] = { { // 0 - .fillValue = PALETTE_NUM_TO_FILL_VALUE(0xF), + .fillValue = PIXEL_FILL(0xF), .fontId = 1, .x = 0, .y = 1, @@ -1661,7 +1661,7 @@ static const struct BattleWindowText sTextOnWindowsInfo_Arena[] = .shadowColor = 6, }, { // 1 - .fillValue = PALETTE_NUM_TO_FILL_VALUE(0xF), + .fillValue = PIXEL_FILL(0xF), .fontId = 1, .x = 1, .y = 1, @@ -1673,7 +1673,7 @@ static const struct BattleWindowText sTextOnWindowsInfo_Arena[] = .shadowColor = 6, }, { // 2 - .fillValue = PALETTE_NUM_TO_FILL_VALUE(0xE), + .fillValue = PIXEL_FILL(0xE), .fontId = 1, .x = 0, .y = 1, @@ -1685,7 +1685,7 @@ static const struct BattleWindowText sTextOnWindowsInfo_Arena[] = .shadowColor = 15, }, { // 3 - .fillValue = PALETTE_NUM_TO_FILL_VALUE(0xE), + .fillValue = PIXEL_FILL(0xE), .fontId = 7, .x = 0, .y = 1, @@ -1697,7 +1697,7 @@ static const struct BattleWindowText sTextOnWindowsInfo_Arena[] = .shadowColor = 15, }, { // 4 - .fillValue = PALETTE_NUM_TO_FILL_VALUE(0xE), + .fillValue = PIXEL_FILL(0xE), .fontId = 7, .x = 0, .y = 1, @@ -1709,7 +1709,7 @@ static const struct BattleWindowText sTextOnWindowsInfo_Arena[] = .shadowColor = 15, }, { // 5 - .fillValue = PALETTE_NUM_TO_FILL_VALUE(0xE), + .fillValue = PIXEL_FILL(0xE), .fontId = 7, .x = 0, .y = 1, @@ -1721,7 +1721,7 @@ static const struct BattleWindowText sTextOnWindowsInfo_Arena[] = .shadowColor = 15, }, { // 6 - .fillValue = PALETTE_NUM_TO_FILL_VALUE(0xE), + .fillValue = PIXEL_FILL(0xE), .fontId = 7, .x = 0, .y = 1, @@ -1733,7 +1733,7 @@ static const struct BattleWindowText sTextOnWindowsInfo_Arena[] = .shadowColor = 15, }, { // 7 - .fillValue = PALETTE_NUM_TO_FILL_VALUE(0xE), + .fillValue = PIXEL_FILL(0xE), .fontId = 7, .x = 0, .y = 1, @@ -1745,7 +1745,7 @@ static const struct BattleWindowText sTextOnWindowsInfo_Arena[] = .shadowColor = 11, }, { // 8 - .fillValue = PALETTE_NUM_TO_FILL_VALUE(0xE), + .fillValue = PIXEL_FILL(0xE), .fontId = 1, .x = 0, .y = 1, @@ -1757,7 +1757,7 @@ static const struct BattleWindowText sTextOnWindowsInfo_Arena[] = .shadowColor = 15, }, { // 9 - .fillValue = PALETTE_NUM_TO_FILL_VALUE(0xE), + .fillValue = PIXEL_FILL(0xE), .fontId = 1, .x = 2, .y = 1, @@ -1769,7 +1769,7 @@ static const struct BattleWindowText sTextOnWindowsInfo_Arena[] = .shadowColor = 11, }, { // 10 - .fillValue = PALETTE_NUM_TO_FILL_VALUE(0xE), + .fillValue = PIXEL_FILL(0xE), .fontId = 7, .x = 0, .y = 1, @@ -1781,7 +1781,7 @@ static const struct BattleWindowText sTextOnWindowsInfo_Arena[] = .shadowColor = 15, }, { // 11 - .fillValue = PALETTE_NUM_TO_FILL_VALUE(0xE), + .fillValue = PIXEL_FILL(0xE), .fontId = 7, .x = 0, .y = 1, @@ -1793,7 +1793,7 @@ static const struct BattleWindowText sTextOnWindowsInfo_Arena[] = .shadowColor = 15, }, { // 12 - .fillValue = PALETTE_NUM_TO_FILL_VALUE(0xE), + .fillValue = PIXEL_FILL(0xE), .fontId = 1, .x = 0, .y = 1, @@ -1805,7 +1805,7 @@ static const struct BattleWindowText sTextOnWindowsInfo_Arena[] = .shadowColor = 15, }, { // 13 - .fillValue = PALETTE_NUM_TO_FILL_VALUE(0xE), + .fillValue = PIXEL_FILL(0xE), .fontId = 1, .x = 0, .y = 1, @@ -1817,7 +1817,7 @@ static const struct BattleWindowText sTextOnWindowsInfo_Arena[] = .shadowColor = 15, }, { // 14 - .fillValue = PALETTE_NUM_TO_FILL_VALUE(0), + .fillValue = PIXEL_FILL(0), .fontId = 1, .x = 32, .y = 1, @@ -1829,7 +1829,7 @@ static const struct BattleWindowText sTextOnWindowsInfo_Arena[] = .shadowColor = 2, }, { // 15 - .fillValue = PALETTE_NUM_TO_FILL_VALUE(0xE), + .fillValue = PIXEL_FILL(0xE), .fontId = 1, .x = -1, .y = 1, @@ -1841,7 +1841,7 @@ static const struct BattleWindowText sTextOnWindowsInfo_Arena[] = .shadowColor = 15, }, { // 16 - .fillValue = PALETTE_NUM_TO_FILL_VALUE(0xE), + .fillValue = PIXEL_FILL(0xE), .fontId = 1, .x = -1, .y = 1, @@ -1853,7 +1853,7 @@ static const struct BattleWindowText sTextOnWindowsInfo_Arena[] = .shadowColor = 15, }, { // 17 - .fillValue = PALETTE_NUM_TO_FILL_VALUE(0xE), + .fillValue = PIXEL_FILL(0xE), .fontId = 1, .x = -1, .y = 1, @@ -1865,7 +1865,7 @@ static const struct BattleWindowText sTextOnWindowsInfo_Arena[] = .shadowColor = 15, }, { // 18 - .fillValue = PALETTE_NUM_TO_FILL_VALUE(0xE), + .fillValue = PIXEL_FILL(0xE), .fontId = 1, .x = -1, .y = 1, @@ -1877,7 +1877,7 @@ static const struct BattleWindowText sTextOnWindowsInfo_Arena[] = .shadowColor = 15, }, { // 19 - .fillValue = PALETTE_NUM_TO_FILL_VALUE(0xE), + .fillValue = PIXEL_FILL(0xE), .fontId = 1, .x = -1, .y = 1, @@ -1889,7 +1889,7 @@ static const struct BattleWindowText sTextOnWindowsInfo_Arena[] = .shadowColor = 15, }, { // 20 - .fillValue = PALETTE_NUM_TO_FILL_VALUE(0xE), + .fillValue = PIXEL_FILL(0xE), .fontId = 1, .x = -1, .y = 1, @@ -1901,7 +1901,7 @@ static const struct BattleWindowText sTextOnWindowsInfo_Arena[] = .shadowColor = 15, }, { // 21 - .fillValue = PALETTE_NUM_TO_FILL_VALUE(0xE), + .fillValue = PIXEL_FILL(0xE), .fontId = 1, .x = -1, .y = 1, @@ -1913,7 +1913,7 @@ static const struct BattleWindowText sTextOnWindowsInfo_Arena[] = .shadowColor = 15, }, { // 22 - .fillValue = PALETTE_NUM_TO_FILL_VALUE(0x1), + .fillValue = PIXEL_FILL(0x1), .fontId = 1, .x = 0, .y = 1, diff --git a/src/battle_pyramid_bag.c b/src/battle_pyramid_bag.c index dec8d4bcad..2e13ea08ba 100644 --- a/src/battle_pyramid_bag.c +++ b/src/battle_pyramid_bag.c @@ -651,7 +651,7 @@ static void PrintItemDescription(s32 listMenuId) StringExpandPlaceholders(gStringVar4, gText_ReturnToVar1); desc = gStringVar4; } - FillWindowPixelBuffer(1, PALETTE_NUM_TO_FILL_VALUE(0)); + FillWindowPixelBuffer(1, PIXEL_FILL(0)); PrintOnWindow_Font1(1, desc, 3, 0, 0, 1, 0, 0); } @@ -804,7 +804,7 @@ static void sub_81C5A98(u8 listMenuTaskId, u8 arg1) static void sub_81C5AB8(u8 y, u8 arg1) { if (arg1 == 0xFF) - FillWindowPixelRect(0, PALETTE_NUM_TO_FILL_VALUE(0), 0, y, GetMenuCursorDimensionByFont(1, 0), GetMenuCursorDimensionByFont(1, 1)); + FillWindowPixelRect(0, PIXEL_FILL(0), 0, y, GetMenuCursorDimensionByFont(1, 0), GetMenuCursorDimensionByFont(1, 1)); else PrintOnWindow_Font1(0, gText_SelectorArrow2, 0, y, 0, 0, 0, arg1); } @@ -911,7 +911,7 @@ static void sub_81C5D20(u8 taskId) CopyItemName(gSpecialVar_ItemId, gStringVar1); StringExpandPlaceholders(gStringVar4, gText_Var1IsSelected); - FillWindowPixelBuffer(1, PALETTE_NUM_TO_FILL_VALUE(0)); + FillWindowPixelBuffer(1, PIXEL_FILL(0)); PrintOnWindow_Font1(1, gStringVar4, 3, 0, 0, 1, 0, 0); if (gPyramidBagResources->menuActionsCount == 1) sub_81C5EAC(sub_81C6D24(0)); @@ -1048,7 +1048,7 @@ static void BagAction_UseOnField(u8 taskId) else if (ItemId_GetFieldFunc(gSpecialVar_ItemId) != NULL) { sub_81C61A8(); - FillWindowPixelBuffer(1, PALETTE_NUM_TO_FILL_VALUE(0)); + FillWindowPixelBuffer(1, PIXEL_FILL(0)); schedule_bg_copy_tilemap_to_vram(0); ItemId_GetFieldFunc(gSpecialVar_ItemId)(taskId); } @@ -1086,7 +1086,7 @@ static void BagAction_Toss(u8 taskId) { CopyItemName(gSpecialVar_ItemId, gStringVar1); StringExpandPlaceholders(gStringVar4, gText_TossHowManyVar1s); - FillWindowPixelBuffer(1, PALETTE_NUM_TO_FILL_VALUE(0)); + FillWindowPixelBuffer(1, PIXEL_FILL(0)); PrintOnWindow_Font1(1, gStringVar4, 3, 0, 0, 1, 0, 0); sub_81C6404(); gTasks[taskId].func = sub_81C64B4; @@ -1100,7 +1100,7 @@ static void sub_81C6350(u8 taskId) CopyItemName(gSpecialVar_ItemId, gStringVar1); ConvertIntToDecimalStringN(gStringVar2, data[8], STR_CONV_MODE_LEFT_ALIGN, 2); StringExpandPlaceholders(gStringVar4, gText_ConfirmTossItems); - FillWindowPixelBuffer(1, PALETTE_NUM_TO_FILL_VALUE(0)); + FillWindowPixelBuffer(1, PIXEL_FILL(0)); PrintOnWindow_Font1(1, gStringVar4, 3, 0, 0, 1, 0, 0); sub_81C6DAC(taskId, &sYesNoTossFuncions); } @@ -1168,7 +1168,7 @@ static void TossItem(u8 taskId) CopyItemName(gSpecialVar_ItemId, gStringVar1); ConvertIntToDecimalStringN(gStringVar2, data[8], STR_CONV_MODE_LEFT_ALIGN, 2); StringExpandPlaceholders(gStringVar4, gText_ThrewAwayVar2Var1s); - FillWindowPixelBuffer(1, PALETTE_NUM_TO_FILL_VALUE(0)); + FillWindowPixelBuffer(1, PIXEL_FILL(0)); PrintOnWindow_Font1(1, gStringVar4, 3, 0, 0, 1, 0, 0); gTasks[taskId].func = sub_81C65CC; } @@ -1265,7 +1265,7 @@ static void Task_BeginItemSwap(u8 taskId) ListMenuSetUnkIndicatorsStructField(data[0], 0x10, 1); CopyItemName(gSaveBlock2Ptr->frontier.pyramidBag.itemId[gSaveBlock2Ptr->frontier.lvlMode][data[1]], gStringVar1); StringExpandPlaceholders(gStringVar4, gText_MoveVar1Where); - FillWindowPixelBuffer(1, PALETTE_NUM_TO_FILL_VALUE(0)); + FillWindowPixelBuffer(1, PIXEL_FILL(0)); PrintOnWindow_Font1(1, gStringVar4, 3, 0, 0, 1, 0, 0); sub_81C5A98(data[0], 1); sub_81C704C(data[1]); @@ -1395,7 +1395,7 @@ static void sub_81C6BD8(void) LoadPalette(gUnknown_0860F074, 0xF0, 0x20); for (i = 0; i < 5; i++) - FillWindowPixelBuffer(i, PALETTE_NUM_TO_FILL_VALUE(0)); + FillWindowPixelBuffer(i, PIXEL_FILL(0)); PutWindowTilemap(0); PutWindowTilemap(1); @@ -1456,7 +1456,7 @@ static void sub_81C6DAC(u8 taskId, const struct YesNoFuncTable *yesNoTable) void DisplayItemMessageInBattlePyramid(u8 taskId, const u8 *str, void (*callback)(u8 taskId)) { - FillWindowPixelBuffer(2, PALETTE_NUM_TO_FILL_VALUE(1)); + FillWindowPixelBuffer(2, PIXEL_FILL(1)); DisplayMessageAndContinueTask(taskId, 2, 0xA, 0xD, 1, GetPlayerTextSpeedDelay(), str, callback); schedule_bg_copy_tilemap_to_vram(1); } diff --git a/src/battle_records.c b/src/battle_records.c index 03d2088b4f..6997e40dd0 100644 --- a/src/battle_records.c +++ b/src/battle_records.c @@ -321,7 +321,7 @@ void ShowLinkBattleRecords(void) gRecordsWindowId = AddWindow(&sLinkBattleRecordsWindow); DrawStdWindowFrame(gRecordsWindowId, FALSE); - FillWindowPixelBuffer(gRecordsWindowId, PALETTE_NUM_TO_FILL_VALUE(1)); + FillWindowPixelBuffer(gRecordsWindowId, PIXEL_FILL(1)); StringExpandPlaceholders(gStringVar4, gText_PlayersBattleResults); x = GetStringCenterAlignXOffset(1, gStringVar4, 208); @@ -383,7 +383,7 @@ static void Task_ExitTrainerHillRecords(u8 taskId) static void RemoveTrainerHillRecordsWindow(u8 windowId) { - FillWindowPixelBuffer(windowId, PALETTE_NUM_TO_FILL_VALUE(0)); + FillWindowPixelBuffer(windowId, PIXEL_FILL(0)); ClearWindowTilemap(windowId); CopyWindowToVram(windowId, 2); RemoveWindow(windowId); diff --git a/src/berry_blender.c b/src/berry_blender.c index 35749db544..0241fa26dc 100644 --- a/src/berry_blender.c +++ b/src/berry_blender.c @@ -945,7 +945,7 @@ static void InitBerryBlenderWindows(void) DeactivateAllTextPrinters(); for (i = 0; i < 5; i++) - FillWindowPixelBuffer(i, PALETTE_NUM_TO_FILL_VALUE(0)); + FillWindowPixelBuffer(i, PIXEL_FILL(0)); FillBgTilemapBufferRect_Palette0(0, 0, 0, 0, 0x1E, 0x14); sub_81978B0(0xE0); @@ -3538,7 +3538,7 @@ void ShowBerryBlenderRecordWindow(void) winTemplate = sBlenderRecordWindowTemplate; gRecordsWindowId = AddWindow(&winTemplate); DrawStdWindowFrame(gRecordsWindowId, 0); - FillWindowPixelBuffer(gRecordsWindowId, PALETTE_NUM_TO_FILL_VALUE(1)); + FillWindowPixelBuffer(gRecordsWindowId, PIXEL_FILL(1)); xPos = GetStringCenterAlignXOffset(1, gText_BlenderMaxSpeedRecord, 0x90); AddTextPrinterParameterized(gRecordsWindowId, 1, gText_BlenderMaxSpeedRecord, xPos, 1, 0, NULL); @@ -3647,7 +3647,7 @@ static void Blender_AddTextPrinter(u8 windowId, const u8 *string, u8 x, u8 y, s3 if (caseId != 3) { - FillWindowPixelBuffer(windowId, PALETTE_NUM_TO_FILL_VALUE(txtColor[0])); + FillWindowPixelBuffer(windowId, PIXEL_FILL(txtColor[0])); } AddTextPrinterParameterized4(windowId, 1, x, y, letterSpacing, 1, txtColor, speed, string); diff --git a/src/berry_fix_program.c b/src/berry_fix_program.c index 24198fc870..37be569f8e 100644 --- a/src/berry_fix_program.c +++ b/src/berry_fix_program.c @@ -226,9 +226,9 @@ static void berry_fix_gpu_set(void) DmaCopy32(3, sUnknown_08618138, BG_PLTT + 0x1E0, 0x20); SetGpuReg(REG_OFFSET_DISPCNT, DISPCNT_OBJ_1D_MAP); - FillWindowPixelBuffer(2, PALETTE_NUM_TO_FILL_VALUE(0)); - FillWindowPixelBuffer(3, PALETTE_NUM_TO_FILL_VALUE(0)); - FillWindowPixelBuffer(0, PALETTE_NUM_TO_FILL_VALUE(0xA)); + FillWindowPixelBuffer(2, PIXEL_FILL(0)); + FillWindowPixelBuffer(3, PIXEL_FILL(0)); + FillWindowPixelBuffer(0, PIXEL_FILL(0xA)); width = GetStringWidth(0, sUnknown_08617E9B, 0); left = (0x78 - width) / 2; @@ -273,7 +273,7 @@ static int berry_fix_text_update(int checkval) static void berry_fix_text_print(int scene) { FillBgTilemapBufferRect_Palette0(0, 0, 0, 0, 32, 32); - FillWindowPixelBuffer(1, PALETTE_NUM_TO_FILL_VALUE(0xA)); + FillWindowPixelBuffer(1, PIXEL_FILL(0xA)); AddTextPrinterParameterized3(1, 1, 0, 0, sUnknown_08618158, -1, gUnknown_08618160[scene]); PutWindowTilemap(1); CopyWindowToVram(1, 2); diff --git a/src/berry_tag_screen.c b/src/berry_tag_screen.c index 7b69357786..a7cf4daf21 100644 --- a/src/berry_tag_screen.c +++ b/src/berry_tag_screen.c @@ -381,7 +381,7 @@ static void PrintTextInBerryTagScreen(u8 windowId, const u8 *text, u8 x, u8 y, s static void AddBerryTagTextToBg0(void) { memcpy(GetBgTilemapBuffer(0), sBerryTag->tilemapBuffers[2], sizeof(sBerryTag->tilemapBuffers[2])); - FillWindowPixelBuffer(WIN_BERRY_TAG, PALETTE_NUM_TO_FILL_VALUE(15)); + FillWindowPixelBuffer(WIN_BERRY_TAG, PIXEL_FILL(15)); PrintTextInBerryTagScreen(WIN_BERRY_TAG, gText_BerryTag, GetStringCenterAlignXOffset(1, gText_BerryTag, 0x40), 1, 0, 1); PutWindowTilemap(WIN_BERRY_TAG); schedule_bg_copy_tilemap_to_vram(0); @@ -598,7 +598,7 @@ static void Task_DisplayAnotherBerry(u8 taskId) switch (data[0]) { case 0x30: - FillWindowPixelBuffer(0, PALETTE_NUM_TO_FILL_VALUE(0)); + FillWindowPixelBuffer(0, PIXEL_FILL(0)); break; case 0x40: PrintBerryNumberAndName(); @@ -608,7 +608,7 @@ static void Task_DisplayAnotherBerry(u8 taskId) CreateBerrySprite(); break; case 0x60: - FillWindowPixelBuffer(1, PALETTE_NUM_TO_FILL_VALUE(0)); + FillWindowPixelBuffer(1, PIXEL_FILL(0)); break; case 0x70: PrintBerrySize(); @@ -620,7 +620,7 @@ static void Task_DisplayAnotherBerry(u8 taskId) SetFlavorCirclesVisiblity(); break; case 0xA0: - FillWindowPixelBuffer(2, PALETTE_NUM_TO_FILL_VALUE(0)); + FillWindowPixelBuffer(2, PIXEL_FILL(0)); break; case 0xB0: PrintBerryDescription1(); @@ -635,7 +635,7 @@ static void Task_DisplayAnotherBerry(u8 taskId) switch (data[0]) { case 0x30: - FillWindowPixelBuffer(2, PALETTE_NUM_TO_FILL_VALUE(0)); + FillWindowPixelBuffer(2, PIXEL_FILL(0)); break; case 0x40: PrintBerryDescription2(); @@ -647,7 +647,7 @@ static void Task_DisplayAnotherBerry(u8 taskId) SetFlavorCirclesVisiblity(); break; case 0x70: - FillWindowPixelBuffer(1, PALETTE_NUM_TO_FILL_VALUE(0)); + FillWindowPixelBuffer(1, PIXEL_FILL(0)); break; case 0x80: PrintBerryFirmness(); @@ -660,7 +660,7 @@ static void Task_DisplayAnotherBerry(u8 taskId) CreateBerrySprite(); break; case 0xB0: - FillWindowPixelBuffer(0, PALETTE_NUM_TO_FILL_VALUE(0)); + FillWindowPixelBuffer(0, PIXEL_FILL(0)); break; case 0xC0: PrintBerryNumberAndName(); diff --git a/src/clear_save_data_screen.c b/src/clear_save_data_screen.c index 619b394105..c1d6930c70 100644 --- a/src/clear_save_data_screen.c +++ b/src/clear_save_data_screen.c @@ -90,7 +90,7 @@ static void Task_ClearSaveDataScreenYesNoChoice(u8 taskId) switch (Menu_ProcessInputNoWrapClearOnChoose()) { case 0: - FillWindowPixelBuffer(0, PALETTE_NUM_TO_FILL_VALUE(1)); + FillWindowPixelBuffer(0, PIXEL_FILL(1)); AddTextPrinterParameterized(0, 1, gText_ClearingData, 0, 1, 0, 0); gTasks[taskId].func = Task_ClearSaveData; break; @@ -203,7 +203,7 @@ static void InitClearSaveDataScreenWindows(void) { InitWindows(sClearSaveTextWindow); DeactivateAllTextPrinters(); - FillWindowPixelBuffer(0, PALETTE_NUM_TO_FILL_VALUE(0)); + FillWindowPixelBuffer(0, PIXEL_FILL(0)); LoadWindowGfx(0, 0, 2, 224); LoadPalette(gUnknown_0860F074, 0xF0, 0x20); } diff --git a/src/coins.c b/src/coins.c index a8d8eae065..b838c303ee 100644 --- a/src/coins.c +++ b/src/coins.c @@ -27,7 +27,7 @@ void ShowCoinsWindow(u32 coinAmount, u8 x, u8 y) struct WindowTemplate template; SetWindowTemplateFields(&template, 0, x, y, 8, 2, 0xF, 0x141); sCoinsWindowId = AddWindow(&template); - FillWindowPixelBuffer(sCoinsWindowId, PALETTE_NUM_TO_FILL_VALUE(0)); + FillWindowPixelBuffer(sCoinsWindowId, PIXEL_FILL(0)); PutWindowTilemap(sCoinsWindowId); DrawStdFrameWithCustomTileAndPalette(sCoinsWindowId, FALSE, 0x214, 0xE); PrintCoinsString(coinAmount); diff --git a/src/contest.c b/src/contest.c index f668baf922..e9353596b0 100644 --- a/src/contest.c +++ b/src/contest.c @@ -819,7 +819,7 @@ static void sub_80D8490(u8 taskId) } r5 = StringCopy(r5, gMoveNames[move]); - FillWindowPixelBuffer(i + 5, PALETTE_NUM_TO_FILL_VALUE(0)); + FillWindowPixelBuffer(i + 5, PIXEL_FILL(0)); Contest_PrintTextToBg0WindowAt(i + 5, sp8, 5, 1, 7); } @@ -941,7 +941,7 @@ static void sub_80D895C(u8 taskId) for (i = 0; i < 4; i++) { - FillWindowPixelBuffer(5 + i, PALETTE_NUM_TO_FILL_VALUE(0)); + FillWindowPixelBuffer(5 + i, PIXEL_FILL(0)); PutWindowTilemap(5 + i); CopyWindowToVram(5 + i, 2); } @@ -2258,7 +2258,7 @@ static void sub_80DAEA4(void) for (i = 0; i < 4; i++) { - FillWindowPixelBuffer(gUnknown_02039F26[i], PALETTE_NUM_TO_FILL_VALUE(0)); + FillWindowPixelBuffer(gUnknown_02039F26[i], PIXEL_FILL(0)); sub_80DAF04(i); sub_80DAF88(i); } @@ -2478,7 +2478,7 @@ static void prints_contest_move_description(u16 a) ContestBG_FillBoxWithTile(0, 0x5036, 0x15, 0x20, 0x08, 0x01, 0x11); ContestBG_FillBoxWithTile(0, 0x5014, 0x15, 0x20, numHearts, 0x01, 0x11); - FillWindowPixelBuffer(10, PALETTE_NUM_TO_FILL_VALUE(0)); + FillWindowPixelBuffer(10, PIXEL_FILL(0)); Contest_PrintTextToBg0WindowStd(10, gContestEffectDescriptionPointers[gContestMoves[a].effect]); Contest_PrintTextToBg0WindowStd(9, gText_Slash); } @@ -2621,7 +2621,7 @@ static void sub_80DB884(void) static void sub_80DB89C(void) { - FillWindowPixelBuffer(4, PALETTE_NUM_TO_FILL_VALUE(0)); + FillWindowPixelBuffer(4, PIXEL_FILL(0)); CopyWindowToVram(4, 2); Contest_SetBgCopyFlags(0); } @@ -3456,7 +3456,7 @@ static void sub_80DCD48(void) break; default: for (i = 0; i < 4; i++) - FillWindowPixelBuffer(i, PALETTE_NUM_TO_FILL_VALUE(0)); + FillWindowPixelBuffer(i, PIXEL_FILL(0)); for (i = 0; i < 4; i++) { value = sContestantStatus[i].unk4; @@ -5038,7 +5038,7 @@ static void sub_80DF750(void) return; for (i = 0; i < 4; i++) - FillWindowPixelBuffer(i, PALETTE_NUM_TO_FILL_VALUE(0)); + FillWindowPixelBuffer(i, PIXEL_FILL(0)); if (gHeap[0x1A000] == 2) { diff --git a/src/contest_link_80F57C4.c b/src/contest_link_80F57C4.c index f2b708db40..b2ce527578 100644 --- a/src/contest_link_80F57C4.c +++ b/src/contest_link_80F57C4.c @@ -935,7 +935,7 @@ static void sub_80F6AE8(void) // windowTemplate.width = 30; // windowTemplate.height = 2; // windowId = AddWindow(&windowTemplate); -// FillWindowPixelBuffer(windowId, PALETTE_NUM_TO_FILL_VALUE(1)); +// FillWindowPixelBuffer(windowId, PIXEL_FILL(1)); // origWidth = GetStringWidth(1, text, 0) + 9; // strWidth = origWidth; // if (strWidth < 0) diff --git a/src/contest_painting.c b/src/contest_painting.c index b961c7a659..931deb01bf 100644 --- a/src/contest_painting.c +++ b/src/contest_painting.c @@ -279,7 +279,7 @@ static void InitContestPaintingWindow(void) SetBgTilemapBuffer(1, AllocZeroed(BG_SCREEN_SIZE)); gContestPaintingWindowId = AddWindow(&gUnknown_085B07EC); DeactivateAllTextPrinters(); - FillWindowPixelBuffer(gContestPaintingWindowId, PALETTE_NUM_TO_FILL_VALUE(0)); + FillWindowPixelBuffer(gContestPaintingWindowId, PIXEL_FILL(0)); PutWindowTilemap(gContestPaintingWindowId); CopyWindowToVram(gContestPaintingWindowId, 3); ShowBg(1); diff --git a/src/credits.c b/src/credits.c index 66f9f7ea87..4483e3160f 100644 --- a/src/credits.c +++ b/src/credits.c @@ -1592,7 +1592,7 @@ static void sub_8175DA0(u8 taskIdB) case 5: if (!gPaletteFade.active) { - FillWindowPixelBuffer(0, PALETTE_NUM_TO_FILL_VALUE(0)); + FillWindowPixelBuffer(0, PIXEL_FILL(0)); CopyWindowToVram(0, 2); gTasks[taskIdB].data[TDB_0] = 2; } diff --git a/src/decoration.c b/src/decoration.c index 207cb1bf00..8f6c9c4496 100644 --- a/src/decoration.c +++ b/src/decoration.c @@ -543,7 +543,7 @@ void sub_8126B80(u8 taskId) void sub_8126C08(void) { - FillWindowPixelBuffer(0, PALETTE_NUM_TO_FILL_VALUE(1)); + FillWindowPixelBuffer(0, PIXEL_FILL(1)); AddTextPrinterParameterized2(0, 1, sSecretBasePCMenuItemDescriptions[sSecretBasePCMenuCursorPos], 0, 0, 2, 1, 3); } @@ -634,7 +634,7 @@ void sub_8126DFC(u8 taskId) void sub_8126E44(u8 taskId) { - FillWindowPixelBuffer(sDecorMenuWindowIndices[1], PALETTE_NUM_TO_FILL_VALUE(1)); + FillWindowPixelBuffer(sDecorMenuWindowIndices[1], PIXEL_FILL(1)); sub_8126E8C(taskId); InitMenuInUpperLeftCornerPlaySoundWhenAPressed(sDecorMenuWindowIndices[1], 9, sCurDecorationCategory); gTasks[taskId].func = sub_8127088; @@ -968,7 +968,7 @@ void sub_8127744(u32 a0) const u8 *txt; winidx = sDecorMenuWindowIndices[3]; - FillWindowPixelBuffer(winidx, PALETTE_NUM_TO_FILL_VALUE(1)); + FillWindowPixelBuffer(winidx, PIXEL_FILL(1)); if (a0 >= sCurDecorCatCount) { txt = gText_GoBackPrevMenu; diff --git a/src/diploma.c b/src/diploma.c index f2c2a965c1..7164950342 100644 --- a/src/diploma.c +++ b/src/diploma.c @@ -197,7 +197,7 @@ static void InitDiplomaWindow(void) InitWindows(sDiplomaWinTemplates); DeactivateAllTextPrinters(); LoadPalette(gUnknown_0860F074, 0xF0, 0x20); - FillWindowPixelBuffer(0, PALETTE_NUM_TO_FILL_VALUE(0)); + FillWindowPixelBuffer(0, PIXEL_FILL(0)); PutWindowTilemap(0); } diff --git a/src/easy_chat.c b/src/easy_chat.c index 5a3ebf69c9..b602077ad2 100644 --- a/src/easy_chat.c +++ b/src/easy_chat.c @@ -3689,7 +3689,7 @@ static void sub_811CFCC(void) return; xOffset = GetStringCenterAlignXOffset(1, titleText, 144); - FillWindowPixelBuffer(0, PALETTE_NUM_TO_FILL_VALUE(0)); + FillWindowPixelBuffer(0, PIXEL_FILL(0)); sub_811D058(0, 1, titleText, xOffset, 1, 0xFF, 0, 2, 3); PutWindowTilemap(0); CopyWindowToVram(0, 3); @@ -3759,7 +3759,7 @@ static void sub_811D104(u8 arg0) break; } - FillWindowPixelBuffer(1, PALETTE_NUM_TO_FILL_VALUE(1)); + FillWindowPixelBuffer(1, PIXEL_FILL(1)); if (text1) sub_811D028(1, 1, text1, 0, 1, 0xFF, 0); @@ -3809,7 +3809,7 @@ static void sub_811D2C8(void) if (var0 == 7) var1 = 1; - FillWindowPixelBuffer(gUnknown_0203A11C->windowId, PALETTE_NUM_TO_FILL_VALUE(1)); + FillWindowPixelBuffer(gUnknown_0203A11C->windowId, PIXEL_FILL(1)); for (i = 0; i < numRows; i++) { memcpy(spC, sText_Clear17, sizeof(sText_Clear17)); @@ -3949,7 +3949,7 @@ static void sub_811D684(void) static void sub_811D698(u32 arg0) { sub_811DD84(); - FillWindowPixelBuffer(2, PALETTE_NUM_TO_FILL_VALUE(1)); + FillWindowPixelBuffer(2, PIXEL_FILL(1)); switch (arg0) { case 0: @@ -4106,14 +4106,14 @@ static void sub_811D950(u8 arg0, u8 arg1) var1 = 0; } - FillWindowPixelRect(2, PALETTE_NUM_TO_FILL_VALUE(1), 0, y, 224, var2); + FillWindowPixelRect(2, PIXEL_FILL(1), 0, y, 224, var2); if (var1) - FillWindowPixelRect(2, PALETTE_NUM_TO_FILL_VALUE(1), 0, 0, 224, var1); + FillWindowPixelRect(2, PIXEL_FILL(1), 0, 0, 224, var1); } static void sub_811D9B4(void) { - FillWindowPixelBuffer(2, PALETTE_NUM_TO_FILL_VALUE(1)); + FillWindowPixelBuffer(2, PIXEL_FILL(1)); CopyWindowToVram(2, 2); } @@ -4783,7 +4783,7 @@ static void sub_811E948(void) template.paletteNum = 11; template.baseBlock = 0x34; windowId = AddWindow(&template); - FillWindowPixelBuffer(windowId, PALETTE_NUM_TO_FILL_VALUE(1)); + FillWindowPixelBuffer(windowId, PIXEL_FILL(1)); for (i = 0; i < 4; i++) { const u8 *str = sFooterTextOptions[var0][i]; diff --git a/src/egg_hatch.c b/src/egg_hatch.c index 66114f19fb..a9b6001ec7 100644 --- a/src/egg_hatch.c +++ b/src/egg_hatch.c @@ -606,7 +606,7 @@ static void CB2_EggHatch_1(void) case 1: if (!gPaletteFade.active) { - FillWindowPixelBuffer(sEggHatchData->windowId, PALETTE_NUM_TO_FILL_VALUE(0)); + FillWindowPixelBuffer(sEggHatchData->windowId, PIXEL_FILL(0)); sEggHatchData->CB2_PalCounter = 0; sEggHatchData->CB2_state++; } @@ -857,7 +857,7 @@ static void CreateEggShardSprite(u8 x, u8 y, s16 data1, s16 data2, s16 data3, u8 static void EggHatchPrintMessage(u8 windowId, u8* string, u8 x, u8 y, u8 speed) { - FillWindowPixelBuffer(windowId, PALETTE_NUM_TO_FILL_VALUE(15)); + FillWindowPixelBuffer(windowId, PIXEL_FILL(15)); sEggHatchData->textColor[0] = 0; sEggHatchData->textColor[1] = 5; sEggHatchData->textColor[2] = 6; diff --git a/src/field_player_avatar.c b/src/field_player_avatar.c index 4ab3cb21ef..96e679dd7b 100644 --- a/src/field_player_avatar.c +++ b/src/field_player_avatar.c @@ -1918,7 +1918,7 @@ static bool8 Fishing9(struct Task *task) static bool8 Fishing10(struct Task *task) { AlignFishingAnimationFrames(); - FillWindowPixelBuffer(0, PALETTE_NUM_TO_FILL_VALUE(1)); + FillWindowPixelBuffer(0, PIXEL_FILL(1)); AddTextPrinterParameterized2(0, 1, gText_PokemonOnHook, 1, 0, 2, 1, 3); task->tStep++; task->tFrameCounter = 0; @@ -1966,7 +1966,7 @@ static bool8 Fishing12(struct Task *task) { AlignFishingAnimationFrames(); StartSpriteAnim(&gSprites[gPlayerAvatar.spriteId], GetFishingNoCatchDirectionAnimNum(GetPlayerFacingDirection())); - FillWindowPixelBuffer(0, PALETTE_NUM_TO_FILL_VALUE(1)); + FillWindowPixelBuffer(0, PIXEL_FILL(1)); AddTextPrinterParameterized2(0, 1, gText_NotEvenANibble, 1, 0, 2, 1, 3); task->tStep = FISHING_SHOW_RESULT; return TRUE; @@ -1977,7 +1977,7 @@ static bool8 Fishing13(struct Task *task) { AlignFishingAnimationFrames(); StartSpriteAnim(&gSprites[gPlayerAvatar.spriteId], GetFishingNoCatchDirectionAnimNum(GetPlayerFacingDirection())); - FillWindowPixelBuffer(0, PALETTE_NUM_TO_FILL_VALUE(1)); + FillWindowPixelBuffer(0, PIXEL_FILL(1)); AddTextPrinterParameterized2(0, 1, gText_ItGotAway, 1, 0, 2, 1, 3); task->tStep++; return TRUE; diff --git a/src/field_region_map.c b/src/field_region_map.c index 850e845543..1d54333fb6 100644 --- a/src/field_region_map.c +++ b/src/field_region_map.c @@ -196,13 +196,13 @@ static void PrintRegionMapSecName(void) { if (sFieldRegionMapHandler->regionMap.iconDrawType != MAPSECTYPE_NONE) { - FillWindowPixelBuffer(0, PALETTE_NUM_TO_FILL_VALUE(1)); + FillWindowPixelBuffer(0, PIXEL_FILL(1)); AddTextPrinterParameterized(0, 1, sFieldRegionMapHandler->regionMap.mapSecName, 0, 1, 0, NULL); schedule_bg_copy_tilemap_to_vram(0); } else { - FillWindowPixelBuffer(0, PALETTE_NUM_TO_FILL_VALUE(1)); + FillWindowPixelBuffer(0, PIXEL_FILL(1)); CopyWindowToVram(0, 3); } } diff --git a/src/field_specials.c b/src/field_specials.c index b4017f0ef5..2e0b032908 100644 --- a/src/field_specials.c +++ b/src/field_specials.c @@ -2646,7 +2646,7 @@ static void sub_813A570(u8 taskId) DestroyListMenuTask(task->data[14], NULL, NULL); Free(gUnknown_0203AB64); ClearStdWindowAndFrameToTransparent(task->data[13], 1); - FillWindowPixelBuffer(task->data[13], PALETTE_NUM_TO_FILL_VALUE(0)); + FillWindowPixelBuffer(task->data[13], PIXEL_FILL(0)); CopyWindowToVram(task->data[13], 2); RemoveWindow(task->data[13]); DestroyTask(taskId); @@ -3001,7 +3001,7 @@ static void sub_813AA60(u16 a0, u16 a1) if (a0 > 2 && a0 < 7) { - FillWindowPixelRect(0, PALETTE_NUM_TO_FILL_VALUE(1), 0, 0, 216, 32); + FillWindowPixelRect(0, PIXEL_FILL(1), 0, 0, 216, 32); switch (a0) { case 3: @@ -3140,7 +3140,7 @@ static void sub_813AD34(u8 a0, u16 a1) if (a0 == 9 || a0 == 10) { - FillWindowPixelRect(gUnknown_0203AB5E, PALETTE_NUM_TO_FILL_VALUE(1), 0, 0, 96, 48); + FillWindowPixelRect(gUnknown_0203AB5E, PIXEL_FILL(1), 0, 0, 96, 48); if (a0 == 10) { AddTextPrinterParameterized(gUnknown_0203AB5E, 1, gUnknown_085B3254[a1], 0, 1, 0, NULL); @@ -3227,7 +3227,7 @@ void sub_813AF48(void) DestroyListMenuTask(task->data[14], NULL, NULL); Free(gUnknown_0203AB64); ClearStdWindowAndFrameToTransparent(task->data[13], TRUE); - FillWindowPixelBuffer(task->data[13], PALETTE_NUM_TO_FILL_VALUE(0)); + FillWindowPixelBuffer(task->data[13], PIXEL_FILL(0)); ClearWindowTilemap(task->data[13]); CopyWindowToVram(task->data[13], 2); RemoveWindow(task->data[13]); diff --git a/src/frontier_pass.c b/src/frontier_pass.c index c449a50f0a..fff93c3c76 100644 --- a/src/frontier_pass.c +++ b/src/frontier_pass.c @@ -1090,7 +1090,7 @@ static void ShowAndPrintWindows(void) for (i = 0; i < WINDOW_COUNT; i++) { PutWindowTilemap(i); - FillWindowPixelBuffer(i, PALETTE_NUM_TO_FILL_VALUE(0)); + FillWindowPixelBuffer(i, PIXEL_FILL(0)); } x = GetStringCenterAlignXOffset(1, gText_SymbolsEarned, 96); @@ -1116,7 +1116,7 @@ static void ShowAndPrintWindows(void) static void PrintAreaDescription(u8 cursorArea) { - FillWindowPixelBuffer(WINDOW_DESCRIPTION, PALETTE_NUM_TO_FILL_VALUE(0)); + FillWindowPixelBuffer(WINDOW_DESCRIPTION, PIXEL_FILL(0)); if (cursorArea == CURSOR_AREA_RECORD && !sPassData->hasBattleRecord) AddTextPrinterParameterized3(WINDOW_DESCRIPTION, 1, 2, 0, sTextColors[1], 0, sPassAreaDescriptions[0]); else if (cursorArea != CURSOR_AREA_NOTHING) @@ -1656,7 +1656,7 @@ static void PrintOnFrontierMap(void) for (i = 0; i < MAP_WINDOW_COUNT; i++) { PutWindowTilemap(i); - FillWindowPixelBuffer(i, PALETTE_NUM_TO_FILL_VALUE(0)); + FillWindowPixelBuffer(i, PIXEL_FILL(0)); } for (i = 0; i < NUM_FRONTIER_FACILITIES; i++) @@ -1698,7 +1698,7 @@ static void HandleFrontierMapCursorMove(u8 direction) StartSpriteAnim(sMapData->mapIndicatorSprite, sMapLandmarks[sMapData->cursorPos].animNum); sMapData->mapIndicatorSprite->pos1.x = sMapLandmarks[sMapData->cursorPos].x; sMapData->mapIndicatorSprite->pos1.y = sMapLandmarks[sMapData->cursorPos].y; - FillWindowPixelBuffer(MAP_WINDOW_DESCRIPTION, PALETTE_NUM_TO_FILL_VALUE(0)); + FillWindowPixelBuffer(MAP_WINDOW_DESCRIPTION, PIXEL_FILL(0)); AddTextPrinterParameterized3(MAP_WINDOW_DESCRIPTION, 1, 4, 0, sTextColors[0], 0, sMapLandmarks[sMapData->cursorPos].description); for (i = 0; i < 3; i++) diff --git a/src/frontier_util.c b/src/frontier_util.c index ec7327ca3f..0c68bf1198 100644 --- a/src/frontier_util.c +++ b/src/frontier_util.c @@ -1045,7 +1045,7 @@ static void ShowTowerResultsWindow(u8 battleMode) { gRecordsWindowId = AddWindow(&gUnknown_08611C74); DrawStdWindowFrame(gRecordsWindowId, FALSE); - FillWindowPixelBuffer(gRecordsWindowId, PALETTE_NUM_TO_FILL_VALUE(1)); + FillWindowPixelBuffer(gRecordsWindowId, PIXEL_FILL(1)); if (battleMode == FRONTIER_MODE_SINGLES) StringExpandPlaceholders(gStringVar4, gText_SingleBattleRoomResults); else if (battleMode == FRONTIER_MODE_DOUBLES) @@ -1116,7 +1116,7 @@ static void ShowDomeResultsWindow(u8 battleMode) { gRecordsWindowId = AddWindow(&gUnknown_08611C74); DrawStdWindowFrame(gRecordsWindowId, FALSE); - FillWindowPixelBuffer(gRecordsWindowId, PALETTE_NUM_TO_FILL_VALUE(1)); + FillWindowPixelBuffer(gRecordsWindowId, PIXEL_FILL(1)); if (battleMode == FRONTIER_MODE_SINGLES) StringExpandPlaceholders(gStringVar4, gText_SingleBattleTourneyResults); else @@ -1192,7 +1192,7 @@ static void ShowPalaceResultsWindow(u8 battleMode) { gRecordsWindowId = AddWindow(&gUnknown_08611C74); DrawStdWindowFrame(gRecordsWindowId, FALSE); - FillWindowPixelBuffer(gRecordsWindowId, PALETTE_NUM_TO_FILL_VALUE(1)); + FillWindowPixelBuffer(gRecordsWindowId, PIXEL_FILL(1)); if (battleMode == FRONTIER_MODE_SINGLES) StringExpandPlaceholders(gStringVar4, gText_SingleBattleHallResults); else @@ -1248,7 +1248,7 @@ static void ShowPikeResultsWindow(void) { gRecordsWindowId = AddWindow(&gUnknown_08611C74); DrawStdWindowFrame(gRecordsWindowId, FALSE); - FillWindowPixelBuffer(gRecordsWindowId, PALETTE_NUM_TO_FILL_VALUE(1)); + FillWindowPixelBuffer(gRecordsWindowId, PIXEL_FILL(1)); StringExpandPlaceholders(gStringVar4, gText_BattleChoiceResults); PrintAligned(gStringVar4, 0); AddTextPrinterParameterized(gRecordsWindowId, 1, gText_Lv502, 8, 33, TEXT_SPEED_FF, NULL); @@ -1310,7 +1310,7 @@ static void ShowArenaResultsWindow(void) { gRecordsWindowId = AddWindow(&gUnknown_08611C74); DrawStdWindowFrame(gRecordsWindowId, FALSE); - FillWindowPixelBuffer(gRecordsWindowId, PALETTE_NUM_TO_FILL_VALUE(1)); + FillWindowPixelBuffer(gRecordsWindowId, PIXEL_FILL(1)); PrintHyphens(10); StringExpandPlaceholders(gStringVar4, gText_SetKOTourneyResults); PrintAligned(gStringVar4, 2); @@ -1396,7 +1396,7 @@ static void ShowFactoryResultsWindow(u8 battleMode) { gRecordsWindowId = AddWindow(&gUnknown_08611C74); DrawStdWindowFrame(gRecordsWindowId, FALSE); - FillWindowPixelBuffer(gRecordsWindowId, PALETTE_NUM_TO_FILL_VALUE(1)); + FillWindowPixelBuffer(gRecordsWindowId, PIXEL_FILL(1)); if (battleMode == FRONTIER_MODE_SINGLES) StringExpandPlaceholders(gStringVar4, gText_BattleSwapSingleResults); else @@ -1461,7 +1461,7 @@ static void ShowPyramidResultsWindow(void) { gRecordsWindowId = AddWindow(&gUnknown_08611C74); DrawStdWindowFrame(gRecordsWindowId, FALSE); - FillWindowPixelBuffer(gRecordsWindowId, PALETTE_NUM_TO_FILL_VALUE(1)); + FillWindowPixelBuffer(gRecordsWindowId, PIXEL_FILL(1)); StringExpandPlaceholders(gStringVar4, gText_BattleQuestResults); PrintAligned(gStringVar4, 2); AddTextPrinterParameterized(gRecordsWindowId, 1, gText_Lv502, 8, 49, TEXT_SPEED_FF, NULL); @@ -1484,7 +1484,7 @@ static void ShowLinkContestResultsWindow(void) gRecordsWindowId = AddWindow(&gUnknown_08611C7C); DrawStdWindowFrame(gRecordsWindowId, FALSE); - FillWindowPixelBuffer(gRecordsWindowId, PALETTE_NUM_TO_FILL_VALUE(1)); + FillWindowPixelBuffer(gRecordsWindowId, PIXEL_FILL(1)); StringExpandPlaceholders(gStringVar4, gText_LinkContestResults); x = GetStringCenterAlignXOffset(1, gStringVar4, 208); @@ -2354,7 +2354,7 @@ void ShowRankingHallRecordsWindow(void) { gRecordsWindowId = AddWindow(&gUnknown_08611C84); DrawStdWindowFrame(gRecordsWindowId, FALSE); - FillWindowPixelBuffer(gRecordsWindowId, PALETTE_NUM_TO_FILL_VALUE(1)); + FillWindowPixelBuffer(gRecordsWindowId, PIXEL_FILL(1)); PrintHallRecords(gSpecialVar_0x8005, FRONTIER_LVL_50); PutWindowTilemap(gRecordsWindowId); CopyWindowToVram(gRecordsWindowId, 3); @@ -2362,7 +2362,7 @@ void ShowRankingHallRecordsWindow(void) void ScrollRankingHallRecordsWindow(void) { - FillWindowPixelBuffer(gRecordsWindowId, PALETTE_NUM_TO_FILL_VALUE(1)); + FillWindowPixelBuffer(gRecordsWindowId, PIXEL_FILL(1)); PrintHallRecords(gSpecialVar_0x8005, FRONTIER_LVL_OPEN); CopyWindowToVram(gRecordsWindowId, 2); } diff --git a/src/hall_of_fame.c b/src/hall_of_fame.c index d3b94cff65..53577e1666 100644 --- a/src/hall_of_fame.c +++ b/src/hall_of_fame.c @@ -649,7 +649,7 @@ static void sub_8173DC0(u8 taskId) gSprites[gTasks[taskId].tMonSpriteId(i)].oam.priority = 1; } BeginNormalPaletteFade(sUnknown_0203BCD4, 0, 12, 12, RGB(16, 29, 24)); - FillWindowPixelBuffer(0, PALETTE_NUM_TO_FILL_VALUE(0)); + FillWindowPixelBuffer(0, PIXEL_FILL(0)); CopyWindowToVram(0, 3); gTasks[taskId].tFrameCount = 7; gTasks[taskId].func = sub_8173EA4; @@ -1086,7 +1086,7 @@ static void Task_HofPC_ExitOnButtonPress(u8 taskId) static void HallOfFame_PrintWelcomeText(u8 unusedPossiblyWindowId, u8 unused2) { - FillWindowPixelBuffer(0, PALETTE_NUM_TO_FILL_VALUE(0)); + FillWindowPixelBuffer(0, PIXEL_FILL(0)); PutWindowTilemap(0); AddTextPrinterParameterized3(0, 1, GetStringCenterAlignXOffset(1, gText_WelcomeToHOF, 0xD0), 1, sUnknown_085E5388, 0, gText_WelcomeToHOF); CopyWindowToVram(0, 3); @@ -1099,7 +1099,7 @@ static void HallOfFame_PrintMonInfo(struct HallofFameMon* currMon, u8 unused1, u s32 dexNumber; s32 width; - FillWindowPixelBuffer(0, PALETTE_NUM_TO_FILL_VALUE(0)); + FillWindowPixelBuffer(0, PIXEL_FILL(0)); PutWindowTilemap(0); // dex number @@ -1180,7 +1180,7 @@ static void HallOfFame_PrintPlayerInfo(u8 unused1, u8 unused2) u32 width; u16 trainerId; - FillWindowPixelBuffer(1, PALETTE_NUM_TO_FILL_VALUE(1)); + FillWindowPixelBuffer(1, PIXEL_FILL(1)); PutWindowTilemap(1); DrawStdFrameWithCustomTileAndPalette(1, FALSE, 0x21D, 0xD); AddTextPrinterParameterized3(1, 1, 0, 1, sUnknown_085E538C, -1, gText_Name); diff --git a/src/item_menu.c b/src/item_menu.c index 8ade67614d..ae2b7d47b3 100755 --- a/src/item_menu.c +++ b/src/item_menu.c @@ -884,7 +884,7 @@ void bag_menu_print_description_box_text(int a) StringExpandPlaceholders(gStringVar4, gText_ReturnToVar1); str = gStringVar4; } - FillWindowPixelBuffer(1, PALETTE_NUM_TO_FILL_VALUE(0)); + FillWindowPixelBuffer(1, PIXEL_FILL(0)); bag_menu_print(1, 1, str, 3, 1, 0, 0, 0, 0); } @@ -896,7 +896,7 @@ void bag_menu_print_cursor_(u8 a, u8 b) void bag_menu_print_cursor(u8 a, u8 b) { if (b == 0xFF) - FillWindowPixelRect(0, PALETTE_NUM_TO_FILL_VALUE(0), 0, a, GetMenuCursorDimensionByFont(1, 0), GetMenuCursorDimensionByFont(1, 1)); + FillWindowPixelRect(0, PIXEL_FILL(0), 0, a, GetMenuCursorDimensionByFont(1, 0), GetMenuCursorDimensionByFont(1, 1)); else bag_menu_print(0, 1, gText_SelectorArrow2, 0, a, 0, 0, 0, b); @@ -1028,7 +1028,7 @@ void DisplayItemMessage(u8 taskId, u8 fontId, const u8 *str, void ( *callback)(u s16* data = gTasks[taskId].data; data[10] = AddItemMessageWindow(4); - FillWindowPixelBuffer(data[10], PALETTE_NUM_TO_FILL_VALUE(1)); + FillWindowPixelBuffer(data[10], PIXEL_FILL(1)); DisplayMessageAndContinueTask(taskId, data[10], 10, 13, fontId, GetPlayerTextSpeedDelay(), str, callback); schedule_bg_copy_tilemap_to_vram(1); } @@ -1293,7 +1293,7 @@ void bag_menu_swap_items(u8 taskId) gUnknown_0203CE54->unk81A = data[1]; CopyItemName(BagGetItemIdByPocketPosition(gUnknown_0203CE58.pocket + 1, data[1]), gStringVar1); StringExpandPlaceholders(gStringVar4, gText_MoveVar1Where); - FillWindowPixelBuffer(1, PALETTE_NUM_TO_FILL_VALUE(0)); + FillWindowPixelBuffer(1, PIXEL_FILL(0)); bag_menu_print(1, 1, gStringVar4, 3, 1, 0, 0, 0, 0); sub_80D4FEC(data[1]); sub_81AB89C(); @@ -1505,7 +1505,7 @@ void sub_81AC644(u8 unused) { CopyItemName(gSpecialVar_ItemId, gStringVar1); StringExpandPlaceholders(gStringVar4, gText_Var1IsSelected); - FillWindowPixelBuffer(1, PALETTE_NUM_TO_FILL_VALUE(0)); + FillWindowPixelBuffer(1, PIXEL_FILL(0)); bag_menu_print(1, 1, gStringVar4, 3, 1, 0, 0, 0, 0); } if (gUnknown_0203CE54->unk828 == 1) @@ -1646,7 +1646,7 @@ void ItemMenu_UseOutOfBattle(u8 taskId) bag_menu_print_there_is_no_pokemon(taskId); else { - FillWindowPixelBuffer(1, PALETTE_NUM_TO_FILL_VALUE(0)); + FillWindowPixelBuffer(1, PIXEL_FILL(0)); schedule_bg_copy_tilemap_to_vram(0); if (gUnknown_0203CE58.pocket != BERRIES_POCKET) ItemId_GetFieldFunc(gSpecialVar_ItemId)(taskId); @@ -1670,7 +1670,7 @@ void ItemMenu_Toss(u8 taskId) { CopyItemName(gSpecialVar_ItemId, gStringVar1); StringExpandPlaceholders(gStringVar4, gText_TossHowManyVar1s); - FillWindowPixelBuffer(1, PALETTE_NUM_TO_FILL_VALUE(0)); + FillWindowPixelBuffer(1, PIXEL_FILL(0)); bag_menu_print(1, 1, gStringVar4, 3, 1, 0, 0, 0, 0); sub_81ABC3C(7); gTasks[taskId].func = Task_ChooseHowManyToToss; @@ -1684,7 +1684,7 @@ void BagMenuConfirmToss(u8 taskId) CopyItemName(gSpecialVar_ItemId, gStringVar1); ConvertIntToDecimalStringN(gStringVar2, data[8], 0, 3); StringExpandPlaceholders(gStringVar4, gText_ConfirmTossItems); - FillWindowPixelBuffer(1, PALETTE_NUM_TO_FILL_VALUE(0)); + FillWindowPixelBuffer(1, PIXEL_FILL(0)); bag_menu_print(1, 1, gStringVar4, 3, 1, 0, 0, 0, 0); bag_menu_yes_no(taskId, 5, &gUnknown_08614084); } @@ -1727,7 +1727,7 @@ void BagMenuActuallyToss(u8 taskId) CopyItemName(gSpecialVar_ItemId, gStringVar1); ConvertIntToDecimalStringN(gStringVar2, data[8], 0, 3); StringExpandPlaceholders(gStringVar4, gText_ThrewAwayVar2Var1s); - FillWindowPixelBuffer(1, PALETTE_NUM_TO_FILL_VALUE(0)); + FillWindowPixelBuffer(1, PIXEL_FILL(0)); bag_menu_print(1, 1, gStringVar4, 3, 1, 0, 0, 0, 0); gTasks[taskId].func = Task_ActuallyToss; } @@ -2043,7 +2043,7 @@ void display_deposit_item_ask_str(u8 taskId) { CopyItemName(gSpecialVar_ItemId, gStringVar1); StringExpandPlaceholders(gStringVar4, gText_DepositHowManyVar1); - FillWindowPixelBuffer(1, PALETTE_NUM_TO_FILL_VALUE(0)); + FillWindowPixelBuffer(1, PIXEL_FILL(0)); bag_menu_print(1, 1, gStringVar4, 3, 1, 0, 0, 0, 0); sub_81ABC3C(7); gTasks[taskId].func = sub_81ADA7C; @@ -2078,7 +2078,7 @@ void sub_81ADB14(u8 taskId) { s16* data = gTasks[taskId].data; - FillWindowPixelBuffer(1, PALETTE_NUM_TO_FILL_VALUE(0)); + FillWindowPixelBuffer(1, PIXEL_FILL(0)); if (ItemId_GetImportance(gSpecialVar_ItemId)) { bag_menu_print(1, 1, gText_CantStoreImportantItems, 3, 1, 0, 0, 0, 0); @@ -2244,7 +2244,7 @@ void bag_menu_print_pocket_names(const u8 *pocketName1, const u8 *pocketName2) window.width = 16; window.height = 2; windowId = AddWindow(&window); - FillWindowPixelBuffer(windowId, PALETTE_NUM_TO_FILL_VALUE(0)); + FillWindowPixelBuffer(windowId, PIXEL_FILL(0)); offset = GetStringCenterAlignXOffset(1, pocketName1, 0x40); bag_menu_print(windowId, 1, pocketName1, offset, 1, 0, 0, -1, 1); if (pocketName2) @@ -2283,7 +2283,7 @@ void setup_bag_menu_textboxes(void) LoadPalette(&gUnknown_0860F074, 0xF0, 0x20); for (i = 0; i < 3; i++) { - FillWindowPixelBuffer(i, PALETTE_NUM_TO_FILL_VALUE(0)); + FillWindowPixelBuffer(i, PIXEL_FILL(0)); PutWindowTilemap(i); } schedule_bg_copy_tilemap_to_vram(0); @@ -2367,7 +2367,7 @@ void bag_menu_remove_money_window(void) void bag_menu_prepare_tmhm_move_window(void) { - FillWindowPixelBuffer(3, PALETTE_NUM_TO_FILL_VALUE(0)); + FillWindowPixelBuffer(3, PIXEL_FILL(0)); blit_move_info_icon(3, 19, 0, 0); blit_move_info_icon(3, 20, 0, 12); blit_move_info_icon(3, 21, 0, 24); @@ -2381,7 +2381,7 @@ void PrintTMHMMoveData(u16 itemId) u16 moveId; const u8* text; - FillWindowPixelBuffer(4, PALETTE_NUM_TO_FILL_VALUE(0)); + FillWindowPixelBuffer(4, PIXEL_FILL(0)); if (itemId == ITEM_NONE) { for (i = 0; i < 4; i++) diff --git a/src/learn_move.c b/src/learn_move.c index 5173525553..879acff6d7 100644 --- a/src/learn_move.c +++ b/src/learn_move.c @@ -498,7 +498,7 @@ static void LearnMoveMain(void) case 27: if (!sub_81D2C3C()) { - FillWindowPixelBuffer(3, PALETTE_NUM_TO_FILL_VALUE(1)); + FillWindowPixelBuffer(3, PIXEL_FILL(1)); if (sLearnMoveStruct2.showContestInfo == FALSE) { sLearnMoveStruct->state = 3; @@ -631,7 +631,7 @@ static void HideSpritesAndPrintTeachText(bool8 a) if (!a) { StringExpandPlaceholders(gStringVar4, gText_TeachWhichMoveToPkmn); - FillWindowPixelBuffer(3, PALETTE_NUM_TO_FILL_VALUE(1)); + FillWindowPixelBuffer(3, PIXEL_FILL(1)); AddTextPrinterParameterized(3, 1, gStringVar4, 0, 1, 0, NULL); } } @@ -695,7 +695,7 @@ static void ShowTeachMoveText(bool8 showContest) if (showContest == FALSE) { StringExpandPlaceholders(gStringVar4, gText_TeachWhichMoveToPkmn); - FillWindowPixelBuffer(3, PALETTE_NUM_TO_FILL_VALUE(1)); + FillWindowPixelBuffer(3, PIXEL_FILL(1)); AddTextPrinterParameterized(3, 1, gStringVar4, 0, 1, 0, NULL); } } diff --git a/src/link.c b/src/link.c index 5c7614c1bf..9aedbc961b 100644 --- a/src/link.c +++ b/src/link.c @@ -1683,8 +1683,8 @@ static void sub_800B080(void) CopyToBgTilemapBuffer(1, gWirelessLinkDisplayTilemap, 0, 0); CopyBgTilemapBufferToVram(1); LoadPalette(gWirelessLinkDisplayPal, 0, 0x20); - FillWindowPixelBuffer(0, PALETTE_NUM_TO_FILL_VALUE(0)); - FillWindowPixelBuffer(2, PALETTE_NUM_TO_FILL_VALUE(0)); + FillWindowPixelBuffer(0, PIXEL_FILL(0)); + FillWindowPixelBuffer(2, PIXEL_FILL(0)); AddTextPrinterParameterized3(0, 3, 2, 6, gUnknown_082ED224, 0, gText_CommErrorEllipsis); AddTextPrinterParameterized3(2, 3, 2, 1, gUnknown_082ED224, 0, gText_MoveCloserToLinkPartner); PutWindowTilemap(0); @@ -1696,8 +1696,8 @@ static void sub_800B080(void) static void sub_800B138(void) { LoadBgTiles(0, g2BlankTilesGfx, 0x20, 0); - FillWindowPixelBuffer(1, PALETTE_NUM_TO_FILL_VALUE(0)); - FillWindowPixelBuffer(2, PALETTE_NUM_TO_FILL_VALUE(0)); + FillWindowPixelBuffer(1, PIXEL_FILL(0)); + FillWindowPixelBuffer(2, PIXEL_FILL(0)); AddTextPrinterParameterized3(1, 3, 2, 0, gUnknown_082ED224, 0, gText_CommErrorCheckConnections); PutWindowTilemap(1); PutWindowTilemap(2); diff --git a/src/list_menu.c b/src/list_menu.c index b8e1863482..51d7dcb15a 100644 --- a/src/list_menu.c +++ b/src/list_menu.c @@ -486,7 +486,7 @@ void RedrawListMenu(u8 listTaskId) { struct ListMenu *list = (void*) gTasks[listTaskId].data; - FillWindowPixelBuffer(list->template.windowId, PALETTE_NUM_TO_FILL_VALUE(list->template.fillValue)); + FillWindowPixelBuffer(list->template.windowId, PIXEL_FILL(list->template.fillValue)); ListMenuPrintEntries(list, list->scrollOffset, 0, list->template.maxShowed); ListMenuDrawCursor(list); CopyWindowToVram(list->template.windowId, 2); @@ -584,7 +584,7 @@ static u8 ListMenuInitInternal(struct ListMenuTemplate *listMenuTemplate, u16 sc if (list->template.totalItems < list->template.maxShowed) list->template.maxShowed = list->template.totalItems; - FillWindowPixelBuffer(list->template.windowId, PALETTE_NUM_TO_FILL_VALUE(list->template.fillValue)); + FillWindowPixelBuffer(list->template.windowId, PIXEL_FILL(list->template.fillValue)); ListMenuPrintEntries(list, list->scrollOffset, 0, list->template.maxShowed); ListMenuDrawCursor(list); ListMenuCallSelectionChangedCallback(list, TRUE); @@ -698,7 +698,7 @@ static void ListMenuErasePrintedCursor(struct ListMenu *list, u16 selectedRow) u8 width = GetMenuCursorDimensionByFont(list->template.fontId, 0); u8 height = GetMenuCursorDimensionByFont(list->template.fontId, 1); FillWindowPixelRect(list->template.windowId, - PALETTE_NUM_TO_FILL_VALUE(list->template.fillValue), + PIXEL_FILL(list->template.fillValue), list->template.cursor_X, selectedRow * yMultiplier + list->template.upText_Y, width, @@ -795,7 +795,7 @@ static void ListMenuScroll(struct ListMenu *list, u8 count, bool8 movingDown) { if (count >= list->template.maxShowed) { - FillWindowPixelBuffer(list->template.windowId, PALETTE_NUM_TO_FILL_VALUE(list->template.fillValue)); + FillWindowPixelBuffer(list->template.windowId, PIXEL_FILL(list->template.fillValue)); ListMenuPrintEntries(list, list->scrollOffset, 0, list->template.maxShowed); } else @@ -806,26 +806,26 @@ static void ListMenuScroll(struct ListMenu *list, u8 count, bool8 movingDown) { u16 y, width, height; - ScrollWindow(list->template.windowId, 1, count * yMultiplier, PALETTE_NUM_TO_FILL_VALUE(list->template.fillValue)); + ScrollWindow(list->template.windowId, 1, count * yMultiplier, PIXEL_FILL(list->template.fillValue)); ListMenuPrintEntries(list, list->scrollOffset, 0, count); y = (list->template.maxShowed * yMultiplier) + list->template.upText_Y; width = GetWindowAttribute(list->template.windowId, WINDOW_WIDTH) * 8; height = (GetWindowAttribute(list->template.windowId, WINDOW_HEIGHT) * 8) - y; FillWindowPixelRect(list->template.windowId, - PALETTE_NUM_TO_FILL_VALUE(list->template.fillValue), + PIXEL_FILL(list->template.fillValue), 0, y, width, height); } else { u16 width; - ScrollWindow(list->template.windowId, 0, count * yMultiplier, PALETTE_NUM_TO_FILL_VALUE(list->template.fillValue)); + ScrollWindow(list->template.windowId, 0, count * yMultiplier, PIXEL_FILL(list->template.fillValue)); ListMenuPrintEntries(list, list->scrollOffset + (list->template.maxShowed - count), list->template.maxShowed - count, count); width = GetWindowAttribute(list->template.windowId, WINDOW_WIDTH) * 8; FillWindowPixelRect(list->template.windowId, - PALETTE_NUM_TO_FILL_VALUE(list->template.fillValue), + PIXEL_FILL(list->template.fillValue), 0, 0, width, list->template.upText_Y); } } diff --git a/src/mail.c b/src/mail.c index 27716a3f8b..9cca4492e1 100644 --- a/src/mail.c +++ b/src/mail.c @@ -477,8 +477,8 @@ static void sub_8121B1C(void) y = 0; PutWindowTilemap(0); PutWindowTilemap(1); - FillWindowPixelBuffer(0, PALETTE_NUM_TO_FILL_VALUE(0)); - FillWindowPixelBuffer(1, PALETTE_NUM_TO_FILL_VALUE(0)); + FillWindowPixelBuffer(0, PIXEL_FILL(0)); + FillWindowPixelBuffer(1, PIXEL_FILL(0)); for (i = 0; i < sMailRead->layout->numSubStructs; i ++) { if (sMailRead->strbuf[i][0] == EOS || sMailRead->strbuf[i][0] == CHAR_SPACE) diff --git a/src/main_menu.c b/src/main_menu.c index 6ad1776f8c..e6e29d942a 100644 --- a/src/main_menu.c +++ b/src/main_menu.c @@ -783,8 +783,8 @@ static void Task_DisplayMainMenu(u8 taskId) { case HAS_NO_SAVED_GAME: default: - FillWindowPixelBuffer(0, PALETTE_NUM_TO_FILL_VALUE(0xA)); - FillWindowPixelBuffer(1, PALETTE_NUM_TO_FILL_VALUE(0xA)); + FillWindowPixelBuffer(0, PIXEL_FILL(0xA)); + FillWindowPixelBuffer(1, PIXEL_FILL(0xA)); AddTextPrinterParameterized3(0, 1, 0, 1, sTextColor_Headers, -1, gText_MainMenuNewGame); AddTextPrinterParameterized3(1, 1, 0, 1, sTextColor_Headers, -1, gText_MainMenuOption); PutWindowTilemap(0); @@ -795,9 +795,9 @@ static void Task_DisplayMainMenu(u8 taskId) DrawMainMenuWindowBorder(&sWindowTemplates_MainMenu[1], MAIN_MENU_BORDER_TILE); break; case HAS_SAVED_GAME: - FillWindowPixelBuffer(2, PALETTE_NUM_TO_FILL_VALUE(0xA)); - FillWindowPixelBuffer(3, PALETTE_NUM_TO_FILL_VALUE(0xA)); - FillWindowPixelBuffer(4, PALETTE_NUM_TO_FILL_VALUE(0xA)); + FillWindowPixelBuffer(2, PIXEL_FILL(0xA)); + FillWindowPixelBuffer(3, PIXEL_FILL(0xA)); + FillWindowPixelBuffer(4, PIXEL_FILL(0xA)); AddTextPrinterParameterized3(2, 1, 0, 1, sTextColor_Headers, -1, gText_MainMenuContinue); AddTextPrinterParameterized3(3, 1, 0, 1, sTextColor_Headers, -1, gText_MainMenuNewGame); AddTextPrinterParameterized3(4, 1, 0, 1, sTextColor_Headers, -1, gText_MainMenuOption); @@ -813,10 +813,10 @@ static void Task_DisplayMainMenu(u8 taskId) DrawMainMenuWindowBorder(&sWindowTemplates_MainMenu[4], MAIN_MENU_BORDER_TILE); break; case HAS_MYSTERY_GIFT: - FillWindowPixelBuffer(2, PALETTE_NUM_TO_FILL_VALUE(0xA)); - FillWindowPixelBuffer(3, PALETTE_NUM_TO_FILL_VALUE(0xA)); - FillWindowPixelBuffer(4, PALETTE_NUM_TO_FILL_VALUE(0xA)); - FillWindowPixelBuffer(5, PALETTE_NUM_TO_FILL_VALUE(0xA)); + FillWindowPixelBuffer(2, PIXEL_FILL(0xA)); + FillWindowPixelBuffer(3, PIXEL_FILL(0xA)); + FillWindowPixelBuffer(4, PIXEL_FILL(0xA)); + FillWindowPixelBuffer(5, PIXEL_FILL(0xA)); AddTextPrinterParameterized3(2, 1, 0, 1, sTextColor_Headers, -1, gText_MainMenuContinue); AddTextPrinterParameterized3(3, 1, 0, 1, sTextColor_Headers, -1, gText_MainMenuNewGame); AddTextPrinterParameterized3(4, 1, 0, 1, sTextColor_Headers, -1, gText_MainMenuMysteryGift); @@ -836,11 +836,11 @@ static void Task_DisplayMainMenu(u8 taskId) DrawMainMenuWindowBorder(&sWindowTemplates_MainMenu[5], MAIN_MENU_BORDER_TILE); break; case HAS_MYSTERY_EVENTS: - FillWindowPixelBuffer(2, PALETTE_NUM_TO_FILL_VALUE(0xA)); - FillWindowPixelBuffer(3, PALETTE_NUM_TO_FILL_VALUE(0xA)); - FillWindowPixelBuffer(4, PALETTE_NUM_TO_FILL_VALUE(0xA)); - FillWindowPixelBuffer(5, PALETTE_NUM_TO_FILL_VALUE(0xA)); - FillWindowPixelBuffer(6, PALETTE_NUM_TO_FILL_VALUE(0xA)); + FillWindowPixelBuffer(2, PIXEL_FILL(0xA)); + FillWindowPixelBuffer(3, PIXEL_FILL(0xA)); + FillWindowPixelBuffer(4, PIXEL_FILL(0xA)); + FillWindowPixelBuffer(5, PIXEL_FILL(0xA)); + FillWindowPixelBuffer(6, PIXEL_FILL(0xA)); AddTextPrinterParameterized3(2, 1, 0, 1, sTextColor_Headers, -1, gText_MainMenuContinue); AddTextPrinterParameterized3(3, 1, 0, 1, sTextColor_Headers, -1, gText_MainMenuNewGame); AddTextPrinterParameterized3(4, 1, 0, 1, sTextColor_Headers, -1, gText_MainMenuMysteryGift2); @@ -2098,7 +2098,7 @@ static void NewGameBirchSpeech_StartFadePlatformOut(u8 taskId, u8 delay) static void NewGameBirchSpeech_ShowGenderMenu(void) { DrawMainMenuWindowBorder(&gNewGameBirchSpeechTextWindows[1], 0xF3); - FillWindowPixelBuffer(1, PALETTE_NUM_TO_FILL_VALUE(1)); + FillWindowPixelBuffer(1, PIXEL_FILL(1)); PrintMenuTable(1, 2, sMenuActions_Gender); InitMenuInUpperLeftCornerPlaySoundWhenAPressed(1, 2, 0); PutWindowTilemap(1); @@ -2126,7 +2126,7 @@ static void NewGameBirchSpeech_SetDefaultPlayerName(u8 nameId) static void CreateMainMenuErrorWindow(const u8* str) { - FillWindowPixelBuffer(7, PALETTE_NUM_TO_FILL_VALUE(1)); + FillWindowPixelBuffer(7, PIXEL_FILL(1)); AddTextPrinterParameterized(7, 1, str, 0, 1, 2, 0); PutWindowTilemap(7); CopyWindowToVram(7, 2); @@ -2239,7 +2239,7 @@ static void NewGameBirchSpeech_ClearGenderWindowTilemap(u8 a, u8 b, u8 c, u8 d, static void NewGameBirchSpeech_ClearGenderWindow(u8 windowId, bool8 copyToVram) { CallWindowFunction(windowId, NewGameBirchSpeech_ClearGenderWindowTilemap); - FillWindowPixelBuffer(windowId, PALETTE_NUM_TO_FILL_VALUE(1)); + FillWindowPixelBuffer(windowId, PIXEL_FILL(1)); ClearWindowTilemap(windowId); if (copyToVram == TRUE) CopyWindowToVram(windowId, 3); @@ -2277,7 +2277,7 @@ void CreateYesNoMenuParameterized(u8 a, u8 b, u16 c, u16 d, u8 e, u8 f) static void NewGameBirchSpeech_ShowDialogueWindow(u8 windowId, u8 copyToVram) { CallWindowFunction(windowId, NewGameBirchSpeech_CreateDialogueWindowBorder); - FillWindowPixelBuffer(windowId, PALETTE_NUM_TO_FILL_VALUE(1)); + FillWindowPixelBuffer(windowId, PIXEL_FILL(1)); PutWindowTilemap(windowId); if (copyToVram == TRUE) CopyWindowToVram(windowId, 3); diff --git a/src/match_call.c b/src/match_call.c index 76012e0767..d4da8d791b 100644 --- a/src/match_call.c +++ b/src/match_call.c @@ -1191,7 +1191,7 @@ static bool32 LoadMatchCallWindowGfx(u8 taskId) return FALSE; } - FillWindowPixelBuffer(taskData[2], PALETTE_NUM_TO_FILL_VALUE(8)); + FillWindowPixelBuffer(taskData[2], PIXEL_FILL(8)); LoadPalette(sUnknown_0860EA4C, 0xE0, 0x20); LoadPalette(sPokeNavIconPalette, 0xF0, 0x20); ChangeBgY(0, -0x2000, 0); @@ -1241,7 +1241,7 @@ static bool32 sub_81962D8(u8 taskId) s16 *taskData = gTasks[taskId].data; if (!ExecuteMatchCallTextPrinter(taskData[2])) { - FillWindowPixelBuffer(taskData[2], PALETTE_NUM_TO_FILL_VALUE(8)); + FillWindowPixelBuffer(taskData[2], PIXEL_FILL(8)); if (!gMatchCallState.triggeredFromScript) SelectMatchCallMessage(gMatchCallState.trainerId, gStringVar4); @@ -1257,7 +1257,7 @@ static bool32 sub_8196330(u8 taskId) s16 *taskData = gTasks[taskId].data; if (!ExecuteMatchCallTextPrinter(taskData[2]) && !IsSEPlaying() && gMain.newKeys & (A_BUTTON | B_BUTTON)) { - FillWindowPixelBuffer(taskData[2], PALETTE_NUM_TO_FILL_VALUE(8)); + FillWindowPixelBuffer(taskData[2], PIXEL_FILL(8)); CopyWindowToVram(taskData[2], 2); PlaySE(SE_TOREOFF); return TRUE; diff --git a/src/menu.c b/src/menu.c index 6a181532ed..8cb7ac0b27 100644 --- a/src/menu.c +++ b/src/menu.c @@ -213,7 +213,7 @@ void sub_81973A4(void) void DrawDialogueFrame(u8 windowId, bool8 copyToVram) { CallWindowFunction(windowId, WindowFunc_DrawDialogueFrame); - FillWindowPixelBuffer(windowId, PALETTE_NUM_TO_FILL_VALUE(1)); + FillWindowPixelBuffer(windowId, PIXEL_FILL(1)); PutWindowTilemap(windowId); if (copyToVram == TRUE) CopyWindowToVram(windowId, 3); @@ -222,7 +222,7 @@ void DrawDialogueFrame(u8 windowId, bool8 copyToVram) void DrawStdWindowFrame(u8 windowId, bool8 copyToVram) { CallWindowFunction(windowId, WindowFunc_DrawStandardFrame); - FillWindowPixelBuffer(windowId, PALETTE_NUM_TO_FILL_VALUE(1)); + FillWindowPixelBuffer(windowId, PIXEL_FILL(1)); PutWindowTilemap(windowId); if (copyToVram == TRUE) CopyWindowToVram(windowId, 3); @@ -231,7 +231,7 @@ void DrawStdWindowFrame(u8 windowId, bool8 copyToVram) void ClearDialogWindowAndFrame(u8 windowId, bool8 copyToVram) { CallWindowFunction(windowId, WindowFunc_ClearDialogWindowAndFrame); - FillWindowPixelBuffer(windowId, PALETTE_NUM_TO_FILL_VALUE(1)); + FillWindowPixelBuffer(windowId, PIXEL_FILL(1)); ClearWindowTilemap(windowId); if (copyToVram == TRUE) CopyWindowToVram(windowId, 3); @@ -240,7 +240,7 @@ void ClearDialogWindowAndFrame(u8 windowId, bool8 copyToVram) void ClearStdWindowAndFrame(u8 windowId, bool8 copyToVram) { CallWindowFunction(windowId, WindowFunc_ClearStdWindowAndFrame); - FillWindowPixelBuffer(windowId, PALETTE_NUM_TO_FILL_VALUE(1)); + FillWindowPixelBuffer(windowId, PIXEL_FILL(1)); ClearWindowTilemap(windowId); if (copyToVram == TRUE) CopyWindowToVram(windowId, 3); @@ -554,7 +554,7 @@ void DrawDialogFrameWithCustomTileAndPalette(u8 windowId, bool8 copyToVram, u16 sTileNum = tileNum; sPaletteNum = paletteNum; CallWindowFunction(windowId, WindowFunc_DrawDialogFrameWithCustomTileAndPalette); - FillWindowPixelBuffer(windowId, PALETTE_NUM_TO_FILL_VALUE(1)); + FillWindowPixelBuffer(windowId, PIXEL_FILL(1)); PutWindowTilemap(windowId); if (copyToVram == TRUE) CopyWindowToVram(windowId, 3); @@ -566,7 +566,7 @@ void DrawDialogFrameWithCustomTile(u8 windowId, bool8 copyToVram, u16 tileNum) sTileNum = tileNum; sPaletteNum = GetWindowAttribute(windowId, WINDOW_PALETTE_NUM); CallWindowFunction(windowId, WindowFunc_DrawDialogFrameWithCustomTileAndPalette); - FillWindowPixelBuffer(windowId, PALETTE_NUM_TO_FILL_VALUE(1)); + FillWindowPixelBuffer(windowId, PIXEL_FILL(1)); PutWindowTilemap(windowId); if (copyToVram == TRUE) CopyWindowToVram(windowId, 3); @@ -671,7 +671,7 @@ void ClearDialogWindowAndFrameToTransparent(u8 windowId, bool8 copyToVram) { // The palette slot doesn't matter, since the tiles are transparent. CallWindowFunction(windowId, WindowFunc_ClearDialogWindowAndFrameNullPalette); - FillWindowPixelBuffer(windowId, PALETTE_NUM_TO_FILL_VALUE(0)); + FillWindowPixelBuffer(windowId, PIXEL_FILL(0)); ClearWindowTilemap(windowId); if (copyToVram == TRUE) CopyWindowToVram(windowId, 3); @@ -687,7 +687,7 @@ void DrawStdFrameWithCustomTileAndPalette(u8 windowId, bool8 copyToVram, u16 bas sTileNum = baseTileNum; sPaletteNum = paletteNum; CallWindowFunction(windowId, WindowFunc_DrawStdFrameWithCustomTileAndPalette); - FillWindowPixelBuffer(windowId, PALETTE_NUM_TO_FILL_VALUE(1)); + FillWindowPixelBuffer(windowId, PIXEL_FILL(1)); PutWindowTilemap(windowId); if (copyToVram == TRUE) CopyWindowToVram(windowId, 3); @@ -699,7 +699,7 @@ void DrawStdFrameWithCustomTile(u8 windowId, bool8 copyToVram, u16 baseTileNum) sTileNum = baseTileNum; sPaletteNum = GetWindowAttribute(windowId, WINDOW_PALETTE_NUM); CallWindowFunction(windowId, WindowFunc_DrawStdFrameWithCustomTileAndPalette); - FillWindowPixelBuffer(windowId, PALETTE_NUM_TO_FILL_VALUE(1)); + FillWindowPixelBuffer(windowId, PIXEL_FILL(1)); PutWindowTilemap(windowId); if (copyToVram == TRUE) CopyWindowToVram(windowId, 3); @@ -768,7 +768,7 @@ void WindowFunc_DrawStdFrameWithCustomTileAndPalette(u8 bg, u8 tilemapLeft, u8 t void ClearStdWindowAndFrameToTransparent(u8 windowId, bool8 copyToVram) { CallWindowFunction(windowId, WindowFunc_ClearStdWindowAndFrameToTransparent); - FillWindowPixelBuffer(windowId, PALETTE_NUM_TO_FILL_VALUE(0)); + FillWindowPixelBuffer(windowId, PIXEL_FILL(0)); ClearWindowTilemap(windowId); if (copyToVram == TRUE) CopyWindowToVram(windowId, 3); @@ -814,7 +814,7 @@ void sub_8198180(const u8 *string, u8 a2, bool8 copyToVram) if (sWindowId != 0xFF) { PutWindowTilemap(sWindowId); - FillWindowPixelBuffer(sWindowId, PALETTE_NUM_TO_FILL_VALUE(15)); + FillWindowPixelBuffer(sWindowId, PIXEL_FILL(15)); width = GetStringWidth(0, string, 0); AddTextPrinterParameterized3(sWindowId, 0, @@ -848,7 +848,7 @@ void sub_8198204(const u8 *string, const u8 *string2, u8 a3, u8 a4, bool8 copyTo color[2] = 2; } PutWindowTilemap(sWindowId); - FillWindowPixelBuffer(sWindowId, PALETTE_NUM_TO_FILL_VALUE(15)); + FillWindowPixelBuffer(sWindowId, PIXEL_FILL(15)); if (string2 != NULL) { width = GetStringWidth(0, string2, 0); @@ -876,7 +876,7 @@ void sub_81982F0(void) { if (sWindowId != 0xFF) { - FillWindowPixelBuffer(sWindowId, PALETTE_NUM_TO_FILL_VALUE(15)); + FillWindowPixelBuffer(sWindowId, PIXEL_FILL(15)); CopyWindowToVram(sWindowId, 3); } } @@ -885,7 +885,7 @@ void sub_8198314(void) { if (sWindowId != 0xFF) { - FillWindowPixelBuffer(sWindowId, PALETTE_NUM_TO_FILL_VALUE(0)); + FillWindowPixelBuffer(sWindowId, PIXEL_FILL(0)); ClearWindowTilemap(sWindowId); CopyWindowToVram(sWindowId, 3); RemoveWindow(sWindowId); @@ -934,7 +934,7 @@ void RedrawMenuCursor(u8 oldPos, u8 newPos) width = GetMenuCursorDimensionByFont(sMenu.fontId, 0); height = GetMenuCursorDimensionByFont(sMenu.fontId, 1); - FillWindowPixelRect(sMenu.windowId, PALETTE_NUM_TO_FILL_VALUE(1), sMenu.left, sMenu.optionHeight * oldPos + sMenu.top, width, height); + FillWindowPixelRect(sMenu.windowId, PIXEL_FILL(1), sMenu.left, sMenu.optionHeight * oldPos + sMenu.top, width, height); AddTextPrinterParameterized(sMenu.windowId, sMenu.fontId, gText_SelectorArrow3, sMenu.left, sMenu.optionHeight * newPos + sMenu.top, 0, 0); } @@ -1313,7 +1313,7 @@ void sub_8199060(u8 oldCursorPos, u8 newCursorPos) u8 xPos = (oldCursorPos % sMenu.horizontalCount) * sMenu.optionWidth + sMenu.left; u8 yPos = (oldCursorPos / sMenu.horizontalCount) * sMenu.optionHeight + sMenu.top; FillWindowPixelRect(sMenu.windowId, - PALETTE_NUM_TO_FILL_VALUE(1), + PIXEL_FILL(1), xPos, yPos, cursorWidth, diff --git a/src/money.c b/src/money.c index e7ae6080ce..4ff8086ead 100644 --- a/src/money.c +++ b/src/money.c @@ -169,7 +169,7 @@ void DrawMoneyBox(int amount, u8 x, u8 y) SetWindowTemplateFields(&template, 0, x + 1, y + 1, 10, 2, 15, 8); sMoneyBoxWindowId = AddWindow(&template); - FillWindowPixelBuffer(sMoneyBoxWindowId, PALETTE_NUM_TO_FILL_VALUE(0)); + FillWindowPixelBuffer(sMoneyBoxWindowId, PIXEL_FILL(0)); PutWindowTilemap(sMoneyBoxWindowId); CopyWindowToVram(sMoneyBoxWindowId, 1); PrintMoneyAmountInMoneyBoxWithBorder(sMoneyBoxWindowId, 0x214, 14, amount); diff --git a/src/mystery_event_menu.c b/src/mystery_event_menu.c index 2a16175927..1c886565a5 100644 --- a/src/mystery_event_menu.c +++ b/src/mystery_event_menu.c @@ -90,7 +90,7 @@ void CB2_InitMysteryEventMenu(void) DeactivateAllTextPrinters(); for (i = 0; i < 2; i++) - FillWindowPixelBuffer(i, PALETTE_NUM_TO_FILL_VALUE(0)); + FillWindowPixelBuffer(i, PIXEL_FILL(0)); FillBgTilemapBufferRect_Palette0(0, 0, 0, 0, 0x1E, 0x14); LoadUserWindowBorderGfx(0, 1u, 0xD0u); @@ -313,6 +313,6 @@ static void PrintMysteryMenuText(u8 windowId, const u8 *text, u8 x, u8 y, s32 sp textColor[1] = 2; textColor[2] = 3; - FillWindowPixelBuffer(windowId, PALETTE_NUM_TO_FILL_VALUE(textColor[0])); + FillWindowPixelBuffer(windowId, PIXEL_FILL(textColor[0])); AddTextPrinterParameterized4(windowId, 1, x, y, letterSpacing, lineSpacing, textColor, speed, text); } diff --git a/src/naming_screen.c b/src/naming_screen.c index e4159e3beb..22bbb84d71 100644 --- a/src/naming_screen.c +++ b/src/naming_screen.c @@ -1474,7 +1474,7 @@ static void HandleDpadMovement(struct Task *task) static void sub_80E4894(void) { - FillWindowPixelBuffer(gNamingScreenData->windows[3], PALETTE_NUM_TO_FILL_VALUE(1)); + FillWindowPixelBuffer(gNamingScreenData->windows[3], PIXEL_FILL(1)); AddTextPrinterParameterized(gNamingScreenData->windows[3], 1, gNamingScreenData->template->title, 8, 1, 0, 0); PutWindowTilemap(gNamingScreenData->windows[3]); } @@ -1485,7 +1485,7 @@ static void sub_80E48E8(void) StringCopy(buffer, gSpeciesNames[gNamingScreenData->monSpecies]); StringAppendN(buffer, gNamingScreenData->template->title, 15); - FillWindowPixelBuffer(gNamingScreenData->windows[3], PALETTE_NUM_TO_FILL_VALUE(1)); + FillWindowPixelBuffer(gNamingScreenData->windows[3], PIXEL_FILL(1)); AddTextPrinterParameterized(gNamingScreenData->windows[3], 1, buffer, 8, 1, 0, 0); PutWindowTilemap(gNamingScreenData->windows[3]); } @@ -1672,7 +1672,7 @@ static void sub_80E4D10(void) u8 maxChars = gNamingScreenData->template->maxChars; u16 unk = gNamingScreenData->inputCharBaseXPos - 0x40; - FillWindowPixelBuffer(gNamingScreenData->windows[2], PALETTE_NUM_TO_FILL_VALUE(1)); + FillWindowPixelBuffer(gNamingScreenData->windows[2], PIXEL_FILL(1)); for (i = 0; i < maxChars; i++) { @@ -1704,9 +1704,9 @@ static const struct TextColorThing sUnkColorStruct = static const u8 sFillValues[3] = { - PALETTE_NUM_TO_FILL_VALUE(0xE), - PALETTE_NUM_TO_FILL_VALUE(0xD), - PALETTE_NUM_TO_FILL_VALUE(0xF) + PIXEL_FILL(0xE), + PIXEL_FILL(0xD), + PIXEL_FILL(0xF) }; static const u8 *const sUnkColors[3] = @@ -1768,7 +1768,7 @@ static void sub_80E4EF0(void) { const u8 color[3] = { 15, 1, 2 }; - FillWindowPixelBuffer(gNamingScreenData->windows[4], PALETTE_NUM_TO_FILL_VALUE(15)); + FillWindowPixelBuffer(gNamingScreenData->windows[4], PIXEL_FILL(15)); AddTextPrinterParameterized3(gNamingScreenData->windows[4], 0, 2, 1, color, 0, gText_MoveOkBack); PutWindowTilemap(gNamingScreenData->windows[4]); CopyWindowToVram(gNamingScreenData->windows[4], 3); diff --git a/src/option_menu.c b/src/option_menu.c index 94bbef3063..1766f0bdbe 100644 --- a/src/option_menu.c +++ b/src/option_menu.c @@ -620,7 +620,7 @@ static void ButtonMode_DrawChoices(u8 selection) static void DrawTextOption(void) { - FillWindowPixelBuffer(WIN_TEXT_OPTION, PALETTE_NUM_TO_FILL_VALUE(1)); + FillWindowPixelBuffer(WIN_TEXT_OPTION, PIXEL_FILL(1)); AddTextPrinterParameterized(WIN_TEXT_OPTION, 1, gText_Option, 8, 1, TEXT_SPEED_FF, NULL); CopyWindowToVram(WIN_TEXT_OPTION, 3); } @@ -629,7 +629,7 @@ static void DrawOptionMenuTexts(void) { u8 i; - FillWindowPixelBuffer(WIN_OPTIONS, PALETTE_NUM_TO_FILL_VALUE(1)); + FillWindowPixelBuffer(WIN_OPTIONS, PIXEL_FILL(1)); for (i = 0; i < MENUITEM_COUNT; i++) { AddTextPrinterParameterized(WIN_OPTIONS, 1, sOptionMenuItemsNames[i], 8, (i * 16) + 1, TEXT_SPEED_FF, NULL); diff --git a/src/party_menu.c b/src/party_menu.c index 03e267e74f..23e4361bcc 100755 --- a/src/party_menu.c +++ b/src/party_menu.c @@ -3108,7 +3108,7 @@ static void sub_81B239C(u8 a) } DeactivateAllTextPrinters(); for (i = 0; i < PARTY_SIZE; i++) - FillWindowPixelBuffer(i, PALETTE_NUM_TO_FILL_VALUE(0)); + FillWindowPixelBuffer(i, PIXEL_FILL(0)); LoadUserWindowBorderGfx(0, 0x4F, 0xD0); LoadPalette(GetOverworldTextboxPalettePtr(), 0xE0, 0x20); LoadPalette(gUnknown_0860F074, 0xF0, 0x20); @@ -3126,7 +3126,7 @@ static void sub_81B2428(bool8 a) if (a == TRUE) { firstWindowId = AddWindow(&gUnknown_08615918); - FillWindowPixelBuffer(firstWindowId, PALETTE_NUM_TO_FILL_VALUE(0)); + FillWindowPixelBuffer(firstWindowId, PIXEL_FILL(0)); mainOffset = GetStringCenterAlignXOffset(0, gMenuText_Confirm, 48); AddTextPrinterParameterized4(firstWindowId, 0, mainOffset, 1, 0, 0, gUnknown_086157FC[0], -1, gMenuText_Confirm); PutWindowTilemap(firstWindowId); @@ -3139,7 +3139,7 @@ static void sub_81B2428(bool8 a) windowId = AddWindow(&gUnknown_08615908); offset = 3; } - FillWindowPixelBuffer(windowId, PALETTE_NUM_TO_FILL_VALUE(0)); + FillWindowPixelBuffer(windowId, PIXEL_FILL(0)); if (gUnknown_0203CEC8.unk8_0 != 10) { mainOffset = GetStringCenterAlignXOffset(0, gText_Cancel, 48); diff --git a/src/player_pc.c b/src/player_pc.c index c088a6ce7f..6e78533e7a 100644 --- a/src/player_pc.c +++ b/src/player_pc.c @@ -977,7 +977,7 @@ static void sub_816BEF0(s32 id) description = (u8 *)ItemId_GetDescription(gSaveBlock1Ptr->pcItems[id].itemId); else description = ItemStorage_GetItemPcResponse(ITEMPC_GO_BACK_TO_PREV); - FillWindowPixelBuffer(windowId, PALETTE_NUM_TO_FILL_VALUE(1)); + FillWindowPixelBuffer(windowId, PIXEL_FILL(1)); AddTextPrinterParameterized(windowId, 1, description, 0, 1, 0, NULL); } @@ -1005,7 +1005,7 @@ static void sub_816BFE0(u8 y, u8 b, u8 speed) { u8 windowId = gUnknown_0203BCC4->windowIds[0]; if (b == 0xFF) - FillWindowPixelRect(windowId, PALETTE_NUM_TO_FILL_VALUE(1), 0, y, GetMenuCursorDimensionByFont(1, 0), GetMenuCursorDimensionByFont(1, 1)); + FillWindowPixelRect(windowId, PIXEL_FILL(1), 0, y, GetMenuCursorDimensionByFont(1, 0), GetMenuCursorDimensionByFont(1, 1)); else AddTextPrinterParameterized4(windowId, 1, 0, y, 0, 0, gUnknown_085DFF8C, speed, gText_SelectorArrow2); } @@ -1123,7 +1123,7 @@ static const u8* ItemStorage_GetItemPcResponse(u16 itemId) static void ItemStorage_PrintItemPcResponse(const u8 *string) { u8 windowId = gUnknown_0203BCC4->windowIds[1]; - FillWindowPixelBuffer(windowId, PALETTE_NUM_TO_FILL_VALUE(1)); + FillWindowPixelBuffer(windowId, PIXEL_FILL(1)); StringExpandPlaceholders(gStringVar4, string); AddTextPrinterParameterized(windowId, 1, gStringVar4, 0, 1, 0, NULL); } diff --git a/src/pokeblock.c b/src/pokeblock.c index 4bd4a8ccb1..2682754aa2 100644 --- a/src/pokeblock.c +++ b/src/pokeblock.c @@ -665,7 +665,7 @@ static void HandleInitWindows(void) for (i = 0; i < ARRAY_COUNT(sWindowTemplatesForPokeblockMenu) - 1; i++) { - FillWindowPixelBuffer(i, PALETTE_NUM_TO_FILL_VALUE(0)); + FillWindowPixelBuffer(i, PIXEL_FILL(0)); } schedule_bg_copy_tilemap_to_vram(0); @@ -749,7 +749,7 @@ static void sub_8135FCC(s32 pkblId) struct Pokeblock *pokeblock; u16 rectTilemapSrc[2]; - FillWindowPixelBuffer(7, PALETTE_NUM_TO_FILL_VALUE(0)); + FillWindowPixelBuffer(7, PIXEL_FILL(0)); if (pkblId != LIST_B_PRESSED) { diff --git a/src/pokeblock_feed.c b/src/pokeblock_feed.c index 908aec1c09..d72a9ffbe2 100644 --- a/src/pokeblock_feed.c +++ b/src/pokeblock_feed.c @@ -704,7 +704,7 @@ static void HandleInitWindows(void) DeactivateAllTextPrinters(); LoadUserWindowBorderGfx(0, 1, 0xE0); LoadPalette(gUnknown_0860F074, 0xF0, 0x20); - FillWindowPixelBuffer(0, PALETTE_NUM_TO_FILL_VALUE(0)); + FillWindowPixelBuffer(0, PIXEL_FILL(0)); PutWindowTilemap(0); schedule_bg_copy_tilemap_to_vram(0); } diff --git a/src/pokedex.c b/src/pokedex.c index f54fdbd295..4bf8dff6db 100644 --- a/src/pokedex.c +++ b/src/pokedex.c @@ -2152,7 +2152,7 @@ static void CreateCaughtBall(u16 a, u8 x, u8 y, u16 unused) if (a) BlitBitmapToWindow(0, gUnknown_0855D2BE, x * 8, y * 8, 8, 16); else - FillWindowPixelRect(0, PALETTE_NUM_TO_FILL_VALUE(0), x * 8, y * 8, 8, 16); + FillWindowPixelRect(0, PIXEL_FILL(0), x * 8, y * 8, 8, 16); } static u8 CreateMonName(u16 num, u8 left, u8 top) @@ -2170,7 +2170,7 @@ static u8 CreateMonName(u16 num, u8 left, u8 top) void sub_80BD28C(u8 x, u8 y, u16 unused) { - FillWindowPixelRect(0, PALETTE_NUM_TO_FILL_VALUE(0), x * 8, y * 8, 0x60, 16); + FillWindowPixelRect(0, PIXEL_FILL(0), x * 8, y * 8, 0x60, 16); } static void CreateInitialPokemonSprites(u16 selectedMon, u16 b) @@ -2927,7 +2927,7 @@ void sub_80BEA24(u8 taskId) case 1: DecompressAndLoadBgGfxUsingHeap(3, gPokedexMenu_Gfx, 0x2000, 0, 0); CopyToBgTilemapBuffer(3, gPokedexTilemap_DescriptionScreen, 0, 0); - FillWindowPixelBuffer(0, PALETTE_NUM_TO_FILL_VALUE(0)); + FillWindowPixelBuffer(0, PIXEL_FILL(0)); PutWindowTilemap(0); PutWindowTilemap(1); sub_80C0D30(1, sPokedexListItem->dexNum); @@ -3222,7 +3222,7 @@ void sub_80BF250(u8 taskId) case 1: DecompressAndLoadBgGfxUsingHeap(3, &gPokedexMenu_Gfx, 0x2000, 0, 0); CopyToBgTilemapBuffer(3, &gPokedexTilemap_CryScreen, 0, 0); - FillWindowPixelBuffer(0, PALETTE_NUM_TO_FILL_VALUE(0)); + FillWindowPixelBuffer(0, PIXEL_FILL(0)); PutWindowTilemap(0); PutWindowTilemap(3); PutWindowTilemap(2); @@ -3416,7 +3416,7 @@ void sub_80BF82C(u8 taskId) case 1: DecompressAndLoadBgGfxUsingHeap(3, gPokedexMenu_Gfx, 0x2000, 0, 0); CopyToBgTilemapBuffer(3, gPokedexTilemap_SizeScreen, 0, 0); - FillWindowPixelBuffer(0, PALETTE_NUM_TO_FILL_VALUE(0)); + FillWindowPixelBuffer(0, PIXEL_FILL(0)); PutWindowTilemap(0); gMain.state++; break; @@ -3766,7 +3766,7 @@ void sub_80BFE38(u8 taskId) case 1: DecompressAndLoadBgGfxUsingHeap(3, gPokedexMenu_Gfx, 0x2000, 0, 0); CopyToBgTilemapBuffer(3, gPokedexTilemap_DescriptionScreen, 0, 0); - FillWindowPixelBuffer(0, PALETTE_NUM_TO_FILL_VALUE(0)); + FillWindowPixelBuffer(0, PIXEL_FILL(0)); PutWindowTilemap(0); PutWindowTilemap(1); sub_80C0D30(1, gTasks[taskId].data[1]); @@ -4784,7 +4784,7 @@ void sub_80C1270(const u8 *str, u32 left, u32 top) void sub_80C12B0(u32 x, u32 y, u32 width, u32 height) { - FillWindowPixelRect(0, PALETTE_NUM_TO_FILL_VALUE(0), x, y, width, height); + FillWindowPixelRect(0, PIXEL_FILL(0), x, y, width, height); } void sub_80C12E0(u8 taskId) diff --git a/src/pokemon_storage_system.c b/src/pokemon_storage_system.c index d18077f21e..9681b72f48 100644 --- a/src/pokemon_storage_system.c +++ b/src/pokemon_storage_system.c @@ -1552,7 +1552,7 @@ void sub_80C6D80(const u8 *string, void *dst, u8 arg2, u8 arg3, s32 arg4) winTemplate.width = 24; winTemplate.height = 2; windowId = AddWindow(&winTemplate); - FillWindowPixelBuffer(windowId, PALETTE_NUM_TO_FILL_VALUE(arg3)); + FillWindowPixelBuffer(windowId, PIXEL_FILL(arg3)); tileData1 = (u8*) GetWindowAttribute(windowId, WINDOW_TILE_DATA); tileData2 = (winTemplate.width * 32) + tileData1; @@ -1599,7 +1599,7 @@ void sub_80C6EAC(const u8 *string, void *dst, u16 arg2, u8 arg3, u8 clr2, u8 clr winTemplate.height = 2; var = winTemplate.width * 32; windowId = AddWindow(&winTemplate); - FillWindowPixelBuffer(windowId, PALETTE_NUM_TO_FILL_VALUE(arg3)); + FillWindowPixelBuffer(windowId, PIXEL_FILL(arg3)); tileData1 = (u8*) GetWindowAttribute(windowId, WINDOW_TILE_DATA); tileData2 = (winTemplate.width * 32) + tileData1; txtColor[0] = arg3; @@ -1737,7 +1737,7 @@ static void Task_PokemonStorageSystemPC(u8 taskId) CreatePCMenu(task->data[1], &task->data[15]); sub_81973A4(); DrawDialogueFrame(0, 0); - FillWindowPixelBuffer(0, PALETTE_NUM_TO_FILL_VALUE(1)); + FillWindowPixelBuffer(0, PIXEL_FILL(1)); AddTextPrinterParameterized2(0, 1, gUnknown_085716C0[task->data[1]].desc, TEXT_SPEED_FF, NULL, 2, 1, 3); CopyWindowToVram(0, 3); CopyWindowToVram(task->data[15], 3); @@ -1763,7 +1763,7 @@ static void Task_PokemonStorageSystemPC(u8 taskId) if (task->data[1] != task->data[3]) { task->data[1] = task->data[3]; - FillWindowPixelBuffer(0, PALETTE_NUM_TO_FILL_VALUE(1)); + FillWindowPixelBuffer(0, PIXEL_FILL(1)); AddTextPrinterParameterized2(0, 1, gUnknown_085716C0[task->data[1]].desc, 0, NULL, 2, 1, 3); } break; @@ -1778,13 +1778,13 @@ static void Task_PokemonStorageSystemPC(u8 taskId) default: if (task->data[2] == 0 && CountPartyMons() == PARTY_SIZE) { - FillWindowPixelBuffer(0, PALETTE_NUM_TO_FILL_VALUE(1)); + FillWindowPixelBuffer(0, PIXEL_FILL(1)); AddTextPrinterParameterized2(0, 1, gText_PartyFull, 0, NULL, 2, 1, 3); task->data[0] = 3; } else if (task->data[2] == 1 && CountPartyMons() == 1) { - FillWindowPixelBuffer(0, PALETTE_NUM_TO_FILL_VALUE(1)); + FillWindowPixelBuffer(0, PIXEL_FILL(1)); AddTextPrinterParameterized2(0, 1, gText_JustOnePkmn, 0, NULL, 2, 1, 3); task->data[0] = 3; } @@ -1799,7 +1799,7 @@ static void Task_PokemonStorageSystemPC(u8 taskId) case 3: if (gMain.newKeys & (A_BUTTON | B_BUTTON)) { - FillWindowPixelBuffer(0, PALETTE_NUM_TO_FILL_VALUE(1)); + FillWindowPixelBuffer(0, PIXEL_FILL(1)); AddTextPrinterParameterized2(0, 1, gUnknown_085716C0[task->data[1]].desc, 0, NULL, 2, 1, 3); task->data[0] = 2; } @@ -1809,7 +1809,7 @@ static void Task_PokemonStorageSystemPC(u8 taskId) task->data[1] = 4; Menu_MoveCursor(-1); task->data[1] = Menu_GetCursorPos(); - FillWindowPixelBuffer(0, PALETTE_NUM_TO_FILL_VALUE(1)); + FillWindowPixelBuffer(0, PIXEL_FILL(1)); AddTextPrinterParameterized2(0, 1, gUnknown_085716C0[task->data[1]].desc, 0, NULL, 2, 1, 3); task->data[0] = 2; } @@ -1819,7 +1819,7 @@ static void Task_PokemonStorageSystemPC(u8 taskId) task->data[1] = 0; Menu_MoveCursor(1); task->data[1] = Menu_GetCursorPos(); - FillWindowPixelBuffer(0, PALETTE_NUM_TO_FILL_VALUE(1)); + FillWindowPixelBuffer(0, PIXEL_FILL(1)); AddTextPrinterParameterized2(0, 1, gUnknown_085716C0[task->data[1]].desc, 0, NULL, 2, 1, 3); task->data[0] = 2; } @@ -2103,7 +2103,7 @@ static void sub_80C7BE4(void) winTemplate.height = 4; windowId = AddWindow(&winTemplate); - FillWindowPixelBuffer(windowId, PALETTE_NUM_TO_FILL_VALUE(4)); + FillWindowPixelBuffer(windowId, PIXEL_FILL(4)); center = GetStringCenterAlignXOffset(1, boxName, 64); AddTextPrinterParameterized3(windowId, 1, center, 1, gUnknown_08571734, TEXT_SPEED_FF, boxName); @@ -4107,7 +4107,7 @@ static void LoadCursorMonGfx(u16 species, u32 pid) static void PrintCursorMonInfo(void) { - FillWindowPixelBuffer(0, PALETTE_NUM_TO_FILL_VALUE(1)); + FillWindowPixelBuffer(0, PIXEL_FILL(1)); if (sPSSData->boxOption != BOX_OPTION_MOVE_ITEMS) { AddTextPrinterParameterized(0, 1, sPSSData->cursorMonNickText, 6, 0, TEXT_SPEED_FF, NULL); @@ -4416,7 +4416,7 @@ static void PrintStorageActionText(u8 id) } DynamicPlaceholderTextUtil_ExpandPlaceholders(sPSSData->field_2190, gPCStorageActionTexts[id].text); - FillWindowPixelBuffer(1, PALETTE_NUM_TO_FILL_VALUE(1)); + FillWindowPixelBuffer(1, PIXEL_FILL(1)); AddTextPrinterParameterized(1, 1, sPSSData->field_2190, 0, 1, TEXT_SPEED_FF, NULL); sub_8098858(1, 2, 14); PutWindowTilemap(1); @@ -8835,7 +8835,7 @@ static bool8 sub_80D0164(void) sPSSData->field_2200 = AddWindow8Bit(&gUnknown_0857BB1C); if (sPSSData->field_2200 != 0xFF) { - FillWindowPixelBuffer(sPSSData->field_2200, PALETTE_NUM_TO_FILL_VALUE(0)); + FillWindowPixelBuffer(sPSSData->field_2200, PIXEL_FILL(0)); return TRUE; } } @@ -8892,7 +8892,7 @@ static bool8 sub_80D024C(void) ChangeBgX(0, -1024, 0); ChangeBgY(0, -1024, 0); FillBgTilemapBufferRect_Palette0(0, 0, 0, 0, 0x20, 0x20); - FillWindowPixelBuffer8Bit(sPSSData->field_2200, PALETTE_NUM_TO_FILL_VALUE(0)); + FillWindowPixelBuffer8Bit(sPSSData->field_2200, PIXEL_FILL(0)); sub_80D07B0(sMoveMonsPtr->fromRow, sMoveMonsPtr->fromColumn); SetBgAttribute(0, BG_ATTR_PALETTEMODE, 1); PutWindowTilemap(sPSSData->field_2200); @@ -9194,7 +9194,7 @@ static void sub_80D0834(u8 arg0, u8 arg1) if (species != SPECIES_NONE) { FillWindowPixelRect8Bit(sPSSData->field_2200, - PALETTE_NUM_TO_FILL_VALUE(0), + PIXEL_FILL(0), 24 * arg0, 24 * arg1, 32, @@ -9911,7 +9911,7 @@ static void PrintItemDescription(void) else description = ItemId_GetDescription(sPSSData->cursorMonItem); - FillWindowPixelBuffer(2, PALETTE_NUM_TO_FILL_VALUE(1)); + FillWindowPixelBuffer(2, PIXEL_FILL(1)); AddTextPrinterParameterized5(2, 1, description, 4, 0, 0, NULL, 0, 1); } diff --git a/src/pokemon_summary_screen.c b/src/pokemon_summary_screen.c index f0c68e7d0e..91e3441234 100644 --- a/src/pokemon_summary_screen.c +++ b/src/pokemon_summary_screen.c @@ -2629,7 +2629,7 @@ static void ResetWindows(void) for (i = 0; i < 20; i++) { - FillWindowPixelBuffer(i, PALETTE_NUM_TO_FILL_VALUE(0)); + FillWindowPixelBuffer(i, PIXEL_FILL(0)); } for (i = 0; i < ARRAY_COUNT(pssData->windowIds); i++) { @@ -2644,9 +2644,9 @@ static void SummaryScreen_PrintTextOnWindow(u8 windowId, const u8 *string, u8 x, static void sub_81C25E8(void) { - FillWindowPixelBuffer(17, PALETTE_NUM_TO_FILL_VALUE(0)); - FillWindowPixelBuffer(18, PALETTE_NUM_TO_FILL_VALUE(0)); - FillWindowPixelBuffer(19, PALETTE_NUM_TO_FILL_VALUE(0)); + FillWindowPixelBuffer(17, PIXEL_FILL(0)); + FillWindowPixelBuffer(18, PIXEL_FILL(0)); + FillWindowPixelBuffer(19, PIXEL_FILL(0)); if (!pssData->summary.isEgg) sub_81C2628(); else @@ -2898,7 +2898,7 @@ static u8 AddWindowFromTemplateList(const struct WindowTemplate *template, u8 te if (*windowIdPtr == 0xFF) { *windowIdPtr = AddWindow(&template[templateId]); - FillWindowPixelBuffer(*windowIdPtr, PALETTE_NUM_TO_FILL_VALUE(0)); + FillWindowPixelBuffer(*windowIdPtr, PIXEL_FILL(0)); } return *windowIdPtr; } @@ -2920,7 +2920,7 @@ static void PrintPageSpecificText(u8 pageIndex) for (i = 0; i < ARRAY_COUNT(pssData->windowIds); i++) { if (pssData->windowIds[i] != 0xFF) - FillWindowPixelBuffer(pssData->windowIds[i], PALETTE_NUM_TO_FILL_VALUE(0)); + FillWindowPixelBuffer(pssData->windowIds[i], PIXEL_FILL(0)); } sTextPrinterFunctions[pageIndex](); } @@ -3469,7 +3469,7 @@ static void PrintMovePowerAndAccuracy(u16 moveIndex) const u8 *text; if (moveIndex != 0) { - FillWindowPixelRect(14, PALETTE_NUM_TO_FILL_VALUE(0), 53, 0, 19, 32); + FillWindowPixelRect(14, PIXEL_FILL(0), 53, 0, 19, 32); if (gBattleMoves[moveIndex].power < 2) { @@ -3567,7 +3567,7 @@ static void PrintContestMoveDescription(u8 moveSlot) static void PrintMoveDetails(u16 move) { u8 windowId = AddWindowFromTemplateList(sPageMovesTemplate, 2); - FillWindowPixelBuffer(windowId, PALETTE_NUM_TO_FILL_VALUE(0)); + FillWindowPixelBuffer(windowId, PIXEL_FILL(0)); if (move != MOVE_NONE) { if (pssData->currPageIndex == 2) @@ -3619,7 +3619,7 @@ static void PrintNewMoveDetailsOrCancelText(void) static void sub_81C4064(void) { u8 windowId = AddWindowFromTemplateList(sPageMovesTemplate, 0); - FillWindowPixelRect(windowId, PALETTE_NUM_TO_FILL_VALUE(0), 0, 66, 72, 16); + FillWindowPixelRect(windowId, PIXEL_FILL(0), 0, 66, 72, 16); CopyWindowToVram(windowId, 2); } @@ -3628,11 +3628,11 @@ static void sub_81C40A0(u8 moveIndex1, u8 moveIndex2) u8 windowId1 = AddWindowFromTemplateList(sPageMovesTemplate, 0); u8 windowId2 = AddWindowFromTemplateList(sPageMovesTemplate, 1); - FillWindowPixelRect(windowId1, PALETTE_NUM_TO_FILL_VALUE(0), 0, moveIndex1 * 16, 0x48, 0x10); - FillWindowPixelRect(windowId1, PALETTE_NUM_TO_FILL_VALUE(0), 0, moveIndex2 * 16, 0x48, 0x10); + FillWindowPixelRect(windowId1, PIXEL_FILL(0), 0, moveIndex1 * 16, 0x48, 0x10); + FillWindowPixelRect(windowId1, PIXEL_FILL(0), 0, moveIndex2 * 16, 0x48, 0x10); - FillWindowPixelRect(windowId2, PALETTE_NUM_TO_FILL_VALUE(0), 0, moveIndex1 * 16, 0x30, 0x10); - FillWindowPixelRect(windowId2, PALETTE_NUM_TO_FILL_VALUE(0), 0, moveIndex2 * 16, 0x30, 0x10); + FillWindowPixelRect(windowId2, PIXEL_FILL(0), 0, moveIndex1 * 16, 0x30, 0x10); + FillWindowPixelRect(windowId2, PIXEL_FILL(0), 0, moveIndex2 * 16, 0x30, 0x10); PrintMoveNameAndPP(moveIndex1); PrintMoveNameAndPP(moveIndex2); @@ -3641,7 +3641,7 @@ static void sub_81C40A0(u8 moveIndex1, u8 moveIndex2) static void PrintHMMovesCantBeForgotten(void) { u8 windowId = AddWindowFromTemplateList(sPageMovesTemplate, 2); - FillWindowPixelBuffer(windowId, PALETTE_NUM_TO_FILL_VALUE(0)); + FillWindowPixelBuffer(windowId, PIXEL_FILL(0)); SummaryScreen_PrintTextOnWindow(windowId, gText_HMMovesCantBeForgotten2, 6, 1, 0, 0); } diff --git a/src/pokenav.c b/src/pokenav.c index 05aa559ece..217d98132f 100644 --- a/src/pokenav.c +++ b/src/pokenav.c @@ -1138,8 +1138,8 @@ bool32 IsDma3ManagerBusyWithBgCopy_(void) void sub_81C7BF8(u32 windowId) { - FillWindowPixelBuffer(windowId, PALETTE_NUM_TO_FILL_VALUE(4)); - FillWindowPixelRect(windowId, PALETTE_NUM_TO_FILL_VALUE(5), 0, 0, 0x80, 1); + FillWindowPixelBuffer(windowId, PIXEL_FILL(4)); + FillWindowPixelRect(windowId, PIXEL_FILL(5), 0, 0, 0x80, 1); } void sub_81C7C28(void) diff --git a/src/region_map.c b/src/region_map.c index 6d5224821c..67cf9cc0fb 100644 --- a/src/region_map.c +++ b/src/region_map.c @@ -1622,7 +1622,7 @@ void MCB2_FlyMap(void) case 7: LoadPalette(sRegionMapFramePal, 0x10, 0x20); PutWindowTilemap(2); - FillWindowPixelBuffer(2, PALETTE_NUM_TO_FILL_VALUE(0)); + FillWindowPixelBuffer(2, PIXEL_FILL(0)); AddTextPrinterParameterized(2, 1, gText_FlyToWhere, 0, 1, 0, NULL); schedule_bg_copy_tilemap_to_vram(0); gMain.state++; @@ -1707,7 +1707,7 @@ static void sub_8124904(void) } else { - FillWindowPixelBuffer(0, PALETTE_NUM_TO_FILL_VALUE(1)); + FillWindowPixelBuffer(0, PIXEL_FILL(1)); } AddTextPrinterParameterized(0, 1, sFlyMap->regionMap.mapSecName, 0, 1, 0, NULL); schedule_bg_copy_tilemap_to_vram(0); @@ -1721,7 +1721,7 @@ static void sub_8124904(void) ClearStdWindowAndFrameToTransparent(1, FALSE); DrawStdFrameWithCustomTileAndPalette(0, FALSE, 0x65, 0x0d); } - FillWindowPixelBuffer(0, PALETTE_NUM_TO_FILL_VALUE(1)); + FillWindowPixelBuffer(0, PIXEL_FILL(1)); CopyWindowToVram(0, 2); schedule_bg_copy_tilemap_to_vram(0); gUnknown_03001180 = FALSE; diff --git a/src/rom_8011DC0.c b/src/rom_8011DC0.c index 7e9e81e962..b06e5cd619 100644 --- a/src/rom_8011DC0.c +++ b/src/rom_8011DC0.c @@ -387,7 +387,7 @@ void nullsub_89(void) void sub_80124EC(u8 windowId, u8 arg1, u8 stringId) { - FillWindowPixelBuffer(windowId, PALETTE_NUM_TO_FILL_VALUE(1)); + FillWindowPixelBuffer(windowId, PIXEL_FILL(1)); switch (arg1 << 8) { case 0x200: @@ -506,7 +506,7 @@ void sub_8012780(u8 taskId) } data->field_11 = AddWindow(&gUnknown_082F012C); - FillWindowPixelBuffer(data->field_10, PALETTE_NUM_TO_FILL_VALUE(2)); + FillWindowPixelBuffer(data->field_10, PIXEL_FILL(2)); sub_80173E0(data->field_10, 0, gUnknown_082EDBC4, 8, 1, 4); PutWindowTilemap(data->field_10); CopyWindowToVram(data->field_10, 2); @@ -1075,7 +1075,7 @@ void sub_80134E8(u8 taskId) data->listWindowId = AddWindow(&gUnknown_082F0174); data->field_D = AddWindow(&gUnknown_082F017C); - FillWindowPixelBuffer(data->field_C, PALETTE_NUM_TO_FILL_VALUE(2)); + FillWindowPixelBuffer(data->field_C, PIXEL_FILL(2)); sub_80173E0(data->field_C, 0, gUnknown_082EF7DC, 8, 1, 4); PutWindowTilemap(data->field_C); CopyWindowToVram(data->field_C, 2); @@ -2155,7 +2155,7 @@ void sub_8014F48(u8 taskId) data->listTaskId = ListMenuInit(&gMultiuseListMenuTemplate, 0, 0); sub_8018784(data->field_D); - FillWindowPixelBuffer(data->field_D, PALETTE_NUM_TO_FILL_VALUE(1)); + FillWindowPixelBuffer(data->field_D, PIXEL_FILL(1)); PutWindowTilemap(data->field_D); sub_80125BC(data->field_D); CopyWindowToVram(data->field_D, 2); diff --git a/src/save_failed_screen.c b/src/save_failed_screen.c index 1f0fe69c99..08f1938904 100644 --- a/src/save_failed_screen.c +++ b/src/save_failed_screen.c @@ -231,8 +231,8 @@ static void CB2_SaveFailedScreen(void) LoadPalette(gUnknown_0860F074, 0xF0, 0x20); DrawStdFrameWithCustomTileAndPalette(gSaveFailedWindowIds[TEXT_WIN_ID], FALSE, 0x214, 0xE); DrawStdFrameWithCustomTileAndPalette(gSaveFailedWindowIds[CLOCK_WIN_ID], FALSE, 0x214, 0xE); - FillWindowPixelBuffer(gSaveFailedWindowIds[CLOCK_WIN_ID], PALETTE_NUM_TO_FILL_VALUE(1)); // backwards? - FillWindowPixelBuffer(gSaveFailedWindowIds[TEXT_WIN_ID], PALETTE_NUM_TO_FILL_VALUE(1)); + FillWindowPixelBuffer(gSaveFailedWindowIds[CLOCK_WIN_ID], PIXEL_FILL(1)); // backwards? + FillWindowPixelBuffer(gSaveFailedWindowIds[TEXT_WIN_ID], PIXEL_FILL(1)); CopyWindowToVram(gSaveFailedWindowIds[CLOCK_WIN_ID], 2); // again? CopyWindowToVram(gSaveFailedWindowIds[TEXT_WIN_ID], 1); SaveFailedScreenTextPrint(gText_SaveFailedCheckingBackup, 1, 0); @@ -265,19 +265,19 @@ static void CB2_WipeSave(void) { if (WipeSectors(gDamagedSaveSectors) != FALSE) { - FillWindowPixelBuffer(gSaveFailedWindowIds[TEXT_WIN_ID], PALETTE_NUM_TO_FILL_VALUE(1)); + FillWindowPixelBuffer(gSaveFailedWindowIds[TEXT_WIN_ID], PIXEL_FILL(1)); SaveFailedScreenTextPrint(gText_BackupMemoryDamaged, 1, 0); SetMainCallback2(CB2_GameplayCannotBeContinued); return; } - FillWindowPixelBuffer(gSaveFailedWindowIds[TEXT_WIN_ID], PALETTE_NUM_TO_FILL_VALUE(1)); + FillWindowPixelBuffer(gSaveFailedWindowIds[TEXT_WIN_ID], PIXEL_FILL(1)); SaveFailedScreenTextPrint(gText_CheckCompleted, 1, 0); HandleSavingData(gSaveFailedType); if (gDamagedSaveSectors != 0) { - FillWindowPixelBuffer(gSaveFailedWindowIds[TEXT_WIN_ID], PALETTE_NUM_TO_FILL_VALUE(1)); + FillWindowPixelBuffer(gSaveFailedWindowIds[TEXT_WIN_ID], PIXEL_FILL(1)); SaveFailedScreenTextPrint(gText_SaveFailedCheckingBackup, 1, 0); } @@ -286,12 +286,12 @@ static void CB2_WipeSave(void) if (wipeTries == 3) { - FillWindowPixelBuffer(gSaveFailedWindowIds[TEXT_WIN_ID], PALETTE_NUM_TO_FILL_VALUE(1)); + FillWindowPixelBuffer(gSaveFailedWindowIds[TEXT_WIN_ID], PIXEL_FILL(1)); SaveFailedScreenTextPrint(gText_BackupMemoryDamaged, 1, 0); } else { - FillWindowPixelBuffer(gSaveFailedWindowIds[TEXT_WIN_ID], PALETTE_NUM_TO_FILL_VALUE(1)); + FillWindowPixelBuffer(gSaveFailedWindowIds[TEXT_WIN_ID], PIXEL_FILL(1)); if (gGameContinueCallback == NULL) SaveFailedScreenTextPrint(gText_SaveCompleteGameCannotContinue, 1, 0); @@ -308,7 +308,7 @@ static void CB2_GameplayCannotBeContinued(void) if (gMain.newKeys & A_BUTTON) { - FillWindowPixelBuffer(gSaveFailedWindowIds[TEXT_WIN_ID], PALETTE_NUM_TO_FILL_VALUE(1)); + FillWindowPixelBuffer(gSaveFailedWindowIds[TEXT_WIN_ID], PIXEL_FILL(1)); SaveFailedScreenTextPrint(gText_GamePlayCannotBeContinued, 1, 0); SetVBlankCallback(VBlankCB); SetMainCallback2(CB2_FadeAndReturnToTitleScreen); diff --git a/src/scrcmd.c b/src/scrcmd.c index b42b3e5f7b..d60fb071ca 100644 --- a/src/scrcmd.c +++ b/src/scrcmd.c @@ -1519,7 +1519,7 @@ bool8 ScrCmd_braillemessage(struct ScriptContext *ctx) LoadUserWindowBorderGfx(gUnknown_03000F30, 0x214, 0xE0); DrawStdWindowFrame(gUnknown_03000F30, 0); PutWindowTilemap(gUnknown_03000F30); - FillWindowPixelBuffer(gUnknown_03000F30, PALETTE_NUM_TO_FILL_VALUE(1)); + FillWindowPixelBuffer(gUnknown_03000F30, PIXEL_FILL(1)); AddTextPrinterParameterized(gUnknown_03000F30, 6, gStringVar4, xText, yText, 0xFF, 0x0); CopyWindowToVram(gUnknown_03000F30, 3); return FALSE; diff --git a/src/script_menu.c b/src/script_menu.c index 4091918037..afb1ef3126 100644 --- a/src/script_menu.c +++ b/src/script_menu.c @@ -1639,27 +1639,27 @@ static void sub_80E2A94(u8 multichoiceId) switch (multichoiceId) { case 77: - FillWindowPixelBuffer(0, PALETTE_NUM_TO_FILL_VALUE(1)); + FillWindowPixelBuffer(0, PIXEL_FILL(1)); AddTextPrinterParameterized2(0, 1, gUnknown_0858BBAC[Menu_GetCursorPos()], 0, NULL, 2, 1, 3); break; case 76: - FillWindowPixelBuffer(0, PALETTE_NUM_TO_FILL_VALUE(1)); + FillWindowPixelBuffer(0, PIXEL_FILL(1)); AddTextPrinterParameterized2(0, 1, gUnknown_0858BB9C[Menu_GetCursorPos()], 0, NULL, 2, 1, 3); break; case 78: - FillWindowPixelBuffer(0, PALETTE_NUM_TO_FILL_VALUE(1)); + FillWindowPixelBuffer(0, PIXEL_FILL(1)); AddTextPrinterParameterized2(0, 1, gUnknown_0858BBBC[Menu_GetCursorPos()], 0, NULL, 2, 1, 3); break; case 79: - FillWindowPixelBuffer(0, PALETTE_NUM_TO_FILL_VALUE(1)); + FillWindowPixelBuffer(0, PIXEL_FILL(1)); AddTextPrinterParameterized2(0, 1, gUnknown_0858BBCC[Menu_GetCursorPos()], 0, NULL, 2, 1, 3); break; case 75: - FillWindowPixelBuffer(0, PALETTE_NUM_TO_FILL_VALUE(1)); + FillWindowPixelBuffer(0, PIXEL_FILL(1)); AddTextPrinterParameterized2(0, 1, gUnknown_0858BBEC[Menu_GetCursorPos()], 0, NULL, 2, 1, 3); break; case 74: - FillWindowPixelBuffer(0, PALETTE_NUM_TO_FILL_VALUE(1)); + FillWindowPixelBuffer(0, PIXEL_FILL(1)); AddTextPrinterParameterized2(0, 1, gUnknown_0858BBE0[Menu_GetCursorPos()], 0, NULL, 2, 1, 3); break; } diff --git a/src/shop.c b/src/shop.c index 55a7a20f76..e03e2ab0cd 100755 --- a/src/shop.c +++ b/src/shop.c @@ -545,7 +545,7 @@ static void BuyMenuPrintItemDescriptionAndShowItemIcon(int item, bool8 onInit, s description = gText_QuitShopping; } - FillWindowPixelBuffer(2, PALETTE_NUM_TO_FILL_VALUE(0)); + FillWindowPixelBuffer(2, PIXEL_FILL(0)); BuyMenuPrint(2, description, 3, 1, 0, 0); } @@ -1144,7 +1144,7 @@ static void BuyMenuPrintItemQuantityAndPrice(u8 taskId) { s16 *data = gTasks[taskId].data; - FillWindowPixelBuffer(4, PALETTE_NUM_TO_FILL_VALUE(1)); + FillWindowPixelBuffer(4, PIXEL_FILL(1)); PrintMoneyAmount(4, 38, 1, gShopDataPtr->totalCost, TEXT_SPEED_FF); ConvertIntToDecimalStringN(gStringVar1, tItemCount, 2, 2); StringExpandPlaceholders(gStringVar4, gText_xVar1); diff --git a/src/slot_machine.c b/src/slot_machine.c index 189bca80f4..759704f2b6 100644 --- a/src/slot_machine.c +++ b/src/slot_machine.c @@ -3036,7 +3036,7 @@ s16 sub_8102D5C(s16 a0) sub_81065DC(); AddWindow(&gUnknown_085A7444); PutWindowTilemap(1); - FillWindowPixelBuffer(1, PALETTE_NUM_TO_FILL_VALUE(0)); + FillWindowPixelBuffer(1, PIXEL_FILL(0)); task->data[0]++; } @@ -3052,7 +3052,7 @@ s16 sub_8102D5C(s16 a0) { if (gMain.newKeys & (B_BUTTON | SELECT_BUTTON)) { - FillWindowPixelBuffer(1, PALETTE_NUM_TO_FILL_VALUE(0)); + FillWindowPixelBuffer(1, PIXEL_FILL(0)); ClearWindowTilemap(1); CopyWindowToVram(1, 1); RemoveWindow(1); diff --git a/src/start_menu.c b/src/start_menu.c index 94b1c79fce..1be530d3cb 100644 --- a/src/start_menu.c +++ b/src/start_menu.c @@ -1232,7 +1232,7 @@ static void sub_80A0550(u8 taskId) switch (*step) { case 0: - FillWindowPixelBuffer(0, PALETTE_NUM_TO_FILL_VALUE(1)); + FillWindowPixelBuffer(0, PIXEL_FILL(1)); AddTextPrinterParameterized2(0, 1, gText_SavingDontTurnOffPower, diff --git a/src/starter_choose.c b/src/starter_choose.c index 3ffc8e2860..4ed53539fe 100644 --- a/src/starter_choose.c +++ b/src/starter_choose.c @@ -523,7 +523,7 @@ static void Task_StarterChoose3(u8 taskId) static void Task_StarterChoose4(u8 taskId) { PlayCry1(GetStarterPokemon(gTasks[taskId].tStarterSelection), 0); - FillWindowPixelBuffer(0, PALETTE_NUM_TO_FILL_VALUE(1)); + FillWindowPixelBuffer(0, PIXEL_FILL(1)); AddTextPrinterParameterized(0, 1, gText_ConfirmStarterChoice, 0, 1, 0, NULL); schedule_bg_copy_tilemap_to_vram(0); CreateYesNoMenu(&gUnknown_085B1DDC, 0x2A8, 0xD, 0); @@ -579,7 +579,7 @@ static void CreateStarterPokemonLabel(u8 selection) winTemplate.tilemapTop = gStarterChoose_LabelCoords[selection][1]; sStarterChooseWindowId = AddWindow(&winTemplate); - FillWindowPixelBuffer(sStarterChooseWindowId, PALETTE_NUM_TO_FILL_VALUE(0)); + FillWindowPixelBuffer(sStarterChooseWindowId, PIXEL_FILL(0)); width = GetStringCenterAlignXOffset(7, text, 0x68); AddTextPrinterParameterized3(sStarterChooseWindowId, 7, width, 1, gUnknown_085B1E0C, 0, text); @@ -600,7 +600,7 @@ static void CreateStarterPokemonLabel(u8 selection) static void sub_8134604(void) { - FillWindowPixelBuffer(sStarterChooseWindowId, PALETTE_NUM_TO_FILL_VALUE(0)); + FillWindowPixelBuffer(sStarterChooseWindowId, PIXEL_FILL(0)); ClearWindowTilemap(sStarterChooseWindowId); RemoveWindow(sStarterChooseWindowId); sStarterChooseWindowId = 0xFF; diff --git a/src/text.c b/src/text.c index dc28d71c89..2d286992d2 100644 --- a/src/text.c +++ b/src/text.c @@ -1581,7 +1581,7 @@ u16 RenderText(struct TextPrinter *textPrinter) textPrinter->printerTemplate.currentChar++; return 2; case 15: - FillWindowPixelBuffer(textPrinter->printerTemplate.windowId, PALETTE_NUM_TO_FILL_VALUE(textPrinter->printerTemplate.bgColor)); + FillWindowPixelBuffer(textPrinter->printerTemplate.windowId, PIXEL_FILL(textPrinter->printerTemplate.bgColor)); textPrinter->printerTemplate.currentX = textPrinter->printerTemplate.x; textPrinter->printerTemplate.currentY = textPrinter->printerTemplate.y; return 2; @@ -1702,7 +1702,7 @@ u16 RenderText(struct TextPrinter *textPrinter) case 2: if (TextPrinterWaitWithDownArrow(textPrinter)) { - FillWindowPixelBuffer(textPrinter->printerTemplate.windowId, PALETTE_NUM_TO_FILL_VALUE(textPrinter->printerTemplate.bgColor)); + FillWindowPixelBuffer(textPrinter->printerTemplate.windowId, PIXEL_FILL(textPrinter->printerTemplate.bgColor)); textPrinter->printerTemplate.currentX = textPrinter->printerTemplate.x; textPrinter->printerTemplate.currentY = textPrinter->printerTemplate.y; textPrinter->state = 0; @@ -1724,12 +1724,12 @@ u16 RenderText(struct TextPrinter *textPrinter) int speed = gWindowVerticalScrollSpeeds[scrollSpeed]; if (textPrinter->scrollDistance < speed) { - ScrollWindow(textPrinter->printerTemplate.windowId, 0, textPrinter->scrollDistance, PALETTE_NUM_TO_FILL_VALUE(textPrinter->printerTemplate.bgColor)); + ScrollWindow(textPrinter->printerTemplate.windowId, 0, textPrinter->scrollDistance, PIXEL_FILL(textPrinter->printerTemplate.bgColor)); textPrinter->scrollDistance = 0; } else { - ScrollWindow(textPrinter->printerTemplate.windowId, 0, speed, PALETTE_NUM_TO_FILL_VALUE(textPrinter->printerTemplate.bgColor)); + ScrollWindow(textPrinter->printerTemplate.windowId, 0, speed, PIXEL_FILL(textPrinter->printerTemplate.bgColor)); textPrinter->scrollDistance -= speed; } CopyWindowToVram(textPrinter->printerTemplate.windowId, 2); diff --git a/src/trade.c b/src/trade.c index 5595cee949..d74b7dfc38 100644 --- a/src/trade.c +++ b/src/trade.c @@ -1418,7 +1418,7 @@ static void sub_80772A4(void) for (i = 0; i < 18; i++) { ClearWindowTilemap(i); - FillWindowPixelBuffer(i, PALETTE_NUM_TO_FILL_VALUE(0)); + FillWindowPixelBuffer(i, PIXEL_FILL(0)); } FillBgTilemapBufferRect(0, 0, 0, 0, 30, 20, 15); @@ -2461,7 +2461,7 @@ static void sub_8078DBC(void) if (gUnknown_0203229C->tradeMenuCursorPosition < 6) { sub_8098858(1, 1, 14); - FillWindowPixelBuffer(1, PALETTE_NUM_TO_FILL_VALUE(1)); + FillWindowPixelBuffer(1, PIXEL_FILL(1)); PrintMenuTable(1, 2, gUnknown_0832DEAC); InitMenuInUpperLeftCornerPlaySoundWhenAPressed(1, 2, 0); PutWindowTilemap(1); @@ -2724,7 +2724,7 @@ static void sub_8079408(void) for (i = 0; i < 4; i++) { - FillWindowPixelBuffer(i + 14, PALETTE_NUM_TO_FILL_VALUE(0)); + FillWindowPixelBuffer(i + 14, PIXEL_FILL(0)); rbox_fill_rectangle(i + 14); } @@ -3256,7 +3256,7 @@ static void sub_807A0C4(void) static void sub_807A19C(u8 a0) { - FillWindowPixelBuffer(0, PALETTE_NUM_TO_FILL_VALUE(1)); + FillWindowPixelBuffer(0, PIXEL_FILL(1)); AddTextPrinterParameterized(0, 1, gUnknown_0832DEBC[a0], 0, 1, TEXT_SPEED_FF, NULL); sub_8098858(0, 20, 12); PutWindowTilemap(0); @@ -4185,7 +4185,7 @@ void sub_807B140(void) void sub_807B154(void) { - FillWindowPixelBuffer(0, PALETTE_NUM_TO_FILL_VALUE(15)); + FillWindowPixelBuffer(0, PIXEL_FILL(15)); PutWindowTilemap(0); CopyWindowToVram(0, 3); } @@ -4263,7 +4263,7 @@ static void sub_807B270(void) break; case 8: sub_807ACFC(1, 1); - FillWindowPixelBuffer(0, PALETTE_NUM_TO_FILL_VALUE(15)); + FillWindowPixelBuffer(0, PIXEL_FILL(15)); PutWindowTilemap(0); CopyWindowToVram(0, 3); gMain.state++; @@ -4654,7 +4654,7 @@ static bool8 sub_807BBEC(void) if (!gPaletteFade.active) { sub_807B62C(4); - FillWindowPixelBuffer(0, PALETTE_NUM_TO_FILL_VALUE(15)); + FillWindowPixelBuffer(0, PIXEL_FILL(15)); CopyWindowToVram(0, 3); gUnknown_020322A0->state++; } @@ -5146,7 +5146,7 @@ static bool8 sub_807CFC8(void) if (!gPaletteFade.active) { sub_807B62C(4); - FillWindowPixelBuffer(0, PALETTE_NUM_TO_FILL_VALUE(15)); + FillWindowPixelBuffer(0, PIXEL_FILL(15)); CopyWindowToVram(0, 3); gUnknown_020322A0->state++; } @@ -6085,7 +6085,7 @@ void sub_807F19C(void) void sub_807F1A8(u8 windowId, const u8 *str, u8 speed) { - FillWindowPixelBuffer(windowId, PALETTE_NUM_TO_FILL_VALUE(15)); + FillWindowPixelBuffer(windowId, PIXEL_FILL(15)); gUnknown_020322A0->unk_F6[0] = 15; gUnknown_020322A0->unk_F6[1] = 1; gUnknown_020322A0->unk_F6[2] = 6; diff --git a/src/trainer_card.c b/src/trainer_card.c index 8d244d6563..4a33855594 100755 --- a/src/trainer_card.c +++ b/src/trainer_card.c @@ -350,7 +350,7 @@ static void sub_80C2760(u8 taskId) case 0: if (!IsDma3ManagerBusyWithBgCopy()) { - FillWindowPixelBuffer(1, PALETTE_NUM_TO_FILL_VALUE(0)); + FillWindowPixelBuffer(1, PIXEL_FILL(0)); sData->var_0++; } break; @@ -363,7 +363,7 @@ static void sub_80C2760(u8 taskId) sData->var_0++; break; case 3: - FillWindowPixelBuffer(2, PALETTE_NUM_TO_FILL_VALUE(0)); + FillWindowPixelBuffer(2, PIXEL_FILL(0)); sub_80C4FF0(); sub_80C438C(2); sData->var_0++; @@ -1103,7 +1103,7 @@ static void PrintTimeOnCard(void) r10 = width + 30; r7 -= r10; - FillWindowPixelRect(1, PALETTE_NUM_TO_FILL_VALUE(0), r7, r4, r10, 15); + FillWindowPixelRect(1, PIXEL_FILL(0), r7, r4, r10, 15); ConvertIntToDecimalStringN(gStringVar4, hours, 1, 3); AddTextPrinterParameterized3(1, 1, r7, r4, gUnknown_0856FB0C, TEXT_SPEED_FF, gStringVar4); r7 += 18; @@ -1634,7 +1634,7 @@ static bool8 sub_80C4B08(struct Task* task) switch (sData->var_4) { case 0: - FillWindowPixelBuffer(1, PALETTE_NUM_TO_FILL_VALUE(0)); + FillWindowPixelBuffer(1, PIXEL_FILL(0)); FillBgTilemapBufferRect_Palette0(3, 0, 0, 0, 0x20, 0x20); break; case 1: @@ -1659,7 +1659,7 @@ static bool8 sub_80C4B08(struct Task* task) if (!sData->var_8) sub_80C474C(); else - FillWindowPixelBuffer(2, PALETTE_NUM_TO_FILL_VALUE(0)); + FillWindowPixelBuffer(2, PIXEL_FILL(0)); break; case 4: if (sData->var_8) diff --git a/src/trainer_hill.c b/src/trainer_hill.c index 2873fdf8f5..bf8482d69c 100644 --- a/src/trainer_hill.c +++ b/src/trainer_hill.c @@ -609,7 +609,7 @@ void PrintOnTrainerHillRecordsWindow(void) u32 total, minutes, secondsWhole, secondsFraction; SetUpDataStruct(); - FillWindowPixelBuffer(0, PALETTE_NUM_TO_FILL_VALUE(0)); + FillWindowPixelBuffer(0, PIXEL_FILL(0)); x = GetStringCenterAlignXOffset(1, gText_TimeBoard, 0xD0); AddTextPrinterParameterized3(0, 1, x, 2, sRecordWinColors, TEXT_SPEED_FF, gText_TimeBoard); diff --git a/src/unk_text_util_2.c b/src/unk_text_util_2.c index 6fbe6d04f5..03e049d72c 100644 --- a/src/unk_text_util_2.c +++ b/src/unk_text_util_2.c @@ -114,7 +114,7 @@ u16 Font6Func(struct TextPrinter *textPrinter) textPrinter->printerTemplate.currentY = textPrinter->printerTemplate.y + *textPrinter->printerTemplate.currentChar++; return 2; case 15: - FillWindowPixelBuffer(textPrinter->printerTemplate.windowId, PALETTE_NUM_TO_FILL_VALUE(textPrinter->printerTemplate.bgColor)); + FillWindowPixelBuffer(textPrinter->printerTemplate.windowId, PIXEL_FILL(textPrinter->printerTemplate.bgColor)); return 2; } break; @@ -146,7 +146,7 @@ u16 Font6Func(struct TextPrinter *textPrinter) case 2: if (TextPrinterWaitWithDownArrow(textPrinter)) { - FillWindowPixelBuffer(textPrinter->printerTemplate.windowId, PALETTE_NUM_TO_FILL_VALUE(textPrinter->printerTemplate.bgColor)); + FillWindowPixelBuffer(textPrinter->printerTemplate.windowId, PIXEL_FILL(textPrinter->printerTemplate.bgColor)); textPrinter->printerTemplate.currentX = textPrinter->printerTemplate.x; textPrinter->printerTemplate.currentY = textPrinter->printerTemplate.y; textPrinter->state = 0; @@ -166,12 +166,12 @@ u16 Font6Func(struct TextPrinter *textPrinter) { if (textPrinter->scrollDistance < sUnknown_08616124[gSaveBlock2Ptr->optionsTextSpeed]) { - ScrollWindow(textPrinter->printerTemplate.windowId, 0, textPrinter->scrollDistance, PALETTE_NUM_TO_FILL_VALUE(textPrinter->printerTemplate.bgColor)); + ScrollWindow(textPrinter->printerTemplate.windowId, 0, textPrinter->scrollDistance, PIXEL_FILL(textPrinter->printerTemplate.bgColor)); textPrinter->scrollDistance = 0; } else { - ScrollWindow(textPrinter->printerTemplate.windowId, 0, sUnknown_08616124[gSaveBlock2Ptr->optionsTextSpeed], PALETTE_NUM_TO_FILL_VALUE(textPrinter->printerTemplate.bgColor)); + ScrollWindow(textPrinter->printerTemplate.windowId, 0, sUnknown_08616124[gSaveBlock2Ptr->optionsTextSpeed], PIXEL_FILL(textPrinter->printerTemplate.bgColor)); textPrinter->scrollDistance -= sUnknown_08616124[gSaveBlock2Ptr->optionsTextSpeed]; } CopyWindowToVram(textPrinter->printerTemplate.windowId, 2); From e03595a10d05e6c860fe051976dd19096ba7e18b Mon Sep 17 00:00:00 2001 From: Phlosioneer Date: Sun, 3 Mar 2019 03:14:08 -0500 Subject: [PATCH 08/20] Bugfixes from #591 --- include/siirtc.h | 8 ++++---- src/battle_factory_screen.c | 2 +- src/pokemon_storage_system.c | 8 ++++---- src/pokemon_summary_screen.c | 2 +- src/siirtc.c | 8 ++++---- 5 files changed, 14 insertions(+), 14 deletions(-) diff --git a/include/siirtc.h b/include/siirtc.h index 5864f95b85..de4fd634df 100644 --- a/include/siirtc.h +++ b/include/siirtc.h @@ -39,10 +39,10 @@ struct SiiRtcInfo u8 alarmMinute; }; -void SiiRtcUnprotect(); -void SiiRtcProtect(); -u8 SiiRtcProbe(); -bool8 SiiRtcReset(); +void SiiRtcUnprotect(void); +void SiiRtcProtect(void); +u8 SiiRtcProbe(void); +bool8 SiiRtcReset(void); bool8 SiiRtcGetStatus(struct SiiRtcInfo *rtc); bool8 SiiRtcSetStatus(struct SiiRtcInfo *rtc); bool8 SiiRtcGetDateTime(struct SiiRtcInfo *rtc); diff --git a/src/battle_factory_screen.c b/src/battle_factory_screen.c index 5cbe97702a..85c0b28089 100644 --- a/src/battle_factory_screen.c +++ b/src/battle_factory_screen.c @@ -1741,7 +1741,7 @@ static void Select_CopyMonsToPlayerParty(void) { gPlayerParty[i] = sFactorySelectScreen->mons[j].monData; gSaveBlock2Ptr->frontier.rentalMons[i].monId = sFactorySelectScreen->mons[j].monSetId; - gSaveBlock2Ptr->frontier.rentalMons[i].personality = GetMonData(&gPlayerParty[i].box, MON_DATA_PERSONALITY, NULL); + gSaveBlock2Ptr->frontier.rentalMons[i].personality = GetMonData(&gPlayerParty[i], MON_DATA_PERSONALITY, NULL); gSaveBlock2Ptr->frontier.rentalMons[i].abilityBit = GetBoxMonData(&gPlayerParty[i].box, MON_DATA_ALT_ABILITY, NULL); gSaveBlock2Ptr->frontier.rentalMons[i].ivs = GetBoxMonData(&gPlayerParty[i].box, MON_DATA_ATK_IV, NULL); break; diff --git a/src/pokemon_storage_system.c b/src/pokemon_storage_system.c index 9681b72f48..c5d40877b3 100644 --- a/src/pokemon_storage_system.c +++ b/src/pokemon_storage_system.c @@ -6501,7 +6501,7 @@ static void InitCanRelaseMonVars(void) } sub_80CE350(sPSSData->field_2176); - sPSSData->field_2174 = GetMonData(&sPSSData->field_2108, MON_DATA_KNOWN_MOVES, sPSSData->field_2176); + sPSSData->field_2174 = GetMonData(&sPSSData->field_2108, MON_DATA_KNOWN_MOVES, (u8*)sPSSData->field_2176); if (sPSSData->field_2174 != 0) { sPSSData->field_216D = 0; @@ -6559,7 +6559,7 @@ static s8 RunCanReleaseMon(void) { if (sPSSData->field_2170 != TOTAL_BOXES_COUNT || sPSSData->field_2171 != i) { - knownMoves = GetMonData(gPlayerParty + i, MON_DATA_KNOWN_MOVES, sPSSData->field_2176); + knownMoves = GetMonData(gPlayerParty + i, MON_DATA_KNOWN_MOVES, (u8*)sPSSData->field_2176); sPSSData->field_2174 &= ~(knownMoves); } } @@ -6578,7 +6578,7 @@ static s8 RunCanReleaseMon(void) case 1: for (i = 0; i < IN_BOX_COUNT; i++) { - knownMoves = GetAndCopyBoxMonDataAt(sPSSData->field_216E, sPSSData->field_216F, MON_DATA_KNOWN_MOVES, sPSSData->field_2176); + knownMoves = GetAndCopyBoxMonDataAt(sPSSData->field_216E, sPSSData->field_216F, MON_DATA_KNOWN_MOVES, (u8*)sPSSData->field_2176); if (knownMoves != 0 && !(sPSSData->field_2170 == sPSSData->field_216E && sPSSData->field_2171 == sPSSData->field_216F)) { @@ -10357,7 +10357,7 @@ bool32 AnyStorageMonWithMove(u16 moveId) { if (GetBoxMonData(&gPokemonStoragePtr->boxes[i][j], MON_DATA_SANITY_HAS_SPECIES) && !GetBoxMonData(&gPokemonStoragePtr->boxes[i][j], MON_DATA_SANITY_IS_EGG) - && GetBoxMonData(&gPokemonStoragePtr->boxes[i][j], MON_DATA_KNOWN_MOVES, moves)) + && GetBoxMonData(&gPokemonStoragePtr->boxes[i][j], MON_DATA_KNOWN_MOVES, (u8*)moves)) return TRUE; } } diff --git a/src/pokemon_summary_screen.c b/src/pokemon_summary_screen.c index 91e3441234..0133e40f12 100644 --- a/src/pokemon_summary_screen.c +++ b/src/pokemon_summary_screen.c @@ -1349,7 +1349,7 @@ static bool8 ExtractMonDataToSummaryStruct(struct Pokemon *a) } break; case 3: - GetMonData(a, MON_DATA_OT_NAME, &sum->OTName); + GetMonData(a, MON_DATA_OT_NAME, sum->OTName); ConvertInternationalString((u8*)&sum->OTName, GetMonData(a, MON_DATA_LANGUAGE)); sum->unk7 = sub_81B205C(a); sum->OTGender = GetMonData(a, MON_DATA_OT_GENDER); diff --git a/src/siirtc.c b/src/siirtc.c index f7e85ef4fa..5c153a8413 100644 --- a/src/siirtc.c +++ b/src/siirtc.c @@ -76,19 +76,19 @@ static void DisableGpioPortRead(); static const char AgbLibRtcVersion[] = "SIIRTC_V001"; -void SiiRtcUnprotect() +void SiiRtcUnprotect(void) { EnableGpioPortRead(); sLocked = FALSE; } -void SiiRtcProtect() +void SiiRtcProtect(void) { DisableGpioPortRead(); sLocked = TRUE; } -u8 SiiRtcProbe() +u8 SiiRtcProbe(void) { u8 errorCode; struct SiiRtcInfo rtc; @@ -129,7 +129,7 @@ u8 SiiRtcProbe() return (errorCode << 4) | 1; } -bool8 SiiRtcReset() +bool8 SiiRtcReset(void) { u8 result; struct SiiRtcInfo rtc; From 4ea5e85bed767a8cffea1fdcfac8669dff06c632 Mon Sep 17 00:00:00 2001 From: Phlosioneer Date: Sat, 2 Mar 2019 17:40:38 -0500 Subject: [PATCH 09/20] Fix typos This is an updated version of #554, since it hasn't been updated in two weeks. --- asm/macros/battle_script.inc | 2 +- data/battle_scripts_1.s | 6 +++--- include/battle.h | 2 +- include/battle_scripts.h | 4 ++-- include/battle_util.h | 4 ++-- src/battle_main.c | 2 +- src/battle_script_commands.c | 8 ++++---- src/battle_util.c | 28 ++++++++++++++-------------- 8 files changed, 28 insertions(+), 28 deletions(-) diff --git a/asm/macros/battle_script.inc b/asm/macros/battle_script.inc index 6370ef5697..ed32e46431 100644 --- a/asm/macros/battle_script.inc +++ b/asm/macros/battle_script.inc @@ -1078,7 +1078,7 @@ .4byte \param0 .endm - .macro tryimprision param0:req + .macro tryimprison param0:req .byte 0xdb .4byte \param0 .endm diff --git a/data/battle_scripts_1.s b/data/battle_scripts_1.s index 8ddf56ef85..0159a3f73d 100644 --- a/data/battle_scripts_1.s +++ b/data/battle_scripts_1.s @@ -2538,7 +2538,7 @@ BattleScript_EffectImprison:: attackcanceler attackstring ppreduce - tryimprision BattleScript_ButItFailed + tryimprison BattleScript_ButItFailed attackanimation waitanimation printstring STRINGID_PKMNSEALEDOPPONENTMOVE @@ -3684,11 +3684,11 @@ BattleScript_MoveUsedIsImprisoned:: waitmessage 0x40 goto BattleScript_MoveEnd -BattleScript_SelectingImprisionedMove:: +BattleScript_SelectingImprisonedMove:: printselectionstring STRINGID_PKMNCANTUSEMOVESEALED endselectionscript -BattleScript_SelectingImprisionedMoveInPalace:: +BattleScript_SelectingImprisonedMoveInPalace:: printstring STRINGID_PKMNCANTUSEMOVESEALED goto BattleScript_SelectingUnusableMoveInPalace diff --git a/include/battle.h b/include/battle.h index 94596c75ea..d155ca5a09 100644 --- a/include/battle.h +++ b/include/battle.h @@ -175,7 +175,7 @@ struct ProtectStruct u32 targetNotAffected:1; u32 chargingTurn:1; u32 fleeFlag:2; // For RunAway and Smoke Ball. - u32 usedImprisionedMove:1; + u32 usedImprisonedMove:1; u32 loveImmobility:1; u32 usedDisabledMove:1; u32 usedTauntedMove:1; diff --git a/include/battle_scripts.h b/include/battle_scripts.h index a23fa6948f..5f314401a9 100644 --- a/include/battle_scripts.h +++ b/include/battle_scripts.h @@ -88,8 +88,8 @@ extern const u8 BattleScript_IngrainTurnHeal[]; extern const u8 BattleScript_AtkDefDown[]; extern const u8 BattleScript_KnockedOff[]; extern const u8 BattleScript_MoveUsedIsImprisoned[]; -extern const u8 BattleScript_SelectingImprisionedMove[]; -extern const u8 BattleScript_SelectingImprisionedMoveInPalace[]; +extern const u8 BattleScript_SelectingImprisonedMove[]; +extern const u8 BattleScript_SelectingImprisonedMoveInPalace[]; extern const u8 BattleScript_GrudgeTakesPp[]; extern const u8 BattleScript_MagicCoatBounce[]; extern const u8 BattleScript_SnatchedMove[]; diff --git a/include/battle_util.h b/include/battle_util.h index 71bb22a005..0756a387a2 100644 --- a/include/battle_util.h +++ b/include/battle_util.h @@ -6,7 +6,7 @@ #define MOVE_LIMITATION_DISABLED (1 << 2) #define MOVE_LIMITATION_TORMENTED (1 << 3) #define MOVE_LIMITATION_TAUNT (1 << 4) -#define MOVE_LIMITATION_IMPRISION (1 << 5) +#define MOVE_LIMITATION_IMPRISON (1 << 5) #define ABILITYEFFECT_ON_SWITCHIN 0x0 #define ABILITYEFFECT_ENDTURN 0x1 @@ -44,7 +44,7 @@ u8 GetBattlerForBattleScript(u8 caseId); void PressurePPLose(u8 target, u8 attacker, u16 move); void PressurePPLoseOnUsingPerishSong(u8 attacker); -void PressurePPLoseOnUsingImprision(u8 attacker); +void PressurePPLoseOnUsingImprison(u8 attacker); void MarkAllBattlersForControllerExec(void); // unused void MarkBattlerForControllerExec(u8 battlerId); void sub_803F850(u8 arg0); diff --git a/src/battle_main.c b/src/battle_main.c index 043e758087..853dafe01f 100644 --- a/src/battle_main.c +++ b/src/battle_main.c @@ -3279,7 +3279,7 @@ void FaintClearSetData(void) gProtectStructs[gActiveBattler].targetNotAffected = 0; gProtectStructs[gActiveBattler].chargingTurn = 0; gProtectStructs[gActiveBattler].fleeFlag = 0; - gProtectStructs[gActiveBattler].usedImprisionedMove = 0; + gProtectStructs[gActiveBattler].usedImprisonedMove = 0; gProtectStructs[gActiveBattler].loveImmobility = 0; gProtectStructs[gActiveBattler].usedDisabledMove = 0; gProtectStructs[gActiveBattler].usedTauntedMove = 0; diff --git a/src/battle_script_commands.c b/src/battle_script_commands.c index a53fa30f21..620366b52d 100644 --- a/src/battle_script_commands.c +++ b/src/battle_script_commands.c @@ -297,7 +297,7 @@ static void atkD7_setyawn(void); static void atkD8_setdamagetohealthdifference(void); static void atkD9_scaledamagebyhealthratio(void); static void atkDA_tryswapabilities(void); -static void atkDB_tryimprision(void); +static void atkDB_tryimprison(void); static void atkDC_trysetgrudge(void); static void atkDD_weightdamagecalculation(void); static void atkDE_asistattackselect(void); @@ -549,7 +549,7 @@ void (* const gBattleScriptingCommandsTable[])(void) = atkD8_setdamagetohealthdifference, atkD9_scaledamagebyhealthratio, atkDA_tryswapabilities, - atkDB_tryimprision, + atkDB_tryimprison, atkDC_trysetgrudge, atkDD_weightdamagecalculation, atkDE_asistattackselect, @@ -9611,7 +9611,7 @@ static void atkDA_tryswapabilities(void) // skill swap } } -static void atkDB_tryimprision(void) +static void atkDB_tryimprison(void) { if ((gStatuses3[gBattlerAttacker] & STATUS3_IMPRISONED_OTHERS)) { @@ -9622,7 +9622,7 @@ static void atkDB_tryimprision(void) u8 battlerId, sideAttacker; sideAttacker = GetBattlerSide(gBattlerAttacker); - PressurePPLoseOnUsingImprision(gBattlerAttacker); + PressurePPLoseOnUsingImprison(gBattlerAttacker); for (battlerId = 0; battlerId < gBattlersCount; battlerId++) { if (sideAttacker != GetBattlerSide(battlerId)) diff --git a/src/battle_util.c b/src/battle_util.c index 2f583a9c7e..fc6042b65f 100644 --- a/src/battle_util.c +++ b/src/battle_util.c @@ -106,10 +106,10 @@ void PressurePPLose(u8 target, u8 attacker, u16 move) } } -void PressurePPLoseOnUsingImprision(u8 attacker) +void PressurePPLoseOnUsingImprison(u8 attacker) { int i, j; - int imprisionPos = 4; + int imprisonPos = 4; u8 atkSide = GetBattlerSide(attacker); for (i = 0; i < gBattlersCount; i++) @@ -123,19 +123,19 @@ void PressurePPLoseOnUsingImprision(u8 attacker) } if (j != MAX_MON_MOVES) { - imprisionPos = j; + imprisonPos = j; if (gBattleMons[attacker].pp[j] != 0) gBattleMons[attacker].pp[j]--; } } } - if (imprisionPos != 4 + if (imprisonPos != 4 && !(gBattleMons[attacker].status2 & STATUS2_TRANSFORMED) - && !(gDisableStructs[attacker].mimickedMoves & gBitTable[imprisionPos])) + && !(gDisableStructs[attacker].mimickedMoves & gBitTable[imprisonPos])) { gActiveBattler = attacker; - BtlController_EmitSetMonData(0, REQUEST_PPMOVE1_BATTLE + imprisionPos, 0, 1, &gBattleMons[gActiveBattler].pp[imprisionPos]); + BtlController_EmitSetMonData(0, REQUEST_PPMOVE1_BATTLE + imprisonPos, 0, 1, &gBattleMons[gActiveBattler].pp[imprisonPos]); MarkBattlerForControllerExec(gActiveBattler); } } @@ -224,7 +224,7 @@ bool8 WasUnableToUseMove(u8 battler) { if (gProtectStructs[battler].prlzImmobility || gProtectStructs[battler].targetNotAffected - || gProtectStructs[battler].usedImprisionedMove + || gProtectStructs[battler].usedImprisonedMove || gProtectStructs[battler].loveImmobility || gProtectStructs[battler].usedDisabledMove || gProtectStructs[battler].usedTauntedMove @@ -365,12 +365,12 @@ u8 TrySetCantSelectMoveBattleScript(void) gCurrentMove = move; if (gBattleTypeFlags & BATTLE_TYPE_PALACE) { - gPalaceSelectionBattleScripts[gActiveBattler] = BattleScript_SelectingImprisionedMoveInPalace; + gPalaceSelectionBattleScripts[gActiveBattler] = BattleScript_SelectingImprisonedMoveInPalace; gProtectStructs[gActiveBattler].palaceUnableToUseMove = 1; } else { - gSelectionBattleScripts[gActiveBattler] = BattleScript_SelectingImprisionedMove; + gSelectionBattleScripts[gActiveBattler] = BattleScript_SelectingImprisonedMove; limitations++; } } @@ -438,7 +438,7 @@ u8 CheckMoveLimitations(u8 battlerId, u8 unusableMoves, u8 check) unusableMoves |= gBitTable[i]; if (gDisableStructs[battlerId].tauntTimer && check & MOVE_LIMITATION_TAUNT && gBattleMoves[gBattleMons[battlerId].moves[i]].power == 0) unusableMoves |= gBitTable[i]; - if (GetImprisonedMovesCount(battlerId, gBattleMons[battlerId].moves[i]) && check & MOVE_LIMITATION_IMPRISION) + if (GetImprisonedMovesCount(battlerId, gBattleMons[battlerId].moves[i]) && check & MOVE_LIMITATION_IMPRISON) unusableMoves |= gBitTable[i]; if (gDisableStructs[battlerId].encoreTimer && gDisableStructs[battlerId].encoredMove != gBattleMons[battlerId].moves[i]) unusableMoves |= gBitTable[i]; @@ -469,7 +469,7 @@ bool8 AreAllMovesUnusable(void) u8 GetImprisonedMovesCount(u8 battlerId, u16 move) { s32 i; - u8 imprisionedMoves = 0; + u8 imprisonedMoves = 0; u8 battlerSide = GetBattlerSide(battlerId); for (i = 0; i < gBattlersCount; i++) @@ -483,11 +483,11 @@ u8 GetImprisonedMovesCount(u8 battlerId, u16 move) break; } if (j < MAX_MON_MOVES) - imprisionedMoves++; + imprisonedMoves++; } } - return imprisionedMoves; + return imprisonedMoves; } enum @@ -1466,7 +1466,7 @@ u8 AtkCanceller_UnableToUseMove(void) case CANCELLER_IMPRISONED: // imprisoned if (GetImprisonedMovesCount(gBattlerAttacker, gCurrentMove)) { - gProtectStructs[gBattlerAttacker].usedImprisionedMove = 1; + gProtectStructs[gBattlerAttacker].usedImprisonedMove = 1; CancelMultiTurnMoves(gBattlerAttacker); gBattlescriptCurrInstr = BattleScript_MoveUsedIsImprisoned; gHitMarker |= HITMARKER_UNABLE_TO_USE_MOVE; From 1e7f4a80c77832d952688206bd7c98e11dba25ba Mon Sep 17 00:00:00 2001 From: shinny456 Date: Sun, 3 Mar 2019 03:54:44 -0500 Subject: [PATCH 10/20] port the rest of flying (leave 2 nonmatchings to egg) --- asm/flying.s | 1698 ------------------------------------------------- ld_script.txt | 1 - src/flying.c | 1209 ++++++++++++++++++++++++++++++++++- 3 files changed, 1199 insertions(+), 1709 deletions(-) delete mode 100644 asm/flying.s diff --git a/asm/flying.s b/asm/flying.s deleted file mode 100644 index 37873f17bf..0000000000 --- a/asm/flying.s +++ /dev/null @@ -1,1698 +0,0 @@ - .include "asm/macros.inc" - .include "constants/constants.inc" - - .syntax unified - - .text - - thumb_func_start sub_810E520 -sub_810E520: @ 810E520 - push {r4-r7,lr} - mov r7, r9 - mov r6, r8 - push {r6,r7} - adds r5, r0, 0 - movs r6, 0 - adds r4, r5, 0 - adds r4, 0x2E - ldrb r2, [r4] - movs r7, 0x1 - movs r0, 0x1 - mov r9, r0 - ands r0, r2 - cmp r0, 0 - beq _0810E55A - ldrb r0, [r4, 0x1] - adds r1, r0, 0 - adds r1, 0xFF - strb r1, [r4, 0x1] - lsls r0, 24 - cmp r0, 0 - beq _0810E54E - b _0810EA36 -_0810E54E: - movs r0, 0x2 - negs r0, r0 - ands r0, r2 - strb r0, [r4] - strb r6, [r4, 0x1] - b _0810EA36 -_0810E55A: - ldrh r0, [r4, 0x2] - lsrs r1, r0, 6 - mov r12, r0 - cmp r1, 0x1 - bne _0810E566 - b _0810E68A -_0810E566: - cmp r1, 0x1 - bgt _0810E570 - cmp r1, 0 - beq _0810E57E - b _0810E97C -_0810E570: - cmp r1, 0x2 - bne _0810E576 - b _0810E77E -_0810E576: - cmp r1, 0x3 - bne _0810E57C - b _0810E872 -_0810E57C: - b _0810E97C -_0810E57E: - lsls r1, r2, 24 - lsrs r0, r1, 28 - cmp r0, 0x1 - bne _0810E592 - movs r0, 0x8 - orrs r0, r2 - orrs r0, r7 - strb r0, [r4] - strb r6, [r4, 0x1] - b _0810E680 -_0810E592: - lsrs r0, r1, 28 - cmp r0, 0x3 - bne _0810E5B4 - lsls r0, r2, 30 - lsrs r0, 31 - movs r1, 0x1 - eors r0, r1 - ands r0, r7 - lsls r0, 1 - movs r1, 0x3 - negs r1, r1 - ands r1, r2 - orrs r1, r0 - orrs r1, r7 - strb r1, [r4] - strb r6, [r4, 0x1] - b _0810E680 -_0810E5B4: - movs r0, 0x8 - ands r0, r2 - cmp r0, 0 - beq _0810E680 - adds r3, r5, 0 - adds r3, 0x3F - ldrb r2, [r3] - lsls r1, r2, 31 - lsrs r1, 31 - movs r6, 0x1 - eors r1, r6 - ands r1, r7 - movs r0, 0x2 - negs r0, r0 - mov r8, r0 - ands r0, r2 - orrs r0, r1 - strb r0, [r3] - lsls r0, 31 - lsrs r0, 31 - adds r1, r5, 0 - adds r1, 0x2A - strb r0, [r1] - ldrb r0, [r3] - movs r1, 0x4 - orrs r0, r1 - movs r1, 0x11 - negs r1, r1 - ands r0, r1 - strb r0, [r3] - ldrb r1, [r4] - movs r0, 0x4 - ands r0, r1 - cmp r0, 0 - beq _0810E672 - bl IsContest - lsls r0, 24 - cmp r0, 0 - bne _0810E642 - ldrb r1, [r4, 0xE] - mov r0, r9 - ands r0, r1 - cmp r0, 0 - bne _0810E628 - ldrb r2, [r5, 0x5] - lsls r1, r2, 28 - lsrs r1, 30 - subs r1, 0x1 - movs r0, 0x3 - ands r1, r0 - lsls r1, 2 - movs r0, 0xD - negs r0, r0 - ands r0, r2 - orrs r0, r1 - strb r0, [r5, 0x5] - b _0810E660 -_0810E628: - ldrb r2, [r5, 0x5] - lsls r1, r2, 28 - lsrs r1, 30 - adds r1, 0x1 - movs r0, 0x3 - ands r1, r0 - lsls r1, 2 - movs r0, 0xD - negs r0, r0 - ands r0, r2 - orrs r0, r1 - strb r0, [r5, 0x5] - b _0810E660 -_0810E642: - ldrb r1, [r4, 0xE] - mov r0, r9 - ands r0, r1 - cmp r0, 0 - bne _0810E656 - adds r1, r5, 0 - adds r1, 0x43 - ldrb r0, [r1] - subs r0, 0xC - b _0810E65E -_0810E656: - adds r1, r5, 0 - adds r1, 0x43 - ldrb r0, [r1] - adds r0, 0xC -_0810E65E: - strb r0, [r1] -_0810E660: - ldrb r2, [r4, 0xE] - lsls r0, r2, 31 - lsrs r0, 31 - eors r0, r6 - ands r0, r7 - mov r1, r8 - ands r1, r2 - orrs r1, r0 - strb r1, [r4, 0xE] -_0810E672: - ldrb r1, [r4] - movs r0, 0x9 - negs r0, r0 - ands r0, r1 - strb r0, [r4] - ldrh r1, [r4, 0x2] - mov r12, r1 -_0810E680: - ldrb r1, [r4] - movs r0, 0xF - ands r0, r1 - strb r0, [r4] - b _0810E97C -_0810E68A: - lsls r1, r2, 24 - lsrs r0, r1, 28 - cmp r0, 0 - bne _0810E698 - movs r0, 0x8 - orrs r0, r2 - b _0810E6A0 -_0810E698: - lsrs r0, r1, 28 - cmp r0, 0x2 - bne _0810E6A8 - adds r0, r2, 0 -_0810E6A0: - orrs r0, r7 - strb r0, [r4] - strb r6, [r4, 0x1] - b _0810E774 -_0810E6A8: - movs r0, 0x8 - ands r0, r2 - cmp r0, 0 - beq _0810E774 - adds r3, r5, 0 - adds r3, 0x3F - ldrb r2, [r3] - lsls r1, r2, 31 - lsrs r1, 31 - movs r6, 0x1 - eors r1, r6 - ands r1, r7 - movs r0, 0x2 - negs r0, r0 - mov r8, r0 - ands r0, r2 - orrs r0, r1 - strb r0, [r3] - lsls r0, 31 - lsrs r0, 31 - adds r1, r5, 0 - adds r1, 0x2A - strb r0, [r1] - ldrb r0, [r3] - movs r1, 0x4 - orrs r0, r1 - movs r1, 0x11 - negs r1, r1 - ands r0, r1 - strb r0, [r3] - ldrb r1, [r4] - movs r0, 0x4 - ands r0, r1 - cmp r0, 0 - beq _0810E766 - bl IsContest - lsls r0, 24 - cmp r0, 0 - bne _0810E736 - ldrb r1, [r4, 0xE] - mov r0, r9 - ands r0, r1 - cmp r0, 0 - bne _0810E71C - ldrb r2, [r5, 0x5] - lsls r1, r2, 28 - lsrs r1, 30 - subs r1, 0x1 - movs r0, 0x3 - ands r1, r0 - lsls r1, 2 - movs r0, 0xD - negs r0, r0 - ands r0, r2 - orrs r0, r1 - strb r0, [r5, 0x5] - b _0810E754 -_0810E71C: - ldrb r2, [r5, 0x5] - lsls r1, r2, 28 - lsrs r1, 30 - adds r1, 0x1 - movs r0, 0x3 - ands r1, r0 - lsls r1, 2 - movs r0, 0xD - negs r0, r0 - ands r0, r2 - orrs r0, r1 - strb r0, [r5, 0x5] - b _0810E754 -_0810E736: - ldrb r1, [r4, 0xE] - mov r0, r9 - ands r0, r1 - cmp r0, 0 - bne _0810E74A - adds r1, r5, 0 - adds r1, 0x43 - ldrb r0, [r1] - subs r0, 0xC - b _0810E752 -_0810E74A: - adds r1, r5, 0 - adds r1, 0x43 - ldrb r0, [r1] - adds r0, 0xC -_0810E752: - strb r0, [r1] -_0810E754: - ldrb r2, [r4, 0xE] - lsls r0, r2, 31 - lsrs r0, 31 - eors r0, r6 - ands r0, r7 - mov r1, r8 - ands r1, r2 - orrs r1, r0 - strb r1, [r4, 0xE] -_0810E766: - ldrb r1, [r4] - movs r0, 0x9 - negs r0, r0 - ands r0, r1 - strb r0, [r4] - ldrh r1, [r4, 0x2] - mov r12, r1 -_0810E774: - ldrb r0, [r4] - movs r1, 0xF - ands r1, r0 - movs r0, 0x10 - b _0810E978 -_0810E77E: - lsls r1, r2, 24 - lsrs r0, r1, 28 - cmp r0, 0x3 - bne _0810E78C - movs r0, 0x8 - orrs r0, r2 - b _0810E794 -_0810E78C: - lsrs r0, r1, 28 - cmp r0, 0x1 - bne _0810E79C - adds r0, r2, 0 -_0810E794: - orrs r0, r7 - strb r0, [r4] - strb r6, [r4, 0x1] - b _0810E868 -_0810E79C: - movs r0, 0x8 - ands r0, r2 - cmp r0, 0 - beq _0810E868 - adds r3, r5, 0 - adds r3, 0x3F - ldrb r2, [r3] - lsls r1, r2, 31 - lsrs r1, 31 - movs r6, 0x1 - eors r1, r6 - ands r1, r7 - movs r0, 0x2 - negs r0, r0 - mov r8, r0 - ands r0, r2 - orrs r0, r1 - strb r0, [r3] - lsls r0, 31 - lsrs r0, 31 - adds r1, r5, 0 - adds r1, 0x2A - strb r0, [r1] - ldrb r0, [r3] - movs r1, 0x4 - orrs r0, r1 - movs r1, 0x11 - negs r1, r1 - ands r0, r1 - strb r0, [r3] - ldrb r1, [r4] - movs r0, 0x4 - ands r0, r1 - cmp r0, 0 - beq _0810E85A - bl IsContest - lsls r0, 24 - cmp r0, 0 - bne _0810E82A - ldrb r1, [r4, 0xE] - mov r0, r9 - ands r0, r1 - cmp r0, 0 - bne _0810E810 - ldrb r2, [r5, 0x5] - lsls r1, r2, 28 - lsrs r1, 30 - subs r1, 0x1 - movs r0, 0x3 - ands r1, r0 - lsls r1, 2 - movs r0, 0xD - negs r0, r0 - ands r0, r2 - orrs r0, r1 - strb r0, [r5, 0x5] - b _0810E848 -_0810E810: - ldrb r2, [r5, 0x5] - lsls r1, r2, 28 - lsrs r1, 30 - adds r1, 0x1 - movs r0, 0x3 - ands r1, r0 - lsls r1, 2 - movs r0, 0xD - negs r0, r0 - ands r0, r2 - orrs r0, r1 - strb r0, [r5, 0x5] - b _0810E848 -_0810E82A: - ldrb r1, [r4, 0xE] - mov r0, r9 - ands r0, r1 - cmp r0, 0 - bne _0810E83E - adds r1, r5, 0 - adds r1, 0x43 - ldrb r0, [r1] - subs r0, 0xC - b _0810E846 -_0810E83E: - adds r1, r5, 0 - adds r1, 0x43 - ldrb r0, [r1] - adds r0, 0xC -_0810E846: - strb r0, [r1] -_0810E848: - ldrb r2, [r4, 0xE] - lsls r0, r2, 31 - lsrs r0, 31 - eors r0, r6 - ands r0, r7 - mov r1, r8 - ands r1, r2 - orrs r1, r0 - strb r1, [r4, 0xE] -_0810E85A: - ldrb r1, [r4] - movs r0, 0x9 - negs r0, r0 - ands r0, r1 - strb r0, [r4] - ldrh r1, [r4, 0x2] - mov r12, r1 -_0810E868: - ldrb r0, [r4] - movs r1, 0xF - ands r1, r0 - movs r0, 0x20 - b _0810E978 -_0810E872: - lsls r1, r2, 24 - lsrs r0, r1, 28 - cmp r0, 0x2 - bne _0810E882 - movs r0, 0x8 - orrs r0, r2 - strb r0, [r4] - b _0810E970 -_0810E882: - lsrs r0, r1, 28 - cmp r0, 0 - bne _0810E8A4 - lsls r0, r2, 30 - lsrs r0, 31 - movs r1, 0x1 - eors r0, r1 - ands r0, r7 - lsls r0, 1 - movs r1, 0x3 - negs r1, r1 - ands r1, r2 - orrs r1, r0 - orrs r1, r7 - strb r1, [r4] - strb r6, [r4, 0x1] - b _0810E970 -_0810E8A4: - movs r0, 0x8 - ands r0, r2 - cmp r0, 0 - beq _0810E970 - adds r3, r5, 0 - adds r3, 0x3F - ldrb r2, [r3] - lsls r1, r2, 31 - lsrs r1, 31 - movs r6, 0x1 - eors r1, r6 - ands r1, r7 - movs r0, 0x2 - negs r0, r0 - mov r8, r0 - ands r0, r2 - orrs r0, r1 - strb r0, [r3] - lsls r0, 31 - lsrs r0, 31 - adds r1, r5, 0 - adds r1, 0x2A - strb r0, [r1] - ldrb r0, [r3] - movs r1, 0x4 - orrs r0, r1 - movs r1, 0x11 - negs r1, r1 - ands r0, r1 - strb r0, [r3] - ldrb r1, [r4] - movs r0, 0x4 - ands r0, r1 - cmp r0, 0 - beq _0810E962 - bl IsContest - lsls r0, 24 - cmp r0, 0 - bne _0810E932 - ldrb r1, [r4, 0xE] - mov r0, r9 - ands r0, r1 - cmp r0, 0 - bne _0810E918 - ldrb r2, [r5, 0x5] - lsls r1, r2, 28 - lsrs r1, 30 - subs r1, 0x1 - movs r0, 0x3 - ands r1, r0 - lsls r1, 2 - movs r0, 0xD - negs r0, r0 - ands r0, r2 - orrs r0, r1 - strb r0, [r5, 0x5] - b _0810E950 -_0810E918: - ldrb r2, [r5, 0x5] - lsls r1, r2, 28 - lsrs r1, 30 - adds r1, 0x1 - movs r0, 0x3 - ands r1, r0 - lsls r1, 2 - movs r0, 0xD - negs r0, r0 - ands r0, r2 - orrs r0, r1 - strb r0, [r5, 0x5] - b _0810E950 -_0810E932: - ldrb r1, [r4, 0xE] - mov r0, r9 - ands r0, r1 - cmp r0, 0 - bne _0810E946 - adds r1, r5, 0 - adds r1, 0x43 - ldrb r0, [r1] - subs r0, 0xC - b _0810E94E -_0810E946: - adds r1, r5, 0 - adds r1, 0x43 - ldrb r0, [r1] - adds r0, 0xC -_0810E94E: - strb r0, [r1] -_0810E950: - ldrb r2, [r4, 0xE] - lsls r0, r2, 31 - lsrs r0, 31 - eors r0, r6 - ands r0, r7 - mov r1, r8 - ands r1, r2 - orrs r1, r0 - strb r1, [r4, 0xE] -_0810E962: - ldrb r1, [r4] - movs r0, 0x9 - negs r0, r0 - ands r0, r1 - strb r0, [r4] - ldrh r1, [r4, 0x2] - mov r12, r1 -_0810E970: - ldrb r0, [r4] - movs r1, 0xF - ands r1, r0 - movs r0, 0x30 -_0810E978: - orrs r1, r0 - strb r1, [r4] -_0810E97C: - ldrb r1, [r4] - lsls r1, 30 - lsrs r1, 31 - adds r0, r4, 0 - adds r0, 0xC - adds r0, r1 - ldrb r1, [r0] - ldr r3, =gSineTable - mov r2, r12 - lsls r0, r2, 1 - adds r0, r3 - movs r2, 0 - ldrsh r0, [r0, r2] - muls r0, r1 - asrs r0, 8 - strh r0, [r5, 0x24] - ldrb r2, [r5, 0x3] - lsls r2, 26 - lsrs r2, 27 - movs r1, 0x24 - ldrsh r0, [r5, r1] - negs r0, r0 - asrs r0, 1 - ldrb r1, [r4, 0xA] - adds r0, r1 - lsls r0, 24 - lsrs r0, 24 - lsls r1, r0, 1 - adds r1, r3 - ldrh r6, [r1] - ldr r1, =gOamMatrices - lsls r2, 3 - adds r2, r1 - adds r0, 0x40 - lsls r0, 1 - adds r0, r3 - ldrh r0, [r0] - strh r0, [r2, 0x6] - strh r0, [r2] - strh r6, [r2, 0x2] - lsls r0, r6, 16 - asrs r0, 16 - negs r0, r0 - strh r0, [r2, 0x4] - ldrh r0, [r4, 0x6] - ldrh r2, [r4, 0x8] - adds r0, r2 - strh r0, [r4, 0x8] - lsls r0, 16 - lsrs r0, 24 - strh r0, [r5, 0x22] - movs r1, 0x4 - ldrsh r0, [r4, r1] - movs r1, 0x80 - lsls r1, 8 - ands r0, r1 - cmp r0, 0 - beq _0810EA0C - ldrh r0, [r4, 0x4] - subs r1, 0x1 - ands r1, r0 - ldrh r0, [r4, 0x2] - subs r0, r1 - movs r1, 0xFF - ands r0, r1 - strh r0, [r4, 0x2] - b _0810EA1C - .pool -_0810EA0C: - ldrh r0, [r4, 0x4] - ldr r1, =0x00007fff - ands r1, r0 - ldrh r2, [r4, 0x2] - adds r1, r2 - movs r0, 0xFF - ands r1, r0 - strh r1, [r4, 0x2] -_0810EA1C: - movs r0, 0x22 - ldrsh r1, [r5, r0] - movs r2, 0x26 - ldrsh r0, [r5, r2] - adds r1, r0 - ldrh r0, [r4, 0xE] - lsrs r0, 1 - cmp r1, r0 - blt _0810EA36 - movs r0, 0 - strh r0, [r5, 0x2E] - ldr r0, =sub_810E2C8 - str r0, [r5, 0x1C] -_0810EA36: - pop {r3,r4} - mov r8, r3 - mov r9, r4 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_810E520 - - thumb_func_start sub_810EA4C -sub_810EA4C: @ 810EA4C - push {r4,r5,lr} - adds r4, r0, 0 - ldr r0, =gBattleAnimTarget - ldrb r0, [r0] - bl GetBattlerSpriteBGPriority - movs r1, 0x3 - ands r1, r0 - lsls r1, 2 - ldrb r2, [r4, 0x5] - movs r0, 0xD - negs r0, r0 - ands r0, r2 - orrs r0, r1 - strb r0, [r4, 0x5] - ldr r5, =gBattleAnimAttacker - ldrb r0, [r5] - movs r1, 0x2 - bl GetBattlerSpriteCoord - lsls r0, 24 - lsrs r0, 24 - strh r0, [r4, 0x20] - ldrb r0, [r5] - movs r1, 0x3 - bl GetBattlerSpriteCoord - lsls r0, 24 - lsrs r0, 24 - strh r0, [r4, 0x22] - ldr r0, =TranslateAnimSpriteToTargetMonLocation - str r0, [r4, 0x1C] - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_810EA4C - - thumb_func_start sub_810EAA0 -sub_810EAA0: @ 810EAA0 - push {r4,r5,lr} - adds r5, r0, 0 - ldr r0, =gBattleAnimArgs - movs r1, 0x4 - ldrsh r0, [r0, r1] - cmp r0, 0 - bne _0810EABC - adds r0, r5, 0 - movs r1, 0 - bl InitSpritePosToAnimAttacker - b _0810EAC4 - .pool -_0810EABC: - adds r0, r5, 0 - movs r1, 0 - bl InitSpritePosToAnimTarget -_0810EAC4: - ldr r4, =gBattleAnimArgs - movs r2, 0x4 - ldrsh r0, [r4, r2] - cmp r0, 0 - bne _0810EADC - ldr r0, =gBattleAnimAttacker - ldrb r0, [r0] - bl GetBattlerSide - lsls r0, 24 - cmp r0, 0 - beq _0810EAF2 -_0810EADC: - movs r1, 0x4 - ldrsh r0, [r4, r1] - cmp r0, 0x1 - bne _0810EAF8 - ldr r0, =gBattleAnimTarget - ldrb r0, [r0] - bl GetBattlerSide - lsls r0, 24 - cmp r0, 0 - bne _0810EAF8 -_0810EAF2: - ldrh r0, [r5, 0x20] - adds r0, 0x8 - strh r0, [r5, 0x20] -_0810EAF8: - ldr r4, =gBattleAnimArgs - ldrb r1, [r4, 0x8] - adds r0, r5, 0 - bl SeekSpriteAnim - ldrh r0, [r5, 0x20] - subs r0, 0x20 - strh r0, [r5, 0x20] - ldr r0, =0x00000ccc - strh r0, [r5, 0x30] - ldrh r1, [r4, 0x8] - movs r0, 0xC - adds r2, r0, 0 - muls r2, r1 - adds r0, r2, 0 - ldrh r2, [r5, 0x24] - adds r0, r2 - strh r0, [r5, 0x24] - strh r1, [r5, 0x2E] - ldrh r0, [r4, 0x6] - strh r0, [r5, 0x3C] - ldr r0, =sub_810EB40 - str r0, [r5, 0x1C] - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_810EAA0 - - thumb_func_start sub_810EB40 -sub_810EB40: @ 810EB40 - push {r4,lr} - adds r4, r0, 0 - ldrh r0, [r4, 0x30] - lsls r0, 16 - asrs r0, 24 - ldrh r1, [r4, 0x24] - adds r0, r1 - movs r1, 0 - strh r0, [r4, 0x24] - ldrh r0, [r4, 0x2E] - adds r0, 0x1 - strh r0, [r4, 0x2E] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x6 - bne _0810EB6A - strh r1, [r4, 0x2E] - strh r1, [r4, 0x24] - adds r0, r4, 0 - bl StartSpriteAnim -_0810EB6A: - ldrh r0, [r4, 0x3C] - subs r0, 0x1 - strh r0, [r4, 0x3C] - lsls r0, 16 - asrs r0, 16 - movs r1, 0x1 - negs r1, r1 - cmp r0, r1 - bne _0810EB82 - adds r0, r4, 0 - bl DestroyAnimSprite -_0810EB82: - pop {r4} - pop {r0} - bx r0 - thumb_func_end sub_810EB40 - - thumb_func_start sub_810EB88 -sub_810EB88: @ 810EB88 - push {r4-r7,lr} - mov r7, r8 - push {r7} - lsls r0, 24 - lsrs r0, 24 - adds r6, r0, 0 - ldr r1, =gTasks - lsls r0, r6, 2 - adds r0, r6 - lsls r0, 3 - adds r7, r0, r1 - ldrh r0, [r7, 0x8] - movs r1, 0x1F - ands r0, r1 - cmp r0, 0 - bne _0810EC02 - ldr r1, =gAnimVisualTaskCount - ldrb r0, [r1] - adds r0, 0x1 - strb r0, [r1] - movs r1, 0x8 - ldrsh r0, [r7, r1] - movs r5, 0xD - negs r5, r5 - adds r1, r5, 0 - bl Sin - ldr r4, =gBattleAnimArgs - strh r0, [r4] - movs r1, 0x8 - ldrsh r0, [r7, r1] - adds r1, r5, 0 - bl Cos - strh r0, [r4, 0x2] - movs r0, 0x1 - strh r0, [r4, 0x4] - movs r0, 0x3 - strh r0, [r4, 0x6] - ldr r0, =gUnknown_085973E8 - mov r8, r0 - ldr r5, =gBattleAnimTarget - ldrb r0, [r5] - movs r1, 0x2 - bl GetBattlerSpriteCoord - adds r4, r0, 0 - lsls r4, 24 - lsrs r4, 24 - ldrb r0, [r5] - movs r1, 0x3 - bl GetBattlerSpriteCoord - adds r2, r0, 0 - lsls r2, 24 - lsrs r2, 24 - mov r0, r8 - adds r1, r4, 0 - movs r3, 0x3 - bl CreateSpriteAndAnimate -_0810EC02: - ldrh r0, [r7, 0x8] - adds r0, 0x8 - strh r0, [r7, 0x8] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0xFF - ble _0810EC16 - adds r0, r6, 0 - bl DestroyAnimVisualTask -_0810EC16: - pop {r3} - mov r8, r3 - pop {r4-r7} - pop {r0} - bx r0 - .pool - thumb_func_end sub_810EB88 - - thumb_func_start sub_810EC34 -sub_810EC34: @ 810EC34 - push {r4,lr} - adds r4, r0, 0 - movs r1, 0x2E - ldrsh r0, [r4, r1] - cmp r0, 0 - beq _0810EC46 - cmp r0, 0x1 - beq _0810EC78 - b _0810EC8C -_0810EC46: - adds r0, r4, 0 - movs r1, 0x1 - bl InitSpritePosToAnimAttacker - movs r0, 0 - bl GetAnimBattlerSpriteId - ldr r2, =gSprites - lsls r0, 24 - lsrs r0, 24 - lsls r1, r0, 4 - adds r1, r0 - lsls r1, 2 - adds r1, r2 - adds r1, 0x3E - ldrb r0, [r1] - movs r2, 0x4 - orrs r0, r2 - strb r0, [r1] - ldrh r0, [r4, 0x2E] - adds r0, 0x1 - strh r0, [r4, 0x2E] - b _0810EC8C - .pool -_0810EC78: - adds r0, r4, 0 - adds r0, 0x3F - ldrb r1, [r0] - movs r0, 0x20 - ands r0, r1 - cmp r0, 0 - beq _0810EC8C - adds r0, r4, 0 - bl DestroyAnimSprite -_0810EC8C: - pop {r4} - pop {r0} - bx r0 - thumb_func_end sub_810EC34 - - thumb_func_start sub_810EC94 -sub_810EC94: @ 810EC94 - push {r4,lr} - adds r4, r0, 0 - movs r1, 0x2E - ldrsh r0, [r4, r1] - cmp r0, 0x1 - beq _0810ECCC - cmp r0, 0x1 - bgt _0810ECAA - cmp r0, 0 - beq _0810ECB0 - b _0810ED1E -_0810ECAA: - cmp r0, 0x2 - beq _0810ECE0 - b _0810ED1E -_0810ECB0: - ldr r0, =gBattleAnimTarget - ldrb r0, [r0] - movs r1, 0x1 - bl GetBattlerSpriteCoord - lsls r0, 24 - lsrs r0, 24 - strh r0, [r4, 0x22] - negs r0, r0 - subs r0, 0x20 - strh r0, [r4, 0x26] - b _0810ECD8 - .pool -_0810ECCC: - ldrh r0, [r4, 0x26] - adds r0, 0xA - strh r0, [r4, 0x26] - lsls r0, 16 - cmp r0, 0 - blt _0810ED1E -_0810ECD8: - ldrh r0, [r4, 0x2E] - adds r0, 0x1 - strh r0, [r4, 0x2E] - b _0810ED1E -_0810ECE0: - ldrh r0, [r4, 0x26] - subs r0, 0xA - strh r0, [r4, 0x26] - movs r2, 0x22 - ldrsh r0, [r4, r2] - movs r2, 0x26 - ldrsh r1, [r4, r2] - adds r0, r1 - movs r1, 0x20 - negs r1, r1 - cmp r0, r1 - bge _0810ED1E - movs r0, 0 - bl GetAnimBattlerSpriteId - ldr r2, =gSprites - lsls r0, 24 - lsrs r0, 24 - lsls r1, r0, 4 - adds r1, r0 - lsls r1, 2 - adds r1, r2 - adds r1, 0x3E - ldrb r2, [r1] - movs r0, 0x5 - negs r0, r0 - ands r0, r2 - strb r0, [r1] - adds r0, r4, 0 - bl DestroyAnimSprite -_0810ED1E: - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_810EC94 - - thumb_func_start sub_810ED28 -sub_810ED28: @ 810ED28 - push {r4,lr} - adds r4, r0, 0 - movs r1, 0x1 - bl InitSpritePosToAnimAttacker - ldr r1, =gBattleAnimArgs - ldrh r0, [r1, 0x4] - strh r0, [r4, 0x2E] - ldrh r0, [r1, 0x6] - strh r0, [r4, 0x30] - ldr r0, =sub_810ED70 - str r0, [r4, 0x1C] - movs r0, 0 - bl GetAnimBattlerSpriteId - ldr r2, =gSprites - lsls r0, 24 - lsrs r0, 24 - lsls r1, r0, 4 - adds r1, r0 - lsls r1, 2 - adds r1, r2 - adds r1, 0x3E - ldrb r0, [r1] - movs r2, 0x4 - orrs r0, r2 - strb r0, [r1] - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_810ED28 - - thumb_func_start sub_810ED70 -sub_810ED70: @ 810ED70 - push {lr} - adds r2, r0, 0 - ldrh r1, [r2, 0x2E] - movs r3, 0x2E - ldrsh r0, [r2, r3] - cmp r0, 0 - ble _0810ED84 - subs r0, r1, 0x1 - strh r0, [r2, 0x2E] - b _0810EDC8 -_0810ED84: - movs r1, 0x22 - ldrsh r0, [r2, r1] - movs r3, 0x26 - ldrsh r1, [r2, r3] - adds r0, r1 - movs r1, 0x20 - negs r1, r1 - cmp r0, r1 - ble _0810EDAA - ldrh r0, [r2, 0x30] - ldrh r1, [r2, 0x32] - adds r0, r1 - strh r0, [r2, 0x32] - lsls r0, 16 - asrs r0, 24 - ldrh r1, [r2, 0x26] - subs r1, r0 - strh r1, [r2, 0x26] - b _0810EDC8 -_0810EDAA: - adds r3, r2, 0 - adds r3, 0x3E - ldrb r0, [r3] - movs r1, 0x4 - orrs r0, r1 - strb r0, [r3] - ldrh r0, [r2, 0x34] - adds r1, r0, 0x1 - strh r1, [r2, 0x34] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x14 - ble _0810EDC8 - ldr r0, =sub_810EDD0 - str r0, [r2, 0x1C] -_0810EDC8: - pop {r0} - bx r0 - .pool - thumb_func_end sub_810ED70 - - thumb_func_start sub_810EDD0 -sub_810EDD0: @ 810EDD0 - push {lr} - adds r2, r0, 0 - ldrh r0, [r2, 0x32] - lsls r0, 16 - asrs r0, 24 - ldrh r1, [r2, 0x26] - adds r0, r1 - strh r0, [r2, 0x26] - movs r3, 0x22 - ldrsh r0, [r2, r3] - movs r3, 0x26 - ldrsh r1, [r2, r3] - adds r0, r1 - movs r1, 0x20 - negs r1, r1 - cmp r0, r1 - ble _0810EE00 - adds r3, r2, 0 - adds r3, 0x3E - ldrb r1, [r3] - movs r0, 0x5 - negs r0, r0 - ands r0, r1 - strb r0, [r3] -_0810EE00: - movs r1, 0x26 - ldrsh r0, [r2, r1] - cmp r0, 0 - ble _0810EE0E - adds r0, r2, 0 - bl DestroyAnimSprite -_0810EE0E: - pop {r0} - bx r0 - thumb_func_end sub_810EDD0 - - thumb_func_start sub_810EE14 -sub_810EE14: @ 810EE14 - push {r4,r5,lr} - sub sp, 0x4 - adds r5, r0, 0 - movs r1, 0x2E - ldrsh r0, [r5, r1] - cmp r0, 0 - beq _0810EE28 - cmp r0, 0x1 - beq _0810EE80 - b _0810EEEC -_0810EE28: - ldr r0, =gBattleAnimArgs - movs r2, 0 - ldrsh r0, [r0, r2] - cmp r0, 0 - bne _0810EE40 - ldr r4, =gBattleAnimAttacker - b _0810EE42 - .pool -_0810EE40: - ldr r4, =gBattleAnimTarget -_0810EE42: - ldrb r0, [r4] - movs r1, 0 - bl GetBattlerSpriteCoord - lsls r0, 24 - lsrs r0, 24 - strh r0, [r5, 0x20] - ldrb r0, [r4] - movs r1, 0x1 - bl GetBattlerSpriteCoord - lsls r0, 24 - lsrs r0, 24 - strh r0, [r5, 0x22] - movs r0, 0 - movs r3, 0x80 - lsls r3, 2 - strh r3, [r5, 0x30] - movs r2, 0x80 - lsls r2, 1 - str r0, [sp] - adds r0, r5, 0 - movs r1, 0 - bl TrySetSpriteRotScale - ldrh r0, [r5, 0x2E] - adds r0, 0x1 - strh r0, [r5, 0x2E] - b _0810EEEC - .pool -_0810EE80: - movs r1, 0x32 - ldrsh r0, [r5, r1] - cmp r0, 0xB - bgt _0810EE8E - ldrh r0, [r5, 0x30] - subs r0, 0x28 - b _0810EE92 -_0810EE8E: - ldrh r0, [r5, 0x30] - adds r0, 0x28 -_0810EE92: - strh r0, [r5, 0x30] - ldrh r0, [r5, 0x32] - adds r0, 0x1 - movs r1, 0 - strh r0, [r5, 0x32] - movs r2, 0x80 - lsls r2, 1 - movs r0, 0x30 - ldrsh r3, [r5, r0] - str r1, [sp] - adds r0, r5, 0 - bl TrySetSpriteRotScale - ldrb r1, [r5, 0x3] - lsls r1, 26 - lsrs r1, 27 - movs r0, 0xF4 - lsls r0, 6 - ldr r2, =gOamMatrices - lsls r1, 3 - adds r1, r2 - movs r2, 0x6 - ldrsh r1, [r1, r2] - bl __divsi3 - adds r1, r0, 0x1 - cmp r1, 0x80 - ble _0810EECC - movs r1, 0x80 -_0810EECC: - movs r0, 0x40 - subs r0, r1 - lsrs r1, r0, 31 - adds r0, r1 - asrs r1, r0, 1 - strh r1, [r5, 0x26] - movs r1, 0x32 - ldrsh r0, [r5, r1] - cmp r0, 0x18 - bne _0810EEEC - adds r0, r5, 0 - bl sub_80A749C - adds r0, r5, 0 - bl DestroyAnimSprite -_0810EEEC: - add sp, 0x4 - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_810EE14 - - thumb_func_start sub_810EEF8 -sub_810EEF8: @ 810EEF8 - push {r4,r5,lr} - adds r5, r0, 0 - bl Random2 - ldr r4, =0x000001ff - ands r4, r0 - bl Random2 - movs r1, 0x7F - ands r1, r0 - movs r0, 0x1 - ands r0, r4 - cmp r0, 0 - beq _0810EF20 - movs r2, 0xB8 - lsls r2, 2 - adds r0, r4, r2 - b _0810EF28 - .pool -_0810EF20: - movs r2, 0xB8 - lsls r2, 2 - adds r0, r2, 0 - subs r0, r4 -_0810EF28: - strh r0, [r5, 0x2E] - movs r0, 0x1 - ands r0, r1 - cmp r0, 0 - beq _0810EF3C - movs r2, 0xE0 - lsls r2, 2 - adds r0, r2, 0 - adds r0, r1, r0 - b _0810EF44 -_0810EF3C: - movs r2, 0xE0 - lsls r2, 2 - adds r0, r2, 0 - subs r0, r1 -_0810EF44: - strh r0, [r5, 0x30] - ldr r2, =gBattleAnimArgs - ldrh r0, [r2] - strh r0, [r5, 0x32] - lsls r0, 16 - cmp r0, 0 - beq _0810EF60 - ldrb r0, [r5, 0x3] - movs r1, 0x3F - negs r1, r1 - ands r1, r0 - movs r0, 0x10 - orrs r1, r0 - strb r1, [r5, 0x3] -_0810EF60: - movs r1, 0x2 - ldrsh r0, [r2, r1] - cmp r0, 0 - bne _0810EF74 - ldr r4, =gBattleAnimAttacker - b _0810EF76 - .pool -_0810EF74: - ldr r4, =gBattleAnimTarget -_0810EF76: - ldrb r0, [r4] - movs r1, 0 - bl GetBattlerSpriteCoord - lsls r0, 24 - lsrs r0, 24 - strh r0, [r5, 0x20] - ldrb r0, [r4] - movs r1, 0x1 - bl GetBattlerSpriteCoord - lsls r0, 24 - lsrs r0, 24 - adds r0, 0x20 - strh r0, [r5, 0x22] - ldr r0, =sub_810EFA8 - str r0, [r5, 0x1C] - pop {r4,r5} - pop {r0} - bx r0 - .pool - thumb_func_end sub_810EEF8 - - thumb_func_start sub_810EFA8 -sub_810EFA8: @ 810EFA8 - push {r4,lr} - adds r4, r0, 0 - movs r1, 0x32 - ldrsh r0, [r4, r1] - cmp r0, 0 - bne _0810EFC0 - ldrh r3, [r4, 0x2E] - lsls r0, r3, 16 - asrs r0, 24 - ldrh r1, [r4, 0x24] - adds r0, r1 - b _0810EFCA -_0810EFC0: - ldrh r3, [r4, 0x2E] - lsls r1, r3, 16 - asrs r1, 24 - ldrh r0, [r4, 0x24] - subs r0, r1 -_0810EFCA: - strh r0, [r4, 0x24] - ldrh r2, [r4, 0x30] - lsls r1, r2, 16 - asrs r1, 24 - ldrh r0, [r4, 0x26] - subs r0, r1 - strh r0, [r4, 0x26] - strh r3, [r4, 0x2E] - adds r0, r2, 0 - subs r0, 0x20 - strh r0, [r4, 0x30] - lsls r0, r3, 16 - cmp r0, 0 - bge _0810EFEA - movs r0, 0 - strh r0, [r4, 0x2E] -_0810EFEA: - ldrh r0, [r4, 0x34] - adds r0, 0x1 - strh r0, [r4, 0x34] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x1F - bne _0810EFFE - adds r0, r4, 0 - bl DestroyAnimSprite -_0810EFFE: - pop {r4} - pop {r0} - bx r0 - thumb_func_end sub_810EFA8 - - thumb_func_start sub_810F004 -sub_810F004: @ 810F004 - movs r1, 0 - strh r1, [r0, 0x3A] - movs r1, 0x40 - strh r1, [r0, 0x3C] - ldr r1, =sub_810F018 - str r1, [r0, 0x1C] - bx lr - .pool - thumb_func_end sub_810F004 - - thumb_func_start sub_810F018 -sub_810F018: @ 810F018 - push {lr} - adds r3, r0, 0 - movs r0, 0x2E - ldrsh r1, [r3, r0] - cmp r1, 0 - beq _0810F02A - cmp r1, 0x1 - beq _0810F078 - b _0810F07E -_0810F02A: - ldrh r0, [r3, 0x30] - adds r0, 0x1 - strh r0, [r3, 0x30] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x8 - ble _0810F07E - strh r1, [r3, 0x30] - movs r1, 0x3E - adds r1, r3 - mov r12, r1 - ldrb r2, [r1] - lsls r0, r2, 29 - lsrs r0, 31 - movs r1, 0x1 - eors r1, r0 - lsls r1, 2 - movs r0, 0x5 - negs r0, r0 - ands r0, r2 - orrs r0, r1 - mov r1, r12 - strb r0, [r1] - ldrh r0, [r3, 0x32] - adds r0, 0x1 - strh r0, [r3, 0x32] - lsls r0, 16 - asrs r0, 16 - cmp r0, 0x5 - ble _0810F07E - ldrb r1, [r1] - movs r0, 0x4 - ands r0, r1 - cmp r0, 0 - beq _0810F07E - ldrh r0, [r3, 0x2E] - adds r0, 0x1 - strh r0, [r3, 0x2E] - b _0810F07E -_0810F078: - adds r0, r3, 0 - bl DestroyAnimSprite -_0810F07E: - pop {r0} - bx r0 - thumb_func_end sub_810F018 - - thumb_func_start sub_810F084 -sub_810F084: @ 810F084 - push {r4-r6,lr} - mov r6, r9 - mov r5, r8 - push {r5,r6} - sub sp, 0x4 - mov r8, r0 - ldrh r4, [r0, 0x20] - ldrh r5, [r0, 0x22] - ldr r6, =gBattleAnimAttacker - ldrb r0, [r6] - movs r1, 0x2 - bl GetBattlerSpriteCoord - lsls r0, 24 - lsrs r0, 24 - mov r1, r8 - strh r0, [r1, 0x20] - ldrb r0, [r6] - movs r1, 0x3 - bl GetBattlerSpriteCoord - adds r6, r0, 0 - lsls r6, 24 - lsrs r6, 24 - mov r2, r8 - strh r6, [r2, 0x22] - ldrh r0, [r2, 0x20] - mov r9, r0 - mov r1, r9 - lsls r0, r1, 4 - strh r0, [r2, 0x36] - lsls r0, r6, 4 - strh r0, [r2, 0x38] - lsls r4, 16 - asrs r4, 16 - movs r1, 0x20 - ldrsh r0, [r2, r1] - subs r0, r4, r0 - lsls r0, 4 - movs r1, 0xC - bl __divsi3 - mov r2, r8 - strh r0, [r2, 0x3A] - lsls r5, 16 - asrs r5, 16 - movs r1, 0x22 - ldrsh r0, [r2, r1] - subs r0, r5, r0 - lsls r0, 4 - movs r1, 0xC - bl __divsi3 - mov r2, r8 - strh r0, [r2, 0x3C] - mov r0, r9 - subs r4, r0 - lsls r4, 16 - asrs r4, 16 - subs r5, r6 - lsls r5, 16 - asrs r5, 16 - adds r0, r4, 0 - adds r1, r5, 0 - bl ArcTan2Neg - lsls r0, 16 - movs r1, 0xC0 - lsls r1, 24 - adds r0, r1 - lsrs r0, 16 - movs r3, 0x80 - lsls r3, 1 - str r0, [sp] - mov r0, r8 - movs r1, 0x1 - adds r2, r3, 0 - bl TrySetSpriteRotScale - ldr r0, =sub_810F140 - mov r2, r8 - str r0, [r2, 0x1C] - add sp, 0x4 - pop {r3,r4} - mov r8, r3 - mov r9, r4 - pop {r4-r6} - pop {r0} - bx r0 - .pool - thumb_func_end sub_810F084 - - thumb_func_start sub_810F140 -sub_810F140: @ 810F140 - push {lr} - adds r2, r0, 0 - ldrh r0, [r2, 0x3A] - ldrh r1, [r2, 0x36] - adds r0, r1 - strh r0, [r2, 0x36] - ldrh r1, [r2, 0x3C] - ldrh r3, [r2, 0x38] - adds r1, r3 - strh r1, [r2, 0x38] - lsls r0, 16 - asrs r0, 20 - strh r0, [r2, 0x20] - lsls r1, 16 - asrs r3, r1, 20 - strh r3, [r2, 0x22] - adds r0, 0x2D - lsls r0, 16 - movs r1, 0xA5 - lsls r1, 17 - cmp r0, r1 - bhi _0810F17A - adds r1, r3, 0 - cmp r1, 0x9D - bgt _0810F17A - movs r0, 0x2D - negs r0, r0 - cmp r1, r0 - bge _0810F180 -_0810F17A: - adds r0, r2, 0 - bl DestroySpriteAndMatrix -_0810F180: - pop {r0} - bx r0 - thumb_func_end sub_810F140 - - thumb_func_start sub_810F184 -sub_810F184: @ 810F184 - push {r4,lr} - lsls r0, 24 - lsrs r4, r0, 24 - ldr r0, =gBattleAnimArgs - movs r1, 0 - ldrsh r0, [r0, r1] - cmp r0, 0 - bne _0810F1BC - movs r0, 0 - bl GetAnimBattlerSpriteId - lsls r0, 24 - lsrs r0, 24 - ldr r2, =gSprites - lsls r1, r0, 4 - adds r1, r0 - lsls r1, 2 - adds r1, r2 - adds r1, 0x3E - ldrb r0, [r1] - movs r2, 0x4 - orrs r0, r2 - b _0810F1DA - .pool -_0810F1BC: - movs r0, 0 - bl GetAnimBattlerSpriteId - lsls r0, 24 - lsrs r0, 24 - ldr r2, =gSprites - lsls r1, r0, 4 - adds r1, r0 - lsls r1, 2 - adds r1, r2 - adds r1, 0x3E - ldrb r2, [r1] - movs r0, 0x5 - negs r0, r0 - ands r0, r2 -_0810F1DA: - strb r0, [r1] - adds r0, r4, 0 - bl DestroyAnimVisualTask - pop {r4} - pop {r0} - bx r0 - .pool - thumb_func_end sub_810F184 - - .align 2, 0 diff --git a/ld_script.txt b/ld_script.txt index acfd535f89..e60badcc20 100644 --- a/ld_script.txt +++ b/ld_script.txt @@ -165,7 +165,6 @@ SECTIONS { src/fight.o(.text); src/poison.o(.text); src/flying.o(.text); - asm/flying.o(.text); src/psychic.o(.text); src/bug.o(.text); src/rock.o(.text); diff --git a/src/flying.c b/src/flying.c index 48df12a067..7f48e57cbd 100644 --- a/src/flying.c +++ b/src/flying.c @@ -4,6 +4,9 @@ #include "trig.h" #include "constants/battle_anim.h" #include "constants/rgb.h" +#include "random.h" + +extern const struct SpriteTemplate gUnknown_085973E8; void sub_810DE70(struct Sprite *); void sub_810DFA8(struct Sprite *); @@ -11,22 +14,29 @@ void sub_810E044(struct Sprite *); void sub_810E13C(struct Sprite *); void sub_810E1C8(struct Sprite *); void sub_810E314(struct Sprite *); -extern void sub_810EA4C(struct Sprite *); -extern void sub_810EAA0(struct Sprite *); -extern void sub_810EC34(struct Sprite *); -extern void sub_810EC94(struct Sprite *); -extern void sub_810ED28(struct Sprite *); -extern void sub_810EE14(struct Sprite *); -extern void sub_810EEF8(struct Sprite *); -extern void sub_810F004(struct Sprite *); -extern void sub_810F084(struct Sprite *); +void sub_810E520(struct Sprite *); +void sub_810EB40(struct Sprite *); +void sub_810EA4C(struct Sprite *); +void sub_810EAA0(struct Sprite *); +void sub_810EC34(struct Sprite *); +void sub_810EC94(struct Sprite *); +void sub_810ED28(struct Sprite *); +void sub_810ED70(struct Sprite *); +void sub_810EDD0(struct Sprite *); +void sub_810EE14(struct Sprite *); +void sub_810EEF8(struct Sprite *); +void sub_810EFA8(struct Sprite *); +void sub_810F004(struct Sprite *); +void sub_810F018(struct Sprite *); +void sub_810F084(struct Sprite *); +void sub_810F140(struct Sprite *); static void sub_810DE98(struct Sprite *); static void sub_810DF18(u8); static void sub_810E028(struct Sprite *); static void sub_810E184(struct Sprite *); static void sub_810E24C(struct Sprite *); -void sub_810E520(struct Sprite *); + const struct SpriteTemplate gUnknown_08596270 = { @@ -626,3 +636,1182 @@ void sub_810E314(struct Sprite *sprite) sprite->callback = sub_810E520; } + +NAKED +void sub_810E520(struct Sprite *sprite) +{ + asm_unified("push {r4-r7,lr}\n\ + mov r7, r9\n\ + mov r6, r8\n\ + push {r6,r7}\n\ + adds r5, r0, 0\n\ + movs r6, 0\n\ + adds r4, r5, 0\n\ + adds r4, 0x2E\n\ + ldrb r2, [r4]\n\ + movs r7, 0x1\n\ + movs r0, 0x1\n\ + mov r9, r0\n\ + ands r0, r2\n\ + cmp r0, 0\n\ + beq _0810E55A\n\ + ldrb r0, [r4, 0x1]\n\ + adds r1, r0, 0\n\ + adds r1, 0xFF\n\ + strb r1, [r4, 0x1]\n\ + lsls r0, 24\n\ + cmp r0, 0\n\ + beq _0810E54E\n\ + b _0810EA36\n\ +_0810E54E:\n\ + movs r0, 0x2\n\ + negs r0, r0\n\ + ands r0, r2\n\ + strb r0, [r4]\n\ + strb r6, [r4, 0x1]\n\ + b _0810EA36\n\ +_0810E55A:\n\ + ldrh r0, [r4, 0x2]\n\ + lsrs r1, r0, 6\n\ + mov r12, r0\n\ + cmp r1, 0x1\n\ + bne _0810E566\n\ + b _0810E68A\n\ +_0810E566:\n\ + cmp r1, 0x1\n\ + bgt _0810E570\n\ + cmp r1, 0\n\ + beq _0810E57E\n\ + b _0810E97C\n\ +_0810E570:\n\ + cmp r1, 0x2\n\ + bne _0810E576\n\ + b _0810E77E\n\ +_0810E576:\n\ + cmp r1, 0x3\n\ + bne _0810E57C\n\ + b _0810E872\n\ +_0810E57C:\n\ + b _0810E97C\n\ +_0810E57E:\n\ + lsls r1, r2, 24\n\ + lsrs r0, r1, 28\n\ + cmp r0, 0x1\n\ + bne _0810E592\n\ + movs r0, 0x8\n\ + orrs r0, r2\n\ + orrs r0, r7\n\ + strb r0, [r4]\n\ + strb r6, [r4, 0x1]\n\ + b _0810E680\n\ +_0810E592:\n\ + lsrs r0, r1, 28\n\ + cmp r0, 0x3\n\ + bne _0810E5B4\n\ + lsls r0, r2, 30\n\ + lsrs r0, 31\n\ + movs r1, 0x1\n\ + eors r0, r1\n\ + ands r0, r7\n\ + lsls r0, 1\n\ + movs r1, 0x3\n\ + negs r1, r1\n\ + ands r1, r2\n\ + orrs r1, r0\n\ + orrs r1, r7\n\ + strb r1, [r4]\n\ + strb r6, [r4, 0x1]\n\ + b _0810E680\n\ +_0810E5B4:\n\ + movs r0, 0x8\n\ + ands r0, r2\n\ + cmp r0, 0\n\ + beq _0810E680\n\ + adds r3, r5, 0\n\ + adds r3, 0x3F\n\ + ldrb r2, [r3]\n\ + lsls r1, r2, 31\n\ + lsrs r1, 31\n\ + movs r6, 0x1\n\ + eors r1, r6\n\ + ands r1, r7\n\ + movs r0, 0x2\n\ + negs r0, r0\n\ + mov r8, r0\n\ + ands r0, r2\n\ + orrs r0, r1\n\ + strb r0, [r3]\n\ + lsls r0, 31\n\ + lsrs r0, 31\n\ + adds r1, r5, 0\n\ + adds r1, 0x2A\n\ + strb r0, [r1]\n\ + ldrb r0, [r3]\n\ + movs r1, 0x4\n\ + orrs r0, r1\n\ + movs r1, 0x11\n\ + negs r1, r1\n\ + ands r0, r1\n\ + strb r0, [r3]\n\ + ldrb r1, [r4]\n\ + movs r0, 0x4\n\ + ands r0, r1\n\ + cmp r0, 0\n\ + beq _0810E672\n\ + bl IsContest\n\ + lsls r0, 24\n\ + cmp r0, 0\n\ + bne _0810E642\n\ + ldrb r1, [r4, 0xE]\n\ + mov r0, r9\n\ + ands r0, r1\n\ + cmp r0, 0\n\ + bne _0810E628\n\ + ldrb r2, [r5, 0x5]\n\ + lsls r1, r2, 28\n\ + lsrs r1, 30\n\ + subs r1, 0x1\n\ + movs r0, 0x3\n\ + ands r1, r0\n\ + lsls r1, 2\n\ + movs r0, 0xD\n\ + negs r0, r0\n\ + ands r0, r2\n\ + orrs r0, r1\n\ + strb r0, [r5, 0x5]\n\ + b _0810E660\n\ +_0810E628:\n\ + ldrb r2, [r5, 0x5]\n\ + lsls r1, r2, 28\n\ + lsrs r1, 30\n\ + adds r1, 0x1\n\ + movs r0, 0x3\n\ + ands r1, r0\n\ + lsls r1, 2\n\ + movs r0, 0xD\n\ + negs r0, r0\n\ + ands r0, r2\n\ + orrs r0, r1\n\ + strb r0, [r5, 0x5]\n\ + b _0810E660\n\ +_0810E642:\n\ + ldrb r1, [r4, 0xE]\n\ + mov r0, r9\n\ + ands r0, r1\n\ + cmp r0, 0\n\ + bne _0810E656\n\ + adds r1, r5, 0\n\ + adds r1, 0x43\n\ + ldrb r0, [r1]\n\ + subs r0, 0xC\n\ + b _0810E65E\n\ +_0810E656:\n\ + adds r1, r5, 0\n\ + adds r1, 0x43\n\ + ldrb r0, [r1]\n\ + adds r0, 0xC\n\ +_0810E65E:\n\ + strb r0, [r1]\n\ +_0810E660:\n\ + ldrb r2, [r4, 0xE]\n\ + lsls r0, r2, 31\n\ + lsrs r0, 31\n\ + eors r0, r6\n\ + ands r0, r7\n\ + mov r1, r8\n\ + ands r1, r2\n\ + orrs r1, r0\n\ + strb r1, [r4, 0xE]\n\ +_0810E672:\n\ + ldrb r1, [r4]\n\ + movs r0, 0x9\n\ + negs r0, r0\n\ + ands r0, r1\n\ + strb r0, [r4]\n\ + ldrh r1, [r4, 0x2]\n\ + mov r12, r1\n\ +_0810E680:\n\ + ldrb r1, [r4]\n\ + movs r0, 0xF\n\ + ands r0, r1\n\ + strb r0, [r4]\n\ + b _0810E97C\n\ +_0810E68A:\n\ + lsls r1, r2, 24\n\ + lsrs r0, r1, 28\n\ + cmp r0, 0\n\ + bne _0810E698\n\ + movs r0, 0x8\n\ + orrs r0, r2\n\ + b _0810E6A0\n\ +_0810E698:\n\ + lsrs r0, r1, 28\n\ + cmp r0, 0x2\n\ + bne _0810E6A8\n\ + adds r0, r2, 0\n\ +_0810E6A0:\n\ + orrs r0, r7\n\ + strb r0, [r4]\n\ + strb r6, [r4, 0x1]\n\ + b _0810E774\n\ +_0810E6A8:\n\ + movs r0, 0x8\n\ + ands r0, r2\n\ + cmp r0, 0\n\ + beq _0810E774\n\ + adds r3, r5, 0\n\ + adds r3, 0x3F\n\ + ldrb r2, [r3]\n\ + lsls r1, r2, 31\n\ + lsrs r1, 31\n\ + movs r6, 0x1\n\ + eors r1, r6\n\ + ands r1, r7\n\ + movs r0, 0x2\n\ + negs r0, r0\n\ + mov r8, r0\n\ + ands r0, r2\n\ + orrs r0, r1\n\ + strb r0, [r3]\n\ + lsls r0, 31\n\ + lsrs r0, 31\n\ + adds r1, r5, 0\n\ + adds r1, 0x2A\n\ + strb r0, [r1]\n\ + ldrb r0, [r3]\n\ + movs r1, 0x4\n\ + orrs r0, r1\n\ + movs r1, 0x11\n\ + negs r1, r1\n\ + ands r0, r1\n\ + strb r0, [r3]\n\ + ldrb r1, [r4]\n\ + movs r0, 0x4\n\ + ands r0, r1\n\ + cmp r0, 0\n\ + beq _0810E766\n\ + bl IsContest\n\ + lsls r0, 24\n\ + cmp r0, 0\n\ + bne _0810E736\n\ + ldrb r1, [r4, 0xE]\n\ + mov r0, r9\n\ + ands r0, r1\n\ + cmp r0, 0\n\ + bne _0810E71C\n\ + ldrb r2, [r5, 0x5]\n\ + lsls r1, r2, 28\n\ + lsrs r1, 30\n\ + subs r1, 0x1\n\ + movs r0, 0x3\n\ + ands r1, r0\n\ + lsls r1, 2\n\ + movs r0, 0xD\n\ + negs r0, r0\n\ + ands r0, r2\n\ + orrs r0, r1\n\ + strb r0, [r5, 0x5]\n\ + b _0810E754\n\ +_0810E71C:\n\ + ldrb r2, [r5, 0x5]\n\ + lsls r1, r2, 28\n\ + lsrs r1, 30\n\ + adds r1, 0x1\n\ + movs r0, 0x3\n\ + ands r1, r0\n\ + lsls r1, 2\n\ + movs r0, 0xD\n\ + negs r0, r0\n\ + ands r0, r2\n\ + orrs r0, r1\n\ + strb r0, [r5, 0x5]\n\ + b _0810E754\n\ +_0810E736:\n\ + ldrb r1, [r4, 0xE]\n\ + mov r0, r9\n\ + ands r0, r1\n\ + cmp r0, 0\n\ + bne _0810E74A\n\ + adds r1, r5, 0\n\ + adds r1, 0x43\n\ + ldrb r0, [r1]\n\ + subs r0, 0xC\n\ + b _0810E752\n\ +_0810E74A:\n\ + adds r1, r5, 0\n\ + adds r1, 0x43\n\ + ldrb r0, [r1]\n\ + adds r0, 0xC\n\ +_0810E752:\n\ + strb r0, [r1]\n\ +_0810E754:\n\ + ldrb r2, [r4, 0xE]\n\ + lsls r0, r2, 31\n\ + lsrs r0, 31\n\ + eors r0, r6\n\ + ands r0, r7\n\ + mov r1, r8\n\ + ands r1, r2\n\ + orrs r1, r0\n\ + strb r1, [r4, 0xE]\n\ +_0810E766:\n\ + ldrb r1, [r4]\n\ + movs r0, 0x9\n\ + negs r0, r0\n\ + ands r0, r1\n\ + strb r0, [r4]\n\ + ldrh r1, [r4, 0x2]\n\ + mov r12, r1\n\ +_0810E774:\n\ + ldrb r0, [r4]\n\ + movs r1, 0xF\n\ + ands r1, r0\n\ + movs r0, 0x10\n\ + b _0810E978\n\ +_0810E77E:\n\ + lsls r1, r2, 24\n\ + lsrs r0, r1, 28\n\ + cmp r0, 0x3\n\ + bne _0810E78C\n\ + movs r0, 0x8\n\ + orrs r0, r2\n\ + b _0810E794\n\ +_0810E78C:\n\ + lsrs r0, r1, 28\n\ + cmp r0, 0x1\n\ + bne _0810E79C\n\ + adds r0, r2, 0\n\ +_0810E794:\n\ + orrs r0, r7\n\ + strb r0, [r4]\n\ + strb r6, [r4, 0x1]\n\ + b _0810E868\n\ +_0810E79C:\n\ + movs r0, 0x8\n\ + ands r0, r2\n\ + cmp r0, 0\n\ + beq _0810E868\n\ + adds r3, r5, 0\n\ + adds r3, 0x3F\n\ + ldrb r2, [r3]\n\ + lsls r1, r2, 31\n\ + lsrs r1, 31\n\ + movs r6, 0x1\n\ + eors r1, r6\n\ + ands r1, r7\n\ + movs r0, 0x2\n\ + negs r0, r0\n\ + mov r8, r0\n\ + ands r0, r2\n\ + orrs r0, r1\n\ + strb r0, [r3]\n\ + lsls r0, 31\n\ + lsrs r0, 31\n\ + adds r1, r5, 0\n\ + adds r1, 0x2A\n\ + strb r0, [r1]\n\ + ldrb r0, [r3]\n\ + movs r1, 0x4\n\ + orrs r0, r1\n\ + movs r1, 0x11\n\ + negs r1, r1\n\ + ands r0, r1\n\ + strb r0, [r3]\n\ + ldrb r1, [r4]\n\ + movs r0, 0x4\n\ + ands r0, r1\n\ + cmp r0, 0\n\ + beq _0810E85A\n\ + bl IsContest\n\ + lsls r0, 24\n\ + cmp r0, 0\n\ + bne _0810E82A\n\ + ldrb r1, [r4, 0xE]\n\ + mov r0, r9\n\ + ands r0, r1\n\ + cmp r0, 0\n\ + bne _0810E810\n\ + ldrb r2, [r5, 0x5]\n\ + lsls r1, r2, 28\n\ + lsrs r1, 30\n\ + subs r1, 0x1\n\ + movs r0, 0x3\n\ + ands r1, r0\n\ + lsls r1, 2\n\ + movs r0, 0xD\n\ + negs r0, r0\n\ + ands r0, r2\n\ + orrs r0, r1\n\ + strb r0, [r5, 0x5]\n\ + b _0810E848\n\ +_0810E810:\n\ + ldrb r2, [r5, 0x5]\n\ + lsls r1, r2, 28\n\ + lsrs r1, 30\n\ + adds r1, 0x1\n\ + movs r0, 0x3\n\ + ands r1, r0\n\ + lsls r1, 2\n\ + movs r0, 0xD\n\ + negs r0, r0\n\ + ands r0, r2\n\ + orrs r0, r1\n\ + strb r0, [r5, 0x5]\n\ + b _0810E848\n\ +_0810E82A:\n\ + ldrb r1, [r4, 0xE]\n\ + mov r0, r9\n\ + ands r0, r1\n\ + cmp r0, 0\n\ + bne _0810E83E\n\ + adds r1, r5, 0\n\ + adds r1, 0x43\n\ + ldrb r0, [r1]\n\ + subs r0, 0xC\n\ + b _0810E846\n\ +_0810E83E:\n\ + adds r1, r5, 0\n\ + adds r1, 0x43\n\ + ldrb r0, [r1]\n\ + adds r0, 0xC\n\ +_0810E846:\n\ + strb r0, [r1]\n\ +_0810E848:\n\ + ldrb r2, [r4, 0xE]\n\ + lsls r0, r2, 31\n\ + lsrs r0, 31\n\ + eors r0, r6\n\ + ands r0, r7\n\ + mov r1, r8\n\ + ands r1, r2\n\ + orrs r1, r0\n\ + strb r1, [r4, 0xE]\n\ +_0810E85A:\n\ + ldrb r1, [r4]\n\ + movs r0, 0x9\n\ + negs r0, r0\n\ + ands r0, r1\n\ + strb r0, [r4]\n\ + ldrh r1, [r4, 0x2]\n\ + mov r12, r1\n\ +_0810E868:\n\ + ldrb r0, [r4]\n\ + movs r1, 0xF\n\ + ands r1, r0\n\ + movs r0, 0x20\n\ + b _0810E978\n\ +_0810E872:\n\ + lsls r1, r2, 24\n\ + lsrs r0, r1, 28\n\ + cmp r0, 0x2\n\ + bne _0810E882\n\ + movs r0, 0x8\n\ + orrs r0, r2\n\ + strb r0, [r4]\n\ + b _0810E970\n\ +_0810E882:\n\ + lsrs r0, r1, 28\n\ + cmp r0, 0\n\ + bne _0810E8A4\n\ + lsls r0, r2, 30\n\ + lsrs r0, 31\n\ + movs r1, 0x1\n\ + eors r0, r1\n\ + ands r0, r7\n\ + lsls r0, 1\n\ + movs r1, 0x3\n\ + negs r1, r1\n\ + ands r1, r2\n\ + orrs r1, r0\n\ + orrs r1, r7\n\ + strb r1, [r4]\n\ + strb r6, [r4, 0x1]\n\ + b _0810E970\n\ +_0810E8A4:\n\ + movs r0, 0x8\n\ + ands r0, r2\n\ + cmp r0, 0\n\ + beq _0810E970\n\ + adds r3, r5, 0\n\ + adds r3, 0x3F\n\ + ldrb r2, [r3]\n\ + lsls r1, r2, 31\n\ + lsrs r1, 31\n\ + movs r6, 0x1\n\ + eors r1, r6\n\ + ands r1, r7\n\ + movs r0, 0x2\n\ + negs r0, r0\n\ + mov r8, r0\n\ + ands r0, r2\n\ + orrs r0, r1\n\ + strb r0, [r3]\n\ + lsls r0, 31\n\ + lsrs r0, 31\n\ + adds r1, r5, 0\n\ + adds r1, 0x2A\n\ + strb r0, [r1]\n\ + ldrb r0, [r3]\n\ + movs r1, 0x4\n\ + orrs r0, r1\n\ + movs r1, 0x11\n\ + negs r1, r1\n\ + ands r0, r1\n\ + strb r0, [r3]\n\ + ldrb r1, [r4]\n\ + movs r0, 0x4\n\ + ands r0, r1\n\ + cmp r0, 0\n\ + beq _0810E962\n\ + bl IsContest\n\ + lsls r0, 24\n\ + cmp r0, 0\n\ + bne _0810E932\n\ + ldrb r1, [r4, 0xE]\n\ + mov r0, r9\n\ + ands r0, r1\n\ + cmp r0, 0\n\ + bne _0810E918\n\ + ldrb r2, [r5, 0x5]\n\ + lsls r1, r2, 28\n\ + lsrs r1, 30\n\ + subs r1, 0x1\n\ + movs r0, 0x3\n\ + ands r1, r0\n\ + lsls r1, 2\n\ + movs r0, 0xD\n\ + negs r0, r0\n\ + ands r0, r2\n\ + orrs r0, r1\n\ + strb r0, [r5, 0x5]\n\ + b _0810E950\n\ +_0810E918:\n\ + ldrb r2, [r5, 0x5]\n\ + lsls r1, r2, 28\n\ + lsrs r1, 30\n\ + adds r1, 0x1\n\ + movs r0, 0x3\n\ + ands r1, r0\n\ + lsls r1, 2\n\ + movs r0, 0xD\n\ + negs r0, r0\n\ + ands r0, r2\n\ + orrs r0, r1\n\ + strb r0, [r5, 0x5]\n\ + b _0810E950\n\ +_0810E932:\n\ + ldrb r1, [r4, 0xE]\n\ + mov r0, r9\n\ + ands r0, r1\n\ + cmp r0, 0\n\ + bne _0810E946\n\ + adds r1, r5, 0\n\ + adds r1, 0x43\n\ + ldrb r0, [r1]\n\ + subs r0, 0xC\n\ + b _0810E94E\n\ +_0810E946:\n\ + adds r1, r5, 0\n\ + adds r1, 0x43\n\ + ldrb r0, [r1]\n\ + adds r0, 0xC\n\ +_0810E94E:\n\ + strb r0, [r1]\n\ +_0810E950:\n\ + ldrb r2, [r4, 0xE]\n\ + lsls r0, r2, 31\n\ + lsrs r0, 31\n\ + eors r0, r6\n\ + ands r0, r7\n\ + mov r1, r8\n\ + ands r1, r2\n\ + orrs r1, r0\n\ + strb r1, [r4, 0xE]\n\ +_0810E962:\n\ + ldrb r1, [r4]\n\ + movs r0, 0x9\n\ + negs r0, r0\n\ + ands r0, r1\n\ + strb r0, [r4]\n\ + ldrh r1, [r4, 0x2]\n\ + mov r12, r1\n\ +_0810E970:\n\ + ldrb r0, [r4]\n\ + movs r1, 0xF\n\ + ands r1, r0\n\ + movs r0, 0x30\n\ +_0810E978:\n\ + orrs r1, r0\n\ + strb r1, [r4]\n\ +_0810E97C:\n\ + ldrb r1, [r4]\n\ + lsls r1, 30\n\ + lsrs r1, 31\n\ + adds r0, r4, 0\n\ + adds r0, 0xC\n\ + adds r0, r1\n\ + ldrb r1, [r0]\n\ + ldr r3, =gSineTable\n\ + mov r2, r12\n\ + lsls r0, r2, 1\n\ + adds r0, r3\n\ + movs r2, 0\n\ + ldrsh r0, [r0, r2]\n\ + muls r0, r1\n\ + asrs r0, 8\n\ + strh r0, [r5, 0x24]\n\ + ldrb r2, [r5, 0x3]\n\ + lsls r2, 26\n\ + lsrs r2, 27\n\ + movs r1, 0x24\n\ + ldrsh r0, [r5, r1]\n\ + negs r0, r0\n\ + asrs r0, 1\n\ + ldrb r1, [r4, 0xA]\n\ + adds r0, r1\n\ + lsls r0, 24\n\ + lsrs r0, 24\n\ + lsls r1, r0, 1\n\ + adds r1, r3\n\ + ldrh r6, [r1]\n\ + ldr r1, =gOamMatrices\n\ + lsls r2, 3\n\ + adds r2, r1\n\ + adds r0, 0x40\n\ + lsls r0, 1\n\ + adds r0, r3\n\ + ldrh r0, [r0]\n\ + strh r0, [r2, 0x6]\n\ + strh r0, [r2]\n\ + strh r6, [r2, 0x2]\n\ + lsls r0, r6, 16\n\ + asrs r0, 16\n\ + negs r0, r0\n\ + strh r0, [r2, 0x4]\n\ + ldrh r0, [r4, 0x6]\n\ + ldrh r2, [r4, 0x8]\n\ + adds r0, r2\n\ + strh r0, [r4, 0x8]\n\ + lsls r0, 16\n\ + lsrs r0, 24\n\ + strh r0, [r5, 0x22]\n\ + movs r1, 0x4\n\ + ldrsh r0, [r4, r1]\n\ + movs r1, 0x80\n\ + lsls r1, 8\n\ + ands r0, r1\n\ + cmp r0, 0\n\ + beq _0810EA0C\n\ + ldrh r0, [r4, 0x4]\n\ + subs r1, 0x1\n\ + ands r1, r0\n\ + ldrh r0, [r4, 0x2]\n\ + subs r0, r1\n\ + movs r1, 0xFF\n\ + ands r0, r1\n\ + strh r0, [r4, 0x2]\n\ + b _0810EA1C\n\ + .pool\n\ +_0810EA0C:\n\ + ldrh r0, [r4, 0x4]\n\ + ldr r1, =0x00007fff\n\ + ands r1, r0\n\ + ldrh r2, [r4, 0x2]\n\ + adds r1, r2\n\ + movs r0, 0xFF\n\ + ands r1, r0\n\ + strh r1, [r4, 0x2]\n\ +_0810EA1C:\n\ + movs r0, 0x22\n\ + ldrsh r1, [r5, r0]\n\ + movs r2, 0x26\n\ + ldrsh r0, [r5, r2]\n\ + adds r1, r0\n\ + ldrh r0, [r4, 0xE]\n\ + lsrs r0, 1\n\ + cmp r1, r0\n\ + blt _0810EA36\n\ + movs r0, 0\n\ + strh r0, [r5, 0x2E]\n\ + ldr r0, =sub_810E2C8\n\ + str r0, [r5, 0x1C]\n\ +_0810EA36:\n\ + pop {r3,r4}\n\ + mov r8, r3\n\ + mov r9, r4\n\ + pop {r4-r7}\n\ + pop {r0}\n\ + bx r0\n\ + .pool\n\ + "); +} + +void sub_810EA4C(struct Sprite *sprite) +{ + sprite->oam.priority = GetBattlerSpriteBGPriority(gBattleAnimTarget); + sprite->pos1.x = GetBattlerSpriteCoord(gBattleAnimAttacker, 2); + sprite->pos1.y = GetBattlerSpriteCoord(gBattleAnimAttacker, 3); + sprite->callback = TranslateAnimSpriteToTargetMonLocation; +} + +void sub_810EAA0(struct Sprite * sprite) +{ + u16 arg; + u8 mult; + + if (!gBattleAnimArgs[2]) + InitSpritePosToAnimAttacker(sprite, 0); + else + InitSpritePosToAnimTarget(sprite, FALSE); + + if ((!gBattleAnimArgs[2] && !GetBattlerSide(gBattleAnimAttacker)) + || (gBattleAnimArgs[2] == 1 && !GetBattlerSide(gBattleAnimTarget))) + { + sprite->pos1.x += 8; + } + + SeekSpriteAnim(sprite, gBattleAnimArgs[4]); + sprite->pos1.x -= 32; + sprite->data[1] = 0x0ccc; + + arg = gBattleAnimArgs[4]; + mult = 12; + sprite->pos2.x += mult * arg; + sprite->data[0] = arg; + sprite->data[7] = gBattleAnimArgs[3]; + sprite->callback = sub_810EB40; +} + +void sub_810EB40(struct Sprite *sprite) +{ + sprite->pos2.x += sprite->data[1] >> 8; + + if (++sprite->data[0] == 6) + { + sprite->data[0] = 0; + sprite->pos2.x = 0; + StartSpriteAnim(sprite, 0); + } + + if (--sprite->data[7] == -1) + DestroyAnimSprite(sprite); +} + +void sub_810EB88(u8 task) +{ + if (!(gTasks[task].data[0] % 32)) + { + gAnimVisualTaskCount++; + + gBattleAnimArgs[0] = Sin(gTasks[task].data[0], -13); + gBattleAnimArgs[1] = Cos(gTasks[task].data[0], -13); + gBattleAnimArgs[2] = 1; + gBattleAnimArgs[3] = 3; + + CreateSpriteAndAnimate(&gUnknown_085973E8, + GetBattlerSpriteCoord(gBattleAnimTarget, 2), + GetBattlerSpriteCoord(gBattleAnimTarget, 3), + 3); + } + + gTasks[task].data[0] += 8; + + if (gTasks[task].data[0] > 255) + DestroyAnimVisualTask(task); +} + +void sub_810EC34(struct Sprite *sprite) +{ + switch (sprite->data[0]) + { + case 0: + InitSpritePosToAnimAttacker(sprite, 1); + gSprites[GetAnimBattlerSpriteId(0)].invisible = 1; + ++sprite->data[0]; + break; + case 1: + if (sprite->affineAnimEnded) + DestroyAnimSprite(sprite); + } +} + +void sub_810EC94(struct Sprite *sprite) +{ + switch (sprite->data[0]) + { + case 0: + sprite->pos1.y = GetBattlerSpriteCoord(gBattleAnimTarget, 1); + sprite->pos2.y = -sprite->pos1.y - 32; + sprite->data[0]++; + break; + case 1: + sprite->pos2.y += 10; + if (sprite->pos2.y >= 0) + ++sprite->data[0]; + break; + case 2: + sprite->pos2.y -= 10; + if (sprite->pos1.y + sprite->pos2.y < -32) + { + gSprites[GetAnimBattlerSpriteId(0)].invisible = 0; + DestroyAnimSprite(sprite); + } + } +} + +void sub_810ED28(struct Sprite *sprite) +{ + InitSpritePosToAnimAttacker(sprite, 1); + sprite->data[0] = gBattleAnimArgs[2]; + sprite->data[1] = gBattleAnimArgs[3]; + sprite->callback = sub_810ED70; + gSprites[GetAnimBattlerSpriteId(0)].invisible = 1; +} + +void sub_810ED70(struct Sprite *sprite) +{ + if (sprite->data[0] > 0) + sprite->data[0]--; + else if (sprite->pos1.y + sprite->pos2.y > -32) + { + sprite->data[2] += sprite->data[1]; + sprite->pos2.y -= (sprite->data[2] >> 8); + } + else + { + sprite->invisible = 1; + if (sprite->data[3]++ > 20) + sprite->callback = sub_810EDD0; + } +} + +void sub_810EDD0(struct Sprite *sprite) +{ + sprite->pos2.y += sprite->data[2] >> 8; + + if (sprite->pos1.y + sprite->pos2.y > -32) + sprite->invisible = 0; + + if (sprite->pos2.y > 0) + DestroyAnimSprite(sprite); +} + +#ifdef NONMATCHING +void sub_810EE14(struct Sprite *sprite) +{ + // NONMATCHING - Functionally equivalent - slight register swap at end + + u32 matrixNum; + int t1, t2; + + switch (sprite->data[0]) + { + case 0: + if (!gBattleAnimArgs[0]) + { + sprite->pos1.x = GetBattlerSpriteCoord(gBattleAnimAttacker, 0); + sprite->pos1.y = GetBattlerSpriteCoord(gBattleAnimAttacker, 1); + } + else + { + sprite->pos1.x = GetBattlerSpriteCoord(gBattleAnimTarget, 0); + sprite->pos1.y = GetBattlerSpriteCoord(gBattleAnimTarget, 1); + } + + sprite->data[1] = 512; + + TrySetSpriteRotScale(sprite, 0, 256, sprite->data[1], 0); + sprite->data[0]++; + break; + case 1: + if (sprite->data[2] <= 11) + sprite->data[1] -= 40; + else + sprite->data[1] += 40; + + sprite->data[2]++; + + TrySetSpriteRotScale(sprite, 0, 256, sprite->data[1], 0); + + matrixNum = sprite->oam.matrixNum; + + t1 = 15616; + t2 = t1 / gOamMatrices[matrixNum].d + 1; + + if (t2 > 128) + t2 = 128; + + + /* NONMATCHING + * compiles to: + * asr r0, r0, #0x1 + strh r0, [r5, #0x26] + * needed: + * asrs r1, r0, 1 + * strh r1, [r5, 0x26] */ + sprite->pos2.y = (64 - t2) / 2; + + if (sprite->data[2] == 24) + { + sub_80A749C(sprite); + DestroyAnimSprite(sprite); + } + } +} + +#else +NAKED +void sub_810EE14(struct Sprite *sprite) +{ + asm_unified("push {r4,r5,lr}\n\ + sub sp, 0x4\n\ + adds r5, r0, 0\n\ + movs r1, 0x2E\n\ + ldrsh r0, [r5, r1]\n\ + cmp r0, 0\n\ + beq _0810EE28\n\ + cmp r0, 0x1\n\ + beq _0810EE80\n\ + b _0810EEEC\n\ +_0810EE28:\n\ + ldr r0, =gBattleAnimArgs\n\ + movs r2, 0\n\ + ldrsh r0, [r0, r2]\n\ + cmp r0, 0\n\ + bne _0810EE40\n\ + ldr r4, =gBattleAnimAttacker\n\ + b _0810EE42\n\ + .pool\n\ +_0810EE40:\n\ + ldr r4, =gBattleAnimTarget\n\ +_0810EE42:\n\ + ldrb r0, [r4]\n\ + movs r1, 0\n\ + bl GetBattlerSpriteCoord\n\ + lsls r0, 24\n\ + lsrs r0, 24\n\ + strh r0, [r5, 0x20]\n\ + ldrb r0, [r4]\n\ + movs r1, 0x1\n\ + bl GetBattlerSpriteCoord\n\ + lsls r0, 24\n\ + lsrs r0, 24\n\ + strh r0, [r5, 0x22]\n\ + movs r0, 0\n\ + movs r3, 0x80\n\ + lsls r3, 2\n\ + strh r3, [r5, 0x30]\n\ + movs r2, 0x80\n\ + lsls r2, 1\n\ + str r0, [sp]\n\ + adds r0, r5, 0\n\ + movs r1, 0\n\ + bl TrySetSpriteRotScale\n\ + ldrh r0, [r5, 0x2E]\n\ + adds r0, 0x1\n\ + strh r0, [r5, 0x2E]\n\ + b _0810EEEC\n\ + .pool\n\ +_0810EE80:\n\ + movs r1, 0x32\n\ + ldrsh r0, [r5, r1]\n\ + cmp r0, 0xB\n\ + bgt _0810EE8E\n\ + ldrh r0, [r5, 0x30]\n\ + subs r0, 0x28\n\ + b _0810EE92\n\ +_0810EE8E:\n\ + ldrh r0, [r5, 0x30]\n\ + adds r0, 0x28\n\ +_0810EE92:\n\ + strh r0, [r5, 0x30]\n\ + ldrh r0, [r5, 0x32]\n\ + adds r0, 0x1\n\ + movs r1, 0\n\ + strh r0, [r5, 0x32]\n\ + movs r2, 0x80\n\ + lsls r2, 1\n\ + movs r0, 0x30\n\ + ldrsh r3, [r5, r0]\n\ + str r1, [sp]\n\ + adds r0, r5, 0\n\ + bl TrySetSpriteRotScale\n\ + ldrb r1, [r5, 0x3]\n\ + lsls r1, 26\n\ + lsrs r1, 27\n\ + movs r0, 0xF4\n\ + lsls r0, 6\n\ + ldr r2, =gOamMatrices\n\ + lsls r1, 3\n\ + adds r1, r2\n\ + movs r2, 0x6\n\ + ldrsh r1, [r1, r2]\n\ + bl __divsi3\n\ + adds r1, r0, 0x1\n\ + cmp r1, 0x80\n\ + ble _0810EECC\n\ + movs r1, 0x80\n\ +_0810EECC:\n\ + movs r0, 0x40\n\ + subs r0, r1\n\ + lsrs r1, r0, 31\n\ + adds r0, r1\n\ + asrs r1, r0, 1\n\ + strh r1, [r5, 0x26]\n\ + movs r1, 0x32\n\ + ldrsh r0, [r5, r1]\n\ + cmp r0, 0x18\n\ + bne _0810EEEC\n\ + adds r0, r5, 0\n\ + bl sub_80A749C\n\ + adds r0, r5, 0\n\ + bl DestroyAnimSprite\n\ +_0810EEEC:\n\ + add sp, 0x4\n\ + pop {r4,r5}\n\ + pop {r0}\n\ + bx r0\n\ + .pool\n"); +} +#endif + +void sub_810EEF8(struct Sprite *sprite) +{ + int v1, v2; + + v1 = 0x1ff & Random2(); + v2 = 0x7f & Random2(); + + if (v1 % 2) + sprite->data[0] = 736 + v1; + + else + sprite->data[0] = 736 - v1; + + + if (v2 % 2) + sprite->data[1] = 896 + v2; + + else + sprite->data[1] = 896 - v2; + + sprite->data[2] = gBattleAnimArgs[0]; + + if (sprite->data[2]) + sprite->oam.matrixNum = 8; + + + if (gBattleAnimArgs[1] == 0) + { + sprite->pos1.x = GetBattlerSpriteCoord(gBattleAnimAttacker, 0); + sprite->pos1.y = GetBattlerSpriteCoord(gBattleAnimAttacker, 1) + 32; + } + else + { + sprite->pos1.x = GetBattlerSpriteCoord(gBattleAnimTarget, 0); + sprite->pos1.y = GetBattlerSpriteCoord(gBattleAnimTarget, 1) + 32; + } + + sprite->callback = sub_810EFA8; +} + +void sub_810EFA8(struct Sprite *sprite) +{ + if (sprite->data[2] == 0) + { + sprite->pos2.x += sprite->data[0] >> 8; + sprite->pos2.y -= sprite->data[1] >> 8; + } + else + { + sprite->pos2.x -= sprite->data[0] >> 8; + sprite->pos2.y -= sprite->data[1] >> 8; + } + + sprite->data[0] = sprite->data[0]; + sprite->data[1] -= 32; + + if (sprite->data[0] < 0) + sprite->data[0] = 0; + + + if (++sprite->data[3] == 31) + DestroyAnimSprite(sprite); +} + +void sub_810F004(struct Sprite *sprite) +{ + sprite->data[6] = 0; + sprite->data[7] = 64; + sprite->callback = sub_810F018; +} + +void sub_810F018(struct Sprite *sprite) +{ + switch (sprite->data[0]) + { + case 0: + if (++sprite->data[1] > 8) + { + sprite->data[1] = 0; + sprite->invisible ^= 1; + if (++sprite->data[2] > 5 && sprite->invisible) + sprite->data[0]++; + } + break; + case 1: + DestroyAnimSprite(sprite); + } +} + +void sub_810F084(struct Sprite *sprite) +{ + s16 posx, posy; + u16 rotation; + + posx = sprite->pos1.x; + posy = sprite->pos1.y; + + sprite->pos1.x = GetBattlerSpriteCoord(gBattleAnimAttacker, 2); + sprite->pos1.y = GetBattlerSpriteCoord(gBattleAnimAttacker, 3); + + sprite->data[4] = sprite->pos1.x << 4; + sprite->data[5] = sprite->pos1.y << 4; + + sprite->data[6] = ((posx - sprite->pos1.x) << 4) / 12; + sprite->data[7] = ((posy - sprite->pos1.y) << 4) / 12; + + rotation = ArcTan2Neg(posx - sprite->pos1.x, posy - sprite->pos1.y); + rotation += 49152; + + TrySetSpriteRotScale(sprite, 1, 0x100, 0x100, rotation); + + sprite->callback = sub_810F140; +} + +void sub_810F140(struct Sprite *sprite) +{ + sprite->data[4] += sprite->data[6]; + sprite->data[5] += sprite->data[7]; + + sprite->pos1.x = sprite->data[4] >> 4; + sprite->pos1.y = sprite->data[5] >> 4; + + if ((u16) (sprite->pos1.x + 0x2d) > 0x14a || sprite->pos1.y > 0x9d || sprite->pos1.y < -0x2d) + DestroySpriteAndMatrix(sprite); +} + +void unref_sub_810F184(u8 taskId) +{ + if (gBattleAnimArgs[0] == 0) + { + u8 spriteId = GetAnimBattlerSpriteId(0); + gSprites[spriteId].invisible = 1; + } + else + { + u8 spriteId = GetAnimBattlerSpriteId(0); + gSprites[spriteId].invisible = 0; + } + DestroyAnimVisualTask(taskId); +} From 1758eb99dfe13c9fc93284d2bbf55dce315fd2c9 Mon Sep 17 00:00:00 2001 From: garak Date: Sun, 3 Mar 2019 22:08:58 -0500 Subject: [PATCH 11/20] match sub_810EE14 in flying.c --- src/flying.c | 130 +-------------------------------------------------- 1 file changed, 2 insertions(+), 128 deletions(-) diff --git a/src/flying.c b/src/flying.c index 7f48e57cbd..3b7417551c 100644 --- a/src/flying.c +++ b/src/flying.c @@ -1496,11 +1496,8 @@ void sub_810EDD0(struct Sprite *sprite) DestroyAnimSprite(sprite); } -#ifdef NONMATCHING void sub_810EE14(struct Sprite *sprite) { - // NONMATCHING - Functionally equivalent - slight register swap at end - u32 matrixNum; int t1, t2; @@ -1540,16 +1537,9 @@ void sub_810EE14(struct Sprite *sprite) if (t2 > 128) t2 = 128; - - /* NONMATCHING - * compiles to: - * asr r0, r0, #0x1 - strh r0, [r5, #0x26] - * needed: - * asrs r1, r0, 1 - * strh r1, [r5, 0x26] */ - sprite->pos2.y = (64 - t2) / 2; + t2 = (64 - t2) / 2; + sprite->pos2.y = t2; if (sprite->data[2] == 24) { @@ -1559,122 +1549,6 @@ void sub_810EE14(struct Sprite *sprite) } } -#else -NAKED -void sub_810EE14(struct Sprite *sprite) -{ - asm_unified("push {r4,r5,lr}\n\ - sub sp, 0x4\n\ - adds r5, r0, 0\n\ - movs r1, 0x2E\n\ - ldrsh r0, [r5, r1]\n\ - cmp r0, 0\n\ - beq _0810EE28\n\ - cmp r0, 0x1\n\ - beq _0810EE80\n\ - b _0810EEEC\n\ -_0810EE28:\n\ - ldr r0, =gBattleAnimArgs\n\ - movs r2, 0\n\ - ldrsh r0, [r0, r2]\n\ - cmp r0, 0\n\ - bne _0810EE40\n\ - ldr r4, =gBattleAnimAttacker\n\ - b _0810EE42\n\ - .pool\n\ -_0810EE40:\n\ - ldr r4, =gBattleAnimTarget\n\ -_0810EE42:\n\ - ldrb r0, [r4]\n\ - movs r1, 0\n\ - bl GetBattlerSpriteCoord\n\ - lsls r0, 24\n\ - lsrs r0, 24\n\ - strh r0, [r5, 0x20]\n\ - ldrb r0, [r4]\n\ - movs r1, 0x1\n\ - bl GetBattlerSpriteCoord\n\ - lsls r0, 24\n\ - lsrs r0, 24\n\ - strh r0, [r5, 0x22]\n\ - movs r0, 0\n\ - movs r3, 0x80\n\ - lsls r3, 2\n\ - strh r3, [r5, 0x30]\n\ - movs r2, 0x80\n\ - lsls r2, 1\n\ - str r0, [sp]\n\ - adds r0, r5, 0\n\ - movs r1, 0\n\ - bl TrySetSpriteRotScale\n\ - ldrh r0, [r5, 0x2E]\n\ - adds r0, 0x1\n\ - strh r0, [r5, 0x2E]\n\ - b _0810EEEC\n\ - .pool\n\ -_0810EE80:\n\ - movs r1, 0x32\n\ - ldrsh r0, [r5, r1]\n\ - cmp r0, 0xB\n\ - bgt _0810EE8E\n\ - ldrh r0, [r5, 0x30]\n\ - subs r0, 0x28\n\ - b _0810EE92\n\ -_0810EE8E:\n\ - ldrh r0, [r5, 0x30]\n\ - adds r0, 0x28\n\ -_0810EE92:\n\ - strh r0, [r5, 0x30]\n\ - ldrh r0, [r5, 0x32]\n\ - adds r0, 0x1\n\ - movs r1, 0\n\ - strh r0, [r5, 0x32]\n\ - movs r2, 0x80\n\ - lsls r2, 1\n\ - movs r0, 0x30\n\ - ldrsh r3, [r5, r0]\n\ - str r1, [sp]\n\ - adds r0, r5, 0\n\ - bl TrySetSpriteRotScale\n\ - ldrb r1, [r5, 0x3]\n\ - lsls r1, 26\n\ - lsrs r1, 27\n\ - movs r0, 0xF4\n\ - lsls r0, 6\n\ - ldr r2, =gOamMatrices\n\ - lsls r1, 3\n\ - adds r1, r2\n\ - movs r2, 0x6\n\ - ldrsh r1, [r1, r2]\n\ - bl __divsi3\n\ - adds r1, r0, 0x1\n\ - cmp r1, 0x80\n\ - ble _0810EECC\n\ - movs r1, 0x80\n\ -_0810EECC:\n\ - movs r0, 0x40\n\ - subs r0, r1\n\ - lsrs r1, r0, 31\n\ - adds r0, r1\n\ - asrs r1, r0, 1\n\ - strh r1, [r5, 0x26]\n\ - movs r1, 0x32\n\ - ldrsh r0, [r5, r1]\n\ - cmp r0, 0x18\n\ - bne _0810EEEC\n\ - adds r0, r5, 0\n\ - bl sub_80A749C\n\ - adds r0, r5, 0\n\ - bl DestroyAnimSprite\n\ -_0810EEEC:\n\ - add sp, 0x4\n\ - pop {r4,r5}\n\ - pop {r0}\n\ - bx r0\n\ - .pool\n"); -} -#endif - void sub_810EEF8(struct Sprite *sprite) { int v1, v2; From 18902219ad0a67f51a443e83973cfe3f03970101 Mon Sep 17 00:00:00 2001 From: Phlosioneer Date: Tue, 5 Mar 2019 01:46:20 -0500 Subject: [PATCH 12/20] Fix make to look for .json files instead of folders Currently, when Make is building the maps, it considers every folder in the data/maps/ directory as a map that needs to be built, even folders that are empty. This can be a problem when modding on a separate branch, because git doesn't always clean up directories when switching branches (usually because of hidden files in those directories), so switching back to an unmodded branch will leave an empty folder that confuses make. This commit changes the makefile so that it only checks directories that have map.json files in them. --- map_data_rules.mk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/map_data_rules.mk b/map_data_rules.mk index 5a7d9dd842..0203b383d0 100755 --- a/map_data_rules.mk +++ b/map_data_rules.mk @@ -3,7 +3,7 @@ MAPS_DIR = $(DATA_ASM_SUBDIR)/maps LAYOUTS_DIR = $(DATA_ASM_SUBDIR)/layouts -MAP_DIRS := $(dir $(wildcard $(MAPS_DIR)/*/)) +MAP_DIRS := $(dir $(wildcard $(MAPS_DIR)/*/map.json)) MAP_CONNECTIONS := $(patsubst $(MAPS_DIR)/%/,$(MAPS_DIR)/%/connections.inc,$(MAP_DIRS)) MAP_EVENTS := $(patsubst $(MAPS_DIR)/%/,$(MAPS_DIR)/%/events.inc,$(MAP_DIRS)) MAP_HEADERS := $(patsubst $(MAPS_DIR)/%/,$(MAPS_DIR)/%/header.inc,$(MAP_DIRS)) From 3507ac397415b445f40fd70c48550fe00deb1484 Mon Sep 17 00:00:00 2001 From: DizzyEggg Date: Tue, 5 Mar 2019 09:02:05 +0100 Subject: [PATCH 13/20] Start fixing flying.c --- src/flying.c | 421 +++++++++++++++++++++++++++++++++++++++------------ 1 file changed, 321 insertions(+), 100 deletions(-) diff --git a/src/flying.c b/src/flying.c index 7f48e57cbd..9519064485 100644 --- a/src/flying.c +++ b/src/flying.c @@ -108,7 +108,7 @@ const union AffineAnimCmd gUnknown_085962EC[] = const union AffineAnimCmd *const gUnknown_08596314[] = { - gUnknown_085962EC, + gUnknown_085962EC, }; const union AffineAnimCmd gUnknown_08596318[] = @@ -357,7 +357,8 @@ void sub_810DE70(struct Sprite *sprite) sprite->callback(sprite); } -static void sub_810DE98(struct Sprite *sprite) { +static void sub_810DE98(struct Sprite *sprite) +{ sprite->pos2.x = Sin(sprite->data[1], 32); sprite->pos2.y = Cos(sprite->data[1], 8); sprite->data[1] += 5; @@ -392,8 +393,7 @@ static void sub_810DF18(u8 taskId) { gPlttBufferFaded[base + 0x101 + i] = gPlttBufferFaded[base + 0x100 + i]; i--; - } - while (i > 0); + } while (i > 0); gPlttBufferFaded[base + 0x101] = temp; } @@ -524,7 +524,9 @@ static void sub_810E24C(struct Sprite *sprite) sprite->data[3] &= 0xFF; } - if ((u32)(sprite->pos1.x + sprite->pos2.x + 32) > 304 || sprite->pos1.y + sprite->pos2.y > 160) + if (sprite->pos1.x + sprite->pos2.x < -32 + || sprite->pos1.x + sprite->pos2.x > 272 + || sprite->pos1.y + sprite->pos2.y > 160) { gSprites[GetAnimBattlerSpriteId(ANIM_ATTACKER)].invisible = 0; DestroyAnimSprite(sprite); @@ -547,55 +549,62 @@ void sub_810E2C8(struct Sprite *sprite) } // FAKEMATCHING +struct FeatherDanceData +{ + u8 unk0_0a:1; + u8 unk0_0b:1; + u8 unk0_0c:1; + u8 unk0_0d:1; + u8 unk0_1:4; + u8 unk1; + u16 unk2; + s16 unk4; + u16 unk6; + u16 unk8; + u16 unkA; + u8 unkC[2]; + u16 unkE_0:1; + u16 unkE_1:15; +}; + void sub_810E314(struct Sprite *sprite) { - s16 *data; - u8 slot; - s16 spriteCoord; - int t1, t2; - u32 arg2; - u32 matrixNum; - u8 sinIndex; - register s16 sinVal asm ("r4"); - register int sinVal2 asm ("r0"); + u8 battler, matrixNum, sinIndex; + s16 spriteCoord, sinVal; - data = sprite->data; + struct FeatherDanceData *data = (struct FeatherDanceData *)sprite->data; if (gBattleAnimArgs[7] & 0x100) - slot = gBattleAnimAttacker; + battler = gBattleAnimAttacker; else - slot = gBattleAnimTarget; + battler = gBattleAnimTarget; - if (GetBattlerSide(slot) == B_SIDE_PLAYER) + if (GetBattlerSide(battler) == B_SIDE_PLAYER) gBattleAnimArgs[0] = -gBattleAnimArgs[0]; - sprite->pos1.x = GetBattlerSpriteCoord(slot, 0) + gBattleAnimArgs[0]; - spriteCoord = GetBattlerSpriteCoord(slot, 1); + sprite->pos1.x = GetBattlerSpriteCoord(battler, BATTLER_COORD_ATTR_HEIGHT) + gBattleAnimArgs[0]; + spriteCoord = GetBattlerSpriteCoord(battler, BATTLER_COORD_ATTR_WIDTH); sprite->pos1.y = spriteCoord + gBattleAnimArgs[1]; - data[4] = sprite->pos1.y << 8; - t1 = (spriteCoord + (u16) gBattleAnimArgs[6]) << 1; - data[7] = (data[7] & 1) | t1; - ((u8 *) data)[0] |= 4; + data->unk8 = sprite->pos1.y << 8; + data->unkE_1 = spriteCoord + gBattleAnimArgs[6]; + data->unk0_0c = 1; + data->unk2 = gBattleAnimArgs[2] & 0xFF; + data->unkA = (gBattleAnimArgs[2] >> 8) & 0xFF; + data->unk4 = gBattleAnimArgs[3]; + data->unk6 = gBattleAnimArgs[4]; + *(u16*)(data->unkC) = gBattleAnimArgs[5]; - arg2 = (u16) gBattleAnimArgs[2]; - data[1] = (u8) gBattleAnimArgs[2]; - arg2 <<= 16; - data[5] = arg2 >> 24; - data[2] = gBattleAnimArgs[3]; - data[3] = gBattleAnimArgs[4]; - data[6] = gBattleAnimArgs[5]; - - if ((u16) (data[1] - 64) <= 0x7f) + if (data->unk2 >= 64 && data->unk2 <= 191) { if (!IsContest()) - sprite->oam.priority = GetBattlerSpriteBGPriority(slot) + 1; + sprite->oam.priority = GetBattlerSpriteBGPriority(battler) + 1; else - sprite->oam.priority = GetBattlerSpriteBGPriority(slot); + sprite->oam.priority = GetBattlerSpriteBGPriority(battler); - ((u8 *) data)[14] = data[7] & -2; + data->unkE_0 = 0; - if (!(data[2] & 0x8000)) + if (!(data->unk4 & 0x8000)) { sprite->hFlip ^= 1; sprite->animNum = sprite->hFlip; @@ -606,10 +615,10 @@ void sub_810E314(struct Sprite *sprite) } else { - sprite->oam.priority = GetBattlerSpriteBGPriority(slot); - ((u8 *) data)[14] |= 1; + sprite->oam.priority = GetBattlerSpriteBGPriority(battler); + data->unkE_0 = 1; - if (data[2] & 0x8000) + if (data->unk4 & 0x8000) { sprite->hFlip ^= 1; sprite->animNum = sprite->hFlip; @@ -619,24 +628,236 @@ void sub_810E314(struct Sprite *sprite) } } - t2 = (u16) data[1] >> 6 << 4; - ((u8 *) data)[0] = (15 & data[0]) | t2; - - sprite->pos2.x = (gSineTable[(u16) data[1]] * (u8) data[6]) >> 8; - + data->unk0_1 = data->unk2 >> 6; + sprite->pos2.x = (gSineTable[data->unk2] * data->unkC[0]) >> 8; matrixNum = sprite->oam.matrixNum; - sinIndex = (-sprite->pos2.x >> 1) + data[5]; + sinIndex = (-sprite->pos2.x >> 1) + data->unkA; sinVal = gSineTable[sinIndex]; gOamMatrices[matrixNum].a = gOamMatrices[matrixNum].d = gSineTable[sinIndex + 64]; - gOamMatrices[matrixNum].b = sinVal; - sinVal2 = -sinVal; - gOamMatrices[matrixNum].c = sinVal2; + // The comparison below is completely pointless. 'sprite' is sure to be a valid pointer and + // both the 'if' and 'else' parts are exactly the same. + // The only reason for this is making sure the compiler generates the exact ASM. + if (sprite) + { + gOamMatrices[matrixNum].b = sinVal; + gOamMatrices[matrixNum].c = -sinVal; + } + else + { + gOamMatrices[matrixNum].b = sinVal; + gOamMatrices[matrixNum].c = -sinVal; + } sprite->callback = sub_810E520; } +#ifndef NONMATCHING +void sub_810E520(struct Sprite *sprite) +{ + u8 matrixNum, sinIndex, var; + s16 sinVal = 0; + struct FeatherDanceData *data = (struct FeatherDanceData *)sprite->data; + + if (data->unk0_0a) + { + if (data->unk1-- % 256 == 0) + { + data->unk0_0a = 0; + data->unk1 = 0; + } + } + else + { + switch (data->unk2 >> 6) + { + case 0: + if (data->unk0_1 == 1) + { + data->unk0_0d = 1; + data->unk0_0a = 1; + data->unk1 = 0; + } + else if (data->unk0_1 == 3) + { + data->unk0_0b ^= 1; + data->unk1 = 0; + } + else if (data->unk0_0d) + { + sprite->hFlip ^= 1; + sprite->animNum = sprite->hFlip; + sprite->animBeginning = 1; + sprite->animEnded = 0; + if (data->unk0_0c) + { + if (!IsContest()) + { + if (!data->unkE_0) + sprite->oam.priority--; + else + sprite->oam.priority++; + } + else + { + if (!data->unkE_0) + sprite->subpriority -= 12; + else + sprite->subpriority += 12; + } + data->unkE_0 ^= 1; + } + data->unk0_0d = 0; + } + data->unk0_1 = 0; + break; + case 1: + if (data->unk0_1 == 0) + { + data->unk0_0d = 1; + data->unk0_0a = 1; + data->unk1 = 0; + } + else if (data->unk0_1 == 2) + { + data->unk0_0a = 1; + data->unk1 = 0; + } + else if (data->unk0_0d) + { + sprite->hFlip ^= 1; + sprite->animNum = sprite->hFlip; + sprite->animBeginning = 1; + sprite->animEnded = 0; + if (data->unk0_0c) + { + if (!IsContest()) + { + if (!data->unkE_0) + sprite->oam.priority--; + else + sprite->oam.priority++; + } + else + { + if (!data->unkE_0) + sprite->subpriority -= 12; + else + sprite->subpriority += 12; + } + data->unkE_0 ^= 1; + } + data->unk0_0d = 0; + } + data->unk0_1 = 1; + break; + case 2: + if (data->unk0_1 == 0) + { + data->unk0_0d = 1; + data->unk0_0a = 1; + data->unk1 = 0; + } + else if (data->unk0_1 == 2) + { + data->unk0_0a = 1; + data->unk1 = 0; + } + else if (data->unk0_0d) + { + sprite->hFlip ^= 1; + sprite->animNum = sprite->hFlip; + sprite->animBeginning = 1; + sprite->animEnded = 0; + if (data->unk0_0c) + { + if (!IsContest()) + { + if (!data->unkE_0) + sprite->oam.priority--; + else + sprite->oam.priority++; + } + else + { + if (!data->unkE_0) + sprite->subpriority -= 12; + else + sprite->subpriority += 12; + } + data->unkE_0 ^= 1; + } + data->unk0_0d = 0; + } + data->unk0_1 = 2; + break; + case 3: + if (data->unk0_1 == 2) + { + data->unk0_0d = 1; + } + else if (data->unk0_1 == 0) + { + data->unk0_0b ^= 1; + data->unk1 = 0; + } + else if (data->unk0_0d) + { + sprite->hFlip ^= 1; + sprite->animNum = sprite->hFlip; + sprite->animBeginning = 1; + sprite->animEnded = 0; + if (data->unk0_0c) + { + if (!IsContest()) + { + if (!data->unkE_0) + sprite->oam.priority--; + else + sprite->oam.priority++; + } + else + { + if (!data->unkE_0) + sprite->subpriority -= 12; + else + sprite->subpriority += 12; + } + data->unkE_0 ^= 1; + } + data->unk0_0d = 0; + } + data->unk0_1 = 3; + break; + } + + var = data->unkC[data->unk0_0b]; + sprite->pos2.x = (gSineTable[data->unk2] * var) >> 8; + matrixNum = sprite->oam.matrixNum; + + sinIndex = (-sprite->pos2.x >> 1) + data->unkA; + sinVal = gSineTable[sinIndex]; + + gOamMatrices[matrixNum].a = gOamMatrices[matrixNum].d = gSineTable[sinIndex + 64]; + gOamMatrices[matrixNum].b = sinVal; + gOamMatrices[matrixNum].c = -sinVal; + + data->unk8 += data->unk6; + sprite->pos1.y = data->unk8 >> 8; + if (data->unk4 & 0x8000) + data->unk2 = (data->unk2 - (data->unk4 & 0x7FFF)) & 0xFF; + else + data->unk2 = (data->unk2 + (data->unk4 & 0x7FFF)) & 0xFF; + + if (sprite->pos1.y + sprite->pos2.y > data->unkE_1) + { + sprite->data[0] = 0; + sprite->callback = sub_810E2C8; + } + } +} +#else NAKED void sub_810E520(struct Sprite *sprite) { @@ -1345,6 +1566,7 @@ _0810EA36:\n\ .pool\n\ "); } +#endif void sub_810EA4C(struct Sprite *sprite) { @@ -1363,7 +1585,7 @@ void sub_810EAA0(struct Sprite * sprite) InitSpritePosToAnimAttacker(sprite, 0); else InitSpritePosToAnimTarget(sprite, FALSE); - + if ((!gBattleAnimArgs[2] && !GetBattlerSide(gBattleAnimAttacker)) || (gBattleAnimArgs[2] == 1 && !GetBattlerSide(gBattleAnimTarget))) { @@ -1424,14 +1646,15 @@ void sub_810EC34(struct Sprite *sprite) { switch (sprite->data[0]) { - case 0: - InitSpritePosToAnimAttacker(sprite, 1); - gSprites[GetAnimBattlerSpriteId(0)].invisible = 1; - ++sprite->data[0]; - break; - case 1: - if (sprite->affineAnimEnded) - DestroyAnimSprite(sprite); + case 0: + InitSpritePosToAnimAttacker(sprite, 1); + gSprites[GetAnimBattlerSpriteId(0)].invisible = 1; + ++sprite->data[0]; + break; + case 1: + if (sprite->affineAnimEnded) + DestroyAnimSprite(sprite); + break; } } @@ -1439,23 +1662,24 @@ void sub_810EC94(struct Sprite *sprite) { switch (sprite->data[0]) { - case 0: - sprite->pos1.y = GetBattlerSpriteCoord(gBattleAnimTarget, 1); - sprite->pos2.y = -sprite->pos1.y - 32; - sprite->data[0]++; - break; - case 1: - sprite->pos2.y += 10; - if (sprite->pos2.y >= 0) - ++sprite->data[0]; - break; - case 2: - sprite->pos2.y -= 10; - if (sprite->pos1.y + sprite->pos2.y < -32) - { - gSprites[GetAnimBattlerSpriteId(0)].invisible = 0; - DestroyAnimSprite(sprite); - } + case 0: + sprite->pos1.y = GetBattlerSpriteCoord(gBattleAnimTarget, 1); + sprite->pos2.y = -sprite->pos1.y - 32; + sprite->data[0]++; + break; + case 1: + sprite->pos2.y += 10; + if (sprite->pos2.y >= 0) + ++sprite->data[0]; + break; + case 2: + sprite->pos2.y -= 10; + if (sprite->pos1.y + sprite->pos2.y < -32) + { + gSprites[GetAnimBattlerSpriteId(0)].invisible = 0; + DestroyAnimSprite(sprite); + } + break; } } @@ -1471,7 +1695,9 @@ void sub_810ED28(struct Sprite *sprite) void sub_810ED70(struct Sprite *sprite) { if (sprite->data[0] > 0) + { sprite->data[0]--; + } else if (sprite->pos1.y + sprite->pos2.y > -32) { sprite->data[2] += sprite->data[1]; @@ -1503,7 +1729,7 @@ void sub_810EE14(struct Sprite *sprite) u32 matrixNum; int t1, t2; - + switch (sprite->data[0]) { case 0: @@ -1528,7 +1754,7 @@ void sub_810EE14(struct Sprite *sprite) sprite->data[1] -= 40; else sprite->data[1] += 40; - + sprite->data[2]++; TrySetSpriteRotScale(sprite, 0, 256, sprite->data[1], 0); @@ -1540,7 +1766,7 @@ void sub_810EE14(struct Sprite *sprite) if (t2 > 128) t2 = 128; - + /* NONMATCHING * compiles to: @@ -1684,22 +1910,18 @@ void sub_810EEF8(struct Sprite *sprite) if (v1 % 2) sprite->data[0] = 736 + v1; - else sprite->data[0] = 736 - v1; - if (v2 % 2) sprite->data[1] = 896 + v2; - else sprite->data[1] = 896 - v2; - + sprite->data[2] = gBattleAnimArgs[0]; if (sprite->data[2]) sprite->oam.matrixNum = 8; - if (gBattleAnimArgs[1] == 0) { @@ -1733,7 +1955,6 @@ void sub_810EFA8(struct Sprite *sprite) if (sprite->data[0] < 0) sprite->data[0] = 0; - if (++sprite->data[3] == 31) DestroyAnimSprite(sprite); @@ -1750,27 +1971,26 @@ void sub_810F018(struct Sprite *sprite) { switch (sprite->data[0]) { - case 0: - if (++sprite->data[1] > 8) - { - sprite->data[1] = 0; - sprite->invisible ^= 1; - if (++sprite->data[2] > 5 && sprite->invisible) - sprite->data[0]++; - } - break; - case 1: - DestroyAnimSprite(sprite); + case 0: + if (++sprite->data[1] > 8) + { + sprite->data[1] = 0; + sprite->invisible ^= 1; + if (++sprite->data[2] > 5 && sprite->invisible) + sprite->data[0]++; + } + break; + case 1: + DestroyAnimSprite(sprite); + break; } } void sub_810F084(struct Sprite *sprite) { - s16 posx, posy; u16 rotation; - - posx = sprite->pos1.x; - posy = sprite->pos1.y; + s16 posx = sprite->pos1.x; + s16 posy = sprite->pos1.y; sprite->pos1.x = GetBattlerSpriteCoord(gBattleAnimAttacker, 2); sprite->pos1.y = GetBattlerSpriteCoord(gBattleAnimAttacker, 3); @@ -1797,7 +2017,8 @@ void sub_810F140(struct Sprite *sprite) sprite->pos1.x = sprite->data[4] >> 4; sprite->pos1.y = sprite->data[5] >> 4; - if ((u16) (sprite->pos1.x + 0x2d) > 0x14a || sprite->pos1.y > 0x9d || sprite->pos1.y < -0x2d) + if (sprite->pos1.x > 285 || sprite->pos1.x < -45 + || sprite->pos1.y > 157 || sprite->pos1.y < -45) DestroySpriteAndMatrix(sprite); } From b150091436a97178675f40bfccf737a08f215ad8 Mon Sep 17 00:00:00 2001 From: DizzyEggg Date: Tue, 5 Mar 2019 17:06:29 +0100 Subject: [PATCH 14/20] Rename an erroneously named battlescript --- data/battle_scripts_1.s | 2 +- include/battle_scripts.h | 2 +- src/battle_util.c | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/data/battle_scripts_1.s b/data/battle_scripts_1.s index 0159a3f73d..b0c753752c 100644 --- a/data/battle_scripts_1.s +++ b/data/battle_scripts_1.s @@ -3876,7 +3876,7 @@ BattleScript_MoveUsedIsInLove:: status2animation BS_ATTACKER, STATUS2_INFATUATION return -BattleScript_MoveUsedIsParalyzedCantAttack:: +BattleScript_MoveUsedIsInLoveCantAttack:: printstring STRINGID_PKMNIMMOBILIZEDBYLOVE waitmessage 0x40 goto BattleScript_MoveEnd diff --git a/include/battle_scripts.h b/include/battle_scripts.h index 5f314401a9..cac3a76523 100644 --- a/include/battle_scripts.h +++ b/include/battle_scripts.h @@ -115,7 +115,7 @@ extern const u8 BattleScript_PrintPayDayMoneyString[]; extern const u8 BattleScript_WrapTurnDmg[]; extern const u8 BattleScript_WrapEnds[]; extern const u8 BattleScript_MoveUsedIsInLove[]; -extern const u8 BattleScript_MoveUsedIsParalyzedCantAttack[]; +extern const u8 BattleScript_MoveUsedIsInLoveCantAttack[]; extern const u8 BattleScript_NightmareTurnDmg[]; extern const u8 BattleScript_CurseTurnDmg[]; extern const u8 BattleScript_TargetPRLZHeal[]; diff --git a/src/battle_util.c b/src/battle_util.c index fc6042b65f..aa88cf9522 100644 --- a/src/battle_util.c +++ b/src/battle_util.c @@ -1526,7 +1526,7 @@ u8 AtkCanceller_UnableToUseMove(void) } else { - BattleScriptPush(BattleScript_MoveUsedIsParalyzedCantAttack); + BattleScriptPush(BattleScript_MoveUsedIsInLoveCantAttack); gHitMarker |= HITMARKER_UNABLE_TO_USE_MOVE; gProtectStructs[gBattlerAttacker].loveImmobility = 1; CancelMultiTurnMoves(gBattlerAttacker); From 596d85bcbd13c11ad71307e79e641035811941db Mon Sep 17 00:00:00 2001 From: DizzyEggg Date: Tue, 5 Mar 2019 17:07:37 +0100 Subject: [PATCH 15/20] What is love, baby dont hurt me --- src/flying.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/flying.c b/src/flying.c index b48538706e..a157582e96 100644 --- a/src/flying.c +++ b/src/flying.c @@ -652,7 +652,7 @@ void sub_810E314(struct Sprite *sprite) sprite->callback = sub_810E520; } -#ifndef NONMATCHING +#ifdef NONMATCHING /* Things I can't get to match: 1. data->unk0_1 bitfield behaviour. The way bits are read is different. From e79b6f747b2095bf78336f4b6e6998d818ce8400 Mon Sep 17 00:00:00 2001 From: DizzyEggg Date: Tue, 5 Mar 2019 20:07:59 +0100 Subject: [PATCH 16/20] Fix Controllers end command function names --- src/battle_controller_link_opponent.c | 9 ++++----- src/battle_controller_link_partner.c | 8 ++++---- src/battle_controller_opponent.c | 6 +++--- src/battle_controller_player.c | 6 +++--- src/battle_controller_player_partner.c | 6 +++--- src/battle_controller_recorded_opponent.c | 7 +++---- src/battle_controller_recorded_player.c | 6 +++--- src/battle_controller_safari.c | 6 +++--- src/battle_controller_wally.c | 6 +++--- 9 files changed, 29 insertions(+), 31 deletions(-) diff --git a/src/battle_controller_link_opponent.c b/src/battle_controller_link_opponent.c index 05da72e16a..28ab4c2798 100644 --- a/src/battle_controller_link_opponent.c +++ b/src/battle_controller_link_opponent.c @@ -16,6 +16,7 @@ #include "palette.h" #include "pokeball.h" #include "pokemon.h" +#include "recorded_battle.h" #include "reshow_battle_screen.h" #include "sound.h" #include "string_util.h" @@ -32,8 +33,6 @@ extern struct MusicPlayerInfo gMPlayInfo_BGM; extern const struct CompressedSpritePalette gTrainerFrontPicPaletteTable[]; extern void sub_8172EF0(u8 battlerId, struct Pokemon *mon); -extern void sub_81851A8(u8 *); -extern u16 sub_8068B48(void); // this file's functions static void LinkOpponentHandleGetMonData(void); @@ -92,7 +91,7 @@ static void LinkOpponentHandleBattleAnimation(void); static void LinkOpponentHandleLinkStandbyMsg(void); static void LinkOpponentHandleResetActionMoveSelection(void); static void LinkOpponentHandleCmd55(void); -static void nullsub_92(void); +static void LinkOpponentCmdEnd(void); static void LinkOpponentBufferRunCommand(void); static void LinkOpponentBufferExecCompleted(void); @@ -164,7 +163,7 @@ static void (*const sLinkOpponentBufferCommands[CONTROLLER_CMDS_COUNT])(void) = LinkOpponentHandleLinkStandbyMsg, LinkOpponentHandleResetActionMoveSelection, LinkOpponentHandleCmd55, - nullsub_92 + LinkOpponentCmdEnd }; static void nullsub_28(void) @@ -1857,6 +1856,6 @@ static void LinkOpponentHandleCmd55(void) gBattlerControllerFuncs[gActiveBattler] = sub_80587B0; } -static void nullsub_92(void) +static void LinkOpponentCmdEnd(void) { } diff --git a/src/battle_controller_link_partner.c b/src/battle_controller_link_partner.c index 4eb122d054..06a8d4a6a0 100644 --- a/src/battle_controller_link_partner.c +++ b/src/battle_controller_link_partner.c @@ -16,6 +16,7 @@ #include "palette.h" #include "pokeball.h" #include "pokemon.h" +#include "recorded_battle.h" #include "reshow_battle_screen.h" #include "sound.h" #include "string_util.h" @@ -31,7 +32,6 @@ extern const struct CompressedSpritePalette gTrainerFrontPicPaletteTable[]; extern const struct CompressedSpritePalette gTrainerBackPicPaletteTable[]; extern void sub_8172EF0(u8 battlerId, struct Pokemon *mon); -extern void sub_81851A8(u8 *); // this file's functions static void LinkPartnerHandleGetMonData(void); @@ -90,7 +90,7 @@ static void LinkPartnerHandleBattleAnimation(void); static void LinkPartnerHandleLinkStandbyMsg(void); static void LinkPartnerHandleResetActionMoveSelection(void); static void LinkPartnerHandleCmd55(void); -static void SpriteCB_Null3(void); +static void LinkPartnerCmdEnd(void); static void LinkPartnerBufferRunCommand(void); static void LinkPartnerBufferExecCompleted(void); @@ -161,7 +161,7 @@ static void (*const sLinkPartnerBufferCommands[CONTROLLER_CMDS_COUNT])(void) = LinkPartnerHandleLinkStandbyMsg, LinkPartnerHandleResetActionMoveSelection, LinkPartnerHandleCmd55, - SpriteCB_Null3 + LinkPartnerCmdEnd }; static void SpriteCB_Null2(void) @@ -1687,6 +1687,6 @@ static void LinkPartnerHandleCmd55(void) gBattlerControllerFuncs[gActiveBattler] = sub_80587B0; } -static void SpriteCB_Null3(void) +static void LinkPartnerCmdEnd(void) { } diff --git a/src/battle_controller_opponent.c b/src/battle_controller_opponent.c index 99bb0c5887..cdb886e5d7 100644 --- a/src/battle_controller_opponent.c +++ b/src/battle_controller_opponent.c @@ -97,7 +97,7 @@ static void OpponentHandleBattleAnimation(void); static void OpponentHandleLinkStandbyMsg(void); static void OpponentHandleResetActionMoveSelection(void); static void OpponentHandleCmd55(void); -static void nullsub_91(void); +static void OpponentCmdEnd(void); static void OpponentBufferRunCommand(void); static void OpponentBufferExecCompleted(void); @@ -169,7 +169,7 @@ static void (*const sOpponentBufferCommands[CONTROLLER_CMDS_COUNT])(void) = OpponentHandleLinkStandbyMsg, OpponentHandleResetActionMoveSelection, OpponentHandleCmd55, - nullsub_91 + OpponentCmdEnd }; // unknown unused data @@ -2003,6 +2003,6 @@ static void OpponentHandleCmd55(void) OpponentBufferExecCompleted(); } -static void nullsub_91(void) +static void OpponentCmdEnd(void) { } diff --git a/src/battle_controller_player.c b/src/battle_controller_player.c index 6bcc97c68d..a0d92f23a4 100644 --- a/src/battle_controller_player.c +++ b/src/battle_controller_player.c @@ -99,7 +99,7 @@ static void PlayerHandleBattleAnimation(void); static void PlayerHandleLinkStandbyMsg(void); static void PlayerHandleResetActionMoveSelection(void); static void PlayerHandleCmd55(void); -static void nullsub_22(void); +static void PlayerCmdEnd(void); static void PlayerBufferRunCommand(void); static void HandleInputChooseTarget(void); @@ -186,7 +186,7 @@ static void (*const sPlayerBufferCommands[CONTROLLER_CMDS_COUNT])(void) = PlayerHandleLinkStandbyMsg, PlayerHandleResetActionMoveSelection, PlayerHandleCmd55, - nullsub_22 + PlayerCmdEnd }; static const u8 sTargetIdentities[] = {B_POSITION_PLAYER_LEFT, B_POSITION_PLAYER_RIGHT, B_POSITION_OPPONENT_RIGHT, B_POSITION_OPPONENT_LEFT}; @@ -3105,6 +3105,6 @@ static void PlayerHandleCmd55(void) gBattlerControllerFuncs[gActiveBattler] = sub_80587B0; } -static void nullsub_22(void) +static void PlayerCmdEnd(void) { } diff --git a/src/battle_controller_player_partner.c b/src/battle_controller_player_partner.c index a9b0f376be..787a4f77c6 100644 --- a/src/battle_controller_player_partner.c +++ b/src/battle_controller_player_partner.c @@ -90,7 +90,7 @@ static void PlayerPartnerHandleBattleAnimation(void); static void PlayerPartnerHandleLinkStandbyMsg(void); static void PlayerPartnerHandleResetActionMoveSelection(void); static void PlayerPartnerHandleCmd55(void); -static void nullsub_128(void); +static void PlayerPartnerCmdEnd(void); static void PlayerPartnerBufferRunCommand(void); static void PlayerPartnerBufferExecCompleted(void); @@ -167,7 +167,7 @@ static void (*const sPlayerPartnerBufferCommands[CONTROLLER_CMDS_COUNT])(void) = PlayerPartnerHandleLinkStandbyMsg, PlayerPartnerHandleResetActionMoveSelection, PlayerPartnerHandleCmd55, - nullsub_128 + PlayerPartnerCmdEnd }; // unknown unused data @@ -1928,6 +1928,6 @@ static void PlayerPartnerHandleCmd55(void) gBattlerControllerFuncs[gActiveBattler] = sub_80587B0; } -static void nullsub_128(void) +static void PlayerPartnerCmdEnd(void) { } diff --git a/src/battle_controller_recorded_opponent.c b/src/battle_controller_recorded_opponent.c index 25e59172d4..79065c2e29 100644 --- a/src/battle_controller_recorded_opponent.c +++ b/src/battle_controller_recorded_opponent.c @@ -34,7 +34,6 @@ extern struct MusicPlayerInfo gMPlayInfo_BGM; extern const struct CompressedSpritePalette gTrainerFrontPicPaletteTable[]; extern void sub_8172EF0(u8 battlerId, struct Pokemon *mon); -extern u16 sub_8068B48(void); // this file's functions static void RecordedOpponentHandleGetMonData(void); @@ -93,7 +92,7 @@ static void RecordedOpponentHandleBattleAnimation(void); static void RecordedOpponentHandleLinkStandbyMsg(void); static void RecordedOpponentHandleResetActionMoveSelection(void); static void RecordedOpponentHandleCmd55(void); -static void SpriteCB_Null9(void); +static void RecordedOpponentCmdEnd(void); static void RecordedOpponentBufferRunCommand(void); static void RecordedOpponentBufferExecCompleted(void); @@ -165,7 +164,7 @@ static void (*const sRecordedOpponentBufferCommands[CONTROLLER_CMDS_COUNT])(void RecordedOpponentHandleLinkStandbyMsg, RecordedOpponentHandleResetActionMoveSelection, RecordedOpponentHandleCmd55, - SpriteCB_Null9 + RecordedOpponentCmdEnd }; static void nullsub_70(void) @@ -1791,6 +1790,6 @@ static void RecordedOpponentHandleCmd55(void) gBattlerControllerFuncs[gActiveBattler] = sub_80587B0; } -static void SpriteCB_Null9(void) +static void RecordedOpponentCmdEnd(void) { } diff --git a/src/battle_controller_recorded_player.c b/src/battle_controller_recorded_player.c index b2dfca6a07..e5e9347613 100644 --- a/src/battle_controller_recorded_player.c +++ b/src/battle_controller_recorded_player.c @@ -89,7 +89,7 @@ static void RecordedPlayerHandleBattleAnimation(void); static void RecordedPlayerHandleLinkStandbyMsg(void); static void RecordedPlayerHandleResetActionMoveSelection(void); static void RecordedPlayerHandleCmd55(void); -static void nullsub_121(void); +static void RecordedPlayerCmdEnd(void); static void RecordedPlayerBufferRunCommand(void); static void RecordedPlayerBufferExecCompleted(void); @@ -160,7 +160,7 @@ static void (*const sRecordedPlayerBufferCommands[CONTROLLER_CMDS_COUNT])(void) RecordedPlayerHandleLinkStandbyMsg, RecordedPlayerHandleResetActionMoveSelection, RecordedPlayerHandleCmd55, - nullsub_121 + RecordedPlayerCmdEnd }; static void nullsub_120(void) @@ -1808,6 +1808,6 @@ static void RecordedPlayerHandleCmd55(void) gBattlerControllerFuncs[gActiveBattler] = sub_80587B0; } -static void nullsub_121(void) +static void RecordedPlayerCmdEnd(void) { } diff --git a/src/battle_controller_safari.c b/src/battle_controller_safari.c index b7223844f1..247f006277 100644 --- a/src/battle_controller_safari.c +++ b/src/battle_controller_safari.c @@ -84,7 +84,7 @@ static void SafariHandleBattleAnimation(void); static void SafariHandleLinkStandbyMsg(void); static void SafariHandleResetActionMoveSelection(void); static void SafariHandleCmd55(void); -static void SpriteCB_Null5(void); +static void SafariCmdEnd(void); static void SafariBufferRunCommand(void); static void SafariBufferExecCompleted(void); @@ -148,7 +148,7 @@ static void (*const sSafariBufferCommands[CONTROLLER_CMDS_COUNT])(void) = SafariHandleLinkStandbyMsg, SafariHandleResetActionMoveSelection, SafariHandleCmd55, - SpriteCB_Null5 + SafariCmdEnd }; static void SpriteCB_Null4(void) @@ -688,6 +688,6 @@ static void SafariHandleCmd55(void) gBattlerControllerFuncs[gActiveBattler] = sub_81595E4; } -static void SpriteCB_Null5(void) +static void SafariCmdEnd(void) { } diff --git a/src/battle_controller_wally.c b/src/battle_controller_wally.c index a196f8a44b..7f4fe47612 100644 --- a/src/battle_controller_wally.c +++ b/src/battle_controller_wally.c @@ -92,7 +92,7 @@ static void WallyHandleBattleAnimation(void); static void WallyHandleLinkStandbyMsg(void); static void WallyHandleResetActionMoveSelection(void); static void WallyHandleCmd55(void); -static void SpriteCB_Null8(void); +static void WallyCmdEnd(void); static void WallyBufferRunCommand(void); static void WallyBufferExecCompleted(void); @@ -161,7 +161,7 @@ static void (*const sWallyBufferCommands[CONTROLLER_CMDS_COUNT])(void) = WallyHandleLinkStandbyMsg, WallyHandleResetActionMoveSelection, WallyHandleCmd55, - SpriteCB_Null8 + WallyCmdEnd }; static void SpriteCB_Null7(void) @@ -1559,6 +1559,6 @@ static void WallyHandleCmd55(void) gBattlerControllerFuncs[gActiveBattler] = sub_80587B0; } -static void SpriteCB_Null8(void) +static void WallyCmdEnd(void) { } From 105e1721d665d8386afd47882020c51d6d97c522 Mon Sep 17 00:00:00 2001 From: Phlosioneer Date: Sun, 3 Mar 2019 21:59:57 -0500 Subject: [PATCH 17/20] Overhaul scaninc to work recursively This also fixes the bug where scaninc would ignore #include lines in assembly files. --- Makefile | 2 +- src/field_message_box.c | 2 +- src/item_menu.c | 2 +- src/main_menu.c | 2 +- tools/scaninc/Makefile | 4 +- tools/scaninc/asm_file.cpp | 3 +- tools/scaninc/scaninc.cpp | 96 +++++++++----------------- tools/scaninc/scaninc.h | 2 +- tools/scaninc/source_file.cpp | 125 ++++++++++++++++++++++++++++++++++ tools/scaninc/source_file.h | 71 +++++++++++++++++++ 10 files changed, 238 insertions(+), 71 deletions(-) create mode 100644 tools/scaninc/source_file.cpp create mode 100644 tools/scaninc/source_file.h diff --git a/Makefile b/Makefile index c9a7c2e059..e5b35a8302 100644 --- a/Makefile +++ b/Makefile @@ -168,7 +168,7 @@ $(ASM_BUILDDIR)/%.o: $(ASM_SUBDIR)/%.s $$(asm_dep) ifeq ($(NODEP),1) $(DATA_ASM_BUILDDIR)/%.o: data_dep := else -$(DATA_ASM_BUILDDIR)/%.o: data_dep = $(shell $(SCANINC) $(DATA_ASM_SUBDIR)/$*.s) +$(DATA_ASM_BUILDDIR)/%.o: data_dep = $(shell $(SCANINC) -I include $(DATA_ASM_SUBDIR)/$*.s) endif $(DATA_ASM_BUILDDIR)/%.o: $(DATA_ASM_SUBDIR)/%.s $$(data_dep) diff --git a/src/field_message_box.c b/src/field_message_box.c index ac5e7a4bb7..ca1c05e224 100755 --- a/src/field_message_box.c +++ b/src/field_message_box.c @@ -1,6 +1,6 @@ +#include #include "global.h" #include "menu.h" -#include "string.h" #include "string_util.h" #include "task.h" #include "text.h" diff --git a/src/item_menu.c b/src/item_menu.c index 5b9946e62e..5d5dfe854a 100755 --- a/src/item_menu.c +++ b/src/item_menu.c @@ -1,3 +1,4 @@ +#include #include "global.h" #include "item_menu.h" #include "battle.h" @@ -40,7 +41,6 @@ #include "shop.h" #include "sound.h" #include "sprite.h" -#include "string.h" #include "strings.h" #include "string_util.h" #include "task.h" diff --git a/src/main_menu.c b/src/main_menu.c index e6e29d942a..1879495f52 100644 --- a/src/main_menu.c +++ b/src/main_menu.c @@ -1,3 +1,4 @@ +#include #include "global.h" #include "trainer_pokemon_sprites.h" #include "bg.h" @@ -30,7 +31,6 @@ #include "scanline_effect.h" #include "sound.h" #include "sprite.h" -#include "string.h" #include "strings.h" #include "string_util.h" #include "task.h" diff --git a/tools/scaninc/Makefile b/tools/scaninc/Makefile index 367a3350b8..53c9d0060d 100644 --- a/tools/scaninc/Makefile +++ b/tools/scaninc/Makefile @@ -2,9 +2,9 @@ CXX = g++ CXXFLAGS = -Wall -Werror -std=c++11 -O2 -SRCS = scaninc.cpp c_file.cpp asm_file.cpp +SRCS = scaninc.cpp c_file.cpp asm_file.cpp source_file.cpp -HEADERS := scaninc.h asm_file.h c_file.h +HEADERS := scaninc.h asm_file.h c_file.h source_file.h .PHONY: clean diff --git a/tools/scaninc/asm_file.cpp b/tools/scaninc/asm_file.cpp index 6322749e20..109e604a22 100644 --- a/tools/scaninc/asm_file.cpp +++ b/tools/scaninc/asm_file.cpp @@ -64,7 +64,8 @@ IncDirectiveType AsmFile::ReadUntilIncDirective(std::string &path) IncDirectiveType incDirectiveType = IncDirectiveType::None; - if (PeekChar() == '.') + char c = PeekChar(); + if (c == '.' || c == '#') { m_pos++; diff --git a/tools/scaninc/scaninc.cpp b/tools/scaninc/scaninc.cpp index 3dc221479c..0d55d11f65 100644 --- a/tools/scaninc/scaninc.cpp +++ b/tools/scaninc/scaninc.cpp @@ -25,8 +25,7 @@ #include #include #include "scaninc.h" -#include "asm_file.h" -#include "c_file.h" +#include "source_file.h" bool CanOpenFile(std::string path) { @@ -46,7 +45,7 @@ int main(int argc, char **argv) std::queue filesToProcess; std::set dependencies; - std::list includeDirs; + std::vector includeDirs; argc--; argv++; @@ -83,79 +82,50 @@ int main(int argc, char **argv) std::string initialPath(argv[0]); - std::size_t pos = initialPath.find_last_of('.'); + filesToProcess.push(initialPath); - if (pos == std::string::npos) - FATAL_ERROR("no file extension in path \"%s\"\n", initialPath.c_str()); - - std::string extension = initialPath.substr(pos + 1); - - std::string srcDir(""); - std::size_t slash = initialPath.rfind('/'); - if (slash != std::string::npos) + while (!filesToProcess.empty()) { - srcDir = initialPath.substr(0, slash + 1); - } - includeDirs.push_back(srcDir); + std::string filePath = filesToProcess.front(); + SourceFile file(filePath); + filesToProcess.pop(); - if (extension == "c" || extension == "h") - { - filesToProcess.push(initialPath); - - while (!filesToProcess.empty()) + includeDirs.push_back(file.GetSrcDir()); + for (auto incbin : file.GetIncbins()) { - CFile file(filesToProcess.front()); - filesToProcess.pop(); - - file.FindIncbins(); - for (auto incbin : file.GetIncbins()) + dependencies.insert(incbin); + } + for (auto include : file.GetIncludes()) + { + bool found = false; + for (auto includeDir : includeDirs) { - dependencies.insert(incbin); - } - for (auto include : file.GetIncludes()) - { - for (auto includeDir : includeDirs) + std::string path(includeDir + include); + if (CanOpenFile(path)) { - std::string path(includeDir + include); - if (CanOpenFile(path)) + bool inserted = dependencies.insert(path).second; + if (inserted) { - bool inserted = dependencies.insert(path).second; - if (inserted) - { - filesToProcess.push(path); - } - break; + filesToProcess.push(path); } + found = true; + break; } } - } - } - else if (extension == "s" || extension == "inc") - { - filesToProcess.push(initialPath); - - while (!filesToProcess.empty()) - { - AsmFile file(filesToProcess.front()); - - filesToProcess.pop(); - - IncDirectiveType incDirectiveType; - std::string path; - - while ((incDirectiveType = file.ReadUntilIncDirective(path)) != IncDirectiveType::None) + if (!found) { - bool inserted = dependencies.insert(path).second; - if (inserted - && incDirectiveType == IncDirectiveType::Include - && CanOpenFile(path)) - filesToProcess.push(path); + if (GetFileType(include) == SourceFileType::Header) + // We don't have any generated .h files... yet. + // Better to give a warning; debugging the makefile when a + // header is missing is very difficult. + fprintf(stderr, "scaninc: warning: C header file \"%s\" not found. (included from \"%s\")\n", + include.c_str(), filePath.c_str()); + + // It's probably a generated file. + dependencies.insert(include); } } - } - else - { - FATAL_ERROR("unknown extension \"%s\"\n", extension.c_str()); + includeDirs.pop_back(); } for (const std::string &path : dependencies) diff --git a/tools/scaninc/scaninc.h b/tools/scaninc/scaninc.h index 30cc9611c1..d6736e01bb 100644 --- a/tools/scaninc/scaninc.h +++ b/tools/scaninc/scaninc.h @@ -1,4 +1,4 @@ -// Copyright(c) 2015-2017 YamaArashi +// Copyright(c) 2019 Phlosioneer // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal diff --git a/tools/scaninc/source_file.cpp b/tools/scaninc/source_file.cpp new file mode 100644 index 0000000000..f23ff6db65 --- /dev/null +++ b/tools/scaninc/source_file.cpp @@ -0,0 +1,125 @@ +// Copyright(c) 2019 Phlosioneer +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. + +#include +#include "source_file.h" + + +SourceFileType GetFileType(std::string& path) +{ + std::size_t pos = path.find_last_of('.'); + + if (pos == std::string::npos) + FATAL_ERROR("no file extension in path \"%s\"\n", path.c_str()); + + std::string extension = path.substr(pos + 1); + + if (extension == "c") + return SourceFileType::Cpp; + else if (extension == "s") + return SourceFileType::Asm; + else if (extension == "h") + return SourceFileType::Header; + else if (extension == "inc") + return SourceFileType::Inc; + else + FATAL_ERROR("Unrecognized extension \"%s\"\n", extension.c_str()); + + // Unreachable + return SourceFileType::Cpp; +} + +std::string GetDir(std::string& path) +{ + std::size_t slash = path.rfind('/'); + + if (slash != std::string::npos) + return path.substr(0, slash + 1); + else + return std::string(""); +} + +SourceFile::SourceFile(std::string path) +{ + m_file_type = GetFileType(path); + + m_src_dir = GetDir(path); + + if (m_file_type == SourceFileType::Cpp + || m_file_type == SourceFileType::Header) + { + new (&m_source_file.c_file) CFile(path); + m_source_file.c_file.FindIncbins(); + } + else + { + AsmFile file(path); + std::set incbins; + std::set includes; + + IncDirectiveType incDirectiveType; + std::string outputPath; + + while ((incDirectiveType = file.ReadUntilIncDirective(outputPath)) != IncDirectiveType::None) + { + if (incDirectiveType == IncDirectiveType::Include) + includes.insert(outputPath); + else + incbins.insert(outputPath); + } + + new (&m_source_file.asm_wrapper) SourceFile::InnerUnion::AsmWrapper{incbins, includes}; + } +} + +SourceFile::~SourceFile() +{ + if (m_file_type == SourceFileType::Cpp || m_file_type == SourceFileType::Header) + { + m_source_file.c_file.~CFile(); + } + else + { + m_source_file.asm_wrapper.asm_incbins.~set(); + m_source_file.asm_wrapper.asm_includes.~set(); + } +} + +const std::set& SourceFile::GetIncbins() +{ + if (m_file_type == SourceFileType::Cpp || m_file_type == SourceFileType::Header) + return m_source_file.c_file.GetIncbins(); + else + return m_source_file.asm_wrapper.asm_incbins; +} + +const std::set& SourceFile::GetIncludes() +{ + if (m_file_type == SourceFileType::Cpp || m_file_type == SourceFileType::Header) + return m_source_file.c_file.GetIncludes(); + else + return m_source_file.asm_wrapper.asm_includes; +} + +std::string& SourceFile::GetSrcDir() +{ + return m_src_dir; +} + diff --git a/tools/scaninc/source_file.h b/tools/scaninc/source_file.h new file mode 100644 index 0000000000..15ea50a034 --- /dev/null +++ b/tools/scaninc/source_file.h @@ -0,0 +1,71 @@ +// Copyright(c) 2015-2017 YamaArashi +// +// Permission is hereby granted, free of charge, to any person obtaining a copy +// of this software and associated documentation files (the "Software"), to deal +// in the Software without restriction, including without limitation the rights +// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the Software is +// furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +// THE SOFTWARE. + +#ifndef SOURCE_FILE_H +#define SOURCE_FILE_H + +#include +#include "scaninc.h" +#include "asm_file.h" +#include "c_file.h" + +enum class SourceFileType +{ + Cpp, + Header, + Asm, + Inc +}; + +SourceFileType GetFileType(std::string& path); + +class SourceFile +{ +public: + + SourceFile(std::string path); + ~SourceFile(); + SourceFile(SourceFile const&) = delete; + SourceFile(SourceFile&&) = delete; + SourceFile& operator =(SourceFile const&) = delete; + SourceFile& operator =(SourceFile&&) = delete; + bool HasIncbins(); + const std::set& GetIncbins(); + const std::set& GetIncludes(); + std::string& GetSrcDir(); + +private: + union InnerUnion { + CFile c_file; + struct AsmWrapper { + std::set asm_incbins; + std::set asm_includes; + } asm_wrapper; + + // Construction and destruction handled by SourceFile. + InnerUnion() {}; + ~InnerUnion() {}; + } m_source_file; + SourceFileType m_file_type; + std::string m_src_dir; +}; + +#endif // SOURCE_FILE_H + From b0c634d5318019f17547a758084fdcfb5a387c24 Mon Sep 17 00:00:00 2001 From: Phlosioneer Date: Mon, 4 Mar 2019 00:21:34 -0500 Subject: [PATCH 18/20] Support absolute paths --- Makefile | 4 ++-- tools/scaninc/scaninc.cpp | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Makefile b/Makefile index e5b35a8302..1bfeebf616 100644 --- a/Makefile +++ b/Makefile @@ -159,7 +159,7 @@ $(C_BUILDDIR)/%.o : $(C_SUBDIR)/%.c $$(c_dep) ifeq ($(NODEP),1) $(ASM_BUILDDIR)/%.o: asm_dep := else -$(ASM_BUILDDIR)/%.o: asm_dep = $(shell $(SCANINC) $(ASM_SUBDIR)/$*.s) +$(ASM_BUILDDIR)/%.o: asm_dep = $(shell $(SCANINC) -I "" $(ASM_SUBDIR)/$*.s) endif $(ASM_BUILDDIR)/%.o: $(ASM_SUBDIR)/%.s $$(asm_dep) @@ -168,7 +168,7 @@ $(ASM_BUILDDIR)/%.o: $(ASM_SUBDIR)/%.s $$(asm_dep) ifeq ($(NODEP),1) $(DATA_ASM_BUILDDIR)/%.o: data_dep := else -$(DATA_ASM_BUILDDIR)/%.o: data_dep = $(shell $(SCANINC) -I include $(DATA_ASM_SUBDIR)/$*.s) +$(DATA_ASM_BUILDDIR)/%.o: data_dep = $(shell $(SCANINC) -I include -I "" $(DATA_ASM_SUBDIR)/$*.s) endif $(DATA_ASM_BUILDDIR)/%.o: $(DATA_ASM_SUBDIR)/%.s $$(data_dep) diff --git a/tools/scaninc/scaninc.cpp b/tools/scaninc/scaninc.cpp index 0d55d11f65..696842dc91 100644 --- a/tools/scaninc/scaninc.cpp +++ b/tools/scaninc/scaninc.cpp @@ -62,7 +62,7 @@ int main(int argc, char **argv) argv++; includeDir = std::string(argv[0]); } - if (includeDir.back() != '/') + if (!includeDir.empty() && includeDir.back() != '/') { includeDir += '/'; } From 6638ebe7fdda1119d8fe0056c8cf0c65cf292c11 Mon Sep 17 00:00:00 2001 From: Phlosioneer Date: Tue, 5 Mar 2019 02:30:08 -0500 Subject: [PATCH 19/20] Fix copyright mixup --- tools/scaninc/scaninc.h | 2 +- tools/scaninc/source_file.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/tools/scaninc/scaninc.h b/tools/scaninc/scaninc.h index d6736e01bb..30cc9611c1 100644 --- a/tools/scaninc/scaninc.h +++ b/tools/scaninc/scaninc.h @@ -1,4 +1,4 @@ -// Copyright(c) 2019 Phlosioneer +// Copyright(c) 2015-2017 YamaArashi // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal diff --git a/tools/scaninc/source_file.h b/tools/scaninc/source_file.h index 15ea50a034..f7b6412bd2 100644 --- a/tools/scaninc/source_file.h +++ b/tools/scaninc/source_file.h @@ -1,4 +1,4 @@ -// Copyright(c) 2015-2017 YamaArashi +// Copyright(c) 2019 Phlosioneer // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal From bd157b301dea3526a4c373737dc8167d9a02b168 Mon Sep 17 00:00:00 2001 From: Marcus Huderle Date: Thu, 7 Mar 2019 09:46:14 -0600 Subject: [PATCH 20/20] Scaninc: Don't insert missing headers into dependencies --- src/field_message_box.c | 2 +- src/item_menu.c | 2 +- src/main_menu.c | 2 +- tools/scaninc/scaninc.cpp | 14 -------------- 4 files changed, 3 insertions(+), 17 deletions(-) diff --git a/src/field_message_box.c b/src/field_message_box.c index ca1c05e224..ac5e7a4bb7 100755 --- a/src/field_message_box.c +++ b/src/field_message_box.c @@ -1,6 +1,6 @@ -#include #include "global.h" #include "menu.h" +#include "string.h" #include "string_util.h" #include "task.h" #include "text.h" diff --git a/src/item_menu.c b/src/item_menu.c index 5d5dfe854a..5b9946e62e 100755 --- a/src/item_menu.c +++ b/src/item_menu.c @@ -1,4 +1,3 @@ -#include #include "global.h" #include "item_menu.h" #include "battle.h" @@ -41,6 +40,7 @@ #include "shop.h" #include "sound.h" #include "sprite.h" +#include "string.h" #include "strings.h" #include "string_util.h" #include "task.h" diff --git a/src/main_menu.c b/src/main_menu.c index 1879495f52..e6e29d942a 100644 --- a/src/main_menu.c +++ b/src/main_menu.c @@ -1,4 +1,3 @@ -#include #include "global.h" #include "trainer_pokemon_sprites.h" #include "bg.h" @@ -31,6 +30,7 @@ #include "scanline_effect.h" #include "sound.h" #include "sprite.h" +#include "string.h" #include "strings.h" #include "string_util.h" #include "task.h" diff --git a/tools/scaninc/scaninc.cpp b/tools/scaninc/scaninc.cpp index 696842dc91..b95cbd0337 100644 --- a/tools/scaninc/scaninc.cpp +++ b/tools/scaninc/scaninc.cpp @@ -97,7 +97,6 @@ int main(int argc, char **argv) } for (auto include : file.GetIncludes()) { - bool found = false; for (auto includeDir : includeDirs) { std::string path(includeDir + include); @@ -108,22 +107,9 @@ int main(int argc, char **argv) { filesToProcess.push(path); } - found = true; break; } } - if (!found) - { - if (GetFileType(include) == SourceFileType::Header) - // We don't have any generated .h files... yet. - // Better to give a warning; debugging the makefile when a - // header is missing is very difficult. - fprintf(stderr, "scaninc: warning: C header file \"%s\" not found. (included from \"%s\")\n", - include.c_str(), filePath.c_str()); - - // It's probably a generated file. - dependencies.insert(include); - } } includeDirs.pop_back(); }