From c291fa8e7fc8f823544e483eccb9b87fd7f99206 Mon Sep 17 00:00:00 2001 From: GriffinR Date: Wed, 3 Nov 2021 23:02:06 -0400 Subject: [PATCH] Propagate BG_COORD constants --- gflib/bg.h | 1 + src/battle_dome.c | 16 +++++------ src/battle_factory_screen.c | 28 +++++++++---------- src/battle_records.c | 16 +++++------ src/battle_transition_frontier.c | 6 ++-- src/berry_blender.c | 8 +++--- src/berry_crush.c | 16 +++++------ src/berry_fix_program.c | 8 +++--- src/contest_painting.c | 4 +-- src/dodrio_berry_picking.c | 32 +++++++++++----------- src/easy_chat.c | 22 +++++++-------- src/egg_hatch.c | 8 +++--- src/frontier_pass.c | 16 +++++------ src/hall_of_fame.c | 12 ++++---- src/item_menu.c | 2 +- src/main_menu.c | 24 ++++++++-------- src/match_call.c | 10 +++---- src/menu.c | 20 +++++++------- src/menu_helpers.c | 16 +++++------ src/mirage_tower.c | 4 +-- src/mystery_gift_menu.c | 16 +++++------ src/mystery_gift_view.c | 14 +++++----- src/naming_screen.c | 16 +++++------ src/option_menu.c | 16 +++++------ src/overworld.c | 16 +++++------ src/party_menu.c | 4 +-- src/pokedex_area_region_map.c | 6 ++-- src/pokedex_area_screen.c | 2 +- src/pokedex_cry_screen.c | 2 +- src/pokemon_jump.c | 8 +++--- src/pokemon_storage_system.c | 16 +++++------ src/pokemon_summary_screen.c | 16 +++++------ src/pokenav_conditions_2.c | 12 ++++---- src/pokenav_conditions_3.c | 4 +-- src/pokenav_main_menu.c | 8 +++--- src/pokenav_match_call_2.c | 8 +++--- src/pokenav_match_call_ui.c | 16 +++++------ src/pokenav_menu_handler_2.c | 14 +++++----- src/pokenav_region_map.c | 14 +++++----- src/pokenav_ribbons_1.c | 4 +-- src/pokenav_ribbons_2.c | 8 +++--- src/rayquaza_scene.c | 28 +++++++++---------- src/starter_choose.c | 16 +++++------ src/trade.c | 4 +-- src/trainer_card.c | 16 +++++------ src/union_room_chat.c | 20 +++++++------- src/use_pokeblock.c | 16 +++++------ src/wallclock.c | 16 +++++------ src/wireless_communication_status_screen.c | 8 +++--- 49 files changed, 307 insertions(+), 306 deletions(-) diff --git a/gflib/bg.h b/gflib/bg.h index b5d18d6d03..3a0bf3bf90 100644 --- a/gflib/bg.h +++ b/gflib/bg.h @@ -21,6 +21,7 @@ enum { BG_TYPE_NONE = 0xFFFF }; +// Modes for ChangeBgX / ChangeBgY enum { BG_COORD_SET, BG_COORD_ADD, diff --git a/src/battle_dome.c b/src/battle_dome.c index 0075e84d6a..08f1fa9343 100644 --- a/src/battle_dome.c +++ b/src/battle_dome.c @@ -5281,10 +5281,10 @@ static void Task_ShowTourneyTree(u8 taskId) gBattle_BG0_Y = 0; gBattle_BG1_X = 0; gBattle_BG1_Y = 0; - ChangeBgX(2, 0, 0); - ChangeBgY(2, 0, 0); - ChangeBgX(3, 0, 0); - ChangeBgY(3, 0xB00, 0); + ChangeBgX(2, 0, BG_COORD_SET); + ChangeBgY(2, 0, BG_COORD_SET); + ChangeBgX(3, 0, BG_COORD_SET); + ChangeBgY(3, 0xB00, BG_COORD_SET); gTasks[taskId].tState++; break; case 1: @@ -5597,8 +5597,8 @@ static void CB2_TourneyTree(void) static void VblankCb_TourneyInfoCard(void) { - ChangeBgX(3, 0x80, 1); - ChangeBgY(3, 0x80, 2); + ChangeBgX(3, 0x80, BG_COORD_ADD); + ChangeBgY(3, 0x80, BG_COORD_SUB); SetGpuReg(REG_OFFSET_BG0HOFS, gBattle_BG0_X); SetGpuReg(REG_OFFSET_BG0VOFS, gBattle_BG0_Y); SetGpuReg(REG_OFFSET_BG1HOFS, gBattle_BG1_X); @@ -5693,8 +5693,8 @@ static void VblankCb_TourneyTree(void) SetGpuReg(REG_OFFSET_BG0VOFS, gBattle_BG0_Y); SetGpuReg(REG_OFFSET_BG1HOFS, gBattle_BG1_X); SetGpuReg(REG_OFFSET_BG1VOFS, gBattle_BG1_Y); - ChangeBgY(2, 0x80, 2); - ChangeBgY(3, 0x80, 1); + ChangeBgY(2, 0x80, BG_COORD_SUB); + ChangeBgY(3, 0x80, BG_COORD_ADD); LoadOam(); ProcessSpriteCopyRequests(); TransferPlttBuffer(); diff --git a/src/battle_factory_screen.c b/src/battle_factory_screen.c index 98caada1d9..247b8712fe 100644 --- a/src/battle_factory_screen.c +++ b/src/battle_factory_screen.c @@ -1147,12 +1147,12 @@ static void CB2_InitSelectScreen(void) sSelectMonPicBgTilesetBuffer = AllocZeroed(0x440); sSelectMenuTilemapBuffer = Alloc(BG_SCREEN_SIZE); sSelectMonPicBgTilemapBuffer = AllocZeroed(BG_SCREEN_SIZE); - ChangeBgX(0, 0, 0); - ChangeBgY(0, 0, 0); - ChangeBgX(1, 0, 0); - ChangeBgY(1, 0, 0); - ChangeBgX(3, 0, 0); - ChangeBgY(3, 0, 0); + ChangeBgX(0, 0, BG_COORD_SET); + ChangeBgY(0, 0, BG_COORD_SET); + ChangeBgX(1, 0, BG_COORD_SET); + ChangeBgY(1, 0, BG_COORD_SET); + ChangeBgX(3, 0, BG_COORD_SET); + ChangeBgY(3, 0, BG_COORD_SET); SetGpuReg(REG_OFFSET_BLDCNT, 0); SetGpuReg(REG_OFFSET_BLDALPHA, 0); SetGpuReg(REG_OFFSET_BLDY, 0); @@ -3280,14 +3280,14 @@ static void CB2_InitSwapScreen(void) sSwapMonPicBgTilesetBuffer = AllocZeroed(0x440); sSwapMenuTilemapBuffer = Alloc(BG_SCREEN_SIZE); sSwapMonPicBgTilemapBuffer = AllocZeroed(BG_SCREEN_SIZE); - ChangeBgX(0, 0, 0); - ChangeBgY(0, 0, 0); - ChangeBgX(1, 0, 0); - ChangeBgY(1, 0, 0); - ChangeBgX(2, 0, 0); - ChangeBgY(2, 0, 0); - ChangeBgX(3, 0, 0); - ChangeBgY(3, 0, 0); + ChangeBgX(0, 0, BG_COORD_SET); + ChangeBgY(0, 0, BG_COORD_SET); + ChangeBgX(1, 0, BG_COORD_SET); + ChangeBgY(1, 0, BG_COORD_SET); + ChangeBgX(2, 0, BG_COORD_SET); + ChangeBgY(2, 0, BG_COORD_SET); + ChangeBgX(3, 0, BG_COORD_SET); + ChangeBgY(3, 0, BG_COORD_SET); SetGpuReg(REG_OFFSET_BLDY, 0); SetGpuReg(REG_OFFSET_MOSAIC, 0); SetGpuReg(REG_OFFSET_WIN0H, 0); diff --git a/src/battle_records.c b/src/battle_records.c index 850feef59e..f576d5912d 100644 --- a/src/battle_records.c +++ b/src/battle_records.c @@ -425,14 +425,14 @@ static void ClearTasksAndGraphicalStructs(void) static void ResetBgCoordinates(void) { - ChangeBgX(0, 0, 0); - ChangeBgY(0, 0, 0); - ChangeBgX(1, 0, 0); - ChangeBgY(1, 0, 0); - ChangeBgX(2, 0, 0); - ChangeBgY(2, 0, 0); - ChangeBgX(3, 0, 0); - ChangeBgY(3, 0, 0); + ChangeBgX(0, 0, BG_COORD_SET); + ChangeBgY(0, 0, BG_COORD_SET); + ChangeBgX(1, 0, BG_COORD_SET); + ChangeBgY(1, 0, BG_COORD_SET); + ChangeBgX(2, 0, BG_COORD_SET); + ChangeBgY(2, 0, BG_COORD_SET); + ChangeBgX(3, 0, BG_COORD_SET); + ChangeBgY(3, 0, BG_COORD_SET); } static void SetDispcntReg(void) diff --git a/src/battle_transition_frontier.c b/src/battle_transition_frontier.c index e1cb03d8df..a1a39abdab 100644 --- a/src/battle_transition_frontier.c +++ b/src/battle_transition_frontier.c @@ -378,9 +378,9 @@ static bool8 Circles_Init(struct Task *task) LoadLogoGfx(); SetGpuReg(REG_OFFSET_BLDCNT, BLDCNT_TGT1_BG0 | BLDCNT_EFFECT_BLEND | BLDCNT_TGT2_ALL); SetGpuReg(REG_OFFSET_BLDALPHA, BLDALPHA_BLEND(0, 16)); - ChangeBgX(0, 0, 0); - ChangeBgY(0, 0, 0); - ChangeBgY(0, 0x500, 2); + ChangeBgX(0, 0, BG_COORD_SET); + ChangeBgY(0, 0, BG_COORD_SET); + ChangeBgY(0, 0x500, BG_COORD_SUB); task->tTimer = 0; task->tState++; diff --git a/src/berry_blender.c b/src/berry_blender.c index 4e7168fc1a..7d22eae774 100644 --- a/src/berry_blender.c +++ b/src/berry_blender.c @@ -1013,10 +1013,10 @@ static void DrawBlenderBg(void) ShowBg(0); ShowBg(1); SetGpuRegBits(REG_OFFSET_DISPCNT, DISPCNT_OBJ_ON | DISPCNT_OBJ_1D_MAP); - ChangeBgX(0, 0, 0); - ChangeBgY(0, 0, 0); - ChangeBgX(1, 0, 0); - ChangeBgY(1, 0, 0); + ChangeBgX(0, 0, BG_COORD_SET); + ChangeBgY(0, 0, BG_COORD_SET); + ChangeBgX(1, 0, BG_COORD_SET); + ChangeBgY(1, 0, BG_COORD_SET); } static void InitBerryBlenderWindows(void) diff --git a/src/berry_crush.c b/src/berry_crush.c index 10f7987e05..6f432a3f98 100755 --- a/src/berry_crush.c +++ b/src/berry_crush.c @@ -1202,12 +1202,12 @@ static s32 ShowGameDisplay(void) SetBgTilemapBuffer(1, game->gfx.bgBuffers[0]); SetBgTilemapBuffer(2, game->gfx.bgBuffers[2]); SetBgTilemapBuffer(3, game->gfx.bgBuffers[3]); - ChangeBgX(0, 0, 0); - ChangeBgY(0, 0, 0); - ChangeBgX(2, 0, 0); - ChangeBgY(2, 0, 0); - ChangeBgX(3, 0, 0); - ChangeBgY(3, 0, 0); + ChangeBgX(0, 0, BG_COORD_SET); + ChangeBgY(0, 0, BG_COORD_SET); + ChangeBgX(2, 0, BG_COORD_SET); + ChangeBgY(2, 0, BG_COORD_SET); + ChangeBgX(3, 0, BG_COORD_SET); + ChangeBgY(3, 0, BG_COORD_SET); SetGpuReg(REG_OFFSET_BLDCNT, 0); SetGpuReg(REG_OFFSET_BLDALPHA, 0); break; @@ -1249,8 +1249,8 @@ static s32 ShowGameDisplay(void) CreateWirelessStatusIndicatorSprite(0, 0); CreateGameSprites(game); SetGpuReg(REG_OFFSET_BG1VOFS, -gSpriteCoordOffsetY); - ChangeBgX(1, 0, 0); - ChangeBgY(1, 0, 0); + ChangeBgX(1, 0, BG_COORD_SET); + ChangeBgY(1, 0, BG_COORD_SET); break; case 9: gPaletteFade.bufferTransferDisabled = FALSE; diff --git a/src/berry_fix_program.c b/src/berry_fix_program.c index e2f7651795..e8c4bc7e68 100644 --- a/src/berry_fix_program.c +++ b/src/berry_fix_program.c @@ -290,10 +290,10 @@ static void BerryFix_GpuSet(void) ResetBgsAndClearDma3BusyFlags(0); InitBgsFromTemplates(0, sBerryFixBgTemplates, ARRAY_COUNT(sBerryFixBgTemplates)); - ChangeBgX(0, 0, 0); - ChangeBgY(0, 0, 0); - ChangeBgX(1, 0, 0); - ChangeBgY(1, 0, 0); + ChangeBgX(0, 0, BG_COORD_SET); + ChangeBgY(0, 0, BG_COORD_SET); + ChangeBgX(1, 0, BG_COORD_SET); + ChangeBgY(1, 0, BG_COORD_SET); InitWindows(sBerryFixWindowTemplates); DeactivateAllTextPrinters(); diff --git a/src/contest_painting.c b/src/contest_painting.c index 84b160eb82..e71cf391f8 100644 --- a/src/contest_painting.c +++ b/src/contest_painting.c @@ -267,8 +267,8 @@ static void InitContestPaintingWindow(void) { ResetBgsAndClearDma3BusyFlags(0); InitBgsFromTemplates(0, sBgTemplates, ARRAY_COUNT(sBgTemplates)); - ChangeBgX(1, 0, 0); - ChangeBgY(1, 0, 0); + ChangeBgX(1, 0, BG_COORD_SET); + ChangeBgY(1, 0, BG_COORD_SET); SetBgTilemapBuffer(1, AllocZeroed(BG_SCREEN_SIZE)); sWindowId = AddWindow(&sWindowTemplate); DeactivateAllTextPrinters(); diff --git a/src/dodrio_berry_picking.c b/src/dodrio_berry_picking.c index 8c09afeb3c..e680b56d39 100644 --- a/src/dodrio_berry_picking.c +++ b/src/dodrio_berry_picking.c @@ -1352,14 +1352,14 @@ static void ResetGame(void) } break; case 2: - ChangeBgX(0, 0, 0); - ChangeBgY(0, 0, 0); - ChangeBgX(1, 0, 0); - ChangeBgY(1, 0, 0); - ChangeBgX(2, 0, 0); - ChangeBgY(2, 0, 0); - ChangeBgX(3, 0, 0); - ChangeBgY(3, 0, 0); + ChangeBgX(0, 0, BG_COORD_SET); + ChangeBgY(0, 0, BG_COORD_SET); + ChangeBgX(1, 0, BG_COORD_SET); + ChangeBgY(1, 0, BG_COORD_SET); + ChangeBgX(2, 0, BG_COORD_SET); + ChangeBgY(2, 0, BG_COORD_SET); + ChangeBgX(3, 0, BG_COORD_SET); + ChangeBgY(3, 0, BG_COORD_SET); sGame->state++; break; case 3: @@ -5172,14 +5172,14 @@ static void InitBgs(void) SetGpuReg(REG_OFFSET_DISPCNT, 0); ResetBgsAndClearDma3BusyFlags(0); InitBgsFromTemplates(0, sBgTemplates, ARRAY_COUNT(sBgTemplates)); - ChangeBgX(0, 0, 0); - ChangeBgY(0, 0, 0); - ChangeBgX(1, 0, 0); - ChangeBgY(1, 0, 0); - ChangeBgX(2, 0, 0); - ChangeBgY(2, 0, 0); - ChangeBgX(3, 0, 0); - ChangeBgY(3, 0, 0); + ChangeBgX(0, 0, BG_COORD_SET); + ChangeBgY(0, 0, BG_COORD_SET); + ChangeBgX(1, 0, BG_COORD_SET); + ChangeBgY(1, 0, BG_COORD_SET); + ChangeBgX(2, 0, BG_COORD_SET); + ChangeBgY(2, 0, BG_COORD_SET); + ChangeBgX(3, 0, BG_COORD_SET); + ChangeBgY(3, 0, BG_COORD_SET); InitStandardTextBoxWindows(); InitTextBoxGfxAndPrinters(); SetGpuReg(REG_OFFSET_DISPCNT, DISPCNT_OBJ_ON | DISPCNT_OBJ_1D_MAP); diff --git a/src/easy_chat.c b/src/easy_chat.c index c78e14ecf3..3257a122db 100644 --- a/src/easy_chat.c +++ b/src/easy_chat.c @@ -3900,14 +3900,14 @@ static bool8 InitEasyChatScreenControl_(void) static void InitEasyChatBgs(void) { - ChangeBgX(3, 0, 0); - ChangeBgY(3, 0, 0); - ChangeBgX(1, 0, 0); - ChangeBgY(1, 0, 0); - ChangeBgX(2, 0, 0); - ChangeBgY(2, 0, 0); - ChangeBgX(0, 0, 0); - ChangeBgY(0, 0, 0); + ChangeBgX(3, 0, BG_COORD_SET); + ChangeBgY(3, 0, BG_COORD_SET); + ChangeBgX(1, 0, BG_COORD_SET); + ChangeBgY(1, 0, BG_COORD_SET); + ChangeBgX(2, 0, BG_COORD_SET); + ChangeBgY(2, 0, BG_COORD_SET); + ChangeBgX(0, 0, BG_COORD_SET); + ChangeBgY(0, 0, BG_COORD_SET); SetGpuReg(REG_OFFSET_DISPCNT, DISPCNT_MODE_0 | DISPCNT_OBJ_1D_MAP | DISPCNT_OBJ_ON | DISPCNT_WIN0_ON); } @@ -4550,7 +4550,7 @@ static void BufferLowerWindowFrame(int left, int top, int width, int height) static void ResetLowerWindowScroll(void) { - ChangeBgY(2, 0x800, 0); + ChangeBgY(2, 0x800, BG_COORD_SET); sScreenControl->scrollOffset = 0; } @@ -4572,7 +4572,7 @@ static void InitLowerWindowScroll(s16 scrollChange, u8 speed) } else { - ChangeBgY(2, bgY, 0); + ChangeBgY(2, bgY, BG_COORD_SET); } } @@ -4587,7 +4587,7 @@ static bool8 UpdateLowerWindowScroll(void) } else { - ChangeBgY(2, sScreenControl->scrollSpeed, 1); + ChangeBgY(2, sScreenControl->scrollSpeed, BG_COORD_ADD); return TRUE; } } diff --git a/src/egg_hatch.c b/src/egg_hatch.c index 4c9456f2e6..283ec753af 100644 --- a/src/egg_hatch.c +++ b/src/egg_hatch.c @@ -495,10 +495,10 @@ static void CB2_EggHatch_0(void) ResetBgsAndClearDma3BusyFlags(0); InitBgsFromTemplates(0, sBgTemplates_EggHatch, ARRAY_COUNT(sBgTemplates_EggHatch)); - ChangeBgX(1, 0, 0); - ChangeBgY(1, 0, 0); - ChangeBgX(0, 0, 0); - ChangeBgY(0, 0, 0); + ChangeBgX(1, 0, BG_COORD_SET); + ChangeBgY(1, 0, BG_COORD_SET); + ChangeBgX(0, 0, BG_COORD_SET); + ChangeBgY(0, 0, BG_COORD_SET); SetBgAttribute(1, BG_ATTR_PRIORITY, 2); SetBgTilemapBuffer(1, Alloc(0x1000)); diff --git a/src/frontier_pass.c b/src/frontier_pass.c index 9dfd5e9354..8ce1e14dc4 100644 --- a/src/frontier_pass.c +++ b/src/frontier_pass.c @@ -561,14 +561,14 @@ static void ResetGpuRegsAndBgs(void) SetGpuReg(REG_OFFSET_BG2CNT, 0); SetGpuReg(REG_OFFSET_BG1CNT, 0); SetGpuReg(REG_OFFSET_BG0CNT, 0); - ChangeBgX(0, 0, 0); - ChangeBgY(0, 0, 0); - ChangeBgX(1, 0, 0); - ChangeBgY(1, 0, 0); - ChangeBgX(2, 0, 0); - ChangeBgY(2, 0, 0); - ChangeBgX(3, 0, 0); - ChangeBgY(3, 0, 0); + ChangeBgX(0, 0, BG_COORD_SET); + ChangeBgY(0, 0, BG_COORD_SET); + ChangeBgX(1, 0, BG_COORD_SET); + ChangeBgY(1, 0, BG_COORD_SET); + ChangeBgX(2, 0, BG_COORD_SET); + ChangeBgY(2, 0, BG_COORD_SET); + ChangeBgX(3, 0, BG_COORD_SET); + ChangeBgY(3, 0, BG_COORD_SET); SetGpuReg(REG_OFFSET_BLDCNT, 0); SetGpuReg(REG_OFFSET_BLDY, 0); SetGpuReg(REG_OFFSET_BLDALPHA, 0); diff --git a/src/hall_of_fame.c b/src/hall_of_fame.c index ecc8b18ae4..84f7d8fe67 100644 --- a/src/hall_of_fame.c +++ b/src/hall_of_fame.c @@ -1295,12 +1295,12 @@ static void InitHofBgs(void) InitBgsFromTemplates(0, sHof_BgTemplates, ARRAY_COUNT(sHof_BgTemplates)); SetBgTilemapBuffer(1, sHofGfxPtr->tilemap1); SetBgTilemapBuffer(3, sHofGfxPtr->tilemap2); - ChangeBgX(0, 0, 0); - ChangeBgY(0, 0, 0); - ChangeBgX(1, 0, 0); - ChangeBgY(1, 0, 0); - ChangeBgX(3, 0, 0); - ChangeBgY(3, 0, 0); + ChangeBgX(0, 0, BG_COORD_SET); + ChangeBgY(0, 0, BG_COORD_SET); + ChangeBgX(1, 0, BG_COORD_SET); + ChangeBgY(1, 0, BG_COORD_SET); + ChangeBgX(3, 0, BG_COORD_SET); + ChangeBgY(3, 0, BG_COORD_SET); } static bool8 LoadHofBgs(void) diff --git a/src/item_menu.c b/src/item_menu.c index 0c4b674525..037567daa7 100755 --- a/src/item_menu.c +++ b/src/item_menu.c @@ -2039,7 +2039,7 @@ bool8 UseRegisteredKeyItemOnField(void) if (InUnionRoom() == TRUE || InBattlePyramid() || InBattlePike() || InMultiPartnerRoom() == TRUE) return FALSE; HideMapNamePopUpWindow(); - ChangeBgY_ScreenOff(0, 0, 0); + ChangeBgY_ScreenOff(0, 0, BG_COORD_SET); if (gSaveBlock1Ptr->registeredItem != ITEM_NONE) { if (CheckBagHasItem(gSaveBlock1Ptr->registeredItem, 1) == TRUE) diff --git a/src/main_menu.c b/src/main_menu.c index 748575ce34..601e66cb9d 100644 --- a/src/main_menu.c +++ b/src/main_menu.c @@ -583,10 +583,10 @@ static u32 InitMainMenu(bool8 returningFromOptionsMenu) BeginNormalPaletteFade(PALETTES_ALL, 0, 0x10, 0, RGB_WHITEALPHA); // fade to white ResetBgsAndClearDma3BusyFlags(0); InitBgsFromTemplates(0, sMainMenuBgTemplates, ARRAY_COUNT(sMainMenuBgTemplates)); - ChangeBgX(0, 0, 0); - ChangeBgY(0, 0, 0); - ChangeBgX(1, 0, 0); - ChangeBgY(1, 0, 0); + ChangeBgX(0, 0, BG_COORD_SET); + ChangeBgY(0, 0, BG_COORD_SET); + ChangeBgX(1, 0, BG_COORD_SET); + ChangeBgY(1, 0, BG_COORD_SET); InitWindows(sWindowTemplates_MainMenu); DeactivateAllTextPrinters(); LoadMainMenuWindowFrameTiles(0, MAIN_MENU_BORDER_TILE); @@ -861,8 +861,8 @@ static void Task_DisplayMainMenu(u8 taskId) gTasks[tScrollArrowTaskId].func = Task_ScrollIndicatorArrowPairOnMainMenu; if (sCurrItemAndOptionMenuCheck == 4) { - ChangeBgY(0, 0x2000, 1); - ChangeBgY(1, 0x2000, 1); + ChangeBgY(0, 0x2000, BG_COORD_ADD); + ChangeBgY(1, 0x2000, BG_COORD_ADD); tIsScrolled = TRUE; gTasks[tScrollArrowTaskId].tArrowTaskIsScrolled = TRUE; } @@ -901,8 +901,8 @@ static bool8 HandleMainMenuInput(u8 taskId) { if (tMenuType == HAS_MYSTERY_EVENTS && tIsScrolled == TRUE && tCurrItem == 1) { - ChangeBgY(0, 0x2000, 2); - ChangeBgY(1, 0x2000, 2); + ChangeBgY(0, 0x2000, BG_COORD_SUB); + ChangeBgY(1, 0x2000, BG_COORD_SUB); gTasks[tScrollArrowTaskId].tArrowTaskIsScrolled = tIsScrolled = FALSE; } tCurrItem--; @@ -913,8 +913,8 @@ static bool8 HandleMainMenuInput(u8 taskId) { if (tMenuType == HAS_MYSTERY_EVENTS && tCurrItem == 3 && tIsScrolled == FALSE) { - ChangeBgY(0, 0x2000, 1); - ChangeBgY(1, 0x2000, 1); + ChangeBgY(0, 0x2000, BG_COORD_ADD); + ChangeBgY(1, 0x2000, BG_COORD_ADD); gTasks[tScrollArrowTaskId].tArrowTaskIsScrolled = tIsScrolled = TRUE; } tCurrItem++; @@ -1048,8 +1048,8 @@ static void Task_HandleMainMenuAPressed(u8 taskId) } break; } - ChangeBgY(0, 0, 0); - ChangeBgY(1, 0, 0); + ChangeBgY(0, 0, BG_COORD_SET); + ChangeBgY(1, 0, BG_COORD_SET); switch (action) { case ACTION_NEW_GAME: diff --git a/src/match_call.c b/src/match_call.c index b292ede31c..9e4659ee60 100644 --- a/src/match_call.c +++ b/src/match_call.c @@ -1263,7 +1263,7 @@ static bool32 MatchCall_LoadGfx(u8 taskId) FillWindowPixelBuffer(tWindowId, PIXEL_FILL(8)); LoadPalette(sMatchCallWindow_Pal, 0xE0, sizeof(sMatchCallWindow_Pal)); LoadPalette(sPokenavIcon_Pal, 0xF0, sizeof(sPokenavIcon_Pal)); - ChangeBgY(0, -0x2000, 0); + ChangeBgY(0, -0x2000, BG_COORD_SET); return TRUE; } @@ -1297,9 +1297,9 @@ static bool32 MatchCall_ReadyIntro(u8 taskId) static bool32 MatchCall_SlideWindowIn(u8 taskId) { - if (ChangeBgY(0, 0x600, 1) >= 0) + if (ChangeBgY(0, 0x600, BG_COORD_ADD) >= 0) { - ChangeBgY(0, 0, 0); + ChangeBgY(0, 0, BG_COORD_SET); return TRUE; } @@ -1340,7 +1340,7 @@ static bool32 MatchCall_PrintMessage(u8 taskId) static bool32 MatchCall_SlideWindowOut(u8 taskId) { s16 *data = gTasks[taskId].data; - if (ChangeBgY(0, 0x600, 2) <= -0x2000) + if (ChangeBgY(0, 0x600, BG_COORD_SUB) <= -0x2000) { FillBgTilemapBufferRect_Palette0(0, 0, 0, 14, 30, 6); DestroyTask(tIconTaskId); @@ -1357,7 +1357,7 @@ static bool32 MatchCall_EndCall(u8 taskId) u8 playerObjectId; if (!IsDma3ManagerBusyWithBgCopy() && !IsSEPlaying()) { - ChangeBgY(0, 0, 0); + ChangeBgY(0, 0, BG_COORD_SET); if (!sMatchCallState.triggeredFromScript) { LoadMessageBoxAndBorderGfx(); diff --git a/src/menu.c b/src/menu.c index 0e7c0c6e46..ddbc826869 100644 --- a/src/menu.c +++ b/src/menu.c @@ -153,8 +153,8 @@ void FreeAllOverworldWindowBuffers(void) void InitTextBoxGfxAndPrinters(void) { - ChangeBgX(0, 0, 0); - ChangeBgY(0, 0, 0); + ChangeBgX(0, 0, BG_COORD_SET); + ChangeBgY(0, 0, BG_COORD_SET); DeactivateAllTextPrinters(); LoadMessageBoxAndBorderGfx(); } @@ -1922,14 +1922,14 @@ void AddValToTilemapBuffer(void *ptr, int delta, int width, int height, bool32 i void ResetBgPositions(void) { - ChangeBgX(0, 0, 0); - ChangeBgX(1, 0, 0); - ChangeBgX(2, 0, 0); - ChangeBgX(3, 0, 0); - ChangeBgY(0, 0, 0); - ChangeBgY(1, 0, 0); - ChangeBgY(2, 0, 0); - ChangeBgY(3, 0, 0); + ChangeBgX(0, 0, BG_COORD_SET); + ChangeBgX(1, 0, BG_COORD_SET); + ChangeBgX(2, 0, BG_COORD_SET); + ChangeBgX(3, 0, BG_COORD_SET); + ChangeBgY(0, 0, BG_COORD_SET); + ChangeBgY(1, 0, BG_COORD_SET); + ChangeBgY(2, 0, BG_COORD_SET); + ChangeBgY(3, 0, BG_COORD_SET); } void sub_8199DF0(u32 bg, u8 a1, int a2, int a3) diff --git a/src/menu_helpers.c b/src/menu_helpers.c index 3317555908..7670c69251 100644 --- a/src/menu_helpers.c +++ b/src/menu_helpers.c @@ -106,14 +106,14 @@ void ResetVramOamAndBgCntRegs(void) void ResetAllBgsCoordinates(void) { - ChangeBgX(0, 0, 0); - ChangeBgY(0, 0, 0); - ChangeBgX(1, 0, 0); - ChangeBgY(1, 0, 0); - ChangeBgX(2, 0, 0); - ChangeBgY(2, 0, 0); - ChangeBgX(3, 0, 0); - ChangeBgY(3, 0, 0); + ChangeBgX(0, 0, BG_COORD_SET); + ChangeBgY(0, 0, BG_COORD_SET); + ChangeBgX(1, 0, BG_COORD_SET); + ChangeBgY(1, 0, BG_COORD_SET); + ChangeBgX(2, 0, BG_COORD_SET); + ChangeBgY(2, 0, BG_COORD_SET); + ChangeBgX(3, 0, BG_COORD_SET); + ChangeBgY(3, 0, BG_COORD_SET); } void SetVBlankHBlankCallbacksToNull(void) diff --git a/src/mirage_tower.c b/src/mirage_tower.c index 7fc883ca18..9473b0f82e 100644 --- a/src/mirage_tower.c +++ b/src/mirage_tower.c @@ -536,8 +536,8 @@ static void InitMirageTowerShake(u8 taskId) case 1: sMirageTowerGfxBuffer = (u8 *)AllocZeroed(MIRAGE_TOWER_GFX_LENGTH); sMirageTowerTilemapBuffer = (u8 *)AllocZeroed(BG_SCREEN_SIZE); - ChangeBgX(0, 0, 0); - ChangeBgY(0, 0, 0); + ChangeBgX(0, 0, BG_COORD_SET); + ChangeBgY(0, 0, BG_COORD_SET); gTasks[taskId].tState++; break; case 2: diff --git a/src/mystery_gift_menu.c b/src/mystery_gift_menu.c index 4a314b076a..429922e58f 100644 --- a/src/mystery_gift_menu.c +++ b/src/mystery_gift_menu.c @@ -387,14 +387,14 @@ static bool32 HandleMysteryGiftOrEReaderSetup(s32 isEReader) ResetBgsAndClearDma3BusyFlags(0); InitBgsFromTemplates(0, sBGTemplates, ARRAY_COUNT(sBGTemplates)); - ChangeBgX(0, 0, 0); - ChangeBgY(0, 0, 0); - ChangeBgX(1, 0, 0); - ChangeBgY(1, 0, 0); - ChangeBgX(2, 0, 0); - ChangeBgY(2, 0, 0); - ChangeBgX(3, 0, 0); - ChangeBgY(3, 0, 0); + ChangeBgX(0, 0, BG_COORD_SET); + ChangeBgY(0, 0, BG_COORD_SET); + ChangeBgX(1, 0, BG_COORD_SET); + ChangeBgY(1, 0, BG_COORD_SET); + ChangeBgX(2, 0, BG_COORD_SET); + ChangeBgY(2, 0, BG_COORD_SET); + ChangeBgX(3, 0, BG_COORD_SET); + ChangeBgY(3, 0, BG_COORD_SET); SetBgTilemapBuffer(3, Alloc(BG_SCREEN_SIZE)); SetBgTilemapBuffer(2, Alloc(BG_SCREEN_SIZE)); diff --git a/src/mystery_gift_view.c b/src/mystery_gift_view.c index cf3a019f53..3047a219e8 100644 --- a/src/mystery_gift_view.c +++ b/src/mystery_gift_view.c @@ -678,10 +678,10 @@ s32 WonderNews_Enter(void) case 1: if (UpdatePaletteFade()) return 0; - ChangeBgY(0, 0, 0); - ChangeBgY(1, 0, 0); - ChangeBgY(2, 0, 0); - ChangeBgY(3, 0, 0); + ChangeBgY(0, 0, BG_COORD_SET); + ChangeBgY(1, 0, BG_COORD_SET); + ChangeBgY(2, 0, BG_COORD_SET); + ChangeBgY(3, 0, BG_COORD_SET); SetGpuReg(REG_OFFSET_WIN0H, WIN_RANGE(0, DISPLAY_WIDTH)); SetGpuReg(REG_OFFSET_WIN0V, WIN_RANGE(26, 152)); SetGpuReg(REG_OFFSET_WININ, WININ_WIN0_BG_ALL | WININ_WIN0_OBJ); @@ -753,7 +753,7 @@ s32 WonderNews_Exit(bool32 useCancel) case 1: if (UpdatePaletteFade()) return 0; - ChangeBgY(2, 0, 0); + ChangeBgY(2, 0, BG_COORD_SET); SetGpuReg(REG_OFFSET_WIN0H, 0); SetGpuReg(REG_OFFSET_WIN0V, 0); SetGpuReg(REG_OFFSET_WININ, 0); @@ -777,8 +777,8 @@ s32 WonderNews_Exit(bool32 useCancel) RemoveWindow(sWonderNewsData->windowIds[NEWS_WIN_TITLE]); break; case 4: - ChangeBgY(2, 0, 0); - ChangeBgY(3, 0, 0); + ChangeBgY(2, 0, BG_COORD_SET); + ChangeBgY(3, 0, BG_COORD_SET); if (sWonderNewsData->arrowTaskId != TASK_NONE) { RemoveScrollIndicatorArrowPair(sWonderNewsData->arrowTaskId); diff --git a/src/naming_screen.c b/src/naming_screen.c index cd48242d07..dcd60259b7 100644 --- a/src/naming_screen.c +++ b/src/naming_screen.c @@ -516,14 +516,14 @@ static void NamingScreen_InitBGs(void) ResetBgsAndClearDma3BusyFlags(0); InitBgsFromTemplates(0, sBgTemplates, ARRAY_COUNT(sBgTemplates)); - ChangeBgX(0, 0, 0); - ChangeBgY(0, 0, 0); - ChangeBgX(1, 0, 0); - ChangeBgY(1, 0, 0); - ChangeBgX(2, 0, 0); - ChangeBgY(2, 0, 0); - ChangeBgX(3, 0, 0); - ChangeBgY(3, 0, 0); + ChangeBgX(0, 0, BG_COORD_SET); + ChangeBgY(0, 0, BG_COORD_SET); + ChangeBgX(1, 0, BG_COORD_SET); + ChangeBgY(1, 0, BG_COORD_SET); + ChangeBgX(2, 0, BG_COORD_SET); + ChangeBgY(2, 0, BG_COORD_SET); + ChangeBgX(3, 0, BG_COORD_SET); + ChangeBgY(3, 0, BG_COORD_SET); InitStandardTextBoxWindows(); InitTextBoxGfxAndPrinters(); diff --git a/src/option_menu.c b/src/option_menu.c index f985e2c52a..e66bddd7f2 100644 --- a/src/option_menu.c +++ b/src/option_menu.c @@ -173,14 +173,14 @@ void CB2_InitOptionMenu(void) SetGpuReg(REG_OFFSET_DISPCNT, 0); ResetBgsAndClearDma3BusyFlags(0); InitBgsFromTemplates(0, sOptionMenuBgTemplates, ARRAY_COUNT(sOptionMenuBgTemplates)); - ChangeBgX(0, 0, 0); - ChangeBgY(0, 0, 0); - ChangeBgX(1, 0, 0); - ChangeBgY(1, 0, 0); - ChangeBgX(2, 0, 0); - ChangeBgY(2, 0, 0); - ChangeBgX(3, 0, 0); - ChangeBgY(3, 0, 0); + ChangeBgX(0, 0, BG_COORD_SET); + ChangeBgY(0, 0, BG_COORD_SET); + ChangeBgX(1, 0, BG_COORD_SET); + ChangeBgY(1, 0, BG_COORD_SET); + ChangeBgX(2, 0, BG_COORD_SET); + ChangeBgY(2, 0, BG_COORD_SET); + ChangeBgX(3, 0, BG_COORD_SET); + ChangeBgY(3, 0, BG_COORD_SET); InitWindows(sOptionMenuWinTemplates); DeactivateAllTextPrinters(); SetGpuReg(REG_OFFSET_WIN0H, 0); diff --git a/src/overworld.c b/src/overworld.c index a8d9a4a833..776d30c754 100644 --- a/src/overworld.c +++ b/src/overworld.c @@ -2101,14 +2101,14 @@ static void InitOverworldGraphicsRegisters(void) ScheduleBgCopyTilemapToVram(1); ScheduleBgCopyTilemapToVram(2); ScheduleBgCopyTilemapToVram(3); - ChangeBgX(0, 0, 0); - ChangeBgY(0, 0, 0); - ChangeBgX(1, 0, 0); - ChangeBgY(1, 0, 0); - ChangeBgX(2, 0, 0); - ChangeBgY(2, 0, 0); - ChangeBgX(3, 0, 0); - ChangeBgY(3, 0, 0); + ChangeBgX(0, 0, BG_COORD_SET); + ChangeBgY(0, 0, BG_COORD_SET); + ChangeBgX(1, 0, BG_COORD_SET); + ChangeBgY(1, 0, BG_COORD_SET); + ChangeBgX(2, 0, BG_COORD_SET); + ChangeBgY(2, 0, BG_COORD_SET); + ChangeBgX(3, 0, BG_COORD_SET); + ChangeBgY(3, 0, BG_COORD_SET); SetGpuReg(REG_OFFSET_DISPCNT, DISPCNT_OBJ_ON | DISPCNT_WIN0_ON | DISPCNT_WIN1_ON | DISPCNT_OBJ_1D_MAP | DISPCNT_HBLANK_INTERVAL); ShowBg(0); diff --git a/src/party_menu.c b/src/party_menu.c index 30a8696086..202b57a529 100755 --- a/src/party_menu.c +++ b/src/party_menu.c @@ -6056,7 +6056,7 @@ static void Task_InitMultiPartnerPartySlideIn(u8 taskId) // The first slide step also sets the sprites offscreen gTasks[taskId].tXPos = 256; SlideMultiPartyMenuBoxSpritesOneStep(taskId); - ChangeBgX(2, 0x10000, 0); + ChangeBgX(2, 0x10000, BG_COORD_SET); gTasks[taskId].func = Task_MultiPartnerPartySlideIn; } @@ -6112,7 +6112,7 @@ static void SlideMultiPartyMenuBoxSpritesOneStep(u8 taskId) MoveMultiPartyMenuBoxSprite(sPartyMenuBoxes[i].statusSpriteId, tXPos - 8); } } - ChangeBgX(2, 0x800, 1); + ChangeBgX(2, 0x800, BG_COORD_ADD); } #undef tXpos diff --git a/src/pokedex_area_region_map.c b/src/pokedex_area_region_map.c index fce550bde0..2ec2c5c8d7 100644 --- a/src/pokedex_area_region_map.c +++ b/src/pokedex_area_region_map.c @@ -38,8 +38,8 @@ void LoadPokedexAreaMapGfx(const struct PokedexAreaMapTemplate *template) AddValToTilemapBuffer(tilemap, template->offset, 64, 64, TRUE); // template->offset is always 0, so this does nothing. } - ChangeBgX(template->bg, 0, 0); - ChangeBgY(template->bg, 0, 0); + ChangeBgX(template->bg, 0, BG_COORD_SET); + ChangeBgY(template->bg, 0, BG_COORD_SET); SetBgAttribute(template->bg, BG_ATTR_PALETTEMODE, 1); CpuCopy32(sPokedexAreaMap_Pal, &gPlttBufferUnfaded[0x70], 0x60); *sPokedexAreaMapBgNum = template->bg; @@ -65,5 +65,5 @@ void FreePokedexAreaMapBgNum(void) void PokedexAreaMapChangeBgY(u32 a0) { - ChangeBgY(*sPokedexAreaMapBgNum, a0 * 0x100, 0); + ChangeBgY(*sPokedexAreaMapBgNum, a0 * 0x100, BG_COORD_SET); } diff --git a/src/pokedex_area_screen.c b/src/pokedex_area_screen.c index 1b6e6a388a..e2973dcab3 100755 --- a/src/pokedex_area_screen.c +++ b/src/pokedex_area_screen.c @@ -319,7 +319,7 @@ static bool8 DrawAreaGlow(void) } return TRUE; case 4: - ChangeBgY(2, -0x800, 0); + ChangeBgY(2, -0x800, BG_COORD_SET); break; default: return FALSE; diff --git a/src/pokedex_cry_screen.c b/src/pokedex_cry_screen.c index a01c06daab..4c9bfe15cb 100644 --- a/src/pokedex_cry_screen.c +++ b/src/pokedex_cry_screen.c @@ -443,7 +443,7 @@ static void ShiftWaveformOver(u8 windowId, s16 offset, bool8 rsVertical) if (!rsVertical) { u8 bg = GetWindowAttribute(windowId, WINDOW_BG); - ChangeBgX(bg, offset << 8, 0); + ChangeBgX(bg, offset << 8, BG_COORD_SET); } } diff --git a/src/pokemon_jump.c b/src/pokemon_jump.c index a6b4b6f424..c86682273a 100755 --- a/src/pokemon_jump.c +++ b/src/pokemon_jump.c @@ -3732,7 +3732,7 @@ static void SetMonSpriteY(u32 id, s16 y) static void UpdateVineSwing(int vineState) { UpdateVineAnim(sPokemonJumpGfx, vineState); - ChangeBgY(BG_VENUSAUR, (sVenusaurStates[vineState] * 5) << 13, 0); + ChangeBgY(BG_VENUSAUR, (sVenusaurStates[vineState] * 5) << 13, BG_COORD_SET); } static int DoSameJumpTimeBonus(u8 flags) @@ -3896,8 +3896,8 @@ static void DrawPlayerNameWindows(void) static void ShowBonus(u8 bonusId) { sPokemonJumpGfx->bonusTimer = 0; - ChangeBgX(BG_BONUSES, (bonusId / 2) * 256 * 256, 0); - ChangeBgY(BG_BONUSES, (((bonusId % 2) * 256) - 40) * 256, 0); + ChangeBgX(BG_BONUSES, (bonusId / 2) * 256 * 256, BG_COORD_SET); + ChangeBgY(BG_BONUSES, (((bonusId % 2) * 256) - 40) * 256, BG_COORD_SET); ShowBg(BG_BONUSES); CreateTask(Task_UpdateBonus, 4); } @@ -3910,7 +3910,7 @@ static bool32 UpdateBonus(void) } else { - ChangeBgY(BG_BONUSES, 128, 1); + ChangeBgY(BG_BONUSES, 128, BG_COORD_ADD); if (++sPokemonJumpGfx->bonusTimer >= 32) HideBg(BG_BONUSES); return TRUE; diff --git a/src/pokemon_storage_system.c b/src/pokemon_storage_system.c index 01133251b7..f18dc68d13 100644 --- a/src/pokemon_storage_system.c +++ b/src/pokemon_storage_system.c @@ -3827,8 +3827,8 @@ static void SetScrollingBackground(void) static void ScrollBackground(void) { - ChangeBgX(3, 128, 1); - ChangeBgY(3, 128, 2); + ChangeBgX(3, 128, BG_COORD_ADD); + ChangeBgY(3, 128, BG_COORD_SUB); } static void LoadPokeStorageMenuGfx(void) @@ -8184,8 +8184,8 @@ static bool8 MultiMove_Start(void) GetCursorBoxColumnAndRow(&sMultiMove->fromColumn, &sMultiMove->fromRow); sMultiMove->toColumn = sMultiMove->fromColumn; sMultiMove->toRow = sMultiMove->fromRow; - ChangeBgX(0, -1024, 0); - ChangeBgY(0, -1024, 0); + ChangeBgX(0, -1024, BG_COORD_SET); + ChangeBgY(0, -1024, BG_COORD_SET); FillBgTilemapBufferRect_Palette0(0, 0, 0, 0, 0x20, 0x20); FillWindowPixelBuffer8Bit(sStorage->multiMoveWindowId, PIXEL_FILL(0)); MultiMove_SetIconToBg(sMultiMove->fromColumn, sMultiMove->fromRow); @@ -8499,8 +8499,8 @@ static u8 MultiMove_UpdateMove(void) { if (sMultiMove->bgMoveSteps != 0) { - ChangeBgX(0, sMultiMove->bgX, 1); - ChangeBgY(0, sMultiMove->bgY, 1); + ChangeBgX(0, sMultiMove->bgX, BG_COORD_ADD); + ChangeBgY(0, sMultiMove->bgY, BG_COORD_ADD); sMultiMove->bgMoveSteps--; } @@ -8605,8 +8605,8 @@ static void MultiMove_SetPlacedMonData(void) static void MultiMove_ResetBg(void) { - ChangeBgX(0, 0, 0); - ChangeBgY(0, 0, 0); + ChangeBgX(0, 0, BG_COORD_SET); + ChangeBgY(0, 0, BG_COORD_SET); SetBgAttribute(0, BG_ATTR_PALETTEMODE, 0); ClearGpuRegBits(REG_OFFSET_BG0CNT, BGCNT_256COLOR); FillBgTilemapBufferRect_Palette0(0, 0, 0, 0, 32, 32); diff --git a/src/pokemon_summary_screen.c b/src/pokemon_summary_screen.c index c83ce727f6..6567cc4caf 100644 --- a/src/pokemon_summary_screen.c +++ b/src/pokemon_summary_screen.c @@ -1462,7 +1462,7 @@ static void SetDefaultTilemaps(void) TilemapFiveMovesDisplay(sMonSummaryScreen->bgTilemapBuffers[PSS_PAGE_CONTEST_MOVES][0], 1, FALSE); SetBgTilemapBuffer(1, sMonSummaryScreen->bgTilemapBuffers[PSS_PAGE_CONTEST_MOVES][0]); SetBgTilemapBuffer(2, sMonSummaryScreen->bgTilemapBuffers[PSS_PAGE_BATTLE_MOVES][0]); - ChangeBgX(2, 0x10000, 1); + ChangeBgX(2, 0x10000, BG_COORD_ADD); ClearWindowTilemap(PSS_LABEL_WINDOW_PORTRAIT_SPECIES); ClearWindowTilemap(PSS_LABEL_WINDOW_POKEMON_SKILLS_STATUS); } @@ -1778,12 +1778,12 @@ static void PssScrollRight(u8 taskId) // Scroll right SetBgAttribute(1, BG_ATTR_PRIORITY, 2); ScheduleBgCopyTilemapToVram(2); } - ChangeBgX(data[1], 0, 0); + ChangeBgX(data[1], 0, BG_COORD_SET); SetBgTilemapBuffer(data[1], sMonSummaryScreen->bgTilemapBuffers[sMonSummaryScreen->currPageIndex][0]); ShowBg(1); ShowBg(2); } - ChangeBgX(data[1], 0x2000, 1); + ChangeBgX(data[1], 0x2000, BG_COORD_ADD); data[0] += 32; if (data[0] > 0xFF) gTasks[taskId].func = PssScrollRightEnd; @@ -1811,9 +1811,9 @@ static void PssScrollLeft(u8 taskId) // Scroll left data[1] = 2; else data[1] = 1; - ChangeBgX(data[1], 0x10000, 0); + ChangeBgX(data[1], 0x10000, BG_COORD_SET); } - ChangeBgX(data[1], 0x2000, 2); + ChangeBgX(data[1], 0x2000, BG_COORD_SUB); data[0] += 32; if (data[0] > 0xFF) gTasks[taskId].func = PssScrollLeftEnd; @@ -1837,7 +1837,7 @@ static void PssScrollLeftEnd(u8 taskId) // display left if (sMonSummaryScreen->currPageIndex > 1) { SetBgTilemapBuffer(data[1], sMonSummaryScreen->bgTilemapBuffers[sMonSummaryScreen->currPageIndex - 1][0]); - ChangeBgX(data[1], 0x10000, 0); + ChangeBgX(data[1], 0x10000, BG_COORD_SET); } ShowBg(1); ShowBg(2); @@ -2681,9 +2681,9 @@ static void DrawContestMoveHearts(u16 move) static void LimitEggSummaryPageDisplay(void) // If the pokemon is an egg, limit the number of pages displayed to 1 { if (sMonSummaryScreen->summary.isEgg) - ChangeBgX(3, 0x10000, 0); + ChangeBgX(3, 0x10000, BG_COORD_SET); else - ChangeBgX(3, 0, 0); + ChangeBgX(3, 0, BG_COORD_SET); } static void ResetWindows(void) diff --git a/src/pokenav_conditions_2.c b/src/pokenav_conditions_2.c index 4862fdc6f6..9fc7d33a15 100644 --- a/src/pokenav_conditions_2.c +++ b/src/pokenav_conditions_2.c @@ -199,12 +199,12 @@ u32 LoopedTask_OpenPartyConditionGraph(s32 state) return LT_INC_AND_PAUSE; case 1: InitBgTemplates(sPartyConditionBgTemplates, ARRAY_COUNT(sPartyConditionBgTemplates)); - ChangeBgX(1, 0, 0); - ChangeBgY(1, 0, 0); - ChangeBgX(2, 0, 0); - ChangeBgY(2, 0, 0); - ChangeBgX(3, 0, 0); - ChangeBgY(3, 0, 0); + ChangeBgX(1, 0, BG_COORD_SET); + ChangeBgY(1, 0, BG_COORD_SET); + ChangeBgX(2, 0, BG_COORD_SET); + ChangeBgY(2, 0, BG_COORD_SET); + ChangeBgX(3, 0, BG_COORD_SET); + ChangeBgY(3, 0, BG_COORD_SET); SetGpuReg(REG_OFFSET_DISPCNT, DISPCNT_WIN0_ON | DISPCNT_WIN1_ON | DISPCNT_OBJ_ON | DISPCNT_OBJ_1D_MAP | DISPCNT_BG0_ON | DISPCNT_BG3_ON); SetGpuReg(REG_OFFSET_BLDCNT, BLDCNT_TGT1_BG2 | BLDCNT_EFFECT_BLEND | BLDCNT_TGT2_BG3); SetGpuReg(REG_OFFSET_BLDALPHA, BLDALPHA_BLEND(11, 4)); diff --git a/src/pokenav_conditions_3.c b/src/pokenav_conditions_3.c index 6ce819c04e..1172774d79 100644 --- a/src/pokenav_conditions_3.c +++ b/src/pokenav_conditions_3.c @@ -448,8 +448,8 @@ static u32 LoopedTask_OpenConditionSearchResults(s32 state) case 4: if (FreeTempTileDataBuffersIfPossible()) return LT_PAUSE; - ChangeBgX(1, 0, 0); - ChangeBgY(1, 0, 0); + ChangeBgX(1, 0, BG_COORD_SET); + ChangeBgY(1, 0, BG_COORD_SET); ShowBg(1); ShowBg(2); HideBg(3); diff --git a/src/pokenav_main_menu.c b/src/pokenav_main_menu.c index 5936ef9d21..714c8221a3 100644 --- a/src/pokenav_main_menu.c +++ b/src/pokenav_main_menu.c @@ -421,9 +421,9 @@ static u32 LoopedTask_SlideMenuHeaderUp(s32 a0) case 0: return LT_INC_AND_PAUSE; case 2: - if (ChangeBgY(0, 384, 1) >= 0x2000u) + if (ChangeBgY(0, 384, BG_COORD_ADD) >= 0x2000u) { - ChangeBgY(0, 0x2000, 0); + ChangeBgY(0, 0x2000, BG_COORD_SET); return LT_FINISH; } @@ -433,9 +433,9 @@ static u32 LoopedTask_SlideMenuHeaderUp(s32 a0) static u32 LoopedTask_SlideMenuHeaderDown(s32 a0) { - if (ChangeBgY(0, 384, 2) <= 0) + if (ChangeBgY(0, 384, BG_COORD_SUB) <= 0) { - ChangeBgY(0, 0, 0); + ChangeBgY(0, 0, BG_COORD_SET); return LT_FINISH; } return LT_PAUSE; diff --git a/src/pokenav_match_call_2.c b/src/pokenav_match_call_2.c index 5af60a001d..3bfacfede4 100755 --- a/src/pokenav_match_call_2.c +++ b/src/pokenav_match_call_2.c @@ -322,8 +322,8 @@ static u32 LoopedTask_OpenMatchCall(s32 taskState) { case 0: InitBgTemplates(sMatchCallBgTemplates, ARRAY_COUNT(sMatchCallBgTemplates)); - ChangeBgX(2, 0, 0); - ChangeBgY(2, 0, 0); + ChangeBgX(2, 0, BG_COORD_SET); + ChangeBgY(2, 0, BG_COORD_SET); DecompressAndCopyTileDataToVram(2, sMatchCallUI_Gfx, 0, 0, 0); SetBgTilemapBuffer(2, state->unk1024); CopyToBgTilemapBuffer(2, sMatchCallUI_Tilemap, 0, 0); @@ -367,8 +367,8 @@ static u32 LoopedTask_OpenMatchCall(s32 taskState) PrintMatchCallLocation(state, 0); return LT_INC_AND_PAUSE; case 6: - ChangeBgX(1, 0, 0); - ChangeBgY(1, 0, 0); + ChangeBgX(1, 0, BG_COORD_SET); + ChangeBgY(1, 0, BG_COORD_SET); ShowBg(2); ShowBg(3); ShowBg(1); diff --git a/src/pokenav_match_call_ui.c b/src/pokenav_match_call_ui.c index 9e0ae89f18..5f95f24935 100644 --- a/src/pokenav_match_call_ui.c +++ b/src/pokenav_match_call_ui.c @@ -174,9 +174,9 @@ void sub_81C82E4(struct PokenavSub17 *matchCall) sub_8199DF0(matchCall->list.listWindow.bg, PIXEL_FILL(4), matchCall->list.listWindow.unk6 + 1, 1); SetBgTilemapBuffer(matchCall->list.listWindow.bg, matchCall->tilemapBuffer); FillBgTilemapBufferRect_Palette0(matchCall->list.listWindow.bg, tileNum, 0, 0, 32, 32); - ChangeBgY(matchCall->list.listWindow.bg, 0, 0); - ChangeBgX(matchCall->list.listWindow.bg, 0, 0); - ChangeBgY(matchCall->list.listWindow.bg, matchCall->list.listWindow.unk3 << 11, 2); + ChangeBgY(matchCall->list.listWindow.bg, 0, BG_COORD_SET); + ChangeBgX(matchCall->list.listWindow.bg, 0, BG_COORD_SET); + ChangeBgY(matchCall->list.listWindow.bg, matchCall->list.listWindow.unk3 << 11, BG_COORD_SUB); CopyBgTilemapBufferToVram(matchCall->list.listWindow.bg); } @@ -296,9 +296,9 @@ void sub_81C8568(s32 a0, struct PokenavSub17Substruct *list) list->unk20 = GetBgY(list->listWindow.bg); list->unk24 = list->unk20 + (a0 << 12); if (a0 > 0) - list->unk30 = 1; + list->unk30 = BG_COORD_ADD; else - list->unk30 = 2; + list->unk30 = BG_COORD_SUB; list->unk2C = a0; list->loopedTaskId = CreateLoopedTask(LoopedTask_sub_81C85A0, 6); } @@ -320,12 +320,12 @@ u32 LoopedTask_sub_81C85A0(s32 state) flag = FALSE; y = GetBgY(subPtr->listWindow.bg); v1 = ChangeBgY(subPtr->listWindow.bg, 0x1000, subPtr->unk30); - if (subPtr->unk30 == 2) + if (subPtr->unk30 == BG_COORD_SUB) { if ((y > subPtr->unk24 || y <= subPtr->unk20) && v1 <= subPtr->unk24) flag = TRUE; } - else + else // BG_COORD_ADD { if ((y < subPtr->unk24 || y >= subPtr->unk20) && v1 >= subPtr->unk24) flag = TRUE; @@ -334,7 +334,7 @@ u32 LoopedTask_sub_81C85A0(s32 state) if (flag) { subPtr->listWindow.unkA = (subPtr->listWindow.unkA + subPtr->unk2C) & 0xF; - ChangeBgY(subPtr->listWindow.bg, subPtr->unk24, 0); + ChangeBgY(subPtr->listWindow.bg, subPtr->unk24, BG_COORD_SET); return LT_FINISH; } return LT_PAUSE; diff --git a/src/pokenav_menu_handler_2.c b/src/pokenav_menu_handler_2.c index 10b6703da3..bcfe94cb7a 100644 --- a/src/pokenav_menu_handler_2.c +++ b/src/pokenav_menu_handler_2.c @@ -415,12 +415,12 @@ static u32 LoopedTask_OpenMenu(s32 state) CopyToBgTilemapBuffer(1, gPokenavMessageBox_Tilemap, 0, 0); CopyBgTilemapBufferToVram(1); CopyPaletteIntoBufferUnfaded(gPokenavMessageBox_Pal, 0x10, 0x20); - ChangeBgX(1, 0, 0); - ChangeBgY(1, 0, 0); - ChangeBgX(2, 0, 0); - ChangeBgY(2, 0, 0); - ChangeBgX(3, 0, 0); - ChangeBgY(3, 0, 0); + ChangeBgX(1, 0, BG_COORD_SET); + ChangeBgY(1, 0, BG_COORD_SET); + ChangeBgX(2, 0, BG_COORD_SET); + ChangeBgY(2, 0, BG_COORD_SET); + ChangeBgX(3, 0, BG_COORD_SET); + ChangeBgY(3, 0, BG_COORD_SET); return LT_INC_AND_PAUSE; case 1: if (FreeTempTileDataBuffersIfPossible()) @@ -1168,7 +1168,7 @@ static void DestroyMovingDotsBgTask(void) static void Task_MoveBgDots(u8 taskId) { - ChangeBgX(3, 0x80, 1); + ChangeBgX(3, 0x80, BG_COORD_ADD); } static void CreateBgDotPurplePalTask(void) diff --git a/src/pokenav_region_map.c b/src/pokenav_region_map.c index 78c60a09c0..c117dce3bd 100755 --- a/src/pokenav_region_map.c +++ b/src/pokenav_region_map.c @@ -515,11 +515,11 @@ static void LoadPokenavRegionMapGfx(struct Pokenav5Struct_2 *state) CopyPaletteIntoBufferUnfaded(sMapSecInfoWindow_Pal, 0x10, 0x20); CopyPaletteIntoBufferUnfaded(gRegionMapCityZoomTiles_Pal, 0x30, 0x20); if (!IsRegionMapZoomed()) - ChangeBgY(1, -0x6000, 0); + ChangeBgY(1, -0x6000, BG_COORD_SET); else - ChangeBgY(1, 0, 0); + ChangeBgY(1, 0, BG_COORD_SET); - ChangeBgX(1, 0, 0); + ChangeBgX(1, 0, BG_COORD_SET); } static bool32 TryFreeTempTileDataBuffers(void) @@ -587,9 +587,9 @@ static void Task_ChangeBgYForZoom(u8 taskId) { if (gTasks[taskId].tZoomIn) { - if (ChangeBgY(1, 0x480, 1) >= 0) + if (ChangeBgY(1, 0x480, BG_COORD_ADD) >= 0) { - ChangeBgY(1, 0, 0); + ChangeBgY(1, 0, BG_COORD_SET); DestroyTask(taskId); } @@ -597,9 +597,9 @@ static void Task_ChangeBgYForZoom(u8 taskId) } else { - if (ChangeBgY(1, 0x480, 2) <= -0x6000) + if (ChangeBgY(1, 0x480, BG_COORD_SUB) <= -0x6000) { - ChangeBgY(1, -0x6000, 0); + ChangeBgY(1, -0x6000, BG_COORD_SET); DestroyTask(taskId); } diff --git a/src/pokenav_ribbons_1.c b/src/pokenav_ribbons_1.c index 464e0b55cb..862128967c 100644 --- a/src/pokenav_ribbons_1.c +++ b/src/pokenav_ribbons_1.c @@ -439,8 +439,8 @@ static u32 LoopedTask_OpenRibbonsMonList(s32 state) return LT_PAUSE; if (!UpdateMonListBgs()) return LT_PAUSE; - ChangeBgX(1, 0, 0); - ChangeBgY(1, 0, 0); + ChangeBgX(1, 0, BG_COORD_SET); + ChangeBgY(1, 0, BG_COORD_SET); ShowBg(1); return LT_INC_AND_PAUSE; case 2: diff --git a/src/pokenav_ribbons_2.c b/src/pokenav_ribbons_2.c index bf1c156e58..361ec950d9 100644 --- a/src/pokenav_ribbons_2.c +++ b/src/pokenav_ribbons_2.c @@ -631,10 +631,10 @@ static u32 LoopedTask_OpenRibbonsSummaryMenu(s32 state) if (!IsDma3ManagerBusyWithBgCopy()) { CreateBigRibbonSprite(structPtr); - ChangeBgX(1, 0, 0); - ChangeBgY(1, 0, 0); - ChangeBgX(2, 0, 0); - ChangeBgY(2, 0, 0); + ChangeBgX(1, 0, BG_COORD_SET); + ChangeBgY(1, 0, BG_COORD_SET); + ChangeBgX(2, 0, BG_COORD_SET); + ChangeBgY(2, 0, BG_COORD_SET); ShowBg(1); ShowBg(2); HideBg(3); diff --git a/src/rayquaza_scene.c b/src/rayquaza_scene.c index 642fe6233b..51498fa1d6 100644 --- a/src/rayquaza_scene.c +++ b/src/rayquaza_scene.c @@ -1757,8 +1757,8 @@ static void DuoFight_LightningLong(void) static void DuoFight_AnimateRain(void) { - ChangeBgX(2, 0x400, 1); - ChangeBgY(2, 0x800, 2); + ChangeBgX(2, 0x400, BG_COORD_ADD); + ChangeBgY(2, 0x800, BG_COORD_SUB); } // Only used by the full version, which pans up at the end (so scene objects move down) @@ -1772,7 +1772,7 @@ static void DuoFight_PanOffScene(u8 taskId) bgY = GetBgY(1); if (GetBgY(1) == 0 || bgY > 0x8000) - ChangeBgY(1, 0x400, 2); + ChangeBgY(1, 0x400, BG_COORD_SUB); if (tTimer != 16) { @@ -1795,7 +1795,7 @@ static void Task_DuoFightEnd(u8 taskId) if (!gPaletteFade.active) { DestroyTask(tHelperTaskId); - ChangeBgY(1, 0, 0); + ChangeBgY(1, 0, BG_COORD_SET); SetVBlankCallback(NULL); ScanlineEffect_Stop(); ResetSpriteData(); @@ -2579,8 +2579,8 @@ static void Task_RayCharges_ShakeRayquaza(u8 taskId) s16 *data = gTasks[taskId].data; if ((tTimer & 3) == 0) { - ChangeBgX(1, (Random() % 8 - 4) << 8, 0); - ChangeBgY(1, (Random() % 8 - 4) << 8, 0); + ChangeBgX(1, (Random() % 8 - 4) << 8, BG_COORD_SET); + ChangeBgY(1, (Random() % 8 - 4) << 8, BG_COORD_SET); } tTimer++; @@ -2592,16 +2592,16 @@ static void Task_RayCharges_FlyOffscreen(u8 taskId) s16 *data = gTasks[taskId].data; if (tState == 0) { - ChangeBgX(1, 0, 0); - ChangeBgY(1, 0, 0); + ChangeBgX(1, 0, BG_COORD_SET); + ChangeBgY(1, 0, BG_COORD_SET); tState++; tOffset = 10; tShakeDir = -1; } else if (tState == 1) { - ChangeBgX(1, tOffset << 8, 2); - ChangeBgY(1, tOffset << 8, 1); + ChangeBgX(1, tOffset << 8, BG_COORD_SUB); + ChangeBgY(1, tOffset << 8, BG_COORD_ADD); tOffset += tShakeDir; if (tOffset == -10) tShakeDir *= -1; @@ -2616,12 +2616,12 @@ static void Task_RayCharges_FlyOffscreen(u8 taskId) static void RayCharges_AnimateBg(void) { // Update yellow orbs - ChangeBgX(2, 0x400, 2); - ChangeBgY(2, 0x400, 1); + ChangeBgX(2, 0x400, BG_COORD_SUB); + ChangeBgY(2, 0x400, BG_COORD_ADD); // Update blue streaks - ChangeBgX(0, 0x800, 2); - ChangeBgY(0, 0x800, 1); + ChangeBgX(0, 0x800, BG_COORD_SUB); + ChangeBgY(0, 0x800, BG_COORD_ADD); } static void Task_RayChargesEnd(u8 taskId) diff --git a/src/starter_choose.c b/src/starter_choose.c index 942f602730..403964684f 100644 --- a/src/starter_choose.c +++ b/src/starter_choose.c @@ -389,14 +389,14 @@ void CB2_ChooseStarter(void) SetGpuReg(REG_OFFSET_BG1CNT, 0); SetGpuReg(REG_OFFSET_BG0CNT, 0); - ChangeBgX(0, 0, 0); - ChangeBgY(0, 0, 0); - ChangeBgX(1, 0, 0); - ChangeBgY(1, 0, 0); - ChangeBgX(2, 0, 0); - ChangeBgY(2, 0, 0); - ChangeBgX(3, 0, 0); - ChangeBgY(3, 0, 0); + ChangeBgX(0, 0, BG_COORD_SET); + ChangeBgY(0, 0, BG_COORD_SET); + ChangeBgX(1, 0, BG_COORD_SET); + ChangeBgY(1, 0, BG_COORD_SET); + ChangeBgX(2, 0, BG_COORD_SET); + ChangeBgY(2, 0, BG_COORD_SET); + ChangeBgX(3, 0, BG_COORD_SET); + ChangeBgY(3, 0, BG_COORD_SET); DmaFill16(3, 0, VRAM, VRAM_SIZE); DmaFill32(3, 0, OAM, OAM_SIZE); diff --git a/src/trade.c b/src/trade.c index 88bef1ea01..4089cf1dfd 100644 --- a/src/trade.c +++ b/src/trade.c @@ -2907,8 +2907,8 @@ static void InitTradeBgInternal(void) SetGpuReg(REG_OFFSET_DISPCNT, 0); ResetBgsAndClearDma3BusyFlags(0); InitBgsFromTemplates(0, sTradeSequenceBgTemplates, ARRAY_COUNT(sTradeSequenceBgTemplates)); - ChangeBgX(0, 0, 0); - ChangeBgY(0, 0, 0); + ChangeBgX(0, 0, BG_COORD_SET); + ChangeBgY(0, 0, BG_COORD_SET); SetBgTilemapBuffer(0, Alloc(BG_SCREEN_SIZE)); SetBgTilemapBuffer(1, Alloc(BG_SCREEN_SIZE)); SetBgTilemapBuffer(3, Alloc(BG_SCREEN_SIZE)); diff --git a/src/trainer_card.c b/src/trainer_card.c index 8f3b61a356..02c7056314 100755 --- a/src/trainer_card.c +++ b/src/trainer_card.c @@ -884,14 +884,14 @@ static void InitBgsAndWindows(void) { ResetBgsAndClearDma3BusyFlags(0); InitBgsFromTemplates(0, sTrainerCardBgTemplates, ARRAY_COUNT(sTrainerCardBgTemplates)); - ChangeBgX(0, 0, 0); - ChangeBgY(0, 0, 0); - ChangeBgX(1, 0, 0); - ChangeBgY(1, 0, 0); - ChangeBgX(2, 0, 0); - ChangeBgY(2, 0, 0); - ChangeBgX(3, 0, 0); - ChangeBgY(3, 0, 0); + ChangeBgX(0, 0, BG_COORD_SET); + ChangeBgY(0, 0, BG_COORD_SET); + ChangeBgX(1, 0, BG_COORD_SET); + ChangeBgY(1, 0, BG_COORD_SET); + ChangeBgX(2, 0, BG_COORD_SET); + ChangeBgY(2, 0, BG_COORD_SET); + ChangeBgX(3, 0, BG_COORD_SET); + ChangeBgY(3, 0, BG_COORD_SET); InitWindows(sTrainerCardWindowTemplates); DeactivateAllTextPrinters(); LoadMessageBoxAndBorderGfx(); diff --git a/src/union_room_chat.c b/src/union_room_chat.c index c6fe7413e1..34aef1a887 100755 --- a/src/union_room_chat.c +++ b/src/union_room_chat.c @@ -2803,7 +2803,7 @@ static void AddStdMessageWindow(int msgId, u16 bg0vofs) str = sDisplayStdMessages[msgId].text; } - ChangeBgY(0, bg0vofs * 256, 0); + ChangeBgY(0, bg0vofs * 256, BG_COORD_SET); FillWindowPixelBuffer(windowId, PIXEL_FILL(1)); PutWindowTilemap(windowId); if (sDisplayStdMessages[msgId].boxType == 1) @@ -2846,7 +2846,7 @@ static void HideStdMessageWindow(void) ClearWindowTilemap(sDisplay->messageWindowId); } - ChangeBgY(0, 0, 0); + ChangeBgY(0, 0, BG_COORD_SET); } static void DestroyStdMessageWindow(void) @@ -3011,14 +3011,14 @@ static void PrintChatMessage(u16 row, u8 *str, u8 colorIdx) static void ResetGpuBgState(void) { - ChangeBgX(0, 0, 0); - ChangeBgY(0, 0, 0); - ChangeBgX(1, 0, 0); - ChangeBgY(1, 0, 0); - ChangeBgX(2, 0, 0); - ChangeBgY(2, 0, 0); - ChangeBgX(3, 0, 0); - ChangeBgY(3, 0, 0); + ChangeBgX(0, 0, BG_COORD_SET); + ChangeBgY(0, 0, BG_COORD_SET); + ChangeBgX(1, 0, BG_COORD_SET); + ChangeBgY(1, 0, BG_COORD_SET); + ChangeBgX(2, 0, BG_COORD_SET); + ChangeBgY(2, 0, BG_COORD_SET); + ChangeBgX(3, 0, BG_COORD_SET); + ChangeBgY(3, 0, BG_COORD_SET); ShowBg(0); ShowBg(1); ShowBg(2); diff --git a/src/use_pokeblock.c b/src/use_pokeblock.c index e67ade342c..9f8918ba2d 100644 --- a/src/use_pokeblock.c +++ b/src/use_pokeblock.c @@ -1316,14 +1316,14 @@ static bool8 LoadUsePokeblockMenuGfx(void) switch (sMenu->info.helperState) { case 0: - ChangeBgX(0, 0, 0); - ChangeBgY(0, 0, 0); - ChangeBgX(1, 0, 0); - ChangeBgY(1, 0, 0); - ChangeBgX(2, 0, 0); - ChangeBgY(2, 0, 0); - ChangeBgX(3, 0, 0); - ChangeBgY(3, 136 << 6, 0); + ChangeBgX(0, 0, BG_COORD_SET); + ChangeBgY(0, 0, BG_COORD_SET); + ChangeBgX(1, 0, BG_COORD_SET); + ChangeBgY(1, 0, BG_COORD_SET); + ChangeBgX(2, 0, BG_COORD_SET); + ChangeBgY(2, 0, BG_COORD_SET); + ChangeBgX(3, 0, BG_COORD_SET); + ChangeBgY(3, 136 << 6, BG_COORD_SET); SetGpuReg(REG_OFFSET_DISPCNT, DISPCNT_OBJ_1D_MAP | DISPCNT_OBJ_ON | DISPCNT_WIN0_ON | DISPCNT_WIN1_ON); SetGpuReg(REG_OFFSET_BLDCNT, BLDCNT_TGT1_BG2 | BLDCNT_EFFECT_BLEND | BLDCNT_TGT2_BG1); SetGpuReg(REG_OFFSET_BLDALPHA, BLDALPHA_BLEND(11, 4)); diff --git a/src/wallclock.c b/src/wallclock.c index 407c89c49a..759b1d11ff 100644 --- a/src/wallclock.c +++ b/src/wallclock.c @@ -628,14 +628,14 @@ static void LoadWallClockGraphics(void) SetGpuReg(REG_OFFSET_BG2CNT, 0); SetGpuReg(REG_OFFSET_BG1CNT, 0); SetGpuReg(REG_OFFSET_BG0CNT, 0); - ChangeBgX(0, 0, 0); - ChangeBgY(0, 0, 0); - ChangeBgX(1, 0, 0); - ChangeBgY(1, 0, 0); - ChangeBgX(2, 0, 0); - ChangeBgY(2, 0, 0); - ChangeBgX(3, 0, 0); - ChangeBgY(3, 0, 0); + ChangeBgX(0, 0, BG_COORD_SET); + ChangeBgY(0, 0, BG_COORD_SET); + ChangeBgX(1, 0, BG_COORD_SET); + ChangeBgY(1, 0, BG_COORD_SET); + ChangeBgX(2, 0, BG_COORD_SET); + ChangeBgY(2, 0, BG_COORD_SET); + ChangeBgX(3, 0, BG_COORD_SET); + ChangeBgY(3, 0, BG_COORD_SET); DmaFillLarge16(3, 0, (void *)VRAM, VRAM_SIZE, 0x1000); DmaClear32(3, (void *)OAM, OAM_SIZE); DmaClear16(3, (void *)PLTT, PLTT_SIZE); diff --git a/src/wireless_communication_status_screen.c b/src/wireless_communication_status_screen.c index a12a8920c1..ffb86488aa 100644 --- a/src/wireless_communication_status_screen.c +++ b/src/wireless_communication_status_screen.c @@ -189,10 +189,10 @@ static void CB2_InitWirelessCommunicationScreen(void) sStatusScreen->taskId = CreateTask(Task_WirelessCommunicationScreen, 0); sStatusScreen->rfuTaskId = CreateTask_ListenToWireless(); sStatusScreen->prevGroupCounts[GROUPTYPE_TOTAL] = 1; - ChangeBgX(0, 0, 0); - ChangeBgY(0, 0, 0); - ChangeBgX(1, 0, 0); - ChangeBgY(1, 0, 0); + ChangeBgX(0, 0, BG_COORD_SET); + ChangeBgY(0, 0, BG_COORD_SET); + ChangeBgX(1, 0, BG_COORD_SET); + ChangeBgY(1, 0, BG_COORD_SET); LoadPalette(sBgTiles_Pal, 0x00, 0x20); Menu_LoadStdPalAt(0xF0); DynamicPlaceholderTextUtil_Reset();