From 9a0618afc3f7ccf8a5d19ee5815fd388003d4a95 Mon Sep 17 00:00:00 2001 From: GriffinR Date: Wed, 3 Nov 2021 15:29:18 -0400 Subject: [PATCH] Add COPYWIN constants --- gflib/text.c | 12 ++--- gflib/window.c | 18 +++---- gflib/window.h | 19 +++---- include/menu.h | 2 +- src/apprentice.c | 2 +- src/battle_dome.c | 22 ++++---- src/battle_factory_screen.c | 60 +++++++++++----------- src/battle_message.c | 2 +- src/battle_records.c | 4 +- src/battle_script_commands.c | 12 ++--- src/berry_blender.c | 16 +++--- src/berry_crush.c | 12 ++--- src/berry_fix_program.c | 8 +-- src/braille.c | 2 +- src/cable_club.c | 6 +-- src/contest.c | 4 +- src/contest_painting.c | 2 +- src/credits.c | 6 +-- src/daycare.c | 2 +- src/diploma.c | 2 +- src/dodrio_berry_picking.c | 30 +++++------ src/easy_chat.c | 12 ++--- src/egg_hatch.c | 2 +- src/field_region_map.c | 2 +- src/field_specials.c | 20 +++----- src/frontier_pass.c | 8 +-- src/frontier_util.c | 20 ++++---- src/hall_of_fame.c | 16 +++--- src/item_menu.c | 8 +-- src/link.c | 8 +-- src/list_menu.c | 14 ++--- src/mail.c | 4 +- src/main_menu.c | 40 +++++++-------- src/map_name_popup.c | 2 +- src/match_call.c | 4 +- src/mauville_old_man.c | 4 +- src/menu.c | 55 ++++++++++---------- src/menu_specialized.c | 6 +-- src/money.c | 4 +- src/move_relearner.c | 2 +- src/mystery_event_menu.c | 4 +- src/mystery_gift_menu.c | 20 ++++---- src/mystery_gift_view.c | 6 +-- src/naming_screen.c | 6 +-- src/option_menu.c | 10 ++-- src/party_menu.c | 14 ++--- src/player_pc.c | 2 +- src/pokeblock.c | 2 +- src/pokedex.c | 50 +++++++++--------- src/pokedex_cry_screen.c | 2 +- src/pokemon_jump.c | 24 ++++----- src/pokemon_storage_system.c | 12 ++--- src/pokemon_summary_screen.c | 2 +- src/pokenav_conditions_2.c | 12 ++--- src/pokenav_conditions_3.c | 4 +- src/pokenav_main_menu.c | 2 +- src/pokenav_match_call_2.c | 12 ++--- src/pokenav_match_call_ui.c | 22 ++++---- src/pokenav_menu_handler_2.c | 2 +- src/pokenav_region_map.c | 8 +-- src/pokenav_ribbons_1.c | 4 +- src/pokenav_ribbons_2.c | 8 +-- src/record_mixing.c | 2 +- src/region_map.c | 2 +- src/reset_rtc_screen.c | 4 +- src/roulette.c | 28 +++++----- src/save_failed_screen.c | 4 +- src/scrcmd.c | 2 +- src/script_menu.c | 8 +-- src/shop.c | 2 +- src/slot_machine.c | 12 ++--- src/start_menu.c | 12 ++--- src/trade.c | 22 ++++---- src/trainer_card.c | 4 +- src/trainer_hill.c | 2 +- src/union_room.c | 20 ++++---- src/union_room_battle.c | 2 +- src/union_room_chat.c | 46 ++++++++--------- src/use_pokeblock.c | 18 +++---- src/wireless_communication_status_screen.c | 6 +-- 80 files changed, 444 insertions(+), 454 deletions(-) diff --git a/gflib/text.c b/gflib/text.c index 54155affe..9d1a5464f 100644 --- a/gflib/text.c +++ b/gflib/text.c @@ -297,7 +297,7 @@ bool16 AddTextPrinter(struct TextPrinterTemplate *printerTemplate, u8 speed, voi } if (speed != TEXT_SPEED_FF) - CopyWindowToVram(gTempTextPrinter.printerTemplate.windowId, 2); + CopyWindowToVram(gTempTextPrinter.printerTemplate.windowId, COPYWIN_GFX); gTextPrinters[printerTemplate->windowId].active = 0; } gDisableTextPrinters = 0; @@ -318,7 +318,7 @@ void RunTextPrinters(void) switch (temp) { case 0: - CopyWindowToVram(gTextPrinters[i].printerTemplate.windowId, 2); + CopyWindowToVram(gTextPrinters[i].printerTemplate.windowId, COPYWIN_GFX); case 3: if (gTextPrinters[i].callback != 0) gTextPrinters[i].callback(&gTextPrinters[i].printerTemplate, temp); @@ -815,7 +815,7 @@ void TextPrinterDrawDownArrow(struct TextPrinter *textPrinter) textPrinter->printerTemplate.currentY, 8, 16); - CopyWindowToVram(textPrinter->printerTemplate.windowId, 2); + CopyWindowToVram(textPrinter->printerTemplate.windowId, COPYWIN_GFX); subStruct->downArrowDelay = 8; subStruct->downArrowYPosIdx++; @@ -832,7 +832,7 @@ void TextPrinterClearDownArrow(struct TextPrinter *textPrinter) textPrinter->printerTemplate.currentY, 8, 16); - CopyWindowToVram(textPrinter->printerTemplate.windowId, 2); + CopyWindowToVram(textPrinter->printerTemplate.windowId, COPYWIN_GFX); } bool8 TextPrinterWaitAutoMode(struct TextPrinter *textPrinter) @@ -922,7 +922,7 @@ void DrawDownArrow(u8 windowId, u16 x, u16 y, u8 bgColor, bool8 drawArrow, u8 *c y - 2, 0x8, 0x10); - CopyWindowToVram(windowId, 0x2); + CopyWindowToVram(windowId, COPYWIN_GFX); *counter = 8; ++*yCoordIndex; } @@ -1199,7 +1199,7 @@ u16 RenderText(struct TextPrinter *textPrinter) ScrollWindow(textPrinter->printerTemplate.windowId, 0, speed, PIXEL_FILL(textPrinter->printerTemplate.bgColor)); textPrinter->scrollDistance -= speed; } - CopyWindowToVram(textPrinter->printerTemplate.windowId, 2); + CopyWindowToVram(textPrinter->printerTemplate.windowId, COPYWIN_GFX); } else { diff --git a/gflib/window.c b/gflib/window.c index c7b8c8917..8ca1a4b62 100644 --- a/gflib/window.c +++ b/gflib/window.c @@ -275,13 +275,13 @@ void CopyWindowToVram(u8 windowId, u8 mode) switch (mode) { - case 1: + case COPYWIN_MAP: CopyBgTilemapBufferToVram(windowLocal.window.bg); break; - case 2: + case COPYWIN_GFX: LoadBgTiles(windowLocal.window.bg, windowLocal.tileData, windowSize, windowLocal.window.baseBlock); break; - case 3: + case COPYWIN_FULL: LoadBgTiles(windowLocal.window.bg, windowLocal.tileData, windowSize, windowLocal.window.baseBlock); CopyBgTilemapBufferToVram(windowLocal.window.bg); break; @@ -307,13 +307,13 @@ void CopyWindowRectToVram(u32 windowId, u32 mode, u32 x, u32 y, u32 w, u32 h) switch (mode) { - case 1: + case COPYWIN_MAP: CopyBgTilemapBufferToVram(windowLocal.window.bg); break; - case 2: + case COPYWIN_GFX: LoadBgTiles(windowLocal.window.bg, windowLocal.tileData + (rectPos * 32), rectSize, windowLocal.window.baseBlock + rectPos); break; - case 3: + case COPYWIN_FULL: LoadBgTiles(windowLocal.window.bg, windowLocal.tileData + (rectPos * 32), rectSize, windowLocal.window.baseBlock + rectPos); CopyBgTilemapBufferToVram(windowLocal.window.bg); break; @@ -693,13 +693,13 @@ void CopyWindowToVram8Bit(u8 windowId, u8 mode) switch (mode) { - case 1: + case COPYWIN_MAP: CopyBgTilemapBufferToVram(sWindowPtr->window.bg); break; - case 2: + case COPYWIN_GFX: LoadBgTiles(sWindowPtr->window.bg, sWindowPtr->tileData, sWindowSize, sWindowPtr->window.baseBlock); break; - case 3: + case COPYWIN_FULL: LoadBgTiles(sWindowPtr->window.bg, sWindowPtr->tileData, sWindowSize, sWindowPtr->window.baseBlock); CopyBgTilemapBufferToVram(sWindowPtr->window.bg); break; diff --git a/gflib/window.h b/gflib/window.h index 3eac75a28..6cb98c845 100644 --- a/gflib/window.h +++ b/gflib/window.h @@ -3,8 +3,7 @@ #define PIXEL_FILL(num) ((num) | ((num) << 4)) -enum -{ +enum { WINDOW_BG, WINDOW_TILEMAP_LEFT, WINDOW_TILEMAP_TOP, @@ -15,6 +14,14 @@ enum WINDOW_TILE_DATA }; +// Mode for CopyWindowToVram, CopyWindowRectToVram and CopyWindowToVram8Bit +enum { + COPYWIN_NONE, + COPYWIN_MAP, + COPYWIN_GFX, + COPYWIN_FULL, +}; + struct WindowTemplate { u8 bg; @@ -28,13 +35,7 @@ struct WindowTemplate #define DUMMY_WIN_TEMPLATE \ { \ - 0xFF, \ - 0, \ - 0, \ - 0, \ - 0, \ - 0, \ - 0, \ + .bg = 0xFF, \ } #define WINDOW_NONE 0xFF diff --git a/include/menu.h b/include/menu.h index eb391e565..cc65a51dc 100644 --- a/include/menu.h +++ b/include/menu.h @@ -123,7 +123,7 @@ void sub_8198314(void); void sub_8198180(const u8 *string, u8 a2, bool8 copyToVram); void ResetBgPositions(void); void AddTextPrinterWithCustomSpeedForMessage(bool8 allowSkippingDelayWithButtonPress, u8 speed); -void sub_8198C78(void); +void EraseYesNoWindow(void); void PrintTextArray(u8 windowId, u8 fontId, u8 left, u8 top, u8 lineHeight, u8 itemCount, const struct MenuAction *strs); void Menu_LoadStdPal(void); diff --git a/src/apprentice.c b/src/apprentice.c index 032b76715..8421d4d8b 100644 --- a/src/apprentice.c +++ b/src/apprentice.c @@ -691,7 +691,7 @@ static u8 CreateAndShowWindow(u8 left, u8 top, u8 width, u8 height) windowId = AddWindow(&winTemplate); PutWindowTilemap(windowId); - CopyWindowToVram(windowId, 3); + CopyWindowToVram(windowId, COPYWIN_FULL); return windowId; } diff --git a/src/battle_dome.c b/src/battle_dome.c index 429cc58d7..0075e84d6 100644 --- a/src/battle_dome.c +++ b/src/battle_dome.c @@ -3428,7 +3428,7 @@ static void Task_HandleInfoCardInput(u8 taskId) for (i = windowId; i < windowId + 9; i++) { - CopyWindowToVram(i, 2); + CopyWindowToVram(i, COPYWIN_GFX); FillWindowPixelBuffer(i, PIXEL_FILL(0)); } gTasks[taskId].tState = STATE_REACT_INPUT; @@ -4358,7 +4358,7 @@ static void DisplayTrainerInfoOnCard(u8 flags, u8 trainerTourneyId) textPrinter.currentChar = gStringVar1; textPrinter.windowId = windowId; PutWindowTilemap(windowId); - CopyWindowToVram(windowId, 3); + CopyWindowToVram(windowId, COPYWIN_FULL); AddTextPrinter(&textPrinter, 0, NULL); textPrinter.letterSpacing = 0; @@ -4380,12 +4380,12 @@ static void DisplayTrainerInfoOnCard(u8 flags, u8 trainerTourneyId) textPrinter.currentX = 0; PutWindowTilemap(1 + i + windowId); - CopyWindowToVram(1 + i + windowId, 3); + CopyWindowToVram(1 + i + windowId, COPYWIN_FULL); AddTextPrinter(&textPrinter, 0, NULL); } PutWindowTilemap(windowId + 4); - CopyWindowToVram(windowId + 4, 3); + CopyWindowToVram(windowId + 4, COPYWIN_FULL); // Print text about trainers potential in the tourney if (trainerId == TRAINER_FRONTIER_BRAIN) @@ -4861,7 +4861,7 @@ static void DisplayMatchInfoOnCard(u8 flags, u8 matchNo) textPrinter.windowId = windowId + 8; textPrinter.fontId = FONT_NORMAL; PutWindowTilemap(windowId + 8); - CopyWindowToVram(windowId + 8, 3); + CopyWindowToVram(windowId + 8, COPYWIN_FULL); textPrinter.currentX = 0; textPrinter.currentY = textPrinter.y = 0; AddTextPrinter(&textPrinter, 0, NULL); @@ -4881,7 +4881,7 @@ static void DisplayMatchInfoOnCard(u8 flags, u8 matchNo) textPrinter.currentX = GetStringCenterAlignXOffsetWithLetterSpacing(textPrinter.fontId, textPrinter.currentChar, 0x40, textPrinter.letterSpacing); textPrinter.currentY = textPrinter.y = 2; PutWindowTilemap(windowId + 6); - CopyWindowToVram(windowId + 6, 3); + CopyWindowToVram(windowId + 6, COPYWIN_FULL); AddTextPrinter(&textPrinter, 0, NULL); // Print right trainer's name. @@ -4897,7 +4897,7 @@ static void DisplayMatchInfoOnCard(u8 flags, u8 matchNo) textPrinter.currentX = GetStringCenterAlignXOffsetWithLetterSpacing(textPrinter.fontId, textPrinter.currentChar, 0x40, textPrinter.letterSpacing); textPrinter.currentY = textPrinter.y = 2; PutWindowTilemap(windowId + 7); - CopyWindowToVram(windowId + 7, 3); + CopyWindowToVram(windowId + 7, COPYWIN_FULL); AddTextPrinter(&textPrinter, 0, NULL); // Print match number. @@ -4907,7 +4907,7 @@ static void DisplayMatchInfoOnCard(u8 flags, u8 matchNo) textPrinter.currentX = GetStringCenterAlignXOffsetWithLetterSpacing(textPrinter.fontId, textPrinter.currentChar, 0xA0, textPrinter.letterSpacing); textPrinter.currentY = textPrinter.y = 2; PutWindowTilemap(windowId + 5); - CopyWindowToVram(windowId + 5, 3); + CopyWindowToVram(windowId + 5, COPYWIN_FULL); AddTextPrinter(&textPrinter, 0, NULL); } @@ -5442,9 +5442,9 @@ static void Task_ShowTourneyTree(u8 taskId) PutWindowTilemap(0); PutWindowTilemap(1); PutWindowTilemap(2); - CopyWindowToVram(0, 3); - CopyWindowToVram(1, 3); - CopyWindowToVram(2, 3); + CopyWindowToVram(0, COPYWIN_FULL); + CopyWindowToVram(1, COPYWIN_FULL); + CopyWindowToVram(2, COPYWIN_FULL); SetHBlankCallback(HblankCb_TourneyTree); SetVBlankCallback(VblankCb_TourneyTree); if (r4 == 2) diff --git a/src/battle_factory_screen.c b/src/battle_factory_screen.c index cd0a44e38..98caada1d 100644 --- a/src/battle_factory_screen.c +++ b/src/battle_factory_screen.c @@ -1854,7 +1854,7 @@ static void Select_ErasePopupMenu(u8 windowId) gSprites[sFactorySelectScreen->menuCursor1SpriteId].invisible = TRUE; gSprites[sFactorySelectScreen->menuCursor2SpriteId].invisible = TRUE; FillWindowPixelBuffer(windowId, PIXEL_FILL(0)); - CopyWindowToVram(windowId, 2); + CopyWindowToVram(windowId, COPYWIN_GFX); ClearWindowTilemap(windowId); } @@ -1862,7 +1862,7 @@ static void Select_PrintRentalPkmnString(void) { FillWindowPixelBuffer(SELECT_WIN_TITLE, PIXEL_FILL(0)); AddTextPrinterParameterized(SELECT_WIN_TITLE, FONT_NORMAL, gText_RentalPkmn2, 2, 1, 0, NULL); - CopyWindowToVram(SELECT_WIN_TITLE, 3); + CopyWindowToVram(SELECT_WIN_TITLE, COPYWIN_FULL); } static void Select_PrintMonSpecies(void) @@ -1876,7 +1876,7 @@ static void Select_PrintMonSpecies(void) StringCopy(gStringVar4, gSpeciesNames[species]); x = GetStringRightAlignXOffset(FONT_NORMAL, gStringVar4, 86); AddTextPrinterParameterized3(SELECT_WIN_SPECIES, FONT_NORMAL, x, 1, sSpeciesNameTextColors, 0, gStringVar4); - CopyWindowToVram(SELECT_WIN_SPECIES, 2); + CopyWindowToVram(SELECT_WIN_SPECIES, COPYWIN_GFX); } static void Select_PrintSelectMonString(void) @@ -1894,14 +1894,14 @@ static void Select_PrintSelectMonString(void) str = gText_TheseThreePkmnOkay; AddTextPrinterParameterized(SELECT_WIN_INFO, FONT_NORMAL, str, 2, 5, 0, NULL); - CopyWindowToVram(SELECT_WIN_INFO, 2); + CopyWindowToVram(SELECT_WIN_INFO, COPYWIN_GFX); } static void Select_PrintCantSelectSameMon(void) { FillWindowPixelBuffer(SELECT_WIN_INFO, PIXEL_FILL(0)); AddTextPrinterParameterized(SELECT_WIN_INFO, FONT_NORMAL, gText_CantSelectSamePkmn, 2, 5, 0, NULL); - CopyWindowToVram(SELECT_WIN_INFO, 2); + CopyWindowToVram(SELECT_WIN_INFO, COPYWIN_GFX); } static void Select_PrintMenuOptions(void) @@ -1917,7 +1917,7 @@ static void Select_PrintMenuOptions(void) AddTextPrinterParameterized3(SELECT_WIN_OPTIONS, FONT_NORMAL, 7, 17, sMenuOptionTextColors, 0, gText_Rent); AddTextPrinterParameterized3(SELECT_WIN_OPTIONS, FONT_NORMAL, 7, 33, sMenuOptionTextColors, 0, gText_Others2); - CopyWindowToVram(SELECT_WIN_OPTIONS, 3); + CopyWindowToVram(SELECT_WIN_OPTIONS, COPYWIN_FULL); } static void Select_PrintYesNoOptions(void) @@ -1926,7 +1926,7 @@ static void Select_PrintYesNoOptions(void) FillWindowPixelBuffer(SELECT_WIN_YES_NO, PIXEL_FILL(0)); AddTextPrinterParameterized3(SELECT_WIN_YES_NO, FONT_NORMAL, 7, 1, sMenuOptionTextColors, 0, gText_Yes2); AddTextPrinterParameterized3(SELECT_WIN_YES_NO, FONT_NORMAL, 7, 17, sMenuOptionTextColors, 0, gText_No2); - CopyWindowToVram(SELECT_WIN_YES_NO, 3); + CopyWindowToVram(SELECT_WIN_YES_NO, COPYWIN_FULL); } static u8 Select_RunMenuOptionFunc(void) @@ -1996,7 +1996,7 @@ static void Select_PrintMonCategory(void) CopyMonCategoryText(SpeciesToNationalPokedexNum(species), text); x = GetStringRightAlignXOffset(FONT_NORMAL, text, 0x76); AddTextPrinterParameterized(SELECT_WIN_MON_CATEGORY, FONT_NORMAL, text, x, 1, 0, NULL); - CopyWindowToVram(SELECT_WIN_MON_CATEGORY, 2); + CopyWindowToVram(SELECT_WIN_MON_CATEGORY, COPYWIN_GFX); } } @@ -3012,7 +3012,7 @@ static void Swap_Task_ScreenInfoTransitionOut(u8 taskId) if (!gPaletteFade.active) { FillWindowPixelBuffer(SWAP_WIN_ACTION_FADE, PIXEL_FILL(0)); - CopyWindowToVram(SWAP_WIN_ACTION_FADE, 2); + CopyWindowToVram(SWAP_WIN_ACTION_FADE, COPYWIN_GFX); if (sFactorySwapScreen->inEnemyScreen == TRUE) { // Start "Pkmn for Swap" button slide offscreen @@ -3150,7 +3150,7 @@ static void Swap_Task_ScreenInfoTransitionIn(u8 taskId) break; case 6: FillWindowPixelBuffer(SWAP_WIN_ACTION_FADE, PIXEL_FILL(0)); - CopyWindowToVram(SWAP_WIN_ACTION_FADE, 2); + CopyWindowToVram(SWAP_WIN_ACTION_FADE, COPYWIN_GFX); gTasks[taskId].tState++; break; case 7: @@ -3724,7 +3724,7 @@ static void Swap_ErasePopupMenu(u8 windowId) gSprites[sFactorySwapScreen->menuCursor1SpriteId].invisible = TRUE; gSprites[sFactorySwapScreen->menuCursor2SpriteId].invisible = TRUE; FillWindowPixelBuffer(windowId, PIXEL_FILL(0)); - CopyWindowToVram(windowId, 2); + CopyWindowToVram(windowId, COPYWIN_GFX); ClearWindowTilemap(windowId); } @@ -3732,14 +3732,14 @@ static void Swap_EraseSpeciesWindow(void) { PutWindowTilemap(SWAP_WIN_SPECIES); FillWindowPixelBuffer(SWAP_WIN_SPECIES, PIXEL_FILL(0)); - CopyWindowToVram(SWAP_WIN_SPECIES, 2); + CopyWindowToVram(SWAP_WIN_SPECIES, COPYWIN_GFX); } static void Swap_EraseSpeciesAtFadeWindow(void) { PutWindowTilemap(SWAP_WIN_SPECIES_AT_FADE); FillWindowPixelBuffer(SWAP_WIN_SPECIES_AT_FADE, PIXEL_FILL(0)); - CopyWindowToVram(SWAP_WIN_SPECIES_AT_FADE, 2); + CopyWindowToVram(SWAP_WIN_SPECIES_AT_FADE, COPYWIN_GFX); } static void Swap_EraseActionFadeWindow(void) @@ -3747,14 +3747,14 @@ static void Swap_EraseActionFadeWindow(void) Swap_EraseSpeciesWindow(); PutWindowTilemap(SWAP_WIN_ACTION_FADE); FillWindowPixelBuffer(SWAP_WIN_ACTION_FADE, PIXEL_FILL(0)); - CopyWindowToVram(SWAP_WIN_ACTION_FADE, 2); + CopyWindowToVram(SWAP_WIN_ACTION_FADE, COPYWIN_GFX); } static void Swap_PrintPkmnSwap(void) { FillWindowPixelBuffer(SWAP_WIN_TITLE, PIXEL_FILL(1)); AddTextPrinterParameterized(SWAP_WIN_TITLE, FONT_NORMAL, gText_PkmnSwap, 2, 1, 0, NULL); - CopyWindowToVram(SWAP_WIN_TITLE, 3); + CopyWindowToVram(SWAP_WIN_TITLE, COPYWIN_FULL); } static void Swap_PrintMonSpecies(void) @@ -3765,7 +3765,7 @@ static void Swap_PrintMonSpecies(void) FillWindowPixelBuffer(SWAP_WIN_SPECIES, PIXEL_FILL(0)); if (sFactorySwapScreen->cursorPos >= FRONTIER_PARTY_SIZE) { - CopyWindowToVram(SWAP_WIN_SPECIES, 2); + CopyWindowToVram(SWAP_WIN_SPECIES, COPYWIN_GFX); } else { @@ -3777,7 +3777,7 @@ static void Swap_PrintMonSpecies(void) StringCopy(gStringVar4, gSpeciesNames[species]); x = GetStringRightAlignXOffset(FONT_NORMAL, gStringVar4, 86); AddTextPrinterParameterized3(SWAP_WIN_SPECIES, FONT_NORMAL, x, 1, sSwapSpeciesNameTextColors, 0, gStringVar4); - CopyWindowToVram(SWAP_WIN_SPECIES, 3); + CopyWindowToVram(SWAP_WIN_SPECIES, COPYWIN_FULL); } } @@ -3785,7 +3785,7 @@ static void Swap_PrintOnInfoWindow(const u8 *str) { FillWindowPixelBuffer(SWAP_WIN_INFO, PIXEL_FILL(0)); AddTextPrinterParameterized(SWAP_WIN_INFO, FONT_NORMAL, str, 2, 5, 0, NULL); - CopyWindowToVram(SWAP_WIN_INFO, 2); + CopyWindowToVram(SWAP_WIN_INFO, COPYWIN_GFX); } static void Swap_PrintMenuOptions(void) @@ -3795,7 +3795,7 @@ static void Swap_PrintMenuOptions(void) AddTextPrinterParameterized3(SWAP_WIN_OPTIONS, FONT_NORMAL, 15, 1, sSwapMenuOptionsTextColors, 0, gText_Summary2); AddTextPrinterParameterized3(SWAP_WIN_OPTIONS, FONT_NORMAL, 15, 17, sSwapMenuOptionsTextColors, 0, gText_Swap); AddTextPrinterParameterized3(SWAP_WIN_OPTIONS, FONT_NORMAL, 15, 33, sSwapMenuOptionsTextColors, 0, gText_Rechoose); - CopyWindowToVram(SWAP_WIN_OPTIONS, 3); + CopyWindowToVram(SWAP_WIN_OPTIONS, COPYWIN_FULL); } static void Swap_PrintYesNoOptions(void) @@ -3804,7 +3804,7 @@ static void Swap_PrintYesNoOptions(void) FillWindowPixelBuffer(SWAP_WIN_YES_NO, PIXEL_FILL(0)); AddTextPrinterParameterized3(SWAP_WIN_YES_NO, FONT_NORMAL, 7, 1, sSwapMenuOptionsTextColors, 0, gText_Yes3); AddTextPrinterParameterized3(SWAP_WIN_YES_NO, FONT_NORMAL, 7, 17, sSwapMenuOptionsTextColors, 0, gText_No3); - CopyWindowToVram(SWAP_WIN_YES_NO, 3); + CopyWindowToVram(SWAP_WIN_YES_NO, COPYWIN_FULL); } static void Swap_PrintActionString(const u8 *str, u32 y, u32 windowId) @@ -3824,7 +3824,7 @@ static void Swap_PrintActionStrings(void) Swap_PrintActionString(gText_Cancel3, 24, SWAP_WIN_ACTION_FADE); break; } - CopyWindowToVram(SWAP_WIN_ACTION_FADE, 3); + CopyWindowToVram(SWAP_WIN_ACTION_FADE, COPYWIN_FULL); } static void Swap_PrintActionStrings2(void) @@ -3838,7 +3838,7 @@ static void Swap_PrintActionStrings2(void) Swap_PrintActionString(gText_Cancel3, 32, SWAP_WIN_OPTIONS); break; } - CopyWindowToVram(SWAP_WIN_OPTIONS, 3); + CopyWindowToVram(SWAP_WIN_OPTIONS, COPYWIN_FULL); } static void Swap_PrintOneActionString(u8 which) @@ -3853,7 +3853,7 @@ static void Swap_PrintOneActionString(u8 which) Swap_PrintActionString(gText_Cancel3, 32, SWAP_WIN_OPTIONS); break; } - CopyWindowToVram(SWAP_WIN_OPTIONS, 3); + CopyWindowToVram(SWAP_WIN_OPTIONS, COPYWIN_FULL); } // For printing the species name once its selected. Keep the current fade but don't keep fading in and out @@ -3874,7 +3874,7 @@ static void Swap_PrintMonSpeciesAtFade(void) FillWindowPixelBuffer(SWAP_WIN_SPECIES_AT_FADE, PIXEL_FILL(0)); if (sFactorySwapScreen->cursorPos >= FRONTIER_PARTY_SIZE) { - CopyWindowToVram(SWAP_WIN_SPECIES_AT_FADE, 3); + CopyWindowToVram(SWAP_WIN_SPECIES_AT_FADE, COPYWIN_FULL); } else { @@ -3886,7 +3886,7 @@ static void Swap_PrintMonSpeciesAtFade(void) StringCopy(gStringVar4, gSpeciesNames[species]); x = GetStringRightAlignXOffset(FONT_NORMAL, gStringVar4, 86); AddTextPrinterParameterized3(SWAP_WIN_SPECIES_AT_FADE, FONT_NORMAL, x, 1, sSwapSpeciesNameTextColors, 0, gStringVar4); - CopyWindowToVram(SWAP_WIN_SPECIES_AT_FADE, 3); + CopyWindowToVram(SWAP_WIN_SPECIES_AT_FADE, COPYWIN_FULL); } } @@ -3901,7 +3901,7 @@ static void Swap_PrintMonSpeciesForTransition(void) if (sFactorySwapScreen->cursorPos >= FRONTIER_PARTY_SIZE) { - CopyWindowToVram(SWAP_WIN_SPECIES, 2); + CopyWindowToVram(SWAP_WIN_SPECIES, COPYWIN_GFX); } else { @@ -3913,7 +3913,7 @@ static void Swap_PrintMonSpeciesForTransition(void) StringCopy(gStringVar4, gSpeciesNames[species]); x = GetStringRightAlignXOffset(FONT_NORMAL, gStringVar4, 86); AddTextPrinterParameterized3(SWAP_WIN_SPECIES, FONT_NORMAL, x, 1, sSwapSpeciesNameTextColors, 0, gStringVar4); - CopyWindowToVram(SWAP_WIN_SPECIES, 3); + CopyWindowToVram(SWAP_WIN_SPECIES, COPYWIN_FULL); } } @@ -3927,7 +3927,7 @@ static void Swap_PrintMonCategory(void) FillWindowPixelBuffer(SWAP_WIN_MON_CATEGORY, PIXEL_FILL(0)); if (monId >= FRONTIER_PARTY_SIZE) { - CopyWindowToVram(SWAP_WIN_MON_CATEGORY, 2); + CopyWindowToVram(SWAP_WIN_MON_CATEGORY, COPYWIN_GFX); } else { @@ -3939,7 +3939,7 @@ static void Swap_PrintMonCategory(void) CopyMonCategoryText(SpeciesToNationalPokedexNum(species), text); x = GetStringRightAlignXOffset(FONT_NORMAL, text, 0x76); AddTextPrinterParameterized(SWAP_WIN_MON_CATEGORY, FONT_NORMAL, text, x, 1, 0, NULL); - CopyWindowToVram(SWAP_WIN_MON_CATEGORY, 2); + CopyWindowToVram(SWAP_WIN_MON_CATEGORY, COPYWIN_GFX); } } @@ -4126,7 +4126,7 @@ static void Swap_TaskCantHaveSameMons(u8 taskId) if (sFactorySwapScreen->monPicAnimating != TRUE) { FillWindowPixelBuffer(SWAP_WIN_ACTION_FADE, PIXEL_FILL(0)); - CopyWindowToVram(SWAP_WIN_ACTION_FADE, 2); + CopyWindowToVram(SWAP_WIN_ACTION_FADE, COPYWIN_GFX); gTasks[taskId].tState++; } break; diff --git a/src/battle_message.c b/src/battle_message.c index 31f256e3c..b88eedfb3 100644 --- a/src/battle_message.c +++ b/src/battle_message.c @@ -3113,7 +3113,7 @@ void BattlePutTextOnWindow(const u8 *text, u8 windowId) if (copyToVram) { PutWindowTilemap(windowId); - CopyWindowToVram(windowId, 3); + CopyWindowToVram(windowId, COPYWIN_FULL); } } diff --git a/src/battle_records.c b/src/battle_records.c index 5c8c92d84..850feef59 100644 --- a/src/battle_records.c +++ b/src/battle_records.c @@ -334,7 +334,7 @@ void ShowLinkBattleRecords(void) } PutWindowTilemap(gRecordsWindowId); - CopyWindowToVram(gRecordsWindowId, 3); + CopyWindowToVram(gRecordsWindowId, COPYWIN_FULL); } void RemoveRecordsWindow(void) @@ -382,7 +382,7 @@ static void RemoveTrainerHillRecordsWindow(u8 windowId) { FillWindowPixelBuffer(windowId, PIXEL_FILL(0)); ClearWindowTilemap(windowId); - CopyWindowToVram(windowId, 2); + CopyWindowToVram(windowId, COPYWIN_GFX); RemoveWindow(windowId); } diff --git a/src/battle_script_commands.c b/src/battle_script_commands.c index 92e5b31e9..c3263099f 100644 --- a/src/battle_script_commands.c +++ b/src/battle_script_commands.c @@ -5921,7 +5921,7 @@ static void Cmd_drawlvlupbox(void) // Draw page 1 of level up box DrawLevelUpWindow1(); PutWindowTilemap(B_WIN_LEVEL_UP_BOX); - CopyWindowToVram(B_WIN_LEVEL_UP_BOX, 3); + CopyWindowToVram(B_WIN_LEVEL_UP_BOX, COPYWIN_FULL); gBattleScripting.drawlvlupboxState++; break; case 5: @@ -5939,7 +5939,7 @@ static void Cmd_drawlvlupbox(void) // Draw page 2 of level up box PlaySE(SE_SELECT); DrawLevelUpWindow2(); - CopyWindowToVram(B_WIN_LEVEL_UP_BOX, 2); + CopyWindowToVram(B_WIN_LEVEL_UP_BOX, COPYWIN_GFX); gBattleScripting.drawlvlupboxState++; } break; @@ -5956,10 +5956,10 @@ static void Cmd_drawlvlupbox(void) if (!SlideOutLevelUpBanner()) { ClearWindowTilemap(B_WIN_LEVEL_UP_BANNER); - CopyWindowToVram(B_WIN_LEVEL_UP_BANNER, 1); + CopyWindowToVram(B_WIN_LEVEL_UP_BANNER, COPYWIN_MAP); ClearWindowTilemap(B_WIN_LEVEL_UP_BOX); - CopyWindowToVram(B_WIN_LEVEL_UP_BOX, 1); + CopyWindowToVram(B_WIN_LEVEL_UP_BOX, COPYWIN_MAP); SetBgAttribute(2, BG_ATTR_PRIORITY, 2); ShowBg(2); @@ -6004,7 +6004,7 @@ static void InitLevelUpBanner(void) LoadPalette(sLevelUpBanner_Pal, 0x60, 0x20); CopyToWindowPixelBuffer(B_WIN_LEVEL_UP_BANNER, sLevelUpBanner_Gfx, 0, 0); PutWindowTilemap(B_WIN_LEVEL_UP_BANNER); - CopyWindowToVram(B_WIN_LEVEL_UP_BANNER, 3); + CopyWindowToVram(B_WIN_LEVEL_UP_BANNER, COPYWIN_FULL); PutMonIconOnLvlUpBanner(); } @@ -6085,7 +6085,7 @@ static void DrawLevelUpBannerText(void) printerTemplate.currentY = 10; AddTextPrinter(&printerTemplate, TEXT_SPEED_FF, NULL); - CopyWindowToVram(B_WIN_LEVEL_UP_BANNER, 2); + CopyWindowToVram(B_WIN_LEVEL_UP_BANNER, COPYWIN_GFX); } static bool8 SlideOutLevelUpBanner(void) diff --git a/src/berry_blender.c b/src/berry_blender.c index 65008dae0..6603f91fb 100644 --- a/src/berry_blender.c +++ b/src/berry_blender.c @@ -1616,7 +1616,7 @@ static void PrintPlayerNames(void) Blender_AddTextPrinter(i, text, xPos, 1, 0, 1); PutWindowTilemap(i); - CopyWindowToVram(i, 3); + CopyWindowToVram(i, COPYWIN_FULL); } } } @@ -2684,7 +2684,7 @@ static void CB2_EndBlenderGame(void) if (sBerryBlender->arrowIdToPlayerId[i] != NO_PLAYER) { PutWindowTilemap(i); - CopyWindowToVram(i, 3); + CopyWindowToVram(i, COPYWIN_FULL); } } break; @@ -2696,7 +2696,7 @@ static void CB2_EndBlenderGame(void) if (sBerryBlender->arrowIdToPlayerId[i] != NO_PLAYER) { PutWindowTilemap(i); - CopyWindowToVram(i, 3); + CopyWindowToVram(i, COPYWIN_FULL); } } break; @@ -3545,7 +3545,7 @@ static bool8 PrintBlendingResults(void) sBerryBlender->framesToWait = 0; sBerryBlender->mainState++; - CopyWindowToVram(5, 2); + CopyWindowToVram(5, COPYWIN_GFX); } break; case 4: @@ -3562,7 +3562,7 @@ static bool8 PrintBlendingResults(void) if (sBerryBlender->arrowIdToPlayerId[i] != NO_PLAYER) { PutWindowTilemap(i); - CopyWindowToVram(i, 3); + CopyWindowToVram(i, COPYWIN_FULL); } } @@ -3731,7 +3731,7 @@ static bool8 PrintBlendingRanking(void) } PutWindowTilemap(5); - CopyWindowToVram(5, 3); + CopyWindowToVram(5, COPYWIN_FULL); sBerryBlender->framesToWait = 0; sBerryBlender->mainState++; @@ -3788,7 +3788,7 @@ void ShowBerryBlenderRecordWindow(void) } PutWindowTilemap(gRecordsWindowId); - CopyWindowToVram(gRecordsWindowId, 3); + CopyWindowToVram(gRecordsWindowId, COPYWIN_FULL); } static void Task_PlayPokeblockFanfare(u8 taskId) @@ -3890,7 +3890,7 @@ static bool32 Blender_PrintText(s16 *textState, const u8 *string, s32 textSpeed) DrawDialogFrameWithCustomTileAndPalette(4, FALSE, 0x14, 0xF); Blender_AddTextPrinter(4, string, 0, 1, textSpeed, 0); PutWindowTilemap(4); - CopyWindowToVram(4, 3); + CopyWindowToVram(4, COPYWIN_FULL); (*textState)++; break; case 1: diff --git a/src/berry_crush.c b/src/berry_crush.c index 8ac6bb312..10f7987e0 100755 --- a/src/berry_crush.c +++ b/src/berry_crush.c @@ -1778,7 +1778,7 @@ static bool32 OpenResultsWindow(struct BerryCrushGame *game, struct BerryCrushGa PrintCrushingResults(game); break; case 5: - CopyWindowToVram(gfx->resultsWindowId, 3); + CopyWindowToVram(gfx->resultsWindowId, COPYWIN_FULL); gfx->resultsState = 0; return TRUE; } @@ -1841,7 +1841,7 @@ static void Task_ShowRankings(u8 taskId) yPos += 16; score = 0; } - CopyWindowToVram(tWindowId, 3); + CopyWindowToVram(tWindowId, COPYWIN_FULL); break; case 2: if (JOY_NEW(A_BUTTON | B_BUTTON)) @@ -1938,7 +1938,7 @@ static void DrawPlayerNameWindows(struct BerryCrushGame *game) game->players[i].name ); } - CopyWindowToVram(game->gfx.nameWindowIds[i], 3); + CopyWindowToVram(game->gfx.nameWindowIds[i], COPYWIN_FULL); } CopyBgTilemapBufferToVram(0); } @@ -2264,7 +2264,7 @@ static u32 Cmd_PrintMessage(struct BerryCrushGame *game, u8 *args) { AddTextPrinterParameterized2(0, FONT_NORMAL, sMessages[args[0]], game->textSpeed, 0, 2, 1, 3); } - CopyWindowToVram(0, 3); + CopyWindowToVram(0, COPYWIN_FULL); break; case 1: if (!IsTextPrinterActive(0)) @@ -3243,7 +3243,7 @@ static u32 Cmd_SaveGame(struct BerryCrushGame *game, u8 *args) return 0; DrawDialogueFrame(0, 0); AddTextPrinterParameterized2(0, FONT_NORMAL, gText_SavingDontTurnOffPower, 0, 0, 2, 1, 3); - CopyWindowToVram(0, 3); + CopyWindowToVram(0, COPYWIN_FULL); CreateTask(Task_LinkSave, 0); break; case 3: @@ -3394,7 +3394,7 @@ static u32 Cmd_StopGame(struct BerryCrushGame *game, u8 *args) AddTextPrinterParameterized2(0, FONT_NORMAL, sMessages[MSG_NO_BERRIES], game->textSpeed, 0, 2, 1, 3); else AddTextPrinterParameterized2(0, FONT_NORMAL, sMessages[MSG_DROPPED], game->textSpeed, 0, 2, 1, 3); - CopyWindowToVram(0, 3); + CopyWindowToVram(0, COPYWIN_FULL); break; case 1: if (IsTextPrinterActive(0)) diff --git a/src/berry_fix_program.c b/src/berry_fix_program.c index 9b0da5bd2..3a0e4c326 100644 --- a/src/berry_fix_program.c +++ b/src/berry_fix_program.c @@ -319,9 +319,9 @@ static void BerryFix_GpuSet(void) left = (208 - width) / 2; AddTextPrinterParameterized3(0, FONT_NORMAL, left, 2, sBerryProgramTextColors, TEXT_SPEED_FF, sText_BerryProgramUpdate); - CopyWindowToVram(2, 2); - CopyWindowToVram(3, 2); - CopyWindowToVram(0, 2); + CopyWindowToVram(2, COPYWIN_GFX); + CopyWindowToVram(3, COPYWIN_GFX); + CopyWindowToVram(0, COPYWIN_GFX); } static int BerryFix_TrySetScene(int scene) @@ -348,7 +348,7 @@ static void BerryFix_SetScene(int scene) FillWindowPixelBuffer(1, PIXEL_FILL(10)); AddTextPrinterParameterized3(1, FONT_NORMAL, 0, 0, sBerryProgramTextColors, -1, sBerryProgramTexts[scene]); PutWindowTilemap(1); - CopyWindowToVram(1, 2); + CopyWindowToVram(1, COPYWIN_GFX); switch (scene) { case SCENE_ENSURE_CONNECT: diff --git a/src/braille.c b/src/braille.c index 4e22a12ef..e9c2ddc40 100644 --- a/src/braille.c +++ b/src/braille.c @@ -177,7 +177,7 @@ u16 FontFunc_Braille(struct TextPrinter *textPrinter) ScrollWindow(textPrinter->printerTemplate.windowId, 0, sScrollDistances[gSaveBlock2Ptr->optionsTextSpeed], PIXEL_FILL(textPrinter->printerTemplate.bgColor)); textPrinter->scrollDistance -= sScrollDistances[gSaveBlock2Ptr->optionsTextSpeed]; } - CopyWindowToVram(textPrinter->printerTemplate.windowId, 2); + CopyWindowToVram(textPrinter->printerTemplate.windowId, COPYWIN_GFX); } else { diff --git a/src/cable_club.c b/src/cable_club.c index 1284aee77..ef1d9ff0d 100644 --- a/src/cable_club.c +++ b/src/cable_club.c @@ -101,15 +101,15 @@ static void PrintNumPlayersInLink(u16 windowId, u32 numPlayers) StringExpandPlaceholders(gStringVar4, gText_NumPlayerLink); xPos = GetStringCenterAlignXOffset(FONT_NORMAL, gStringVar4, 88); AddTextPrinterParameterized(windowId, FONT_NORMAL, gStringVar4, xPos, 1, 0xFF, NULL); - CopyWindowToVram(windowId, 3); + CopyWindowToVram(windowId, COPYWIN_FULL); } static void ClearLinkPlayerCountWindow(u16 windowId) { - // Following this call with a copy-to-vram with mode 3 is identical to + // Following this call with a copy-to-vram with mode COPYWIN_FULL is identical to // calling ClearStdWindowAndFrame(windowId, TRUE). ClearStdWindowAndFrame(windowId, FALSE); - CopyWindowToVram(windowId, 3); + CopyWindowToVram(windowId, COPYWIN_FULL); } static void UpdateLinkPlayerCountDisplay(u8 taskId, u8 numPlayers) diff --git a/src/contest.c b/src/contest.c index 1cd8f18b0..b5a035ff8 100644 --- a/src/contest.c +++ b/src/contest.c @@ -1667,7 +1667,7 @@ static void Task_HideMoveSelectScreen(u8 taskId) { FillWindowPixelBuffer(MOVE_WINDOWS_START + i, PIXEL_FILL(0)); PutWindowTilemap(MOVE_WINDOWS_START + i); - CopyWindowToVram(MOVE_WINDOWS_START + i, 2); + CopyWindowToVram(MOVE_WINDOWS_START + i, COPYWIN_GFX); } Contest_SetBgCopyFlags(0); // This seems to be a bug; it should have just copied PLTT_BUFFER_SIZE. @@ -3377,7 +3377,7 @@ static void DrawStatusSymbols(void) static void ContestClearGeneralTextWindow(void) { FillWindowPixelBuffer(WIN_GENERAL_TEXT, PIXEL_FILL(0)); - CopyWindowToVram(WIN_GENERAL_TEXT, 2); + CopyWindowToVram(WIN_GENERAL_TEXT, COPYWIN_GFX); Contest_SetBgCopyFlags(0); } diff --git a/src/contest_painting.c b/src/contest_painting.c index db6bf4455..84b160eb8 100644 --- a/src/contest_painting.c +++ b/src/contest_painting.c @@ -274,7 +274,7 @@ static void InitContestPaintingWindow(void) DeactivateAllTextPrinters(); FillWindowPixelBuffer(sWindowId, PIXEL_FILL(0)); PutWindowTilemap(sWindowId); - CopyWindowToVram(sWindowId, 3); + CopyWindowToVram(sWindowId, COPYWIN_FULL); ShowBg(1); } diff --git a/src/credits.c b/src/credits.c index de7597e32..0643f2c59 100644 --- a/src/credits.c +++ b/src/credits.c @@ -369,7 +369,7 @@ static void InitCreditsBgsAndWindows(void) InitWindows(sWindowTemplates); DeactivateAllTextPrinters(); PutWindowTilemap(0); - CopyWindowToVram(0, 3); + CopyWindowToVram(0, COPYWIN_FULL); ShowBg(0); } @@ -761,7 +761,7 @@ static void Task_UpdatePage(u8 taskId) sCreditsEntryPointerTable[gTasks[taskId].tCurrentPage][i]->text, 5 + i * 16, sCreditsEntryPointerTable[gTasks[taskId].tCurrentPage][i]->isTitle); - CopyWindowToVram(0, 2); + CopyWindowToVram(0, COPYWIN_GFX); gTasks[taskId].tCurrentPage++; gTasks[taskId].tState++; @@ -811,7 +811,7 @@ static void Task_UpdatePage(u8 taskId) { // Still more Credits pages to show, return to state 2 to print FillWindowPixelBuffer(0, PIXEL_FILL(0)); - CopyWindowToVram(0, 2); + CopyWindowToVram(0, COPYWIN_GFX); gTasks[taskId].tState = 2; } return; diff --git a/src/daycare.c b/src/daycare.c index eb17147b5..ce11e4375 100644 --- a/src/daycare.c +++ b/src/daycare.c @@ -1285,7 +1285,7 @@ void ShowDaycareLevelMenu(void) menuTemplate.windowId = windowId; listMenuTaskId = ListMenuInit(&menuTemplate, 0, 0); - CopyWindowToVram(windowId, 3); + CopyWindowToVram(windowId, COPYWIN_FULL); daycareMenuTaskId = CreateTask(Task_HandleDaycareLevelMenuInput, 3); gTasks[daycareMenuTaskId].tMenuListTaskId = listMenuTaskId; diff --git a/src/diploma.c b/src/diploma.c index ffb1447eb..6b1b7fbf5 100644 --- a/src/diploma.c +++ b/src/diploma.c @@ -140,7 +140,7 @@ static void DisplayDiplomaText(void) StringExpandPlaceholders(gStringVar4, gText_PokedexDiploma); PrintDiplomaText(gStringVar4, 0, 1); PutWindowTilemap(0); - CopyWindowToVram(0, 3); + CopyWindowToVram(0, COPYWIN_FULL); } static const struct BgTemplate sDiplomaBgTemplates[2] = diff --git a/src/dodrio_berry_picking.c b/src/dodrio_berry_picking.c index 838e8ed94..41060415e 100644 --- a/src/dodrio_berry_picking.c +++ b/src/dodrio_berry_picking.c @@ -2968,7 +2968,7 @@ static void Task_ShowDodrioBerryPickingRecords(u8 taskId) window.width = width; tWindowId = AddWindow(&window); PrintRecordsText(tWindowId, width); - CopyWindowToVram(tWindowId, 3); + CopyWindowToVram(tWindowId, COPYWIN_FULL); tState++; break; case 1: @@ -2979,7 +2979,7 @@ static void Task_ShowDodrioBerryPickingRecords(u8 taskId) if (JOY_NEW(A_BUTTON | B_BUTTON)) { rbox_fill_rectangle(tWindowId); - CopyWindowToVram(tWindowId, 1); + CopyWindowToVram(tWindowId, COPYWIN_MAP); tState++; } break; @@ -4650,7 +4650,7 @@ static void ShowNames(void) colorsId = COLORID_BLUE; name = GetPlayerName(playerId); AddTextPrinterParameterized3(sGfx->windowIds[i], FONT_NORMAL, left, 1, sTextColorTable[colorsId], -1, name); - CopyWindowToVram(sGfx->windowIds[i], 2); + CopyWindowToVram(sGfx->windowIds[i], COPYWIN_GFX); window.baseBlock += 0xE; DrawMessageWindow(&window); } @@ -4798,8 +4798,8 @@ static void ShowResults(void) AddTextPrinterParameterized(sGfx->windowIds[1], FONT_NORMAL, gStringVar4, sResultsXCoords[j] - width, sResultsYCoords[i], -1, NULL); } } - CopyWindowToVram(sGfx->windowIds[0], 2); - CopyWindowToVram(sGfx->windowIds[1], 2); + CopyWindowToVram(sGfx->windowIds[0], COPYWIN_GFX); + CopyWindowToVram(sGfx->windowIds[1], COPYWIN_GFX); sGfx->state++; break; case 3: @@ -4831,8 +4831,8 @@ static void ShowResults(void) break; case 6: PrintRankedScores(numPlayers); - CopyWindowToVram(sGfx->windowIds[0], 2); - CopyWindowToVram(sGfx->windowIds[1], 2); + CopyWindowToVram(sGfx->windowIds[0], COPYWIN_GFX); + CopyWindowToVram(sGfx->windowIds[1], COPYWIN_GFX); sGfx->state++; break; case 7: @@ -4890,8 +4890,8 @@ static void ShowResults(void) DynamicPlaceholderTextUtil_ExpandPlaceholders(gStringVar4, gText_FilledStorageSpace); AddTextPrinterParameterized(sGfx->windowIds[1], FONT_NORMAL, gStringVar4, 0, 41, -1, NULL); } - CopyWindowToVram(sGfx->windowIds[0], 2); - CopyWindowToVram(sGfx->windowIds[1], 2); + CopyWindowToVram(sGfx->windowIds[0], COPYWIN_GFX); + CopyWindowToVram(sGfx->windowIds[1], COPYWIN_GFX); sGfx->state++; break; case 10: @@ -4950,8 +4950,8 @@ static void Msg_WantToPlayAgain(void) AddTextPrinterParameterized(sGfx->windowIds[WIN_YES_NO], FONT_NORMAL, gText_Yes, 8, 1, -1, NULL); AddTextPrinterParameterized(sGfx->windowIds[WIN_YES_NO], FONT_NORMAL, gText_No, 8, 17, -1, NULL); AddTextPrinterParameterized(sGfx->windowIds[WIN_YES_NO], FONT_NORMAL, gText_SelectorArrow2, 0, 1, -1, NULL); - CopyWindowToVram(sGfx->windowIds[WIN_PLAY_AGAIN], 2); - CopyWindowToVram(sGfx->windowIds[WIN_YES_NO], 2); + CopyWindowToVram(sGfx->windowIds[WIN_PLAY_AGAIN], COPYWIN_GFX); + CopyWindowToVram(sGfx->windowIds[WIN_YES_NO], COPYWIN_GFX); sGfx->state++; break; case 2: @@ -4973,7 +4973,7 @@ static void Msg_WantToPlayAgain(void) AddTextPrinterParameterized(sGfx->windowIds[WIN_YES_NO], FONT_NORMAL, gText_Yes, 8, 1, -1, NULL); AddTextPrinterParameterized(sGfx->windowIds[WIN_YES_NO], FONT_NORMAL, gText_No, 8, 17, -1, NULL); AddTextPrinterParameterized(sGfx->windowIds[WIN_YES_NO], FONT_NORMAL, gText_SelectorArrow2, 0, ((y - 1) * 16) + 1, -1, NULL); - CopyWindowToVram(sGfx->windowIds[WIN_YES_NO], 3); + CopyWindowToVram(sGfx->windowIds[WIN_YES_NO], COPYWIN_FULL); // Increment state only if A or B button have been pressed. if (JOY_NEW(A_BUTTON)) @@ -5029,7 +5029,7 @@ static void Msg_SavingDontTurnOff(void) sGfx->state++; break; case 1: - CopyWindowToVram(0, 3); + CopyWindowToVram(0, COPYWIN_FULL); sGfx->state++; break; case 2: @@ -5064,7 +5064,7 @@ static void Msg_CommunicationStandby(void) case 1: FillWindowPixelBuffer(sGfx->windowIds[0], PIXEL_FILL(1)); AddTextPrinterParameterized(sGfx->windowIds[0], FONT_NORMAL, gText_CommunicationStandby3, 0, 5, -1, NULL); - CopyWindowToVram(sGfx->windowIds[0], 2); + CopyWindowToVram(sGfx->windowIds[0], COPYWIN_GFX); sGfx->state++; break; case 2: @@ -5104,7 +5104,7 @@ static void Msg_SomeoneDroppedOut(void) case 1: FillWindowPixelBuffer(sGfx->windowIds[0], PIXEL_FILL(1)); AddTextPrinterParameterized(sGfx->windowIds[0], FONT_NORMAL, gText_SomeoneDroppedOut, 0, 5, -1, NULL); - CopyWindowToVram(sGfx->windowIds[0], 2); + CopyWindowToVram(sGfx->windowIds[0], COPYWIN_GFX); sGfx->state++; break; case 2: diff --git a/src/easy_chat.c b/src/easy_chat.c index ff4049cd7..078e07eb2 100644 --- a/src/easy_chat.c +++ b/src/easy_chat.c @@ -3934,7 +3934,7 @@ static void PrintTitle(void) FillWindowPixelBuffer(0, PIXEL_FILL(0)); PrintEasyChatTextWithColors(0, FONT_NORMAL, titleText, xOffset, 1, TEXT_SPEED_FF, TEXT_COLOR_TRANSPARENT, TEXT_COLOR_DARK_GRAY, TEXT_COLOR_LIGHT_GRAY); PutWindowTilemap(0); - CopyWindowToVram(0, 3); + CopyWindowToVram(0, COPYWIN_FULL); } static void PrintEasyChatText(u8 windowId, u8 fontId, const u8 *str, u8 x, u8 y, u8 speed, void (*callback)(struct TextPrinterTemplate *, u16)) @@ -4008,7 +4008,7 @@ static void PrintEasyChatStdMessage(u8 msgId) if (text2) PrintEasyChatText(1, FONT_NORMAL, text2, 0, 17, TEXT_SPEED_FF, 0); - CopyWindowToVram(1, 3); + CopyWindowToVram(1, COPYWIN_FULL); } static void CreateEasyChatYesNoMenu(u8 initialCursorPos) @@ -4102,7 +4102,7 @@ static void PrintCurrentPhrase(void) PrintEasyChatText(sScreenControl->windowId, FONT_NORMAL, sScreenControl->phrasePrintBuffer, 0, i * 16 + 1, TEXT_SPEED_FF, 0); } - CopyWindowToVram(sScreenControl->windowId, 3); + CopyWindowToVram(sScreenControl->windowId, COPYWIN_FULL); } static void BufferFrameTilemap(u16 *tilemap) @@ -4216,7 +4216,7 @@ static void InitLowerWindowText(u32 whichText) break; } - CopyWindowToVram(2, 2); + CopyWindowToVram(2, COPYWIN_GFX); } static void PrintKeyboardText(void) @@ -4337,7 +4337,7 @@ static void PrintWordSelectText(u8 scrollOffset, u8 numRows) y += 16; } - CopyWindowToVram(2, 2); + CopyWindowToVram(2, COPYWIN_GFX); } static void EraseWordSelectRows(u8 scrollOffset, u8 numRows) @@ -4369,7 +4369,7 @@ static void EraseWordSelectRows(u8 scrollOffset, u8 numRows) static void ClearWordSelectWindow(void) { FillWindowPixelBuffer(2, PIXEL_FILL(1)); - CopyWindowToVram(2, 2); + CopyWindowToVram(2, COPYWIN_GFX); } static void InitLowerWindowAnim(int winAnimType) diff --git a/src/egg_hatch.c b/src/egg_hatch.c index 25a61fcf6..c705cf24b 100644 --- a/src/egg_hatch.c +++ b/src/egg_hatch.c @@ -644,7 +644,7 @@ static void CB2_EggHatch_1(void) PlayFanfare(MUS_EVOLVED); sEggHatchData->CB2_state++; PutWindowTilemap(sEggHatchData->windowId); - CopyWindowToVram(sEggHatchData->windowId, 3); + CopyWindowToVram(sEggHatchData->windowId, COPYWIN_FULL); break; case 6: if (IsFanfareTaskInactive()) diff --git a/src/field_region_map.c b/src/field_region_map.c index 9dcc65c9a..26ae736a6 100644 --- a/src/field_region_map.c +++ b/src/field_region_map.c @@ -213,6 +213,6 @@ static void PrintRegionMapSecName(void) else { FillWindowPixelBuffer(0, PIXEL_FILL(1)); - CopyWindowToVram(0, 3); + CopyWindowToVram(0, COPYWIN_FULL); } } diff --git a/src/field_specials.c b/src/field_specials.c index c85940162..96cef93ba 100644 --- a/src/field_specials.c +++ b/src/field_specials.c @@ -1917,7 +1917,7 @@ void ShowDeptStoreElevatorFloorSelect(void) AddTextPrinterParameterized(sTutorMoveAndElevatorWindowId, FONT_NORMAL, gDeptStoreFloorNames[gSpecialVar_0x8005], xPos, 17, TEXT_SPEED_FF, NULL); PutWindowTilemap(sTutorMoveAndElevatorWindowId); - CopyWindowToVram(sTutorMoveAndElevatorWindowId, 3); + CopyWindowToVram(sTutorMoveAndElevatorWindowId, COPYWIN_FULL); } void CloseDeptStoreElevatorWindow(void) @@ -2723,7 +2723,7 @@ static void CloseScrollableMultichoice(u8 taskId) Free(sScrollableMultichoice_ListMenuItem); ClearStdWindowAndFrameToTransparent(task->tWindowId, 1); FillWindowPixelBuffer(task->tWindowId, PIXEL_FILL(0)); - CopyWindowToVram(task->tWindowId, 2); + CopyWindowToVram(task->tWindowId, COPYWIN_GFX); RemoveWindow(task->tWindowId); DestroyTask(taskId); EnableBothScriptContexts(); @@ -2976,7 +2976,7 @@ void ShowBattlePointsWindow(void) sBattlePointsWindowId = AddWindow(&sBattlePoints_WindowTemplate); SetStandardWindowBorderStyle(sBattlePointsWindowId, 0); UpdateBattlePointsWindow(); - CopyWindowToVram(sBattlePointsWindowId, 2); + CopyWindowToVram(sBattlePointsWindowId, COPYWIN_GFX); } void CloseBattlePointsWindow(void) @@ -2988,25 +2988,17 @@ void CloseBattlePointsWindow(void) void TakeFrontierBattlePoints(void) { if (gSaveBlock2Ptr->frontier.battlePoints < gSpecialVar_0x8004) - { gSaveBlock2Ptr->frontier.battlePoints = 0; - } else - { gSaveBlock2Ptr->frontier.battlePoints -= gSpecialVar_0x8004; - } } void GiveFrontierBattlePoints(void) { if (gSaveBlock2Ptr->frontier.battlePoints + gSpecialVar_0x8004 > MAX_BATTLE_FRONTIER_POINTS) - { gSaveBlock2Ptr->frontier.battlePoints = MAX_BATTLE_FRONTIER_POINTS; - } else - { gSaveBlock2Ptr->frontier.battlePoints = gSaveBlock2Ptr->frontier.battlePoints + gSpecialVar_0x8004; - } } u16 GetFrontierBattlePoints(void) @@ -3028,7 +3020,7 @@ void ShowFrontierExchangeCornerItemIconWindow(void) sFrontierExchangeCorner_ItemIconWindowId = AddWindow(&sFrontierExchangeCorner_ItemIconWindowTemplate); SetStandardWindowBorderStyle(sFrontierExchangeCorner_ItemIconWindowId, 0); - CopyWindowToVram(sFrontierExchangeCorner_ItemIconWindowId, 2); + CopyWindowToVram(sFrontierExchangeCorner_ItemIconWindowId, COPYWIN_GFX); } void CloseFrontierExchangeCornerItemIconWindow(void) @@ -3248,7 +3240,7 @@ void ScrollableMultichoice_RedrawPersistentMenu(void) AddTextPrinterParameterized(task->tWindowId, FONT_NORMAL, gText_SelectorArrow, 0, selectedRow * 16, TEXT_SPEED_FF, NULL); PutWindowTilemap(task->tWindowId); - CopyWindowToVram(task->tWindowId, 3); + CopyWindowToVram(task->tWindowId, COPYWIN_FULL); } } @@ -3303,7 +3295,7 @@ void ScrollableMultichoice_ClosePersistentMenu(void) ClearStdWindowAndFrameToTransparent(task->tWindowId, TRUE); FillWindowPixelBuffer(task->tWindowId, PIXEL_FILL(0)); ClearWindowTilemap(task->tWindowId); - CopyWindowToVram(task->tWindowId, 2); + CopyWindowToVram(task->tWindowId, COPYWIN_GFX); RemoveWindow(task->tWindowId); DestroyTask(taskId); } diff --git a/src/frontier_pass.c b/src/frontier_pass.c index 699e19c7a..9dfd5e935 100644 --- a/src/frontier_pass.c +++ b/src/frontier_pass.c @@ -1166,7 +1166,7 @@ static void ShowAndPrintWindows(void) PrintAreaDescription(sPassData->cursorArea); for (i = 0; i < WINDOW_COUNT; i++) - CopyWindowToVram(i, 3); + CopyWindowToVram(i, COPYWIN_FULL); CopyBgTilemapBufferToVram(0); } @@ -1180,7 +1180,7 @@ static void PrintAreaDescription(u8 cursorArea) else if (cursorArea != CURSOR_AREA_NOTHING) AddTextPrinterParameterized3(WINDOW_DESCRIPTION, FONT_NORMAL, 2, 0, sTextColors[1], 0, sPassAreaDescriptions[cursorArea]); - CopyWindowToVram(WINDOW_DESCRIPTION, 3); + CopyWindowToVram(WINDOW_DESCRIPTION, COPYWIN_FULL); CopyBgTilemapBufferToVram(0); } @@ -1723,7 +1723,7 @@ static void PrintOnFrontierMap(void) AddTextPrinterParameterized3(MAP_WINDOW_DESCRIPTION, FONT_NORMAL, 4, 0, sTextColors[0], 0, sMapLandmarks[sMapData->cursorPos].description); for (i = 0; i < MAP_WINDOW_COUNT; i++) - CopyWindowToVram(i, 3); + CopyWindowToVram(i, COPYWIN_FULL); CopyBgTilemapBufferToVram(0); } @@ -1755,7 +1755,7 @@ static void HandleFrontierMapCursorMove(u8 direction) AddTextPrinterParameterized3(MAP_WINDOW_DESCRIPTION, FONT_NORMAL, 4, 0, sTextColors[0], 0, sMapLandmarks[sMapData->cursorPos].description); for (i = 0; i < MAP_WINDOW_COUNT; i++) - CopyWindowToVram(i, 3); + CopyWindowToVram(i, COPYWIN_FULL); CopyBgTilemapBufferToVram(0); PlaySE(SE_DEX_SCROLL); diff --git a/src/frontier_util.c b/src/frontier_util.c index 25153b05c..88db7af1f 100644 --- a/src/frontier_util.c +++ b/src/frontier_util.c @@ -1064,7 +1064,7 @@ static void ShowTowerResultsWindow(u8 battleMode) TowerPrintPrevOrCurrentStreak(battleMode, FRONTIER_LVL_OPEN, 72, 132, 97); TowerPrintRecordStreak(battleMode, FRONTIER_LVL_OPEN, 72, 132, 113); PutWindowTilemap(gRecordsWindowId); - CopyWindowToVram(gRecordsWindowId, 3); + CopyWindowToVram(gRecordsWindowId, COPYWIN_FULL); } // Battle Dome records. @@ -1133,7 +1133,7 @@ static void ShowDomeResultsWindow(u8 battleMode) PrintTwoStrings(gText_Record, gText_ClearStreak, gSaveBlock2Ptr->frontier.domeRecordWinStreaks[battleMode][FRONTIER_LVL_OPEN], 64, 121, 113); PrintTwoStrings(gText_Total, gText_Championships, gSaveBlock2Ptr->frontier.domeTotalChampionships[battleMode][FRONTIER_LVL_OPEN], 64, 112, 129); PutWindowTilemap(gRecordsWindowId); - CopyWindowToVram(gRecordsWindowId, 3); + CopyWindowToVram(gRecordsWindowId, COPYWIN_FULL); } // Battle Palace records. @@ -1207,7 +1207,7 @@ static void ShowPalaceResultsWindow(u8 battleMode) PalacePrintPrevOrCurrentStreak(battleMode, FRONTIER_LVL_OPEN, 72, 131, 97); PalacePrintRecordStreak(battleMode, FRONTIER_LVL_OPEN, 72, 131, 113); PutWindowTilemap(gRecordsWindowId); - CopyWindowToVram(gRecordsWindowId, 3); + CopyWindowToVram(gRecordsWindowId, COPYWIN_FULL); } // Battle Pike records. @@ -1261,7 +1261,7 @@ static void ShowPikeResultsWindow(void) PikePrintCleared(gText_Record, gText_RoomsCleared, gSaveBlock2Ptr->frontier.pikeRecordStreaks[FRONTIER_LVL_OPEN], 64, 114, 113); PikePrintCleared(gText_Total, gText_TimesCleared, gSaveBlock2Ptr->frontier.pikeTotalStreaks[FRONTIER_LVL_OPEN], 64, 114, 129); PutWindowTilemap(gRecordsWindowId); - CopyWindowToVram(gRecordsWindowId, 3); + CopyWindowToVram(gRecordsWindowId, COPYWIN_FULL); } // Battle Arena records. @@ -1321,7 +1321,7 @@ static void ShowArenaResultsWindow(void) ArenaPrintPrevOrCurrentStreak(FRONTIER_LVL_OPEN, 72, 126, 97); ArenaPrintRecordStreak(FRONTIER_LVL_OPEN, 72, 126, 113); PutWindowTilemap(gRecordsWindowId); - CopyWindowToVram(gRecordsWindowId, 3); + CopyWindowToVram(gRecordsWindowId, COPYWIN_FULL); } // Battle Factory records. @@ -1412,7 +1412,7 @@ static void ShowFactoryResultsWindow(u8 battleMode) FactoryPrintPrevOrCurrentStreak(battleMode, FRONTIER_LVL_OPEN, 8, 64, 158, 113); FactoryPrintRecordStreak(battleMode, FRONTIER_LVL_OPEN, 8, 64, 158, 129); PutWindowTilemap(gRecordsWindowId); - CopyWindowToVram(gRecordsWindowId, 3); + CopyWindowToVram(gRecordsWindowId, COPYWIN_FULL); } // Battle Pyramid records. @@ -1472,7 +1472,7 @@ static void ShowPyramidResultsWindow(void) PyramidPrintPrevOrCurrentStreak(FRONTIER_LVL_OPEN, 64, 111, 97); PyramidPrintRecordStreak(FRONTIER_LVL_OPEN, 64, 111, 113); PutWindowTilemap(gRecordsWindowId); - CopyWindowToVram(gRecordsWindowId, 3); + CopyWindowToVram(gRecordsWindowId, COPYWIN_FULL); } // Link contest records. Why is it in this file? @@ -1523,7 +1523,7 @@ static void ShowLinkContestResultsWindow(void) } PutWindowTilemap(gRecordsWindowId); - CopyWindowToVram(gRecordsWindowId, 3); + CopyWindowToVram(gRecordsWindowId, COPYWIN_FULL); } static void CheckPutFrontierTVShowOnAir(void) @@ -2369,14 +2369,14 @@ void ShowRankingHallRecordsWindow(void) FillWindowPixelBuffer(gRecordsWindowId, PIXEL_FILL(1)); PrintHallRecords(gSpecialVar_0x8005, FRONTIER_LVL_50); PutWindowTilemap(gRecordsWindowId); - CopyWindowToVram(gRecordsWindowId, 3); + CopyWindowToVram(gRecordsWindowId, COPYWIN_FULL); } void ScrollRankingHallRecordsWindow(void) { FillWindowPixelBuffer(gRecordsWindowId, PIXEL_FILL(1)); PrintHallRecords(gSpecialVar_0x8005, FRONTIER_LVL_OPEN); - CopyWindowToVram(gRecordsWindowId, 2); + CopyWindowToVram(gRecordsWindowId, COPYWIN_GFX); } void ClearRankingHallRecords(void) diff --git a/src/hall_of_fame.c b/src/hall_of_fame.c index 8d69b03bc..58e062d50 100644 --- a/src/hall_of_fame.c +++ b/src/hall_of_fame.c @@ -515,7 +515,7 @@ static void Task_Hof_InitTeamSaveData(u8 taskId) DrawDialogueFrame(0, 0); AddTextPrinterParameterized2(0, FONT_NORMAL, gText_SavingDontTurnOffPower, 0, NULL, 2, 1, 3); - CopyWindowToVram(0, 3); + CopyWindowToVram(0, COPYWIN_FULL); gTasks[taskId].func = Task_Hof_TrySaveData; } @@ -676,7 +676,7 @@ static void Task_Hof_DoConfetti(u8 taskId) } BeginNormalPaletteFade(sHofFadePalettes, 0, 12, 12, RGB(16, 29, 24)); FillWindowPixelBuffer(0, PIXEL_FILL(0)); - CopyWindowToVram(0, 3); + CopyWindowToVram(0, COPYWIN_FULL); gTasks[taskId].tFrameCount = 7; gTasks[taskId].func = Task_Hof_WaitToDisplayPlayer; } @@ -725,7 +725,7 @@ static void Task_Hof_WaitAndPrintPlayerInfo(u8 taskId) HallOfFame_PrintPlayerInfo(1, 2); DrawDialogueFrame(0, 0); AddTextPrinterParameterized2(0, FONT_NORMAL, gText_LeagueChamp, 0, NULL, 2, 1, 3); - CopyWindowToVram(0, 3); + CopyWindowToVram(0, COPYWIN_FULL); gTasks[taskId].func = Task_Hof_ExitOnKeyPressed; } } @@ -1094,7 +1094,7 @@ static void Task_HofPC_PrintDataIsCorrupted(u8 taskId) sub_8198180(gText_AButtonExit, 8, TRUE); DrawDialogueFrame(0, 0); AddTextPrinterParameterized2(0, FONT_NORMAL, gText_HOFCorrupted, 0, NULL, 2, 1, 3); - CopyWindowToVram(0, 3); + CopyWindowToVram(0, COPYWIN_FULL); gTasks[taskId].func = Task_HofPC_ExitOnButtonPress; } @@ -1115,7 +1115,7 @@ static void HallOfFame_PrintWelcomeText(u8 unusedPossiblyWindowId, u8 unused2) FillWindowPixelBuffer(0, PIXEL_FILL(0)); PutWindowTilemap(0); AddTextPrinterParameterized3(0, FONT_NORMAL, GetStringCenterAlignXOffset(FONT_NORMAL, gText_WelcomeToHOF, 0xD0), 1, sMonInfoTextColors, 0, gText_WelcomeToHOF); - CopyWindowToVram(0, 3); + CopyWindowToVram(0, COPYWIN_FULL); } static void HallOfFame_PrintMonInfo(struct HallofFameMon* currMon, u8 unused1, u8 unused2) @@ -1160,7 +1160,7 @@ static void HallOfFame_PrintMonInfo(struct HallofFameMon* currMon, u8 unused1, u { width = GetStringCenterAlignXOffset(FONT_NORMAL, text, 0xD0); AddTextPrinterParameterized3(0, FONT_NORMAL, width, 1, sMonInfoTextColors, -1, text); - CopyWindowToVram(0, 3); + CopyWindowToVram(0, COPYWIN_FULL); } else { @@ -1196,7 +1196,7 @@ static void HallOfFame_PrintMonInfo(struct HallofFameMon* currMon, u8 unused1, u ConvertIntToDecimalStringN(stringPtr, (u16)(currMon->tid), STR_CONV_MODE_LEADING_ZEROS, 5); AddTextPrinterParameterized3(0, FONT_NORMAL, 0x68, 0x11, sMonInfoTextColors, -1, text); - CopyWindowToVram(0, 3); + CopyWindowToVram(0, COPYWIN_FULL); } } @@ -1243,7 +1243,7 @@ static void HallOfFame_PrintPlayerInfo(u8 unused1, u8 unused2) width = GetStringRightAlignXOffset(FONT_NORMAL, text, 0x70); AddTextPrinterParameterized3(1, FONT_NORMAL, width, 0x21, sPlayerInfoTextColors, -1, text); - CopyWindowToVram(1, 3); + CopyWindowToVram(1, COPYWIN_FULL); } static void ClearVramOamPltt_LoadHofPal(void) diff --git a/src/item_menu.c b/src/item_menu.c index bee5dc716..1baa3965c 100755 --- a/src/item_menu.c +++ b/src/item_menu.c @@ -2439,7 +2439,7 @@ static void CopyPocketNameToWindow(u32 a) CpuCopy32(tileDataBuffer[0][a], windowTileData, 0x100); // Top half of pocket name b = a + 16; CpuCopy32(tileDataBuffer[0][b], windowTileData + 0x100, 0x100); // Bottom half of pocket name - CopyWindowToVram(WIN_POCKET_NAME, 2); + CopyWindowToVram(WIN_POCKET_NAME, COPYWIN_GFX); } static void LoadBagMenuTextWindows(void) @@ -2544,7 +2544,7 @@ static void PrepareTMHMMoveWindow(void) BlitMenuInfoIcon(WIN_TMHM_INFO_ICONS, MENU_INFO_ICON_POWER, 0, 12); BlitMenuInfoIcon(WIN_TMHM_INFO_ICONS, MENU_INFO_ICON_ACCURACY, 0, 24); BlitMenuInfoIcon(WIN_TMHM_INFO_ICONS, MENU_INFO_ICON_PP, 0, 36); - CopyWindowToVram(WIN_TMHM_INFO_ICONS, 2); + CopyWindowToVram(WIN_TMHM_INFO_ICONS, COPYWIN_GFX); } static void PrintTMHMMoveData(u16 itemId) @@ -2558,7 +2558,7 @@ static void PrintTMHMMoveData(u16 itemId) { for (i = 0; i < 4; i++) BagMenu_Print(WIN_TMHM_INFO, FONT_NORMAL, gText_ThreeDashes, 7, i * 12, 0, 0, TEXT_SPEED_FF, COLORID_TMHM_INFO); - CopyWindowToVram(WIN_TMHM_INFO, 2); + CopyWindowToVram(WIN_TMHM_INFO, COPYWIN_GFX); } else { @@ -2593,6 +2593,6 @@ static void PrintTMHMMoveData(u16 itemId) ConvertIntToDecimalStringN(gStringVar1, gBattleMoves[moveId].pp, STR_CONV_MODE_RIGHT_ALIGN, 3); BagMenu_Print(WIN_TMHM_INFO, FONT_NORMAL, gStringVar1, 7, 36, 0, 0, TEXT_SPEED_FF, COLORID_TMHM_INFO); - CopyWindowToVram(WIN_TMHM_INFO, 2); + CopyWindowToVram(WIN_TMHM_INFO, COPYWIN_GFX); } } diff --git a/src/link.c b/src/link.c index 40f6ce786..3380514e1 100644 --- a/src/link.c +++ b/src/link.c @@ -1648,8 +1648,8 @@ static void ErrorMsg_MoveCloserToPartner(void) AddTextPrinterParameterized3(2, FONT_SHORT_COPY_1, 2, 1, sTextColors, 0, gText_MoveCloserToLinkPartner); PutWindowTilemap(0); PutWindowTilemap(2); - CopyWindowToVram(0, 0); - CopyWindowToVram(2, 3); + CopyWindowToVram(0, COPYWIN_NONE); // Does nothing + CopyWindowToVram(2, COPYWIN_FULL); } static void ErrorMsg_CheckConnections(void) @@ -1660,8 +1660,8 @@ static void ErrorMsg_CheckConnections(void) AddTextPrinterParameterized3(1, FONT_SHORT_COPY_1, 2, 0, sTextColors, 0, gText_CommErrorCheckConnections); PutWindowTilemap(1); PutWindowTilemap(2); - CopyWindowToVram(1, 0); - CopyWindowToVram(2, 3); + CopyWindowToVram(1, COPYWIN_NONE); // Does nothing + CopyWindowToVram(2, COPYWIN_FULL); } static void CB2_PrintErrorMessage(void) diff --git a/src/list_menu.c b/src/list_menu.c index 84b917eec..6b1c377f3 100644 --- a/src/list_menu.c +++ b/src/list_menu.c @@ -330,7 +330,7 @@ s32 DoMysteryGiftListMenu(const struct WindowTemplate *windowTemplate, const str gMultiuseListMenuTemplate = *listMenuTemplate; gMultiuseListMenuTemplate.windowId = sMysteryGiftLinkMenu.windowId; sMysteryGiftLinkMenu.listTaskId = ListMenuInit(&gMultiuseListMenuTemplate, 0, 0); - CopyWindowToVram(sMysteryGiftLinkMenu.windowId, 1); + CopyWindowToVram(sMysteryGiftLinkMenu.windowId, COPYWIN_MAP); sMysteryGiftLinkMenu.state = 1; break; case 1: @@ -364,7 +364,7 @@ s32 DoMysteryGiftListMenu(const struct WindowTemplate *windowTemplate, const str } } - CopyWindowToVram(sMysteryGiftLinkMenu.windowId, 1); + CopyWindowToVram(sMysteryGiftLinkMenu.windowId, COPYWIN_MAP); } break; case 2: @@ -381,7 +381,7 @@ u8 ListMenuInit(struct ListMenuTemplate *listMenuTemplate, u16 scrollOffset, u16 { u8 taskId = ListMenuInitInternal(listMenuTemplate, scrollOffset, selectedRow); PutWindowTilemap(listMenuTemplate->windowId); - CopyWindowToVram(listMenuTemplate->windowId, 2); + CopyWindowToVram(listMenuTemplate->windowId, COPYWIN_GFX); return taskId; } @@ -401,7 +401,7 @@ u8 ListMenuInitInRect(struct ListMenuTemplate *listMenuTemplate, struct ListMenu rect[i].height, rect[i].palNum); } - CopyWindowToVram(listMenuTemplate->windowId, 2); + CopyWindowToVram(listMenuTemplate->windowId, COPYWIN_GFX); return taskId; } @@ -489,7 +489,7 @@ void RedrawListMenu(u8 listTaskId) FillWindowPixelBuffer(list->template.windowId, PIXEL_FILL(list->template.fillValue)); ListMenuPrintEntries(list, list->scrollOffset, 0, list->template.maxShowed); ListMenuDrawCursor(list); - CopyWindowToVram(list->template.windowId, 2); + CopyWindowToVram(list->template.windowId, COPYWIN_GFX); } // unused @@ -862,7 +862,7 @@ static bool8 ListMenuChangeSelection(struct ListMenu *list, bool8 updateCursorAn ListMenuErasePrintedCursor(list, oldSelectedRow); ListMenuDrawCursor(list); ListMenuCallSelectionChangedCallback(list, FALSE); - CopyWindowToVram(list->template.windowId, 2); + CopyWindowToVram(list->template.windowId, COPYWIN_GFX); break; case 2: case 3: @@ -870,7 +870,7 @@ static bool8 ListMenuChangeSelection(struct ListMenu *list, bool8 updateCursorAn ListMenuScroll(list, cursorCount, movingDown); ListMenuDrawCursor(list); ListMenuCallSelectionChangedCallback(list, FALSE); - CopyWindowToVram(list->template.windowId, 2); + CopyWindowToVram(list->template.windowId, COPYWIN_GFX); break; } } diff --git a/src/mail.c b/src/mail.c index 5b4e62baf..f59e7edf1 100644 --- a/src/mail.c +++ b/src/mail.c @@ -700,8 +700,8 @@ static void PrintMailText(void) box_x = GetStringCenterAlignXOffset(FONT_NORMAL, signature, sMailRead->signatureWidth) + 104; box_y = sMailRead->layout->signatureYPos + 88; AddTextPrinterParameterized3(0, FONT_NORMAL, box_x, box_y, sTextColors, 0, signature); - CopyWindowToVram(0, 3); - CopyWindowToVram(1, 3); + CopyWindowToVram(0, COPYWIN_FULL); + CopyWindowToVram(1, COPYWIN_FULL); } static void VBlankCB_MailRead(void) diff --git a/src/main_menu.c b/src/main_menu.c index 637719dea..bd7107963 100644 --- a/src/main_menu.c +++ b/src/main_menu.c @@ -784,8 +784,8 @@ static void Task_DisplayMainMenu(u8 taskId) AddTextPrinterParameterized3(1, FONT_NORMAL, 0, 1, sTextColor_Headers, -1, gText_MainMenuOption); PutWindowTilemap(0); PutWindowTilemap(1); - CopyWindowToVram(0, 2); - CopyWindowToVram(1, 2); + CopyWindowToVram(0, COPYWIN_GFX); + CopyWindowToVram(1, COPYWIN_GFX); DrawMainMenuWindowBorder(&sWindowTemplates_MainMenu[0], MAIN_MENU_BORDER_TILE); DrawMainMenuWindowBorder(&sWindowTemplates_MainMenu[1], MAIN_MENU_BORDER_TILE); break; @@ -800,9 +800,9 @@ static void Task_DisplayMainMenu(u8 taskId) PutWindowTilemap(2); PutWindowTilemap(3); PutWindowTilemap(4); - CopyWindowToVram(2, 2); - CopyWindowToVram(3, 2); - CopyWindowToVram(4, 2); + CopyWindowToVram(2, COPYWIN_GFX); + CopyWindowToVram(3, COPYWIN_GFX); + CopyWindowToVram(4, COPYWIN_GFX); DrawMainMenuWindowBorder(&sWindowTemplates_MainMenu[2], MAIN_MENU_BORDER_TILE); DrawMainMenuWindowBorder(&sWindowTemplates_MainMenu[3], MAIN_MENU_BORDER_TILE); DrawMainMenuWindowBorder(&sWindowTemplates_MainMenu[4], MAIN_MENU_BORDER_TILE); @@ -821,10 +821,10 @@ static void Task_DisplayMainMenu(u8 taskId) PutWindowTilemap(3); PutWindowTilemap(4); PutWindowTilemap(5); - CopyWindowToVram(2, 2); - CopyWindowToVram(3, 2); - CopyWindowToVram(4, 2); - CopyWindowToVram(5, 2); + CopyWindowToVram(2, COPYWIN_GFX); + CopyWindowToVram(3, COPYWIN_GFX); + CopyWindowToVram(4, COPYWIN_GFX); + CopyWindowToVram(5, COPYWIN_GFX); DrawMainMenuWindowBorder(&sWindowTemplates_MainMenu[2], MAIN_MENU_BORDER_TILE); DrawMainMenuWindowBorder(&sWindowTemplates_MainMenu[3], MAIN_MENU_BORDER_TILE); DrawMainMenuWindowBorder(&sWindowTemplates_MainMenu[4], MAIN_MENU_BORDER_TILE); @@ -847,11 +847,11 @@ static void Task_DisplayMainMenu(u8 taskId) PutWindowTilemap(4); PutWindowTilemap(5); PutWindowTilemap(6); - CopyWindowToVram(2, 2); - CopyWindowToVram(3, 2); - CopyWindowToVram(4, 2); - CopyWindowToVram(5, 2); - CopyWindowToVram(6, 2); + CopyWindowToVram(2, COPYWIN_GFX); + CopyWindowToVram(3, COPYWIN_GFX); + CopyWindowToVram(4, COPYWIN_GFX); + CopyWindowToVram(5, COPYWIN_GFX); + CopyWindowToVram(6, COPYWIN_GFX); DrawMainMenuWindowBorder(&sWindowTemplates_MainMenu[2], MAIN_MENU_BORDER_TILE); DrawMainMenuWindowBorder(&sWindowTemplates_MainMenu[3], MAIN_MENU_BORDER_TILE); DrawMainMenuWindowBorder(&sWindowTemplates_MainMenu[4], MAIN_MENU_BORDER_TILE); @@ -1330,7 +1330,7 @@ static void Task_NewGameBirchSpeech_WaitForSpriteFadeInWelcome(u8 taskId) LoadMessageBoxGfx(0, 0xFC, 0xF0); NewGameBirchSpeech_ShowDialogueWindow(0, 1); PutWindowTilemap(0); - CopyWindowToVram(0, 2); + CopyWindowToVram(0, COPYWIN_GFX); NewGameBirchSpeech_ClearWindow(0); StringExpandPlaceholders(gStringVar4, gText_Birch_Welcome); AddTextPrinterForMessage(1); @@ -1855,7 +1855,7 @@ static void CB2_NewGameBirchSpeech_ReturnFromNamingScreen(void) LoadMainMenuWindowFrameTiles(0, 0xF3); LoadMessageBoxGfx(0, 0xFC, 0xF0); PutWindowTilemap(0); - CopyWindowToVram(0, 3); + CopyWindowToVram(0, COPYWIN_FULL); } static void SpriteCB_Null(struct Sprite *sprite) @@ -2092,7 +2092,7 @@ static void NewGameBirchSpeech_ShowGenderMenu(void) PrintMenuTable(1, ARRAY_COUNT(sMenuActions_Gender), sMenuActions_Gender); InitMenuInUpperLeftCornerPlaySoundWhenAPressed(1, 2, 0); PutWindowTilemap(1); - CopyWindowToVram(1, 3); + CopyWindowToVram(1, COPYWIN_FULL); } static s8 NewGameBirchSpeech_ProcessGenderMenuInput(void) @@ -2119,7 +2119,7 @@ static void CreateMainMenuErrorWindow(const u8* str) FillWindowPixelBuffer(7, PIXEL_FILL(1)); AddTextPrinterParameterized(7, FONT_NORMAL, str, 0, 1, 2, 0); PutWindowTilemap(7); - CopyWindowToVram(7, 2); + CopyWindowToVram(7, COPYWIN_GFX); DrawMainMenuWindowBorder(&sWindowTemplates_MainMenu[7], MAIN_MENU_BORDER_TILE); SetGpuReg(REG_OFFSET_WIN0H, WIN_RANGE(9, DISPLAY_WIDTH - 9)); SetGpuReg(REG_OFFSET_WIN0V, WIN_RANGE(113, DISPLAY_HEIGHT - 1)); @@ -2232,7 +2232,7 @@ static void NewGameBirchSpeech_ClearGenderWindow(u8 windowId, bool8 copyToVram) FillWindowPixelBuffer(windowId, PIXEL_FILL(1)); ClearWindowTilemap(windowId); if (copyToVram == TRUE) - CopyWindowToVram(windowId, 3); + CopyWindowToVram(windowId, COPYWIN_FULL); } static void NewGameBirchSpeech_ClearWindow(u8 windowId) @@ -2244,7 +2244,7 @@ static void NewGameBirchSpeech_ClearWindow(u8 windowId) u8 winHeight = GetWindowAttribute(windowId, WINDOW_HEIGHT); FillWindowPixelRect(windowId, bgColor, 0, 0, maxCharWidth * winWidth, maxCharHeight * winHeight); - CopyWindowToVram(windowId, 2); + CopyWindowToVram(windowId, COPYWIN_GFX); } static void NewGameBirchSpeech_WaitForThisIsPokemonText(struct TextPrinterTemplate *printer, u16 a) diff --git a/src/map_name_popup.c b/src/map_name_popup.c index 88a06eed4..bc0b31162 100644 --- a/src/map_name_popup.c +++ b/src/map_name_popup.c @@ -330,7 +330,7 @@ static void ShowMapNamePopUpWindow(void) mapDisplayHeader[1] = EXT_CTRL_CODE_HIGHLIGHT; mapDisplayHeader[2] = TEXT_COLOR_TRANSPARENT; AddTextPrinterParameterized(GetMapNamePopUpWindowId(), FONT_NARROW, mapDisplayHeader, x, 3, 0xFF, NULL); - CopyWindowToVram(GetMapNamePopUpWindowId(), 3); + CopyWindowToVram(GetMapNamePopUpWindowId(), COPYWIN_FULL); } #define TILE_TOP_EDGE_START 0x21D diff --git a/src/match_call.c b/src/match_call.c index 4c77b8764..b292ede31 100644 --- a/src/match_call.c +++ b/src/match_call.c @@ -1277,7 +1277,7 @@ static bool32 MatchCall_DrawWindow(u8 taskId) DrawMatchCallTextBoxBorder_Internal(tWindowId, TILE_MC_WINDOW, 14); WriteSequenceToBgTilemapBuffer(0, (0xF << 12) | TILE_POKENAV_ICON, 1, 15, 4, 4, 17, 1); tIconTaskId = CreateTask(Task_SpinPokenavIcon, 10); - CopyWindowToVram(tWindowId, 2); + CopyWindowToVram(tWindowId, COPYWIN_GFX); CopyBgTilemapBufferToVram(0); return TRUE; } @@ -1329,7 +1329,7 @@ static bool32 MatchCall_PrintMessage(u8 taskId) if (!RunMatchCallTextPrinter(tWindowId) && !IsSEPlaying() && JOY_NEW(A_BUTTON | B_BUTTON)) { FillWindowPixelBuffer(tWindowId, PIXEL_FILL(8)); - CopyWindowToVram(tWindowId, 2); + CopyWindowToVram(tWindowId, COPYWIN_GFX); PlaySE(SE_POKENAV_HANG_UP); return TRUE; } diff --git a/src/mauville_old_man.c b/src/mauville_old_man.c index a9f7df744..2525e065a 100644 --- a/src/mauville_old_man.c +++ b/src/mauville_old_man.c @@ -449,7 +449,7 @@ static void DrawSongTextWindow(const u8 * str) DrawDialogueFrame(0, 0); AddTextPrinterParameterized(0, FONT_NORMAL, str, 0, 1, 1, DisableTextPrinters); gDisableTextPrinters = TRUE; - CopyWindowToVram(0, 3); + CopyWindowToVram(0, COPYWIN_FULL); } static void BardSing(struct Task *task, struct BardSong *song) @@ -1347,7 +1347,7 @@ static void PrintStoryList(void) } AddTextPrinterParameterized(sStorytellerWindowId, FONT_NORMAL, gText_Exit, 8, 16 * i + 1, 0xFF, NULL); InitMenuInUpperLeftCornerPlaySoundWhenAPressed(sStorytellerWindowId, GetFreeStorySlot() + 1, 0); - CopyWindowToVram(sStorytellerWindowId, 3); + CopyWindowToVram(sStorytellerWindowId, COPYWIN_FULL); } static void Task_StoryListMenu(u8 taskId) diff --git a/src/menu.c b/src/menu.c index b8f09063d..7625f113c 100644 --- a/src/menu.c +++ b/src/menu.c @@ -138,7 +138,6 @@ void WindowFunc_DrawDialogFrameWithCustomTileAndPalette(u8, u8, u8, u8, u8, u8); void WindowFunc_ClearDialogWindowAndFrameNullPalette(u8, u8, u8, u8, u8, u8); void WindowFunc_DrawStdFrameWithCustomTileAndPalette(u8, u8, u8, u8, u8, u8); void WindowFunc_ClearStdWindowAndFrameToTransparent(u8, u8, u8, u8, u8, u8); -void sub_8198C78(void); void task_free_buf_after_copying_tile_data_to_vram(u8 taskId); void InitStandardTextBoxWindows(void) @@ -220,7 +219,7 @@ void DrawDialogueFrame(u8 windowId, bool8 copyToVram) FillWindowPixelBuffer(windowId, PIXEL_FILL(1)); PutWindowTilemap(windowId); if (copyToVram == TRUE) - CopyWindowToVram(windowId, 3); + CopyWindowToVram(windowId, COPYWIN_FULL); } void DrawStdWindowFrame(u8 windowId, bool8 copyToVram) @@ -229,7 +228,7 @@ void DrawStdWindowFrame(u8 windowId, bool8 copyToVram) FillWindowPixelBuffer(windowId, PIXEL_FILL(1)); PutWindowTilemap(windowId); if (copyToVram == TRUE) - CopyWindowToVram(windowId, 3); + CopyWindowToVram(windowId, COPYWIN_FULL); } void ClearDialogWindowAndFrame(u8 windowId, bool8 copyToVram) @@ -238,7 +237,7 @@ void ClearDialogWindowAndFrame(u8 windowId, bool8 copyToVram) FillWindowPixelBuffer(windowId, PIXEL_FILL(1)); ClearWindowTilemap(windowId); if (copyToVram == TRUE) - CopyWindowToVram(windowId, 3); + CopyWindowToVram(windowId, COPYWIN_FULL); } void ClearStdWindowAndFrame(u8 windowId, bool8 copyToVram) @@ -247,7 +246,7 @@ void ClearStdWindowAndFrame(u8 windowId, bool8 copyToVram) FillWindowPixelBuffer(windowId, PIXEL_FILL(1)); ClearWindowTilemap(windowId); if (copyToVram == TRUE) - CopyWindowToVram(windowId, 3); + CopyWindowToVram(windowId, COPYWIN_FULL); } void WindowFunc_DrawStandardFrame(u8 bg, u8 tilemapLeft, u8 tilemapTop, u8 width, u8 height, u8 paletteNum) @@ -461,7 +460,7 @@ void DisplayItemMessageOnField(u8 taskId, const u8 *string, TaskFunc callback) { LoadMessageBoxAndBorderGfx(); DisplayMessageAndContinueTask(taskId, 0, DLG_WINDOW_BASE_TILE_NUM, DLG_WINDOW_PALETTE_NUM, FONT_NORMAL, GetPlayerTextSpeedDelay(), string, callback); - CopyWindowToVram(0, 3); + CopyWindowToVram(0, COPYWIN_FULL); } void DisplayYesNoMenuDefaultYes(void) @@ -565,7 +564,7 @@ void DrawDialogFrameWithCustomTileAndPalette(u8 windowId, bool8 copyToVram, u16 FillWindowPixelBuffer(windowId, PIXEL_FILL(1)); PutWindowTilemap(windowId); if (copyToVram == TRUE) - CopyWindowToVram(windowId, 3); + CopyWindowToVram(windowId, COPYWIN_FULL); } // Never used. @@ -577,7 +576,7 @@ void DrawDialogFrameWithCustomTile(u8 windowId, bool8 copyToVram, u16 tileNum) FillWindowPixelBuffer(windowId, PIXEL_FILL(1)); PutWindowTilemap(windowId); if (copyToVram == TRUE) - CopyWindowToVram(windowId, 3); + CopyWindowToVram(windowId, COPYWIN_FULL); } void WindowFunc_DrawDialogFrameWithCustomTileAndPalette(u8 bg, u8 tilemapLeft, u8 tilemapTop, u8 width, u8 height, u8 paletteNum) @@ -682,7 +681,7 @@ void ClearDialogWindowAndFrameToTransparent(u8 windowId, bool8 copyToVram) FillWindowPixelBuffer(windowId, PIXEL_FILL(0)); ClearWindowTilemap(windowId); if (copyToVram == TRUE) - CopyWindowToVram(windowId, 3); + CopyWindowToVram(windowId, COPYWIN_FULL); } void WindowFunc_ClearDialogWindowAndFrameNullPalette(u8 bg, u8 tilemapLeft, u8 tilemapTop, u8 width, u8 height, u8 paletteNum) @@ -698,7 +697,7 @@ void DrawStdFrameWithCustomTileAndPalette(u8 windowId, bool8 copyToVram, u16 bas FillWindowPixelBuffer(windowId, PIXEL_FILL(1)); PutWindowTilemap(windowId); if (copyToVram == TRUE) - CopyWindowToVram(windowId, 3); + CopyWindowToVram(windowId, COPYWIN_FULL); } // Never used. @@ -710,7 +709,7 @@ void DrawStdFrameWithCustomTile(u8 windowId, bool8 copyToVram, u16 baseTileNum) FillWindowPixelBuffer(windowId, PIXEL_FILL(1)); PutWindowTilemap(windowId); if (copyToVram == TRUE) - CopyWindowToVram(windowId, 3); + CopyWindowToVram(windowId, COPYWIN_FULL); } void WindowFunc_DrawStdFrameWithCustomTileAndPalette(u8 bg, u8 tilemapLeft, u8 tilemapTop, u8 width, u8 height, u8 paletteNum) @@ -779,7 +778,7 @@ void ClearStdWindowAndFrameToTransparent(u8 windowId, bool8 copyToVram) FillWindowPixelBuffer(windowId, PIXEL_FILL(0)); ClearWindowTilemap(windowId); if (copyToVram == TRUE) - CopyWindowToVram(windowId, 3); + CopyWindowToVram(windowId, COPYWIN_FULL); } void WindowFunc_ClearStdWindowAndFrameToTransparent(u8 bg, u8 tilemapLeft, u8 tilemapTop, u8 width, u8 height, u8 paletteNum) @@ -832,7 +831,7 @@ void sub_8198180(const u8 *string, u8 a2, bool8 copyToVram) 0, string); if (copyToVram) - CopyWindowToVram(sWindowId, 3); + CopyWindowToVram(sWindowId, COPYWIN_FULL); } } @@ -870,14 +869,14 @@ void sub_8198204(const u8 *string, const u8 *string2, u8 a3, u8 a4, bool8 copyTo } AddTextPrinterParameterized4(sWindowId, FONT_NORMAL, 4, 1, 0, 0, color, 0, string); if (copyToVram) - CopyWindowToVram(sWindowId, 3); + CopyWindowToVram(sWindowId, COPYWIN_FULL); } } void sub_81982D8(void) { if (sWindowId != WINDOW_NONE) - CopyWindowToVram(sWindowId, 3); + CopyWindowToVram(sWindowId, COPYWIN_FULL); } void sub_81982F0(void) @@ -885,7 +884,7 @@ void sub_81982F0(void) if (sWindowId != WINDOW_NONE) { FillWindowPixelBuffer(sWindowId, PIXEL_FILL(15)); - CopyWindowToVram(sWindowId, 3); + CopyWindowToVram(sWindowId, COPYWIN_FULL); } } @@ -895,7 +894,7 @@ void sub_8198314(void) { FillWindowPixelBuffer(sWindowId, PIXEL_FILL(0)); ClearWindowTilemap(sWindowId); - CopyWindowToVram(sWindowId, 3); + CopyWindowToVram(sWindowId, COPYWIN_FULL); RemoveWindow(sWindowId); sWindowId = WINDOW_NONE; } @@ -1106,7 +1105,7 @@ void PrintTextArray(u8 windowId, u8 fontId, u8 left, u8 top, u8 lineHeight, u8 i { AddTextPrinterParameterized(windowId, fontId, menuActions[i].text, left, (lineHeight * i) + top, 0xFF, NULL); } - CopyWindowToVram(windowId, 2); + CopyWindowToVram(windowId, COPYWIN_GFX); } void sub_81987BC(u8 windowId, u8 fontId, u8 left, u8 top, u8 lineHeight, u8 itemCount, const struct MenuAction *menuActions, u8 a6, u8 a7) @@ -1116,7 +1115,7 @@ void sub_81987BC(u8 windowId, u8 fontId, u8 left, u8 top, u8 lineHeight, u8 item { AddTextPrinterParameterized5(windowId, fontId, menuActions[i].text, left, (lineHeight * i) + top, 0xFF, NULL, a6, a7); } - CopyWindowToVram(windowId, 2); + CopyWindowToVram(windowId, COPYWIN_GFX); } void sub_8198854(u8 windowId, u8 fontId, u8 lineHeight, u8 itemCount, const struct MenuAction *menuActions) @@ -1148,7 +1147,7 @@ void AddItemMenuActionTextPrinters(u8 windowId, u8 fontId, u8 left, u8 top, u8 l AddTextPrinter(&printer, 0xFF, NULL); } - CopyWindowToVram(windowId, 2); + CopyWindowToVram(windowId, COPYWIN_GFX); } void sub_81989B8(u8 windowId, u8 fontId, u8 lineHeight, u8 itemCount, const struct MenuAction *menuActions, const u8 *actionIds) @@ -1216,11 +1215,11 @@ s8 Menu_ProcessInputNoWrapClearOnChoose(void) { s8 result = Menu_ProcessInputNoWrap(); if (result != MENU_NOTHING_CHOSEN) - sub_8198C78(); + EraseYesNoWindow(); return result; } -void sub_8198C78(void) +void EraseYesNoWindow(void) { ClearStdWindowAndFrameToTransparent(sYesNoWindowId, TRUE); RemoveWindow(sYesNoWindowId); @@ -1237,7 +1236,7 @@ void sub_8198C94(u8 windowId, u8 fontId, u8 left, u8 top, u8 a4, u8 a5, u8 a6, u AddTextPrinterParameterized(windowId, fontId, menuActions[(i * a6) + j].text, (a4 * j) + left, (a5 * i) + top, 0xFF, NULL); } } - CopyWindowToVram(windowId, 2); + CopyWindowToVram(windowId, COPYWIN_GFX); } void sub_8198D54(u8 windowId, u8 fontId, u8 a2, u8 a3, u8 a4, u8 a5, const struct MenuAction *menuActions) @@ -1273,7 +1272,7 @@ void PrintMenuActionGrid(u8 windowId, u8 fontId, u8 left, u8 top, u8 optionWidth } } - CopyWindowToVram(windowId, 2); + CopyWindowToVram(windowId, COPYWIN_GFX); } // Unused @@ -1608,7 +1607,7 @@ void PrintMenuTable(u8 windowId, u8 itemCount, const struct MenuAction *menuActi AddTextPrinterParameterized(windowId, 1, menuActions[i].text, 8, (i * 16) + 1, 0xFF, NULL); } - CopyWindowToVram(windowId, 2); + CopyWindowToVram(windowId, COPYWIN_GFX); } void sub_81995E4(u8 windowId, u8 itemCount, const struct MenuAction *menuActions, const u8 *actionIds) @@ -1635,7 +1634,7 @@ void sub_81995E4(u8 windowId, u8 itemCount, const struct MenuAction *menuActions AddTextPrinter(&printer, 0xFF, NULL); } - CopyWindowToVram(windowId, 2); + CopyWindowToVram(windowId, COPYWIN_GFX); } void CreateYesNoMenu(const struct WindowTemplate *window, u16 baseTileNum, u8 paletteNum, u8 initialCursorPos) @@ -1672,7 +1671,7 @@ void PrintMenuGridTable(u8 windowId, u8 optionWidth, u8 columns, u8 rows, const for (j = 0; j < columns; j++) AddTextPrinterParameterized(windowId, 1, menuActions[(i * columns) + j].text, (optionWidth * j) + 8, (i * 16) + 1, 0xFF, NULL); } - CopyWindowToVram(windowId, 2); + CopyWindowToVram(windowId, COPYWIN_GFX); } void sub_819983C(u8 windowId, u8 a4, u8 itemCount, u8 itemCount2, const struct MenuAction *menuActions, const u8 *actionIds) @@ -1703,7 +1702,7 @@ void sub_819983C(u8 windowId, u8 a4, u8 itemCount, u8 itemCount2, const struct M } } - CopyWindowToVram(windowId, 2); + CopyWindowToVram(windowId, COPYWIN_GFX); } u8 InitMenuActionGrid(u8 windowId, u8 optionWidth, u8 columns, u8 rows, u8 initialCursorPos) diff --git a/src/menu_specialized.c b/src/menu_specialized.c index 6e13a769f..d5bb975c8 100644 --- a/src/menu_specialized.c +++ b/src/menu_specialized.c @@ -754,7 +754,7 @@ static void MoveRelearnerLoadBattleMoveDescription(u32 chosenMove) AddTextPrinterParameterized(0, FONT_NORMAL, str, x, 0x29, TEXT_SPEED_FF, NULL); if (chosenMove == LIST_CANCEL) { - CopyWindowToVram(0, 2); + CopyWindowToVram(0, COPYWIN_GFX); return; } move = &gBattleMoves[chosenMove]; @@ -813,7 +813,7 @@ static void MoveRelearnerMenuLoadContestMoveDescription(u32 chosenMove) if (chosenMove == MENU_NOTHING_CHOSEN) { - CopyWindowToVram(1, 2); + CopyWindowToVram(1, COPYWIN_GFX); return; } @@ -824,7 +824,7 @@ static void MoveRelearnerMenuLoadContestMoveDescription(u32 chosenMove) str = gContestEffectDescriptionPointers[move->effect]; AddTextPrinterParameterized(1, FONT_NARROW, str, 0, 0x41, TEXT_SPEED_FF, NULL); - CopyWindowToVram(1, 2); + CopyWindowToVram(1, COPYWIN_GFX); } static void MoveRelearnerCursorCallback(s32 itemIndex, bool8 onInit, struct ListMenu *list) diff --git a/src/money.c b/src/money.c index db571939a..c331462d4 100644 --- a/src/money.c +++ b/src/money.c @@ -171,7 +171,7 @@ void DrawMoneyBox(int amount, u8 x, u8 y) sMoneyBoxWindowId = AddWindow(&template); FillWindowPixelBuffer(sMoneyBoxWindowId, PIXEL_FILL(0)); PutWindowTilemap(sMoneyBoxWindowId); - CopyWindowToVram(sMoneyBoxWindowId, 1); + CopyWindowToVram(sMoneyBoxWindowId, COPYWIN_MAP); PrintMoneyAmountInMoneyBoxWithBorder(sMoneyBoxWindowId, 0x214, 14, amount); AddMoneyLabelObject((8 * x) + 19, (8 * y) + 11); } @@ -180,7 +180,7 @@ void HideMoneyBox(void) { RemoveMoneyLabelObject(); ClearStdWindowAndFrameToTransparent(sMoneyBoxWindowId, FALSE); - CopyWindowToVram(sMoneyBoxWindowId, 2); + CopyWindowToVram(sMoneyBoxWindowId, COPYWIN_GFX); RemoveWindow(sMoneyBoxWindowId); } diff --git a/src/move_relearner.c b/src/move_relearner.c index 554f84fe9..92d230616 100644 --- a/src/move_relearner.c +++ b/src/move_relearner.c @@ -687,7 +687,7 @@ static void DoMoveRelearnerMain(void) ShowTeachMoveText(TRUE); } RemoveScrollArrows(); - CopyWindowToVram(3, 2); + CopyWindowToVram(3, COPYWIN_GFX); break; case MENU_STATE_TRY_OVERWRITE_MOVE: if (!gPaletteFade.active) diff --git a/src/mystery_event_menu.c b/src/mystery_event_menu.c index 0bf65a91c..f36995a9c 100644 --- a/src/mystery_event_menu.c +++ b/src/mystery_event_menu.c @@ -136,7 +136,7 @@ static void CB2_MysteryEventMenu(void) case 0: DrawStdFrameWithCustomTileAndPalette(0, 1, 1, 0xD); PutWindowTilemap(0); - CopyWindowToVram(0, 3); + CopyWindowToVram(0, COPYWIN_FULL); ShowBg(0); BeginNormalPaletteFade(PALETTES_ALL, 0, 0x10, 0, RGB_BLACK); gMain.state++; @@ -184,7 +184,7 @@ static void CB2_MysteryEventMenu(void) DrawStdFrameWithCustomTileAndPalette(1, 1, 1, 0xD); PrintMysteryMenuText(1, gText_LoadingEvent, 1, 2, 0); PutWindowTilemap(1); - CopyWindowToVram(1, 3); + CopyWindowToVram(1, COPYWIN_FULL); gMain.state++; } else if (JOY_NEW(B_BUTTON)) diff --git a/src/mystery_gift_menu.c b/src/mystery_gift_menu.c index cd12e163c..a6d5953f9 100644 --- a/src/mystery_gift_menu.c +++ b/src/mystery_gift_menu.c @@ -492,7 +492,7 @@ void PrintMysteryGiftOrEReaderTopMenu(bool8 isEReader, bool32 useCancel) AddTextPrinterParameterized4(0, FONT_NORMAL, 4, 1, 0, 0, sTextColors_TopMenu, TEXT_SPEED_FF, header); AddTextPrinterParameterized4(0, FONT_SMALL, GetStringRightAlignXOffset(FONT_SMALL, options, 0xDE), 1, 0, 0, sTextColors_TopMenu, TEXT_SPEED_FF, options); - CopyWindowToVram(0, 2); + CopyWindowToVram(0, COPYWIN_GFX); PutWindowTilemap(0); } @@ -540,14 +540,14 @@ void AddTextPrinterToWindow1(const u8 *str) AddTextPrinterParameterized4(1, FONT_NORMAL, 0, 1, 0, 0, sMG_Ereader_TextColor_2, 0, gStringVar4); DrawTextBorderOuter(1, 0x001, 0xF); PutWindowTilemap(1); - CopyWindowToVram(1, 3); + CopyWindowToVram(1, COPYWIN_FULL); } static void ClearTextWindow(void) { rbox_fill_rectangle(1); ClearWindowTilemap(1); - CopyWindowToVram(1, 1); + CopyWindowToVram(1, COPYWIN_MAP); } #define DOWN_ARROW_X 208 @@ -649,7 +649,7 @@ static u32 MysteryGift_HandleThreeOptionMenu(u8 * unused0, u16 * unused1, u8 whi if (response != LIST_NOTHING_CHOSEN) { ClearWindowTilemap(2); - CopyWindowToVram(2, 1); + CopyWindowToVram(2, COPYWIN_MAP); } return response; } @@ -671,7 +671,7 @@ s8 DoMysteryGiftYesNo(u8 * textState, u16 * windowId, bool8 yesNoBoxPlacement, c FillWindowPixelBuffer(*windowId, 0x11); AddTextPrinterParameterized4(*windowId, FONT_NORMAL, 0, 1, 0, 0, sMG_Ereader_TextColor_2, 0, gStringVar4); DrawTextBorderOuter(*windowId, 0x001, 0x0F); - CopyWindowToVram(*windowId, 2); + CopyWindowToVram(*windowId, COPYWIN_GFX); PutWindowTilemap(*windowId); (*textState)++; break; @@ -693,7 +693,7 @@ s8 DoMysteryGiftYesNo(u8 * textState, u16 * windowId, bool8 yesNoBoxPlacement, c *textState = 0; rbox_fill_rectangle(*windowId); ClearWindowTilemap(*windowId); - CopyWindowToVram(*windowId, 1); + CopyWindowToVram(*windowId, COPYWIN_MAP); RemoveWindow(*windowId); return input; } @@ -702,7 +702,7 @@ s8 DoMysteryGiftYesNo(u8 * textState, u16 * windowId, bool8 yesNoBoxPlacement, c *textState = 0; rbox_fill_rectangle(*windowId); ClearWindowTilemap(*windowId); - CopyWindowToVram(*windowId, 1); + CopyWindowToVram(*windowId, COPYWIN_MAP); RemoveWindow(*windowId); return MENU_B_PRESSED; } @@ -728,7 +728,7 @@ static s32 HandleGiftSelectMenu(u8 * textState, u16 * windowId, bool32 cannotTos FillWindowPixelBuffer(*windowId, 0x11); AddTextPrinterParameterized4(*windowId, FONT_NORMAL, 0, 1, 0, 0, sMG_Ereader_TextColor_2, 0, gStringVar4); DrawTextBorderOuter(*windowId, 0x001, 0x0F); - CopyWindowToVram(*windowId, 2); + CopyWindowToVram(*windowId, COPYWIN_GFX); PutWindowTilemap(*windowId); (*textState)++; break; @@ -753,7 +753,7 @@ static s32 HandleGiftSelectMenu(u8 * textState, u16 * windowId, bool32 cannotTos *textState = 0; rbox_fill_rectangle(*windowId); ClearWindowTilemap(*windowId); - CopyWindowToVram(*windowId, 1); + CopyWindowToVram(*windowId, COPYWIN_MAP); RemoveWindow(*windowId); return input; } @@ -762,7 +762,7 @@ static s32 HandleGiftSelectMenu(u8 * textState, u16 * windowId, bool32 cannotTos *textState = 0; rbox_fill_rectangle(*windowId); ClearWindowTilemap(*windowId); - CopyWindowToVram(*windowId, 1); + CopyWindowToVram(*windowId, COPYWIN_MAP); RemoveWindow(*windowId); return LIST_CANCEL; } diff --git a/src/mystery_gift_view.c b/src/mystery_gift_view.c index 400367b92..cf3a019f5 100644 --- a/src/mystery_gift_view.c +++ b/src/mystery_gift_view.c @@ -479,7 +479,7 @@ static void DrawCardWindow(u8 whichWindow) } break; } - CopyWindowToVram(windowId, 3); + CopyWindowToVram(windowId, COPYWIN_FULL); } static void CreateCardSprites(void) @@ -905,8 +905,8 @@ static void DrawNewsWindows(void) sNews_TextColorTable[sWonderNewsData->gfx->bodyTextPal], 0, sWonderNewsData->bodyText[i]); - CopyWindowToVram(sWonderNewsData->windowIds[NEWS_WIN_TITLE], 3); - CopyWindowToVram(sWonderNewsData->windowIds[NEWS_WIN_BODY], 3); + CopyWindowToVram(sWonderNewsData->windowIds[NEWS_WIN_TITLE], COPYWIN_FULL); + CopyWindowToVram(sWonderNewsData->windowIds[NEWS_WIN_BODY], COPYWIN_FULL); } static void UpdateNewsScroll(void) diff --git a/src/naming_screen.c b/src/naming_screen.c index 65629215c..1d42d7063 100644 --- a/src/naming_screen.c +++ b/src/naming_screen.c @@ -741,7 +741,7 @@ static void DisplaySentToPCMessage(void) DrawDialogueFrame(0, 0); gTextFlags.canABSpeedUpPrint = TRUE; AddTextPrinterParameterized2(0, FONT_NORMAL, gStringVar4, GetPlayerTextSpeedDelay(), 0, 2, 1, 3); - CopyWindowToVram(0, 3); + CopyWindowToVram(0, COPYWIN_FULL); } static bool8 MainState_WaitSentToPCMessage(void) @@ -1925,7 +1925,7 @@ static void DrawTextEntry(void) } TryDrawGenderIcon(); - CopyWindowToVram(sNamingScreen->windows[WIN_TEXT_ENTRY], 2); + CopyWindowToVram(sNamingScreen->windows[WIN_TEXT_ENTRY], COPYWIN_GFX); PutWindowTilemap(sNamingScreen->windows[WIN_TEXT_ENTRY]); } @@ -2012,7 +2012,7 @@ static void PrintControls(void) FillWindowPixelBuffer(sNamingScreen->windows[WIN_BANNER], PIXEL_FILL(15)); AddTextPrinterParameterized3(sNamingScreen->windows[WIN_BANNER], FONT_SMALL, 2, 1, color, 0, gText_MoveOkBack); PutWindowTilemap(sNamingScreen->windows[WIN_BANNER]); - CopyWindowToVram(sNamingScreen->windows[WIN_BANNER], 3); + CopyWindowToVram(sNamingScreen->windows[WIN_BANNER], COPYWIN_FULL); } static void CB2_NamingScreen(void) diff --git a/src/option_menu.c b/src/option_menu.c index d96ed1ecf..58d63b19b 100644 --- a/src/option_menu.c +++ b/src/option_menu.c @@ -251,7 +251,7 @@ void CB2_InitOptionMenu(void) FrameType_DrawChoices(gTasks[taskId].data[TD_FRAMETYPE]); HighlightOptionMenuItem(gTasks[taskId].data[TD_MENUSELECTION]); - CopyWindowToVram(WIN_OPTIONS, 3); + CopyWindowToVram(WIN_OPTIONS, COPYWIN_FULL); gMain.state++; break; } @@ -351,7 +351,7 @@ static void Task_OptionMenuProcessInput(u8 taskId) if (sArrowPressed) { sArrowPressed = FALSE; - CopyWindowToVram(WIN_OPTIONS, 2); + CopyWindowToVram(WIN_OPTIONS, COPYWIN_GFX); } } } @@ -627,7 +627,7 @@ static void DrawTextOption(void) { FillWindowPixelBuffer(WIN_TEXT_OPTION, PIXEL_FILL(1)); AddTextPrinterParameterized(WIN_TEXT_OPTION, FONT_NORMAL, gText_Option, 8, 1, TEXT_SPEED_FF, NULL); - CopyWindowToVram(WIN_TEXT_OPTION, 3); + CopyWindowToVram(WIN_TEXT_OPTION, COPYWIN_FULL); } static void DrawOptionMenuTexts(void) @@ -636,10 +636,8 @@ static void DrawOptionMenuTexts(void) FillWindowPixelBuffer(WIN_OPTIONS, PIXEL_FILL(1)); for (i = 0; i < MENUITEM_COUNT; i++) - { AddTextPrinterParameterized(WIN_OPTIONS, FONT_NORMAL, sOptionMenuItemsNames[i], 8, (i * 16) + 1, TEXT_SPEED_FF, NULL); - } - CopyWindowToVram(WIN_OPTIONS, 3); + CopyWindowToVram(WIN_OPTIONS, COPYWIN_FULL); } #define TILE_TOP_CORNER_L 0x1A2 diff --git a/src/party_menu.c b/src/party_menu.c index ae55463b8..609d5249f 100755 --- a/src/party_menu.c +++ b/src/party_menu.c @@ -754,7 +754,7 @@ static void RenderPartyMenuBox(u8 slot) LoadPartyBoxPalette(&sPartyMenuBoxes[slot], PARTY_PAL_NO_MON); else LoadPartyBoxPalette(&sPartyMenuBoxes[slot], PARTY_PAL_MULTI_ALT); - CopyWindowToVram(sPartyMenuBoxes[slot].windowId, 2); + CopyWindowToVram(sPartyMenuBoxes[slot].windowId, COPYWIN_GFX); PutWindowTilemap(sPartyMenuBoxes[slot].windowId); ScheduleBgCopyTilemapToVram(2); } @@ -764,7 +764,7 @@ static void RenderPartyMenuBox(u8 slot) { DrawEmptySlot(sPartyMenuBoxes[slot].windowId); LoadPartyBoxPalette(&sPartyMenuBoxes[slot], PARTY_PAL_NO_MON); - CopyWindowToVram(sPartyMenuBoxes[slot].windowId, 2); + CopyWindowToVram(sPartyMenuBoxes[slot].windowId, COPYWIN_GFX); } else { @@ -2038,7 +2038,7 @@ static void CreateCancelConfirmWindows(bool8 chooseHalf) mainOffset = GetStringCenterAlignXOffset(FONT_SMALL, gMenuText_Confirm, 48); AddTextPrinterParameterized4(confirmWindowId, FONT_SMALL, mainOffset, 1, 0, 0, sFontColorTable[0], -1, gMenuText_Confirm); PutWindowTilemap(confirmWindowId); - CopyWindowToVram(confirmWindowId, 2); + CopyWindowToVram(confirmWindowId, COPYWIN_GFX); cancelWindowId = AddWindow(&sMultiCancelButtonWindowTemplate); offset = 0; } @@ -2061,7 +2061,7 @@ static void CreateCancelConfirmWindows(bool8 chooseHalf) AddTextPrinterParameterized3(cancelWindowId, FONT_SMALL, mainOffset + offset, 1, sFontColorTable[0], -1, gText_Cancel2); } PutWindowTilemap(cancelWindowId); - CopyWindowToVram(cancelWindowId, 2); + CopyWindowToVram(cancelWindowId, COPYWIN_GFX); ScheduleBgCopyTilemapToVram(0); } } @@ -2354,7 +2354,7 @@ static void DisplayPartyPokemonHPBar(u16 hp, u16 maxhp, struct PartyMenuBox *men FillWindowPixelRect(menuBox->windowId, 0x0D, menuBox->infoRects->dimensions[20] + hpFraction, menuBox->infoRects->dimensions[21], menuBox->infoRects->dimensions[22] - hpFraction, 1); FillWindowPixelRect(menuBox->windowId, 0x02, menuBox->infoRects->dimensions[20] + hpFraction, menuBox->infoRects->dimensions[21] + 1, menuBox->infoRects->dimensions[22] - hpFraction, 2); } - CopyWindowToVram(menuBox->windowId, 2); + CopyWindowToVram(menuBox->windowId, COPYWIN_GFX); } static void DisplayPartyPokemonDescriptionText(u8 stringID, struct PartyMenuBox *menuBox, u8 c) @@ -4954,7 +4954,7 @@ static void DisplayLevelUpStatsPg1(u8 taskId) arrayPtr[12] = CreateLevelUpStatsWindow(); DrawLevelUpWindowPg1(arrayPtr[12], arrayPtr, &arrayPtr[6], TEXT_COLOR_WHITE, TEXT_COLOR_DARK_GRAY, TEXT_COLOR_LIGHT_GRAY); - CopyWindowToVram(arrayPtr[12], 2); + CopyWindowToVram(arrayPtr[12], COPYWIN_GFX); ScheduleBgCopyTilemapToVram(2); } @@ -4963,7 +4963,7 @@ static void DisplayLevelUpStatsPg2(u8 taskId) s16 *arrayPtr = sPartyMenuInternal->data; DrawLevelUpWindowPg2(arrayPtr[12], &arrayPtr[6], TEXT_COLOR_WHITE, TEXT_COLOR_DARK_GRAY, TEXT_COLOR_LIGHT_GRAY); - CopyWindowToVram(arrayPtr[12], 2); + CopyWindowToVram(arrayPtr[12], COPYWIN_GFX); ScheduleBgCopyTilemapToVram(2); } diff --git a/src/player_pc.c b/src/player_pc.c index b83ecdaba..0742341ec 100644 --- a/src/player_pc.c +++ b/src/player_pc.c @@ -1144,7 +1144,7 @@ static void ItemStorage_CreateListMenu(u8 taskId) text = gText_WithdrawItem; x = GetStringCenterAlignXOffset(FONT_NORMAL, text, 104); AddTextPrinterParameterized(sItemStorageMenu->windowIds[ITEMPC_WIN_TITLE], FONT_NORMAL, text, x, 1, 0, NULL); - CopyWindowToVram(sItemStorageMenu->windowIds[ITEMPC_WIN_ICON], 2); + CopyWindowToVram(sItemStorageMenu->windowIds[ITEMPC_WIN_ICON], COPYWIN_GFX); ItemStorage_CompactList(); ItemStorage_CompactCursor(); ItemStorage_RefreshListMenu(); diff --git a/src/pokeblock.c b/src/pokeblock.c index 77c22d24a..b5f1c9298 100644 --- a/src/pokeblock.c +++ b/src/pokeblock.c @@ -802,7 +802,7 @@ static void DrawPokeblockInfo(s32 pkblId) for (i = 0; i < FLAVOR_COUNT; i++) CopyToBgTilemapBufferRect(2, rectTilemapSrc, (i / 3 * 6) + 1, (i % 3 * 2) + 13, 1, 2); - CopyWindowToVram(7, 2); + CopyWindowToVram(7, COPYWIN_GFX); } ScheduleBgCopyTilemapToVram(0); diff --git a/src/pokedex.c b/src/pokedex.c index 8a8576243..ae4def99a 100644 --- a/src/pokedex.c +++ b/src/pokedex.c @@ -2081,7 +2081,7 @@ static bool8 LoadPokedexListPage(u8 page) InitWindows(sPokemonList_WindowTemplate); DeactivateAllTextPrinters(); PutWindowTilemap(0); - CopyWindowToVram(0, 3); + CopyWindowToVram(0, COPYWIN_FULL); gMain.state = 1; break; case 1: @@ -2412,7 +2412,7 @@ static void CreateMonListEntry(u8 position, u16 b, u16 ignored) } break; } - CopyWindowToVram(0, 2); + CopyWindowToVram(0, COPYWIN_GFX); } static void CreateMonDexNum(u16 entryNum, u8 left, u8 top, u16 unused) @@ -3248,7 +3248,7 @@ static void Task_LoadInfoScreen(u8 taskId) PutWindowTilemap(WIN_INFO); PutWindowTilemap(WIN_FOOTPRINT); DrawFootprint(WIN_FOOTPRINT, sPokedexListItem->dexNum); - CopyWindowToVram(WIN_FOOTPRINT, 2); + CopyWindowToVram(WIN_FOOTPRINT, COPYWIN_GFX); gMain.state++; break; case 2: @@ -3264,7 +3264,7 @@ static void Task_LoadInfoScreen(u8 taskId) PrintMonInfo(sPokedexListItem->dexNum, sPokedexView->dexMode == DEX_MODE_HOENN ? FALSE : TRUE, sPokedexListItem->owned, 0); if (!sPokedexListItem->owned) LoadPalette(gPlttBufferUnfaded + 1, 0x31, 0x1E); - CopyWindowToVram(WIN_INFO, 3); + CopyWindowToVram(WIN_INFO, COPYWIN_FULL); CopyBgTilemapBufferToVram(1); CopyBgTilemapBufferToVram(2); CopyBgTilemapBufferToVram(3); @@ -3594,8 +3594,8 @@ static void Task_LoadCryScreen(u8 taskId) cryMeter.yPos = 3; if (LoadCryMeter(&cryMeter, 3)) gMain.state++; - CopyWindowToVram(WIN_VU_METER, 2); - CopyWindowToVram(WIN_INFO, 3); + CopyWindowToVram(WIN_VU_METER, COPYWIN_GFX); + CopyWindowToVram(WIN_INFO, COPYWIN_FULL); CopyBgTilemapBufferToVram(0); CopyBgTilemapBufferToVram(1); CopyBgTilemapBufferToVram(2); @@ -3780,7 +3780,7 @@ static void Task_LoadSizeScreen(u8 taskId) SetOamMatrix(2, gPokedexEntries[sPokedexListItem->dexNum].pokemonScale, 0, 0, gPokedexEntries[sPokedexListItem->dexNum].pokemonScale); LoadPalette(sSizeScreenSilhouette_Pal, (gSprites[spriteId].oam.paletteNum + 16) * 16, 0x20); gTasks[taskId].tMonSpriteId = spriteId; - CopyWindowToVram(WIN_INFO, 3); + CopyWindowToVram(WIN_INFO, COPYWIN_FULL); CopyBgTilemapBufferToVram(1); CopyBgTilemapBufferToVram(2); CopyBgTilemapBufferToVram(3); @@ -3975,7 +3975,7 @@ static void Task_DisplayCaughtMonDexPage(u8 taskId) PutWindowTilemap(WIN_INFO); PutWindowTilemap(WIN_FOOTPRINT); DrawFootprint(WIN_FOOTPRINT, gTasks[taskId].tDexNum); - CopyWindowToVram(WIN_FOOTPRINT, 2); + CopyWindowToVram(WIN_FOOTPRINT, COPYWIN_GFX); ResetPaletteFade(); LoadPokedexBgPalette(FALSE); gTasks[taskId].tState++; @@ -3985,7 +3985,7 @@ static void Task_DisplayCaughtMonDexPage(u8 taskId) break; case 3: PrintMonInfo(dexNum, IsNationalPokedexEnabled(), 1, 1); - CopyWindowToVram(WIN_INFO, 3); + CopyWindowToVram(WIN_INFO, COPYWIN_FULL); CopyBgTilemapBufferToVram(2); CopyBgTilemapBufferToVram(3); gTasks[taskId].tState++; @@ -4847,7 +4847,7 @@ static void Task_LoadSearchMenu(u8 taskId) SetDefaultSearchModeAndOrder(taskId); HighlightSelectedSearchTopBarItem(SEARCH_TOPBAR_SEARCH); PrintSelectedSearchParameters(taskId); - CopyWindowToVram(0, 3); + CopyWindowToVram(0, COPYWIN_FULL); CopyBgTilemapBufferToVram(1); CopyBgTilemapBufferToVram(2); CopyBgTilemapBufferToVram(3); @@ -4901,7 +4901,7 @@ static void Task_SwitchToSearchMenuTopBar(u8 taskId) { HighlightSelectedSearchTopBarItem(gTasks[taskId].tTopBarItem); PrintSelectedSearchParameters(taskId); - CopyWindowToVram(0, 2); + CopyWindowToVram(0, COPYWIN_GFX); CopyBgTilemapBufferToVram(3); gTasks[taskId].func = Task_HandleSearchTopBarInput; } @@ -4940,7 +4940,7 @@ static void Task_HandleSearchTopBarInput(u8 taskId) PlaySE(SE_DEX_PAGE); gTasks[taskId].tTopBarItem--; HighlightSelectedSearchTopBarItem(gTasks[taskId].tTopBarItem); - CopyWindowToVram(0, 2); + CopyWindowToVram(0, COPYWIN_GFX); CopyBgTilemapBufferToVram(3); } if (JOY_NEW(DPAD_RIGHT) && gTasks[taskId].tTopBarItem < SEARCH_TOPBAR_CANCEL) @@ -4948,7 +4948,7 @@ static void Task_HandleSearchTopBarInput(u8 taskId) PlaySE(SE_DEX_PAGE); gTasks[taskId].tTopBarItem++; HighlightSelectedSearchTopBarItem(gTasks[taskId].tTopBarItem); - CopyWindowToVram(0, 2); + CopyWindowToVram(0, COPYWIN_GFX); CopyBgTilemapBufferToVram(3); } } @@ -4957,7 +4957,7 @@ static void Task_SwitchToSearchMenu(u8 taskId) { HighlightSelectedSearchMenuItem(gTasks[taskId].tTopBarItem, gTasks[taskId].tMenuItem); PrintSelectedSearchParameters(taskId); - CopyWindowToVram(0, 2); + CopyWindowToVram(0, COPYWIN_GFX); CopyBgTilemapBufferToVram(3); gTasks[taskId].func = Task_HandleSearchMenuInput; } @@ -5013,7 +5013,7 @@ static void Task_HandleSearchMenuInput(u8 taskId) EraseAndPrintSearchTextBox(gText_SearchingPleaseWait); gTasks[taskId].func = Task_StartPokedexSearch; PlaySE(SE_DEX_SEARCH); - CopyWindowToVram(0, 2); + CopyWindowToVram(0, COPYWIN_GFX); } } else @@ -5029,7 +5029,7 @@ static void Task_HandleSearchMenuInput(u8 taskId) PlaySE(SE_SELECT); gTasks[taskId].tMenuItem = movementMap[gTasks[taskId].tMenuItem][0]; HighlightSelectedSearchMenuItem(gTasks[taskId].tTopBarItem, gTasks[taskId].tMenuItem); - CopyWindowToVram(0, 2); + CopyWindowToVram(0, COPYWIN_GFX); CopyBgTilemapBufferToVram(3); } if (JOY_NEW(DPAD_RIGHT) && movementMap[gTasks[taskId].tMenuItem][1] != 0xFF) @@ -5037,7 +5037,7 @@ static void Task_HandleSearchMenuInput(u8 taskId) PlaySE(SE_SELECT); gTasks[taskId].tMenuItem = movementMap[gTasks[taskId].tMenuItem][1]; HighlightSelectedSearchMenuItem(gTasks[taskId].tTopBarItem, gTasks[taskId].tMenuItem); - CopyWindowToVram(0, 2); + CopyWindowToVram(0, COPYWIN_GFX); CopyBgTilemapBufferToVram(3); } if (JOY_NEW(DPAD_UP) && movementMap[gTasks[taskId].tMenuItem][2] != 0xFF) @@ -5045,7 +5045,7 @@ static void Task_HandleSearchMenuInput(u8 taskId) PlaySE(SE_SELECT); gTasks[taskId].tMenuItem = movementMap[gTasks[taskId].tMenuItem][2]; HighlightSelectedSearchMenuItem(gTasks[taskId].tTopBarItem, gTasks[taskId].tMenuItem); - CopyWindowToVram(0, 2); + CopyWindowToVram(0, COPYWIN_GFX); CopyBgTilemapBufferToVram(3); } if (JOY_NEW(DPAD_DOWN) && movementMap[gTasks[taskId].tMenuItem][3] != 0xFF) @@ -5053,7 +5053,7 @@ static void Task_HandleSearchMenuInput(u8 taskId) PlaySE(SE_SELECT); gTasks[taskId].tMenuItem = movementMap[gTasks[taskId].tMenuItem][3]; HighlightSelectedSearchMenuItem(gTasks[taskId].tTopBarItem, gTasks[taskId].tMenuItem); - CopyWindowToVram(0, 2); + CopyWindowToVram(0, COPYWIN_GFX); CopyBgTilemapBufferToVram(3); } } @@ -5086,7 +5086,7 @@ static void Task_WaitAndCompleteSearch(u8 taskId) EraseAndPrintSearchTextBox(gText_NoMatchingPkmnWereFound); } gTasks[taskId].func = Task_SearchCompleteWaitForInput; - CopyWindowToVram(0, 2); + CopyWindowToVram(0, COPYWIN_GFX); } } @@ -5126,7 +5126,7 @@ static void Task_SelectSearchMenuItem(u8 taskId) PrintSearchParameterText(taskId); PrintSelectorArrow(*cursorPos); gTasks[taskId].func = Task_HandleSearchParameterInput; - CopyWindowToVram(0, 2); + CopyWindowToVram(0, COPYWIN_GFX); CopyBgTilemapBufferToVram(3); } @@ -5151,7 +5151,7 @@ static void Task_HandleSearchParameterInput(u8 taskId) ClearSearchParameterBoxText(); DrawOrEraseSearchParameterBox(TRUE); gTasks[taskId].func = Task_SwitchToSearchMenu; - CopyWindowToVram(0, 2); + CopyWindowToVram(0, COPYWIN_GFX); CopyBgTilemapBufferToVram(3); return; } @@ -5163,7 +5163,7 @@ static void Task_HandleSearchParameterInput(u8 taskId) *cursorPos = gTasks[taskId].tCursorPos; *scrollOffset = gTasks[taskId].tScrollOffset; gTasks[taskId].func = Task_SwitchToSearchMenu; - CopyWindowToVram(0, 2); + CopyWindowToVram(0, COPYWIN_GFX); CopyBgTilemapBufferToVram(3); return; } @@ -5190,7 +5190,7 @@ static void Task_HandleSearchParameterInput(u8 taskId) { PlaySE(SE_SELECT); EraseAndPrintSearchTextBox(texts[*cursorPos + *scrollOffset].description); - CopyWindowToVram(0, 2); + CopyWindowToVram(0, COPYWIN_GFX); } return; } @@ -5216,7 +5216,7 @@ static void Task_HandleSearchParameterInput(u8 taskId) { PlaySE(SE_SELECT); EraseAndPrintSearchTextBox(texts[*cursorPos + *scrollOffset].description); - CopyWindowToVram(0, 2); + CopyWindowToVram(0, COPYWIN_GFX); } return; } diff --git a/src/pokedex_cry_screen.c b/src/pokedex_cry_screen.c index 350946f3b..a01c06daa 100644 --- a/src/pokedex_cry_screen.c +++ b/src/pokedex_cry_screen.c @@ -432,7 +432,7 @@ static void DrawWaveformSegment(u8 position, u8 amplitude) static void DrawWaveformWindow(u8 windowId) { - CopyWindowToVram(windowId, 2); + CopyWindowToVram(windowId, COPYWIN_GFX); } // rsVertical is leftover from a very different version of this function in RS diff --git a/src/pokemon_jump.c b/src/pokemon_jump.c index c95a86a41..dd213989c 100755 --- a/src/pokemon_jump.c +++ b/src/pokemon_jump.c @@ -3314,7 +3314,7 @@ static void Msg_WantToPlayAgain(void) case 0: sPokemonJumpGfx->msgWindowId = AddMessageWindow(1, 8, 20, 2); AddTextPrinterParameterized(sPokemonJumpGfx->msgWindowId, FONT_NORMAL, gText_WantToPlayAgain2, 0, 1, TEXT_SPEED_FF, NULL); - CopyWindowToVram(sPokemonJumpGfx->msgWindowId, 2); + CopyWindowToVram(sPokemonJumpGfx->msgWindowId, COPYWIN_GFX); sPokemonJumpGfx->mainState++; break; case 1: @@ -3341,7 +3341,7 @@ static void Msg_SavingDontTurnOff(void) case 0: sPokemonJumpGfx->msgWindowId = AddMessageWindow(2, 7, 26, 4); AddTextPrinterParameterized(sPokemonJumpGfx->msgWindowId, FONT_NORMAL, gText_SavingDontTurnOffPower, 0, 1, TEXT_SPEED_FF, NULL); - CopyWindowToVram(sPokemonJumpGfx->msgWindowId, 2); + CopyWindowToVram(sPokemonJumpGfx->msgWindowId, COPYWIN_GFX); sPokemonJumpGfx->mainState++; break; case 1: @@ -3366,7 +3366,7 @@ static void EraseMessage(void) { case 0: ClearMessageWindow(); - sub_8198C78(); + EraseYesNoWindow(); CopyBgTilemapBufferToVram(BG_INTERFACE); sPokemonJumpGfx->mainState++; break; @@ -3384,7 +3384,7 @@ static void Msg_SomeoneDroppedOut(void) case 0: sPokemonJumpGfx->msgWindowId = AddMessageWindow(2, 8, 22, 4); AddTextPrinterParameterized(sPokemonJumpGfx->msgWindowId, FONT_NORMAL, gText_SomeoneDroppedOut2, 0, 1, TEXT_SPEED_FF, NULL); - CopyWindowToVram(sPokemonJumpGfx->msgWindowId, 2); + CopyWindowToVram(sPokemonJumpGfx->msgWindowId, COPYWIN_GFX); sPokemonJumpGfx->mainState++; break; case 1: @@ -3410,7 +3410,7 @@ static void Msg_CommunicationStandby(void) case 0: sPokemonJumpGfx->msgWindowId = AddMessageWindow(7, 10, 16, 2); AddTextPrinterParameterized(sPokemonJumpGfx->msgWindowId, FONT_NORMAL, gText_CommunicationStandby4, 0, 1, TEXT_SPEED_FF, NULL); - CopyWindowToVram(sPokemonJumpGfx->msgWindowId, 2); + CopyWindowToVram(sPokemonJumpGfx->msgWindowId, COPYWIN_GFX); sPokemonJumpGfx->mainState++; break; case 1: @@ -3488,7 +3488,7 @@ static void PrintPrizeMessage(u16 itemId, u16 quantity) DynamicPlaceholderTextUtil_ExpandPlaceholders(sPokemonJumpGfx->prizeMsg, gText_AwesomeWonF701F700); sPokemonJumpGfx->msgWindowId = AddMessageWindow(4, 8, 22, 4); AddTextPrinterParameterized(sPokemonJumpGfx->msgWindowId, FONT_NORMAL, sPokemonJumpGfx->prizeMsg, 0, 1, TEXT_SPEED_FF, NULL); - CopyWindowToVram(sPokemonJumpGfx->msgWindowId, 2); + CopyWindowToVram(sPokemonJumpGfx->msgWindowId, COPYWIN_GFX); sPokemonJumpGfx->fanfare = MUS_LEVEL_UP; sPokemonJumpGfx->msgWindowState = 0; } @@ -3501,7 +3501,7 @@ static void PrintPrizeFilledBagMessage(u16 itemId) DynamicPlaceholderTextUtil_ExpandPlaceholders(sPokemonJumpGfx->prizeMsg, gText_FilledStorageSpace2); sPokemonJumpGfx->msgWindowId = AddMessageWindow(4, 8, 22, 4); AddTextPrinterParameterized(sPokemonJumpGfx->msgWindowId, FONT_NORMAL, sPokemonJumpGfx->prizeMsg, 0, 1, TEXT_SPEED_FF, NULL); - CopyWindowToVram(sPokemonJumpGfx->msgWindowId, 2); + CopyWindowToVram(sPokemonJumpGfx->msgWindowId, COPYWIN_GFX); sPokemonJumpGfx->fanfare = MUS_DUMMY; sPokemonJumpGfx->msgWindowState = 0; } @@ -3514,7 +3514,7 @@ static void PrintNoRoomForPrizeMessage(u16 itemId) DynamicPlaceholderTextUtil_ExpandPlaceholders(sPokemonJumpGfx->prizeMsg, gText_CantHoldMore); sPokemonJumpGfx->msgWindowId = AddMessageWindow(4, 9, 22, 2); AddTextPrinterParameterized(sPokemonJumpGfx->msgWindowId, FONT_NORMAL, sPokemonJumpGfx->prizeMsg, 0, 1, TEXT_SPEED_FF, NULL); - CopyWindowToVram(sPokemonJumpGfx->msgWindowId, 2); + CopyWindowToVram(sPokemonJumpGfx->msgWindowId, COPYWIN_GFX); sPokemonJumpGfx->fanfare = MUS_DUMMY; sPokemonJumpGfx->msgWindowState = 0; } @@ -3558,7 +3558,7 @@ static void ClearMessageWindow(void) if (sPokemonJumpGfx->msgWindowId != WINDOW_NONE) { rbox_fill_rectangle(sPokemonJumpGfx->msgWindowId); - CopyWindowToVram(sPokemonJumpGfx->msgWindowId, 1); + CopyWindowToVram(sPokemonJumpGfx->msgWindowId, COPYWIN_MAP); sPokemonJumpGfx->msgWindowState = 0; } } @@ -3858,7 +3858,7 @@ static void PrintPokeJumpPlayerName(int multiplayerId, u8 bgColor, u8 fgColor, u x = 64 - GetStringWidth(FONT_NORMAL, GetPokeJumpPlayerName(multiplayerId), -1); x /= 2; AddTextPrinterParameterized3(sPokemonJumpGfx->nameWindowIds[multiplayerId], FONT_NORMAL, x, 1, colors, -1, GetPokeJumpPlayerName(multiplayerId)); - CopyWindowToVram(sPokemonJumpGfx->nameWindowIds[multiplayerId], 2); + CopyWindowToVram(sPokemonJumpGfx->nameWindowIds[multiplayerId], COPYWIN_GFX); } static void PrintPokeJumpPlayerNames(bool32 highlightSelf) @@ -4176,7 +4176,7 @@ static void Task_ShowPokemonJumpRecords(u8 taskId) window.width = width; tWindowId = AddWindow(&window); PrintRecordsText(tWindowId, width); - CopyWindowToVram(tWindowId, 3); + CopyWindowToVram(tWindowId, COPYWIN_FULL); tState++; break; case 1: @@ -4187,7 +4187,7 @@ static void Task_ShowPokemonJumpRecords(u8 taskId) if (JOY_NEW(A_BUTTON | B_BUTTON)) { rbox_fill_rectangle(tWindowId); - CopyWindowToVram(tWindowId, 1); + CopyWindowToVram(tWindowId, COPYWIN_MAP); tState++; } break; diff --git a/src/pokemon_storage_system.c b/src/pokemon_storage_system.c index ee2d9b1a7..f936d8711 100644 --- a/src/pokemon_storage_system.c +++ b/src/pokemon_storage_system.c @@ -1562,8 +1562,8 @@ static void Task_PCMainMenu(u8 taskId) DrawDialogueFrame(0, 0); FillWindowPixelBuffer(0, PIXEL_FILL(1)); AddTextPrinterParameterized2(0, FONT_NORMAL, sMainMenuTexts[task->tSelectedOption].desc, TEXT_SPEED_FF, NULL, 2, 1, 3); - CopyWindowToVram(0, 3); - CopyWindowToVram(task->tWindowId, 3); + CopyWindowToVram(0, COPYWIN_FULL); + CopyWindowToVram(task->tWindowId, COPYWIN_FULL); task->tState++; break; case STATE_FADE_IN: @@ -4018,7 +4018,7 @@ static void PrintDisplayMonInfo(void) AddTextPrinterParameterized(0, FONT_SHORT, sStorage->displayMonGenderLvlText, 10, 42, TEXT_SPEED_FF, NULL); } - CopyWindowToVram(0, 2); + CopyWindowToVram(0, COPYWIN_GFX); if (sStorage->displayMonSpecies != SPECIES_NONE) { UpdateMonMarkingTiles(sStorage->displayMonMarkings, sStorage->markingComboTilesPtr); @@ -4322,7 +4322,7 @@ static void PrintMessage(u8 id) AddTextPrinterParameterized(1, FONT_NORMAL, sStorage->messageText, 0, 1, TEXT_SPEED_FF, NULL); DrawTextBorderOuter(1, 2, 14); PutWindowTilemap(1); - CopyWindowToVram(1, 2); + CopyWindowToVram(1, COPYWIN_GFX); ScheduleBgCopyTilemapToVram(0); } @@ -8191,7 +8191,7 @@ static bool8 MultiMove_Start(void) MultiMove_SetIconToBg(sMultiMove->fromColumn, sMultiMove->fromRow); SetBgAttribute(0, BG_ATTR_PALETTEMODE, 1); PutWindowTilemap(sStorage->multiMoveWindowId); - CopyWindowToVram8Bit(sStorage->multiMoveWindowId, 3); + CopyWindowToVram8Bit(sStorage->multiMoveWindowId, COPYWIN_FULL); BlendPalettes(0x3F00, 8, RGB_WHITE); StartCursorAnim(CURSOR_ANIM_OPEN); SetGpuRegBits(REG_OFFSET_BG0CNT, BGCNT_256COLOR); @@ -8247,7 +8247,7 @@ static bool8 MultiMove_ChangeSelection(void) MultiMove_UpdateSelectedIcons(); sMultiMove->toColumn = sMultiMove->cursorColumn; sMultiMove->toRow = sMultiMove->cursorRow; - CopyWindowToVram8Bit(sStorage->multiMoveWindowId, 2); + CopyWindowToVram8Bit(sStorage->multiMoveWindowId, COPYWIN_GFX); sMultiMove->state++; } break; diff --git a/src/pokemon_summary_screen.c b/src/pokemon_summary_screen.c index 4c5b351ab..c83ce727f 100644 --- a/src/pokemon_summary_screen.c +++ b/src/pokemon_summary_screen.c @@ -3677,7 +3677,7 @@ static void AddAndFillMoveNamesWindow(void) { u8 windowId = AddWindowFromTemplateList(sPageMovesTemplate, PSS_DATA_WINDOW_MOVE_NAMES); FillWindowPixelRect(windowId, PIXEL_FILL(0), 0, 66, 72, 16); - CopyWindowToVram(windowId, 2); + CopyWindowToVram(windowId, COPYWIN_GFX); } static void SwapMovesNamesPP(u8 moveIndex1, u8 moveIndex2) diff --git a/src/pokenav_conditions_2.c b/src/pokenav_conditions_2.c index 089a56e26..4862fdc6f 100644 --- a/src/pokenav_conditions_2.c +++ b/src/pokenav_conditions_2.c @@ -596,9 +596,9 @@ bool32 UpdateConditionGraphWindows(u8 mode, u16 bufferIndex, bool8 winMode) { case 0: if (winMode) - CopyWindowToVram(structPtr->nameGenderWindowId, 3); + CopyWindowToVram(structPtr->nameGenderWindowId, COPYWIN_FULL); else - CopyWindowToVram(structPtr->nameGenderWindowId, 2); + CopyWindowToVram(structPtr->nameGenderWindowId, COPYWIN_GFX); if (IsConditionMenuSearchMode() == TRUE) { @@ -612,9 +612,9 @@ bool32 UpdateConditionGraphWindows(u8 mode, u16 bufferIndex, bool8 winMode) } case 1: if (winMode) - CopyWindowToVram(structPtr->listIndexWindowId, 3); + CopyWindowToVram(structPtr->listIndexWindowId, COPYWIN_FULL); else - CopyWindowToVram(structPtr->listIndexWindowId, 2); + CopyWindowToVram(structPtr->listIndexWindowId, COPYWIN_GFX); structPtr->windowModeState = 0; return TRUE; @@ -628,8 +628,8 @@ void CopyUnusedConditionWindowsToVram(void) { struct Pokenav7Struct *structPtr = GetSubstructPtr(POKENAV_SUBSTRUCT_MON_MARK_MENU); - CopyWindowToVram(structPtr->unusedWindowId1, 3); - CopyWindowToVram(structPtr->unusedWindowId2, 3); + CopyWindowToVram(structPtr->unusedWindowId1, COPYWIN_FULL); + CopyWindowToVram(structPtr->unusedWindowId2, COPYWIN_FULL); } void sub_81CE964(struct Sprite *sprite) diff --git a/src/pokenav_conditions_3.c b/src/pokenav_conditions_3.c index 0e5a9b785..37079b171 100644 --- a/src/pokenav_conditions_3.c +++ b/src/pokenav_conditions_3.c @@ -644,7 +644,7 @@ static void AddSearchResultListMenuWindow(struct PokenavSub8 *searchList) { searchList->winid = AddWindow(&sSearchResultListMenuWindowTemplate); PutWindowTilemap(searchList->winid); - CopyWindowToVram(searchList->winid, 1); + CopyWindowToVram(searchList->winid, COPYWIN_MAP); PrintSearchResultListMenuItems(searchList); } @@ -658,7 +658,7 @@ static void PrintSearchResultListMenuItems(struct PokenavSub8 *searchList) AddTextPrinterParameterized(searchList->winid, FONT_NORMAL, gStringVar2, 4, 1, 0xFF, NULL); ConvertIntToDecimalStringN(gStringVar1, r7, STR_CONV_MODE_RIGHT_ALIGN, 3); AddTextPrinterParameterized(searchList->winid, FONT_NORMAL, gStringVar1, 34, 1, 0xFF, NULL); - CopyWindowToVram(searchList->winid, 2); + CopyWindowToVram(searchList->winid, COPYWIN_GFX); } static void InitConditionSearchListMenuTemplate(void) diff --git a/src/pokenav_main_menu.c b/src/pokenav_main_menu.c index 0166cc10c..5936ef9d2 100644 --- a/src/pokenav_main_menu.c +++ b/src/pokenav_main_menu.c @@ -555,7 +555,7 @@ static void InitHelpBar(void) structPtr->helpBarWindowId = 0; DrawHelpBar(structPtr->helpBarWindowId); PutWindowTilemap(structPtr->helpBarWindowId); - CopyWindowToVram(structPtr->helpBarWindowId, 3); // TODO: Use a defined constant here. + CopyWindowToVram(structPtr->helpBarWindowId, COPYWIN_FULL); } void PrintHelpBarText(u32 textId) diff --git a/src/pokenav_match_call_2.c b/src/pokenav_match_call_2.c index 727aa3694..e8751e0bf 100755 --- a/src/pokenav_match_call_2.c +++ b/src/pokenav_match_call_2.c @@ -942,7 +942,7 @@ static void DrawMatchCallLeftColumnWindows(struct Pokenav4Struct *state) PutWindowTilemap(state->locWindowId); FillWindowPixelBuffer(state->infoBoxWindowId, PIXEL_FILL(1)); PutWindowTilemap(state->infoBoxWindowId); - CopyWindowToVram(state->locWindowId, 1); + CopyWindowToVram(state->locWindowId, COPYWIN_MAP); } static void UpdateMatchCallInfoBox(struct Pokenav4Struct *state) @@ -952,7 +952,7 @@ static void UpdateMatchCallInfoBox(struct Pokenav4Struct *state) PrintNumberRegistered(state->infoBoxWindowId); PrintNumberOfBattlesLabel(state->infoBoxWindowId); PrintNumberOfBattles(state->infoBoxWindowId); - CopyWindowToVram(state->infoBoxWindowId, 2); + CopyWindowToVram(state->infoBoxWindowId, COPYWIN_GFX); } static void PrintNumberRegisteredLabel(u16 windowId) @@ -1026,7 +1026,7 @@ static void PrintMatchCallSelectionOptions(struct Pokenav4Struct *state) AddTextPrinterParameterized(state->infoBoxWindowId, FONT_NARROW, sMatchCallOptionTexts[optionText], 16, i * 16 + 1, TEXT_SPEED_FF, NULL); } - CopyWindowToVram(state->infoBoxWindowId, 2); + CopyWindowToVram(state->infoBoxWindowId, COPYWIN_GFX); } static bool32 sub_81CBFC4(struct Pokenav4Struct *state) @@ -1055,7 +1055,7 @@ static void UpdateWindowsToShowCheckPage(struct Pokenav4Struct *state) { CloseMatchCallSelectOptionsWindow(state); FillWindowPixelBuffer(state->infoBoxWindowId, PIXEL_FILL(1)); - CopyWindowToVram(state->infoBoxWindowId, 2); + CopyWindowToVram(state->infoBoxWindowId, COPYWIN_GFX); } static void sub_81CC034(struct Pokenav4Struct *state) @@ -1072,7 +1072,7 @@ static void DrawMsgBoxForMatchCallMsg(struct Pokenav4Struct *state) DrawMatchCallTextBoxBorder(state->msgBoxWindowId, 1, 4); FillWindowPixelBuffer(state->msgBoxWindowId, PIXEL_FILL(1)); PutWindowTilemap(state->msgBoxWindowId); - CopyWindowToVram(state->msgBoxWindowId, 3); + CopyWindowToVram(state->msgBoxWindowId, COPYWIN_FULL); sprite = PauseSpinningPokenavSprite(); sprite->x = 24; sprite->y = 112; @@ -1085,7 +1085,7 @@ static void DrawMsgBoxForCloseByMsg(struct Pokenav4Struct *state) DrawTextBorderOuter(state->msgBoxWindowId, 1, 4); FillWindowPixelBuffer(state->msgBoxWindowId, PIXEL_FILL(1)); PutWindowTilemap(state->msgBoxWindowId); - CopyWindowToVram(state->msgBoxWindowId, 3); + CopyWindowToVram(state->msgBoxWindowId, COPYWIN_FULL); } static bool32 IsDma3ManagerBusyWithBgCopy2(struct Pokenav4Struct *state) diff --git a/src/pokenav_match_call_ui.c b/src/pokenav_match_call_ui.c index dc3be8181..b8e543c67 100644 --- a/src/pokenav_match_call_ui.c +++ b/src/pokenav_match_call_ui.c @@ -184,7 +184,7 @@ void sub_81C835C(struct PokenavListMenuWindow *listWindow) { FillWindowPixelBuffer(listWindow->windowId, PIXEL_FILL(1)); PutWindowTilemap(listWindow->windowId); - CopyWindowToVram(listWindow->windowId, 1); + CopyWindowToVram(listWindow->windowId, COPYWIN_MAP); } void sub_81C837C(struct MatchCallWindowState *state, struct PokenavSub17Substruct *a1) @@ -232,9 +232,9 @@ u32 LoopedTask_sub_81C83F0(s32 state) if (++structPtr->listWindow.unkC >= structPtr->listWindow.unkE) { if (structPtr->unk38 != NULL) - CopyWindowToVram(structPtr->listWindow.windowId, 3); + CopyWindowToVram(structPtr->listWindow.windowId, COPYWIN_FULL); else - CopyWindowToVram(structPtr->listWindow.windowId, 2); + CopyWindowToVram(structPtr->listWindow.windowId, COPYWIN_GFX); return LT_INC_AND_PAUSE; } else @@ -495,7 +495,7 @@ void sub_81C8838(void) struct PokenavSub17 *structPtr = GetSubstructPtr(POKENAV_SUBSTRUCT_MATCH_CALL_LIST); struct MatchCallWindowState *subPtr = &structPtr->unk888; structPtr->list.unk38(structPtr->list.listWindow.windowId, subPtr->windowTopIndex + subPtr->selectedIndexOffset, (structPtr->list.listWindow.unkA + subPtr->selectedIndexOffset) & 0xF); - CopyWindowToVram(structPtr->list.listWindow.windowId, 1); + CopyWindowToVram(structPtr->list.listWindow.windowId, COPYWIN_MAP); } // TODO: @@ -673,7 +673,7 @@ void sub_81C8B70(struct PokenavListMenuWindow *listWindow, s32 a1, s32 a2) if (a1 + a2 <= 16) { CpuFastFill8(PIXEL_FILL(1), v1 + a1 * v2, a2 * v2); - CopyWindowToVram(listWindow->windowId, 2); + CopyWindowToVram(listWindow->windowId, COPYWIN_GFX); } else { @@ -682,13 +682,13 @@ void sub_81C8B70(struct PokenavListMenuWindow *listWindow, s32 a1, s32 a2) CpuFastFill8(PIXEL_FILL(1), v1 + a1 * v2, v3 * v2); CpuFastFill8(PIXEL_FILL(1), v1, v4 * v2); - CopyWindowToVram(listWindow->windowId, 2); + CopyWindowToVram(listWindow->windowId, COPYWIN_GFX); } for (a2--; a2 != -1; a1 = (a1 + 1) & 0xF, a2--) ClearRematchPokeballIcon(listWindow->windowId, a1); - CopyWindowToVram(listWindow->windowId, 1); + CopyWindowToVram(listWindow->windowId, COPYWIN_MAP); } void sub_81C8C64(struct PokenavListMenuWindow *listWindow, u32 a1) @@ -715,7 +715,7 @@ void sub_81C8CB4(struct MatchCallWindowState *state, struct PokenavSub17Substruc FillWindowPixelRect(list->listWindow.windowId, PIXEL_FILL(4), 0, list->listWindow.unkA * 16, list->listWindow.unk4 * 8, 16); AddTextPrinterParameterized3(list->listWindow.windowId, list->listWindow.fontId, 8, (list->listWindow.unkA * 16) + 1, colors, TEXT_SPEED_FF, list->unkTextBuffer); sub_81C8C64(&list->listWindow, 1); - CopyWindowRectToVram(list->listWindow.windowId, 3, 0, list->listWindow.unkA * 2, list->listWindow.unk4, 2); + CopyWindowRectToVram(list->listWindow.windowId, COPYWIN_FULL, 0, list->listWindow.unkA * 2, list->listWindow.unk4, 2); } void sub_81C8D4C(struct MatchCallWindowState *state, struct PokenavSub17Substruct *list) @@ -724,7 +724,7 @@ void sub_81C8D4C(struct MatchCallWindowState *state, struct PokenavSub17Substruc FillWindowPixelRect(list->listWindow.windowId, PIXEL_FILL(1), 0, list->listWindow.unkA * 16, list->listWindow.unk4 * 8, 16); AddTextPrinterParameterized(list->listWindow.windowId, list->listWindow.fontId, list->unkTextBuffer, 8, list->listWindow.unkA * 16 + 1, TEXT_SPEED_FF, NULL); sub_81C8C64(&list->listWindow, 0); - CopyWindowToVram(list->listWindow.windowId, 3); + CopyWindowToVram(list->listWindow.windowId, COPYWIN_FULL); } void PrintMatchCallFieldNames(struct PokenavSub17Substruct *list, u32 fieldId) @@ -735,7 +735,7 @@ void PrintMatchCallFieldNames(struct PokenavSub17Substruct *list, u32 fieldId) FillWindowPixelRect(list->listWindow.windowId, PIXEL_FILL(1), 0, top << 4, list->listWindow.unk4, 16); AddTextPrinterParameterized3(list->listWindow.windowId, FONT_NARROW, 2, (top << 4) + 1, colors, -1, fieldNames[fieldId]); - CopyWindowRectToVram(list->listWindow.windowId, 2, 0, top << 1, list->listWindow.unk4, 2); + CopyWindowRectToVram(list->listWindow.windowId, COPYWIN_GFX, 0, top << 1, list->listWindow.unk4, 2); } static void PrintMatchCallFlavorText(struct MatchCallWindowState *a0, struct PokenavSub17Substruct *list, u32 checkPageEntry) @@ -756,7 +756,7 @@ static void PrintMatchCallFlavorText(struct MatchCallWindowState *a0, struct Pok { sub_81DB620(list->listWindow.windowId, 1, r6 * 2, list->listWindow.unk4 - 1, 2); AddTextPrinterParameterized(list->listWindow.windowId, FONT_NARROW, str, 2, (r6 << 4) + 1, TEXT_SPEED_FF, NULL); - CopyWindowRectToVram(list->listWindow.windowId, 2, 0, r6 * 2, list->listWindow.unk4, 2); + CopyWindowRectToVram(list->listWindow.windowId, COPYWIN_GFX, 0, r6 * 2, list->listWindow.unk4, 2); } } diff --git a/src/pokenav_menu_handler_2.c b/src/pokenav_menu_handler_2.c index ded4c7007..10b6703da 100644 --- a/src/pokenav_menu_handler_2.c +++ b/src/pokenav_menu_handler_2.c @@ -1125,7 +1125,7 @@ static void AddOptionDescriptionWindow(void) ptr->optionDescWindowId = AddWindow(&sOptionDescWindowTemplate); PutWindowTilemap(ptr->optionDescWindowId); FillWindowPixelBuffer(ptr->optionDescWindowId, PIXEL_FILL(6)); - CopyWindowToVram(ptr->optionDescWindowId, 3); + CopyWindowToVram(ptr->optionDescWindowId, COPYWIN_FULL); } static void PrintCurrentOptionDescription(void) diff --git a/src/pokenav_region_map.c b/src/pokenav_region_map.c index 07788a5d3..8da5ddc90 100755 --- a/src/pokenav_region_map.c +++ b/src/pokenav_region_map.c @@ -511,7 +511,7 @@ static void LoadPokenavRegionMapGfx(struct Pokenav5Struct_2 *state) DecompressAndCopyTileDataToVram(1, sRegionMapCityZoomTiles_Gfx, 0, 0, 0); FillWindowPixelBuffer(state->infoWindowId, PIXEL_FILL(1)); PutWindowTilemap(state->infoWindowId); - CopyWindowToVram(state->infoWindowId, 3); + CopyWindowToVram(state->infoWindowId, COPYWIN_FULL); CopyPaletteIntoBufferUnfaded(sMapSecInfoWindow_Pal, 0x10, 0x20); CopyPaletteIntoBufferUnfaded(gRegionMapCityZoomTiles_Pal, 0x30, 0x20); if (!IsRegionMapZoomed()) @@ -537,7 +537,7 @@ static void UpdateMapSecInfoWindow(struct Pokenav5Struct_2 *state) PutWindowRectTilemap(state->infoWindowId, 0, 0, 12, 2); AddTextPrinterParameterized(state->infoWindowId, FONT_NARROW, regionMap->mapSecName, 0, 1, TEXT_SPEED_FF, NULL); DrawCityMap(state, regionMap->mapSecId, regionMap->posWithinMapSec); - CopyWindowToVram(state->infoWindowId, 3); + CopyWindowToVram(state->infoWindowId, COPYWIN_FULL); SetCityZoomTextInvisibility(FALSE); break; case MAPSECTYPE_CITY_CANTFLY: @@ -545,7 +545,7 @@ static void UpdateMapSecInfoWindow(struct Pokenav5Struct_2 *state) PutWindowRectTilemap(state->infoWindowId, 0, 0, 12, 2); AddTextPrinterParameterized(state->infoWindowId, FONT_NARROW, regionMap->mapSecName, 0, 1, TEXT_SPEED_FF, NULL); FillBgTilemapBufferRect(1, 0x1041, 17, 6, 12, 11, 17); - CopyWindowToVram(state->infoWindowId, 3); + CopyWindowToVram(state->infoWindowId, COPYWIN_FULL); SetCityZoomTextInvisibility(TRUE); break; case MAPSECTYPE_ROUTE: @@ -554,7 +554,7 @@ static void UpdateMapSecInfoWindow(struct Pokenav5Struct_2 *state) PutWindowTilemap(state->infoWindowId); AddTextPrinterParameterized(state->infoWindowId, FONT_NARROW, regionMap->mapSecName, 0, 1, TEXT_SPEED_FF, NULL); PrintLandmarkNames(state, regionMap->mapSecId, regionMap->posWithinMapSec); - CopyWindowToVram(state->infoWindowId, 3); + CopyWindowToVram(state->infoWindowId, COPYWIN_FULL); SetCityZoomTextInvisibility(TRUE); break; case MAPSECTYPE_NONE: diff --git a/src/pokenav_ribbons_1.c b/src/pokenav_ribbons_1.c index 3d8611a4a..8f7e27fe1 100644 --- a/src/pokenav_ribbons_1.c +++ b/src/pokenav_ribbons_1.c @@ -652,7 +652,7 @@ static void AddRibbonsMonListWindow(struct PokenavSub10 *monMenu) PutWindowTilemap(monMenu->winid); r2 = GetRibbonsMonListCount(); sub_81D02B0(monMenu->winid, 0, r2); - CopyWindowToVram(monMenu->winid, 1); + CopyWindowToVram(monMenu->winid, COPYWIN_MAP); sub_81D0288(monMenu); } @@ -661,7 +661,7 @@ static void sub_81D0288(struct PokenavSub10 *monMenu) s32 r4 = GetSelectedPokenavListIndex(); s32 r2 = GetRibbonsMonListCount(); sub_81D02B0(monMenu->winid, r4 + 1, r2); - CopyWindowToVram(monMenu->winid, 2); + CopyWindowToVram(monMenu->winid, COPYWIN_GFX); } static void sub_81D02B0(s32 windowId, s32 val1, s32 val2) diff --git a/src/pokenav_ribbons_2.c b/src/pokenav_ribbons_2.c index 75d9f5bd0..c8c63f017 100644 --- a/src/pokenav_ribbons_2.c +++ b/src/pokenav_ribbons_2.c @@ -810,7 +810,7 @@ static void PrintCurrentMonRibbonCount(struct PokenavSub14 *structPtr) DynamicPlaceholderTextUtil_ExpandPlaceholders(gStringVar4, gText_RibbonsF700); FillWindowPixelBuffer(structPtr->ribbonCountWindowId, PIXEL_FILL(4)); AddTextPrinterParameterized3(structPtr->ribbonCountWindowId, FONT_NORMAL, 0, 1, color, -1, gStringVar4); - CopyWindowToVram(structPtr->ribbonCountWindowId, 2); + CopyWindowToVram(structPtr->ribbonCountWindowId, COPYWIN_GFX); } static void PrintRibbonNameAndDescription(struct PokenavSub14 *structPtr) @@ -843,7 +843,7 @@ static void PrintRibbonNameAndDescription(struct PokenavSub14 *structPtr) AddTextPrinterParameterized3(structPtr->ribbonCountWindowId, FONT_NORMAL, 0, (i * 16) + 1, color, -1, gGiftRibbonDescriptionPointers[ribbonId][i]); } - CopyWindowToVram(structPtr->ribbonCountWindowId, 2); + CopyWindowToVram(structPtr->ribbonCountWindowId, COPYWIN_GFX); } static const struct WindowTemplate sRibbonSummaryMonNameWindowTemplate = @@ -897,7 +897,7 @@ static void PrintRibbbonsSummaryMonInfo(struct PokenavSub14 *structPtr) *(txtPtr++) = CHAR_LV_2; ConvertIntToDecimalStringN(txtPtr, level, STR_CONV_MODE_LEFT_ALIGN, 3); AddTextPrinterParameterized(windowId, FONT_NORMAL, gStringVar1, 60, 1, TEXT_SPEED_FF, NULL); - CopyWindowToVram(windowId, 2); + CopyWindowToVram(windowId, COPYWIN_GFX); } static const struct WindowTemplate sRibbonMonListIndexWindowTemplate[] = @@ -934,7 +934,7 @@ static void PrintRibbonsMonListIndex(struct PokenavSub14 *structPtr) ConvertIntToDecimalStringN(txtPtr, count, STR_CONV_MODE_RIGHT_ALIGN, 3); x = GetStringCenterAlignXOffset(FONT_NORMAL, gStringVar1, 56); AddTextPrinterParameterized(structPtr->listIdxWindowId, FONT_NORMAL, gStringVar1, x, 1, TEXT_SPEED_FF, NULL); - CopyWindowToVram(structPtr->listIdxWindowId, 2); + CopyWindowToVram(structPtr->listIdxWindowId, COPYWIN_GFX); } static void ResetSpritesAndDrawMonFrontPic(struct PokenavSub14 *structPtr) diff --git a/src/record_mixing.c b/src/record_mixing.c index 2197d8542..f308e5b3d 100644 --- a/src/record_mixing.c +++ b/src/record_mixing.c @@ -287,7 +287,7 @@ static void PrintTextOnRecordMixing(const u8 *src) { DrawDialogueFrame(0, 0); AddTextPrinterParameterized(0, FONT_NORMAL, src, 0, 1, 0, NULL); - CopyWindowToVram(0, 3); + CopyWindowToVram(0, COPYWIN_FULL); } #define tCounter data[0] diff --git a/src/region_map.c b/src/region_map.c index 46539205b..021ef7c71 100644 --- a/src/region_map.c +++ b/src/region_map.c @@ -1819,7 +1819,7 @@ static void DrawFlyDestTextWindow(void) DrawStdFrameWithCustomTileAndPalette(0, FALSE, 101, 13); } FillWindowPixelBuffer(0, PIXEL_FILL(1)); - CopyWindowToVram(0, 2); + CopyWindowToVram(0, COPYWIN_GFX); ScheduleBgCopyTilemapToVram(0); sDrawFlyDestTextWindow = FALSE; } diff --git a/src/reset_rtc_screen.c b/src/reset_rtc_screen.c index 5fe1a6013..da434482e 100644 --- a/src/reset_rtc_screen.c +++ b/src/reset_rtc_screen.c @@ -493,7 +493,7 @@ static void Task_ResetRtc_HandleInput(u8 taskId) { PlaySE(SE_SELECT); PrintTime(tWindowId, 0, 1, tDays, tHours, tMinutes, tSeconds); - CopyWindowToVram(tWindowId, 2); + CopyWindowToVram(tWindowId, COPYWIN_GFX); } } @@ -599,7 +599,7 @@ static void Task_ShowResetRtcPrompt(u8 taskId) gSaveBlock2Ptr->lastBerryTreeUpdate.seconds); ShowMessage(gText_ResetRTCConfirmCancel); - CopyWindowToVram(0, 2); + CopyWindowToVram(0, COPYWIN_GFX); ScheduleBgCopyTilemapToVram(0); tState++; case 1: diff --git a/src/roulette.c b/src/roulette.c index 29a8f779a..7e43f5db3 100644 --- a/src/roulette.c +++ b/src/roulette.c @@ -1224,7 +1224,7 @@ static void CB2_LoadRoulette(void) DrawGridBackground(SELECTION_NONE); DrawStdWindowFrame(sTextWindowId, FALSE); AddTextPrinterParameterized(sTextWindowId, FONT_NORMAL, Roulette_Text_ControlsInstruction, 0, 1, TEXT_SPEED_FF, NULL); - CopyWindowToVram(sTextWindowId, 3); + CopyWindowToVram(sTextWindowId, COPYWIN_FULL); gSpriteCoordOffsetX = -60; gSpriteCoordOffsetY = 0; break; @@ -1295,7 +1295,7 @@ static void Task_AskKeepPlaying(u8 taskId) DisplayYesNoMenuDefaultYes(); DrawStdWindowFrame(sTextWindowId, 0); AddTextPrinterParameterized(sTextWindowId, FONT_NORMAL, Roulette_Text_KeepPlaying, 0, 1, TEXT_SPEED_FF, 0); - CopyWindowToVram(sTextWindowId, 3); + CopyWindowToVram(sTextWindowId, COPYWIN_FULL); DoYesNoFuncWithChoice(taskId, &sYesNoTable_KeepPlaying); } @@ -1807,14 +1807,14 @@ static void Task_PrintSpinResult(u8 taskId) PlayFanfare(MUS_SLOTS_JACKPOT); DrawStdWindowFrame(sTextWindowId, FALSE); AddTextPrinterParameterized(sTextWindowId, FONT_NORMAL, Roulette_Text_Jackpot, 0, 1, TEXT_SPEED_FF, NULL); - CopyWindowToVram(sTextWindowId, 3); + CopyWindowToVram(sTextWindowId, COPYWIN_FULL); } else { PlayFanfare(MUS_SLOTS_WIN); DrawStdWindowFrame(sTextWindowId, FALSE); AddTextPrinterParameterized(sTextWindowId, FONT_NORMAL, Roulette_Text_ItsAHit, 0, 1, TEXT_SPEED_FF, NULL); - CopyWindowToVram(sTextWindowId, 3); + CopyWindowToVram(sTextWindowId, COPYWIN_FULL); } break; case FALSE: @@ -1822,7 +1822,7 @@ static void Task_PrintSpinResult(u8 taskId) m4aSongNumStart(SE_FAILURE); DrawStdWindowFrame(sTextWindowId, FALSE); AddTextPrinterParameterized(sTextWindowId, FONT_NORMAL, Roulette_Text_NothingDoing, 0, 1, TEXT_SPEED_FF, NULL); - CopyWindowToVram(sTextWindowId, 3); + CopyWindowToVram(sTextWindowId, COPYWIN_FULL); break; } gTasks[taskId].data[1] = 0; @@ -1867,7 +1867,7 @@ static void Task_PrintPayout(u8 taskId) StringExpandPlaceholders(gStringVar4, Roulette_Text_YouveWonXCoins); DrawStdWindowFrame(sTextWindowId, FALSE); AddTextPrinterParameterized(sTextWindowId, FONT_NORMAL, gStringVar4, 0, 1, TEXT_SPEED_FF, NULL); - CopyWindowToVram(sTextWindowId, 3); + CopyWindowToVram(sTextWindowId, COPYWIN_FULL); gTasks[taskId].tPayout = (sRoulette->minBet * gTasks[taskId].tMultiplier); gTasks[taskId].data[7] = 0; gTasks[taskId].func = Task_GivePayout; @@ -1903,7 +1903,7 @@ static void Task_TryPrintEndTurnMsg(u8 taskId) // Reached Ball 6, clear board DrawStdWindowFrame(sTextWindowId, FALSE); AddTextPrinterParameterized(sTextWindowId, FONT_NORMAL, Roulette_Text_BoardWillBeCleared, 0, 1, TEXT_SPEED_FF, NULL); - CopyWindowToVram(sTextWindowId, 3); + CopyWindowToVram(sTextWindowId, COPYWIN_FULL); StartTaskAfterDelayOrInput(taskId, Task_ClearBoard, NO_DELAY, A_BUTTON | B_BUTTON); } else if (gTasks[taskId].tCoins == MAX_COINS) @@ -1911,7 +1911,7 @@ static void Task_TryPrintEndTurnMsg(u8 taskId) // Player maxed out coins DrawStdWindowFrame(sTextWindowId, FALSE); AddTextPrinterParameterized(sTextWindowId, FONT_NORMAL, Roulette_Text_CoinCaseIsFull, 0, 1, TEXT_SPEED_FF, NULL); - CopyWindowToVram(sTextWindowId, 3); + CopyWindowToVram(sTextWindowId, COPYWIN_FULL); StartTaskAfterDelayOrInput(taskId, Task_AskKeepPlaying, NO_DELAY, A_BUTTON | B_BUTTON); } else @@ -1925,7 +1925,7 @@ static void Task_TryPrintEndTurnMsg(u8 taskId) // Player out of coins DrawStdWindowFrame(sTextWindowId, FALSE); AddTextPrinterParameterized(sTextWindowId, FONT_NORMAL, Roulette_Text_NoCoinsLeft, 0, 1, TEXT_SPEED_FF, NULL); - CopyWindowToVram(sTextWindowId, 3); + CopyWindowToVram(sTextWindowId, COPYWIN_FULL); StartTaskAfterDelayOrInput(taskId, Task_StopPlaying, 60, A_BUTTON | B_BUTTON); } } @@ -1950,7 +1950,7 @@ static void Task_ClearBoard(u8 taskId) { DrawStdWindowFrame(sTextWindowId, FALSE); AddTextPrinterParameterized(sTextWindowId, FONT_NORMAL, Roulette_Text_CoinCaseIsFull, 0, 1, TEXT_SPEED_FF, NULL); - CopyWindowToVram(sTextWindowId, 3); + CopyWindowToVram(sTextWindowId, COPYWIN_FULL); StartTaskAfterDelayOrInput(taskId, Task_AskKeepPlaying, NO_DELAY, A_BUTTON | B_BUTTON); } else @@ -3427,7 +3427,7 @@ static void Task_PrintMinBet(u8 taskId) StringExpandPlaceholders(gStringVar4, Roulette_Text_PlayMinimumWagerIsX); DrawStdWindowFrame(0, FALSE); AddTextPrinterParameterized(0, FONT_NORMAL, gStringVar4, 0, 1, TEXT_SPEED_FF, NULL); - CopyWindowToVram(0, 3); + CopyWindowToVram(0, COPYWIN_FULL); gTasks[taskId].func = Task_ShowMinBetYesNo; } } @@ -3446,7 +3446,7 @@ static void Task_PrintRouletteEntryMsg(u8 taskId) // Special rate for Game Corner service day (only at second table) DrawStdWindowFrame(0, FALSE); AddTextPrinterParameterized(0, FONT_NORMAL, Roulette_Text_SpecialRateTable, 0, 1, TEXT_SPEED_FF, NULL); - CopyWindowToVram(0, 3); + CopyWindowToVram(0, COPYWIN_FULL); gTasks[taskId].func = Task_PrintMinBet; } else @@ -3455,7 +3455,7 @@ static void Task_PrintRouletteEntryMsg(u8 taskId) StringExpandPlaceholders(gStringVar4, Roulette_Text_PlayMinimumWagerIsX); DrawStdWindowFrame(0, FALSE); AddTextPrinterParameterized(0, FONT_NORMAL, gStringVar4, 0, 1, TEXT_SPEED_FF, NULL); - CopyWindowToVram(0, 3); + CopyWindowToVram(0, COPYWIN_FULL); gTasks[taskId].func = Task_ShowMinBetYesNo; } } @@ -3465,7 +3465,7 @@ static void Task_PrintRouletteEntryMsg(u8 taskId) StringExpandPlaceholders(gStringVar4, Roulette_Text_NotEnoughCoins); DrawStdWindowFrame(0, FALSE); AddTextPrinterParameterized(0, FONT_NORMAL, gStringVar4, 0, 1, TEXT_SPEED_FF, NULL); - CopyWindowToVram(0, 3); + CopyWindowToVram(0, COPYWIN_FULL); gTasks[taskId].func = Task_NotEnoughForMinBet; gTasks[taskId].tCoins = 0; gTasks[taskId].data[0] = 0; diff --git a/src/save_failed_screen.c b/src/save_failed_screen.c index 4f0373270..e7bdc3400 100644 --- a/src/save_failed_screen.c +++ b/src/save_failed_screen.c @@ -222,8 +222,8 @@ static void CB2_SaveFailedScreen(void) DrawStdFrameWithCustomTileAndPalette(sWindowIds[CLOCK_WIN_ID], FALSE, 0x214, 0xE); FillWindowPixelBuffer(sWindowIds[CLOCK_WIN_ID], PIXEL_FILL(1)); // backwards? FillWindowPixelBuffer(sWindowIds[TEXT_WIN_ID], PIXEL_FILL(1)); - CopyWindowToVram(sWindowIds[CLOCK_WIN_ID], 2); // again? - CopyWindowToVram(sWindowIds[TEXT_WIN_ID], 1); + CopyWindowToVram(sWindowIds[CLOCK_WIN_ID], COPYWIN_GFX); // again? + CopyWindowToVram(sWindowIds[TEXT_WIN_ID], COPYWIN_MAP); SaveFailedScreenTextPrint(gText_SaveFailedCheckingBackup, 1, 0); BeginNormalPaletteFade(PALETTES_ALL, 0, 16, 0, RGB_BLACK); EnableInterrupts(1); diff --git a/src/scrcmd.c b/src/scrcmd.c index a6223bdf5..ce312a563 100644 --- a/src/scrcmd.c +++ b/src/scrcmd.c @@ -1533,7 +1533,7 @@ bool8 ScrCmd_braillemessage(struct ScriptContext *ctx) PutWindowTilemap(gBrailleWindowId); FillWindowPixelBuffer(gBrailleWindowId, PIXEL_FILL(1)); AddTextPrinterParameterized(gBrailleWindowId, FONT_BRAILLE, gStringVar4, xText, yText, 0xFF, 0x0); - CopyWindowToVram(gBrailleWindowId, 3); + CopyWindowToVram(gBrailleWindowId, COPYWIN_FULL); return FALSE; } diff --git a/src/script_menu.c b/src/script_menu.c index f0dccd9f9..30aa4a063 100644 --- a/src/script_menu.c +++ b/src/script_menu.c @@ -280,7 +280,7 @@ bool8 ScriptMenu_MultichoiceGrid(u8 left, u8 top, u8 multichoiceId, bool8 ignore SetStandardWindowBorderStyle(gTasks[taskId].tWindowId, 0); PrintMenuGridTable(gTasks[taskId].tWindowId, newWidth * 8, columnCount, rowCount, sMultichoiceLists[multichoiceId].list); InitMenuActionGrid(gTasks[taskId].tWindowId, newWidth * 8, columnCount, rowCount, 0); - CopyWindowToVram(gTasks[taskId].tWindowId, 3); + CopyWindowToVram(gTasks[taskId].tWindowId, COPYWIN_FULL); return TRUE; } } @@ -373,7 +373,7 @@ static void CreatePCMultichoice(void) StringExpandPlaceholders(gStringVar4, gText_PlayersPC); PrintPlayerNameOnWindow(windowId, gStringVar4, y, 17); InitMenuInUpperLeftCornerPlaySoundWhenAPressed(windowId, numChoices, 0); - CopyWindowToVram(windowId, 3); + CopyWindowToVram(windowId, COPYWIN_FULL); InitMultichoiceCheckWrap(FALSE, numChoices, windowId, MULTI_PC); } @@ -533,7 +533,7 @@ static void CreateLilycoveSSTidalMultichoice(void) } InitMenuInUpperLeftCornerPlaySoundWhenAPressed(windowId, count, count - 1); - CopyWindowToVram(windowId, 3); + CopyWindowToVram(windowId, COPYWIN_FULL); InitMultichoiceCheckWrap(FALSE, count, windowId, MULTI_SSTIDAL_LILYCOVE); } } @@ -698,7 +698,7 @@ static void CreateStartMenuForPokenavTutorial(void) AddTextPrinterParameterized(windowId, FONT_NORMAL, gText_MenuOptionExit, 8, 121, TEXT_SPEED_FF, NULL); sub_81983AC(windowId, FONT_NORMAL, 0, 9, 16, ARRAY_COUNT(MultichoiceList_ForcedStartMenu), 0); InitMultichoiceNoWrap(FALSE, ARRAY_COUNT(MultichoiceList_ForcedStartMenu), windowId, MULTI_FORCED_START_MENU); - CopyWindowToVram(windowId, 3); + CopyWindowToVram(windowId, COPYWIN_FULL); } #define tWindowId data[6] diff --git a/src/shop.c b/src/shop.c index 817146d78..43b7816f5 100755 --- a/src/shop.c +++ b/src/shop.c @@ -303,7 +303,7 @@ static u8 CreateShopMenu(u8 martType) PrintMenuTable(sMartInfo.windowId, numMenuItems, sMartInfo.menuActions); InitMenuInUpperLeftCornerPlaySoundWhenAPressed(sMartInfo.windowId, numMenuItems, 0); PutWindowTilemap(sMartInfo.windowId); - CopyWindowToVram(sMartInfo.windowId, 1); + CopyWindowToVram(sMartInfo.windowId, COPYWIN_MAP); return CreateTask(Task_ShopMenu, 8); } diff --git a/src/slot_machine.c b/src/slot_machine.c index 7d4610273..1c21f230d 100644 --- a/src/slot_machine.c +++ b/src/slot_machine.c @@ -1254,7 +1254,7 @@ static bool8 SlotAction_PrintMsg_Need3Coins(struct Task *task) { DrawDialogueFrame(0, 0); AddTextPrinterParameterized(0, FONT_NORMAL, gText_YouDontHaveThreeCoins, 0, 1, 0, 0); - CopyWindowToVram(0, 3); + CopyWindowToVram(0, COPYWIN_FULL); sSlotMachine->state = SLOT_ACTION_WAIT_MSG_NEED_3_COINS; return FALSE; } @@ -1519,7 +1519,7 @@ static bool8 SlotAction_AskQuit(struct Task *task) { DrawDialogueFrame(0, 0); AddTextPrinterParameterized(0, FONT_NORMAL, gText_QuitTheGame, 0, 1, 0, 0); - CopyWindowToVram(0, 3); + CopyWindowToVram(0, COPYWIN_FULL); CreateYesNoMenuParameterized(0x15, 7, 0x214, 0x180, 0xE, 0xF); sSlotMachine->state = SLOT_ACTION_HANDLE_QUIT_INPUT; return FALSE; @@ -1551,7 +1551,7 @@ static bool8 SlotAction_PrintMsg_9999Coins(struct Task *task) { DrawDialogueFrame(0, 0); AddTextPrinterParameterized(0, FONT_NORMAL, gText_YouveGot9999Coins, 0, 1, 0, 0); - CopyWindowToVram(0, 3); + CopyWindowToVram(0, COPYWIN_FULL); sSlotMachine->state = SLOT_ACTION_WAIT_MSG_MAX_COINS; return FALSE; } @@ -1572,7 +1572,7 @@ static bool8 SlotAction_PrintMsg_NoMoreCoins(struct Task *task) { DrawDialogueFrame(0, 0); AddTextPrinterParameterized(0, FONT_NORMAL, gText_YouveRunOutOfCoins, 0, 1, 0, 0); - CopyWindowToVram(0, 3); + CopyWindowToVram(0, COPYWIN_FULL); sSlotMachine->state = SLOT_ACTION_WAIT_MSG_NO_MORE_COINS; return FALSE; } @@ -3445,7 +3445,7 @@ static void InfoBox_DrawWindow(struct Task *task) static void InfoBox_AddText(struct Task *task) { AddTextPrinterParameterized3(1, FONT_NORMAL, 2, 5, sColors_ReeltimeHelp, 0, gText_ReelTimeHelp); - CopyWindowToVram(1, 3); + CopyWindowToVram(1, COPYWIN_FULL); BeginNormalPaletteFade(PALETTES_ALL, 0, 16, 0, RGB(0, 0, 0)); task->tState++; } @@ -3456,7 +3456,7 @@ static void InfoBox_AwaitPlayerInput(struct Task *task) { FillWindowPixelBuffer(1, PIXEL_FILL(0)); ClearWindowTilemap(1); - CopyWindowToVram(1, 1); + CopyWindowToVram(1, COPYWIN_MAP); RemoveWindow(1); BeginNormalPaletteFade(PALETTES_ALL, 0, 0, 16, RGB(0, 0, 0)); task->tState++; diff --git a/src/start_menu.c b/src/start_menu.c index a9d3ce15b..1c0b006e6 100644 --- a/src/start_menu.c +++ b/src/start_menu.c @@ -387,7 +387,7 @@ static void ShowSafariBallsWindow(void) ConvertIntToDecimalStringN(gStringVar1, gNumSafariBalls, STR_CONV_MODE_RIGHT_ALIGN, 2); StringExpandPlaceholders(gStringVar4, gText_SafariBallStock); AddTextPrinterParameterized(sSafariBallsWindowId, FONT_NORMAL, gStringVar4, 0, 1, 0xFF, NULL); - CopyWindowToVram(sSafariBallsWindowId, 2); + CopyWindowToVram(sSafariBallsWindowId, COPYWIN_GFX); } static void ShowPyramidFloorWindow(void) @@ -402,7 +402,7 @@ static void ShowPyramidFloorWindow(void) StringCopy(gStringVar1, sPyramidFloorNames[gSaveBlock2Ptr->frontier.curChallengeBattleNum]); StringExpandPlaceholders(gStringVar4, gText_BattlePyramidFloor); AddTextPrinterParameterized(sBattlePyramidFloorWindowId, FONT_NORMAL, gStringVar4, 0, 1, 0xFF, NULL); - CopyWindowToVram(sBattlePyramidFloorWindowId, 2); + CopyWindowToVram(sBattlePyramidFloorWindowId, COPYWIN_GFX); } static void RemoveExtraStartMenuWindows(void) @@ -410,7 +410,7 @@ static void RemoveExtraStartMenuWindows(void) if (GetSafariZoneFlag()) { ClearStdWindowAndFrameToTransparent(sSafariBallsWindowId, FALSE); - CopyWindowToVram(sSafariBallsWindowId, 2); + CopyWindowToVram(sSafariBallsWindowId, COPYWIN_GFX); RemoveWindow(sSafariBallsWindowId); } if (InBattlePyramid()) @@ -483,7 +483,7 @@ static bool32 InitStartMenuStep(void) break; case 5: sStartMenuCursorPos = sub_81983AC(GetStartMenuWindowId(), FONT_NORMAL, 0, 9, 16, sNumStartMenuActions, sStartMenuCursorPos); - CopyWindowToVram(GetStartMenuWindowId(), TRUE); + CopyWindowToVram(GetStartMenuWindowId(), COPYWIN_MAP); return TRUE; } @@ -1247,7 +1247,7 @@ static void Task_SaveAfterLinkBattle(u8 taskId) TEXT_COLOR_LIGHT_GRAY); DrawTextBorderOuter(0, 8, 14); PutWindowTilemap(0); - CopyWindowToVram(0, 3); + CopyWindowToVram(0, COPYWIN_FULL); BeginNormalPaletteFade(PALETTES_ALL, 0, 16, 0, RGB_BLACK); if (gWirelessCommType != 0 && InUnionRoom()) @@ -1363,7 +1363,7 @@ static void ShowSaveInfoWindow(void) xOffset = GetStringRightAlignXOffset(FONT_NORMAL, gStringVar4, 0x70); AddTextPrinterParameterized(sSaveInfoWindowId, FONT_NORMAL, gStringVar4, xOffset, yOffset, 0xFF, NULL); - CopyWindowToVram(sSaveInfoWindowId, 2); + CopyWindowToVram(sSaveInfoWindowId, COPYWIN_GFX); } static void RemoveSaveInfoWindow(void) diff --git a/src/trade.c b/src/trade.c index 475b82d5e..5716fdd84 100644 --- a/src/trade.c +++ b/src/trade.c @@ -1397,7 +1397,7 @@ static void TradeMenuProcessInput(void) PrintMenuTable(1, ARRAY_COUNT(sSelectTradeMonActions), sSelectTradeMonActions); InitMenuInUpperLeftCornerPlaySoundWhenAPressed(1, 2, 0); PutWindowTilemap(1); - CopyWindowToVram(1, 3); + CopyWindowToVram(1, COPYWIN_FULL); sTradeMenuData->tradeMenuFunc = TRADEMENUFUNC_SELECTED_MON; } // Cursor is in partner's party @@ -1584,7 +1584,7 @@ static void RestoreNicknamesCoveredByYesNo(void) for (i = 0; i < sTradeMenuData->partyCounts[1] - 4; i++) { PutWindowTilemap(i + 12); - CopyWindowToVram(i + 12, 1); + CopyWindowToVram(i + 12, COPYWIN_MAP); } } @@ -1855,9 +1855,9 @@ static void DrawTradeMenuParty(u8 whichParty) BufferTradeMonMoves(movesString, selectedMonParty, partyIdx); AddTextPrinterParameterized4((whichParty * 2) + 15, FONT_NORMAL, 0, 0, 0, 0, sTradeTextColors, 0, movesString); PutWindowTilemap((whichParty * 2) + 14); - CopyWindowToVram((whichParty * 2) + 14, 3); + CopyWindowToVram((whichParty * 2) + 14, COPYWIN_FULL); PutWindowTilemap((whichParty * 2) + 15); - CopyWindowToVram((whichParty * 2) + 15, 3); + CopyWindowToVram((whichParty * 2) + 15, COPYWIN_FULL); sTradeMenuData->drawPartyState[whichParty]++; break; case 4: @@ -1929,7 +1929,7 @@ static void PrintMonNicknameForTradeMenu(u8 whichParty, u8 windowId, u8 *nicknam xPos = GetStringCenterAlignXOffset(FONT_SMALL, nickname, 64); AddTextPrinterParameterized3(windowId, FONT_SMALL, xPos, 4, sTradeTextColors, 0, nickname); PutWindowTilemap(windowId); - CopyWindowToVram(windowId, 3); + CopyWindowToVram(windowId, COPYWIN_FULL); } static void PrintPartyNicknamesForTradeMenu(u8 whichParty) @@ -2156,7 +2156,7 @@ static void PrintTradeMessage(u8 messageId) AddTextPrinterParameterized(0, FONT_NORMAL, sTradeMessages[messageId], 0, 1, TEXT_SPEED_FF, NULL); DrawTextBorderOuter(0, 20, 12); PutWindowTilemap(0); - CopyWindowToVram(0, 3); + CopyWindowToVram(0, COPYWIN_FULL); } static bool8 LoadTradeMenuSpriteSheetsAndPalettes(void) @@ -2899,7 +2899,7 @@ void LinkTradeDrawWindow(void) { FillWindowPixelBuffer(0, PIXEL_FILL(15)); PutWindowTilemap(0); - CopyWindowToVram(0, 3); + CopyWindowToVram(0, COPYWIN_FULL); } static void InitTradeBgInternal(void) @@ -2976,7 +2976,7 @@ static void CB2_InGameTrade(void) LoadTradeMonPic(TRADE_PARTNER, 1); FillWindowPixelBuffer(0, PIXEL_FILL(15)); PutWindowTilemap(0); - CopyWindowToVram(0, 3); + CopyWindowToVram(0, COPYWIN_FULL); gMain.state++; break; case 9: @@ -3433,7 +3433,7 @@ static bool8 AnimateTradeSequenceCable(void) { SetTradeSequenceBgGpuRegs(4); FillWindowPixelBuffer(0, PIXEL_FILL(15)); - CopyWindowToVram(0, 3); + CopyWindowToVram(0, COPYWIN_FULL); sTradeData->state++; } break; @@ -3904,7 +3904,7 @@ static bool8 AnimateTradeSequenceWireless(void) { SetTradeSequenceBgGpuRegs(4); FillWindowPixelBuffer(0, PIXEL_FILL(15)); - CopyWindowToVram(0, 3); + CopyWindowToVram(0, COPYWIN_FULL); sTradeData->state++; } break; @@ -4834,7 +4834,7 @@ void DrawTextOnTradeWindow(u8 windowId, const u8 *str, u8 speed) sTradeData->textColors[1] = TEXT_COLOR_WHITE; sTradeData->textColors[2] = TEXT_COLOR_GREEN; AddTextPrinterParameterized4(windowId, FONT_NORMAL, 0, 2, 0, 0, sTradeData->textColors, speed, str); - CopyWindowToVram(windowId, 3); + CopyWindowToVram(windowId, COPYWIN_FULL); } #define idx data[0] diff --git a/src/trainer_card.c b/src/trainer_card.c index a2c90e867..b72e45498 100755 --- a/src/trainer_card.c +++ b/src/trainer_card.c @@ -498,7 +498,7 @@ static void Task_TrainerCard(u8 taskId) SetCloseLinkCallback(); DrawDialogueFrame(0, 1); AddTextPrinterParameterized(0, FONT_NORMAL, gText_WaitingTrainerFinishReading, 0, 1, 255, 0); - CopyWindowToVram(0, 3); + CopyWindowToVram(0, COPYWIN_FULL); sData->mainState = STATE_CLOSE_CARD_LINK; break; case STATE_CLOSE_CARD_LINK: @@ -1408,7 +1408,7 @@ static void LoadStickerGfx(void) static void DrawTrainerCardWindow(u8 windowId) { PutWindowTilemap(windowId); - CopyWindowToVram(windowId, 3); + CopyWindowToVram(windowId, COPYWIN_FULL); } static u8 SetCardBgsAndPals(void) diff --git a/src/trainer_hill.c b/src/trainer_hill.c index 621f81133..f0a633729 100644 --- a/src/trainer_hill.c +++ b/src/trainer_hill.c @@ -614,7 +614,7 @@ void PrintOnTrainerHillRecordsWindow(void) } PutWindowTilemap(0); - CopyWindowToVram(0, 3); + CopyWindowToVram(0, COPYWIN_FULL); FreeDataStruct(); } diff --git a/src/union_room.c b/src/union_room.c index 5196c1cdb..a2fbd382d 100644 --- a/src/union_room.c +++ b/src/union_room.c @@ -306,7 +306,7 @@ static void PrintNumPlayersWaitingForMsg(u8 windowId, u8 capacityCode, u8 string break; } - CopyWindowToVram(windowId, 2); + CopyWindowToVram(windowId, COPYWIN_GFX); } static void PrintPlayerNameAndIdOnWindow(u8 windowId) @@ -434,7 +434,7 @@ static void Task_TryBecomeLinkLeader(u8 taskId) FillWindowPixelBuffer(data->bButtonCancelWindowId, PIXEL_FILL(2)); PrintUnionRoomText(data->bButtonCancelWindowId, 0, sText_BButtonCancel, 8, 1, UR_COLOR_CANCEL); PutWindowTilemap(data->bButtonCancelWindowId); - CopyWindowToVram(data->bButtonCancelWindowId, 2); + CopyWindowToVram(data->bButtonCancelWindowId, COPYWIN_GFX); DrawStdWindowFrame(data->listWindowId, FALSE); gMultiuseListMenuTemplate = sListMenuTemplate_PossibleGroupMembers; @@ -443,7 +443,7 @@ static void Task_TryBecomeLinkLeader(u8 taskId) DrawStdWindowFrame(data->nPlayerModeWindowId, FALSE); PutWindowTilemap(data->nPlayerModeWindowId); - CopyWindowToVram(data->nPlayerModeWindowId, 2); + CopyWindowToVram(data->nPlayerModeWindowId, COPYWIN_GFX); CopyBgTilemapBufferToVram(0); data->playerCount = 1; @@ -1014,7 +1014,7 @@ static void Task_TryJoinLinkGroup(u8 taskId) FillWindowPixelBuffer(data->bButtonCancelWindowId, PIXEL_FILL(2)); PrintUnionRoomText(data->bButtonCancelWindowId, 0, sText_ChooseJoinCancel, 8, 1, UR_COLOR_CANCEL); PutWindowTilemap(data->bButtonCancelWindowId); - CopyWindowToVram(data->bButtonCancelWindowId, 2); + CopyWindowToVram(data->bButtonCancelWindowId, COPYWIN_GFX); DrawStdWindowFrame(data->listWindowId, FALSE); gMultiuseListMenuTemplate = sListMenuTemplate_UnionRoomGroups; @@ -1024,7 +1024,7 @@ static void Task_TryJoinLinkGroup(u8 taskId) DrawStdWindowFrame(data->playerNameAndIdWindowId, FALSE); PutWindowTilemap(data->playerNameAndIdWindowId); PrintPlayerNameAndIdOnWindow(data->playerNameAndIdWindowId); - CopyWindowToVram(data->playerNameAndIdWindowId, 2); + CopyWindowToVram(data->playerNameAndIdWindowId, COPYWIN_GFX); CopyBgTilemapBufferToVram(0); data->leaderId = 0; @@ -2131,7 +2131,7 @@ static void Task_CardOrNewsWithFriend(u8 taskId) FillWindowPixelBuffer(data->playerNameAndIdWindowId, PIXEL_FILL(1)); PutWindowTilemap(data->playerNameAndIdWindowId); PrintPlayerNameAndIdOnWindow(data->playerNameAndIdWindowId); - CopyWindowToVram(data->playerNameAndIdWindowId, 2); + CopyWindowToVram(data->playerNameAndIdWindowId, COPYWIN_GFX); CopyBgTilemapBufferToVram(0); data->leaderId = 0; @@ -3637,7 +3637,7 @@ static s8 UnionRoomHandleYesNo(u8 *state, bool32 noDraw) case 1: if (noDraw) { - sub_8198C78(); + EraseYesNoWindow(); *state = 0; return -3; } @@ -3658,7 +3658,7 @@ static u8 CreateTradeBoardWindow(const struct WindowTemplate * template) DrawStdWindowFrame(windowId, FALSE); FillWindowPixelBuffer(windowId, PIXEL_FILL(15)); PrintUnionRoomText(windowId, 1, sText_NameWantedOfferLv, 8, 1, UR_COLOR_TRADE_BOARD_OTHER); - CopyWindowToVram(windowId, 2); + CopyWindowToVram(windowId, COPYWIN_GFX); PutWindowTilemap(windowId); return windowId; } @@ -3689,7 +3689,7 @@ static s32 ListMenuHandler_AllItemsAvailable(u8 *state, u8 *windowId, u8 *listMe gMultiuseListMenuTemplate = *menuTemplate; gMultiuseListMenuTemplate.windowId = *windowId; *listMenuId = ListMenuInit(&gMultiuseListMenuTemplate, 0, 0); - CopyWindowToVram(*windowId, TRUE); + CopyWindowToVram(*windowId, COPYWIN_MAP); (*state)++; break; case 1: @@ -3736,7 +3736,7 @@ static s32 TradeBoardMenuHandler(u8 *state, u8 *mainWindowId, u8 *listMenuId, u8 (*state)++; break; case 1: - CopyWindowToVram(*mainWindowId, TRUE); + CopyWindowToVram(*mainWindowId, COPYWIN_MAP); (*state)++; break; case 2: diff --git a/src/union_room_battle.c b/src/union_room_battle.c index 6c4dfc268..1ec8be77b 100644 --- a/src/union_room_battle.c +++ b/src/union_room_battle.c @@ -89,7 +89,7 @@ static bool32 PrintUnionRoomBattleMessage(s16 * state, const u8 * str, s32 speed DrawTextBorderOuter(0, 0x001, 0xD); AddTextPrinterForUnionRoomBattle(0, str, 0, 1, speed); PutWindowTilemap(0); - CopyWindowToVram(0, 3); + CopyWindowToVram(0, COPYWIN_FULL); (*state)++; break; case 1: diff --git a/src/union_room_chat.c b/src/union_room_chat.c index 90a9cda48..96c2aa886 100755 --- a/src/union_room_chat.c +++ b/src/union_room_chat.c @@ -2276,7 +2276,7 @@ static bool32 Display_ShowKeyboardSwapMenu(u8 *state) { case 0: ShowKeyboardSwapMenu(); - CopyWindowToVram(3, 3); + CopyWindowToVram(3, COPYWIN_FULL); break; case 1: return IsDma3ManagerBusyWithBgCopy(); @@ -2292,7 +2292,7 @@ static bool32 Display_HideKeyboardSwapMenu(u8 *state) { case 0: HideKeyboardSwapMenu(); - CopyWindowToVram(3, 3); + CopyWindowToVram(3, COPYWIN_FULL); break; case 1: return IsDma3ManagerBusyWithBgCopy(); @@ -2312,7 +2312,7 @@ static bool32 Display_SwitchPages(u8 *state) return TRUE; PrintCurrentKeyboardPage(); - CopyWindowToVram(2, 2); + CopyWindowToVram(2, COPYWIN_GFX); break; case 1: if (IsDma3ManagerBusyWithBgCopy()) @@ -2345,7 +2345,7 @@ static bool32 Display_AskQuitChatting(u8 *state) case 0: AddStdMessageWindow(STDMESSAGE_QUIT_CHATTING, 0); AddYesNoMenuAt(23, 11, 1); - CopyWindowToVram(sDisplay->messageWindowId, 3); + CopyWindowToVram(sDisplay->messageWindowId, COPYWIN_FULL); break; case 1: return IsDma3ManagerBusyWithBgCopy(); @@ -2389,7 +2389,7 @@ static bool32 Display_UpdateMessageBuffer(u8 *state) FillTextEntryWindow(x, width, 0); str = GetMessageEntryBuffer(); DrawTextEntryMessage(0, str, 3, 1, 2); - CopyWindowToVram(1, 2); + CopyWindowToVram(1, COPYWIN_GFX); break; case 1: if (!IsDma3ManagerBusyWithBgCopy()) @@ -2418,13 +2418,13 @@ static bool32 Display_AskRegisterText(u8 *state) length = StringLength_Multibyte(str); FillTextEntryWindow(x, length, PIXEL_FILL(6)); DrawTextEntryMessage(x, str, 0, 4, 5); - CopyWindowToVram(1, 2); + CopyWindowToVram(1, COPYWIN_GFX); break; case 1: if (!IsDma3ManagerBusyWithBgCopy()) { AddStdMessageWindow(STDMESSAGE_REGISTER_WHERE, 16); - CopyWindowToVram(sDisplay->messageWindowId, 3); + CopyWindowToVram(sDisplay->messageWindowId, COPYWIN_FULL); } else { @@ -2459,13 +2459,13 @@ static bool32 Display_CancelRegister(u8 *state) length = StringLength_Multibyte(str); FillTextEntryWindow(x, length, PIXEL_FILL(0)); DrawTextEntryMessage(x, str, 3, 1, 2); - CopyWindowToVram(1, 2); + CopyWindowToVram(1, COPYWIN_GFX); break; case 1: if (!IsDma3ManagerBusyWithBgCopy()) { HideStdMessageWindow(); - CopyWindowToVram(sDisplay->messageWindowId, 3); + CopyWindowToVram(sDisplay->messageWindowId, COPYWIN_FULL); } else { @@ -2497,7 +2497,7 @@ static bool32 Display_ReturnToKeyboard(u8 *state) { case 0: PrintCurrentKeyboardPage(); - CopyWindowToVram(2, 2); + CopyWindowToVram(2, COPYWIN_GFX); (*state)++; break; case 1: @@ -2523,7 +2523,7 @@ static bool32 Display_ScrollChat(u8 *state) str = GetLastReceivedMessage(); colorIdx = GetReceivedPlayerIndex(); PrintChatMessage(row, str, colorIdx); - CopyWindowToVram(0, 2); + CopyWindowToVram(0, COPYWIN_GFX); break; case 1: if (IsDma3ManagerBusyWithBgCopy()) @@ -2543,7 +2543,7 @@ static bool32 Display_ScrollChat(u8 *state) // fall through case 2: ScrollWindow(0, 0, 5, PIXEL_FILL(1)); - CopyWindowToVram(0, 2); + CopyWindowToVram(0, COPYWIN_GFX); sDisplay->scrollCount++; (*state)++; // fall through @@ -2588,7 +2588,7 @@ static bool32 Display_PrintInputText(u8 *state) { case 0: AddStdMessageWindow(STDMESSAGE_INPUT_TEXT, 16); - CopyWindowToVram(sDisplay->messageWindowId, 3); + CopyWindowToVram(sDisplay->messageWindowId, COPYWIN_FULL); (*state)++; break; case 1: @@ -2604,7 +2604,7 @@ static bool32 Display_PrintExitingChat(u8 *state) { case 0: AddStdMessageWindow(STDMESSAGE_EXITING_CHAT, 0); - CopyWindowToVram(sDisplay->messageWindowId, 3); + CopyWindowToVram(sDisplay->messageWindowId, COPYWIN_FULL); (*state)++; break; case 1: @@ -2625,7 +2625,7 @@ static bool32 Display_PrintLeaderLeft(u8 *state) str = GetChatHostName(); DynamicPlaceholderTextUtil_SetPlaceholderPtr(0, str); AddStdMessageWindow(STDMESSAGE_LEADER_LEFT, 0); - CopyWindowToVram(sDisplay->messageWindowId, 3); + CopyWindowToVram(sDisplay->messageWindowId, COPYWIN_FULL); (*state)++; break; case 1: @@ -2642,7 +2642,7 @@ static bool32 Display_AskSave(u8 *state) case 0: AddStdMessageWindow(STDMESSAGE_ASK_SAVE, 0); AddYesNoMenuAt(23, 10, 1); - CopyWindowToVram(sDisplay->messageWindowId, 3); + CopyWindowToVram(sDisplay->messageWindowId, COPYWIN_FULL); (*state)++; break; case 1: @@ -2659,7 +2659,7 @@ static bool32 Display_AskOverwriteSave(u8 *state) case 0: AddStdMessageWindow(STDMESSAGE_ASK_OVERWRITE, 0); AddYesNoMenuAt(23, 10, 1); - CopyWindowToVram(sDisplay->messageWindowId, 3); + CopyWindowToVram(sDisplay->messageWindowId, COPYWIN_FULL); (*state)++; break; case 1: @@ -2675,7 +2675,7 @@ static bool32 Display_PrintSavingDontTurnOff(u8 *state) { case 0: AddStdMessageWindow(STDMESSAGE_SAVING_NO_OFF, 0); - CopyWindowToVram(sDisplay->messageWindowId, 3); + CopyWindowToVram(sDisplay->messageWindowId, COPYWIN_FULL); (*state)++; break; case 1: @@ -2693,7 +2693,7 @@ static bool32 Display_PrintSavedTheGame(u8 *state) DynamicPlaceholderTextUtil_Reset(); DynamicPlaceholderTextUtil_SetPlaceholderPtr(0, gSaveBlock2Ptr->playerName); AddStdMessageWindow(STDMESSAGE_SAVED_THE_GAME, 0); - CopyWindowToVram(sDisplay->messageWindowId, 3); + CopyWindowToVram(sDisplay->messageWindowId, COPYWIN_FULL); (*state)++; break; case 1: @@ -2710,7 +2710,7 @@ static bool32 Display_AskConfirmLeaderLeave(u8 *state) case 0: AddStdMessageWindow(STDMESSAGE_WARN_LEADER_LEAVE, 0); AddYesNoMenuAt(23, 10, 1); - CopyWindowToVram(sDisplay->messageWindowId, 3); + CopyWindowToVram(sDisplay->messageWindowId, COPYWIN_FULL); (*state)++; break; case 1: @@ -3085,14 +3085,14 @@ static void LoadChatMessagesWindow(void) LoadPalette(sUnk_Palette2, 0xF0, sizeof(sUnk_Palette2)); PutWindowTilemap(0); FillWindowPixelBuffer(0, PIXEL_FILL(1)); - CopyWindowToVram(0, 3); + CopyWindowToVram(0, COPYWIN_FULL); } static void LoadKeyboardWindow(void) { PutWindowTilemap(2); PrintCurrentKeyboardPage(); - CopyWindowToVram(2, 3); + CopyWindowToVram(2, COPYWIN_FULL); } static void LoadTextEntryWindow(void) @@ -3107,7 +3107,7 @@ static void LoadTextEntryWindow(void) FillWindowPixelBuffer(1, PIXEL_FILL(0)); PutWindowTilemap(1); - CopyWindowToVram(1, 3); + CopyWindowToVram(1, COPYWIN_FULL); } static void LoadKeyboardSwapWindow(void) diff --git a/src/use_pokeblock.c b/src/use_pokeblock.c index dcfc27d91..e67ade342 100644 --- a/src/use_pokeblock.c +++ b/src/use_pokeblock.c @@ -878,7 +878,7 @@ static void AskUsePokeblock(void) DrawTextBorderOuter(WIN_TEXT, 151, 14); AddTextPrinterParameterized(WIN_TEXT, FONT_NORMAL, gStringVar4, 0, 1, 0, NULL); PutWindowTilemap(WIN_TEXT); - CopyWindowToVram(WIN_TEXT, 3); + CopyWindowToVram(WIN_TEXT, COPYWIN_FULL); CreateYesNoMenu(&sUsePokeblockYesNoWinTemplate, 151, 14, 0); } @@ -919,7 +919,7 @@ static void PrintFirstEnhancement(void) PrintMenuWindowText(gStringVar4); PutWindowTilemap(WIN_TEXT); - CopyWindowToVram(WIN_TEXT, 3); + CopyWindowToVram(WIN_TEXT, COPYWIN_FULL); } static bool8 TryPrintNextEnhancement(void) @@ -943,7 +943,7 @@ static bool8 TryPrintNextEnhancement(void) BufferEnhancedStatText(gStringVar4, sInfo->statId, sInfo->enhancements[sInfo->statId]); PrintMenuWindowText(gStringVar4); - CopyWindowToVram(WIN_TEXT, 2); + CopyWindowToVram(WIN_TEXT, COPYWIN_GFX); return TRUE; } @@ -954,14 +954,14 @@ static void PrintWontEatAnymore(void) DrawTextBorderOuter(WIN_TEXT, 151, 14); AddTextPrinterParameterized(WIN_TEXT, FONT_NORMAL, gText_WontEatAnymore, 0, 1, 0, NULL); PutWindowTilemap(WIN_TEXT); - CopyWindowToVram(WIN_TEXT, 3); + CopyWindowToVram(WIN_TEXT, COPYWIN_FULL); } static void EraseMenuWindow(void) { rbox_fill_rectangle(WIN_TEXT); ClearWindowTilemap(WIN_TEXT); - CopyWindowToVram(WIN_TEXT, 3); + CopyWindowToVram(WIN_TEXT, COPYWIN_FULL); } static void PrintMenuWindowText(const u8 *message) @@ -1399,13 +1399,13 @@ static void UpdateMonInfoText(u16 loadId, bool8 firstPrint) if (firstPrint) { - CopyWindowToVram(WIN_NAME, 3); - CopyWindowToVram(WIN_NATURE, 3); + CopyWindowToVram(WIN_NAME, COPYWIN_FULL); + CopyWindowToVram(WIN_NATURE, COPYWIN_FULL); } else { - CopyWindowToVram(WIN_NAME, 2); - CopyWindowToVram(WIN_NATURE, 2); + CopyWindowToVram(WIN_NAME, COPYWIN_GFX); + CopyWindowToVram(WIN_NATURE, COPYWIN_GFX); } } diff --git a/src/wireless_communication_status_screen.c b/src/wireless_communication_status_screen.c index 295eab97f..7a69cf6d6 100644 --- a/src/wireless_communication_status_screen.c +++ b/src/wireless_communication_status_screen.c @@ -243,9 +243,9 @@ static void PrintHeaderTexts(void) } WCSS_AddTextPrinterParameterized(1, FONT_NORMAL, sHeaderTexts[i + 1], 0, 30 * i + 8, COLORMODE_RED); PutWindowTilemap(0); - CopyWindowToVram(0, 2); + CopyWindowToVram(0, COPYWIN_GFX); PutWindowTilemap(1); - CopyWindowToVram(1, 2); + CopyWindowToVram(1, COPYWIN_GFX); } #define tState data[0] @@ -285,7 +285,7 @@ static void Task_WirelessCommunicationScreen(u8 taskId) WCSS_AddTextPrinterParameterized(2, FONT_NORMAL, gStringVar4, 12, 98, COLORMODE_RED); } PutWindowTilemap(2); - CopyWindowToVram(2, 3); + CopyWindowToVram(2, COPYWIN_FULL); } if (JOY_NEW(A_BUTTON) || JOY_NEW(B_BUTTON)) {