diff --git a/src/battle_anim_effects_2.c b/src/battle_anim_effects_2.c index 92bca01f2..5dd584386 100755 --- a/src/battle_anim_effects_2.c +++ b/src/battle_anim_effects_2.c @@ -3079,7 +3079,7 @@ void AnimTask_FakeOut(u8 taskId) SetGpuReg(REG_OFFSET_WININ, WININ_WIN0_BG_ALL | WININ_WIN0_OBJ | WININ_WIN1_ALL); SetGpuReg(REG_OFFSET_WINOUT, WINOUT_WIN01_ALL | WINOUT_WINOBJ_ALL); SetGpuReg(REG_OFFSET_BLDCNT, BLDCNT_TGT1_BG3 | BLDCNT_EFFECT_DARKEN); - SetGpuReg(REG_OFFSET_BLDY, 0x10); + SetGpuReg(REG_OFFSET_BLDY, 16); gTasks[taskId].data[0] = win0v; gTasks[taskId].data[1] = win0h; gTasks[taskId].func = AnimTask_FakeOut_Step1; diff --git a/src/battle_anim_ghost.c b/src/battle_anim_ghost.c index b52932b46..e7cd4b253 100644 --- a/src/battle_anim_ghost.c +++ b/src/battle_anim_ghost.c @@ -950,7 +950,7 @@ void AnimTask_CurseStretchingBlackBg(u8 taskId) SetGpuReg(REG_OFFSET_WINOUT, ((WINOUT_WIN01_BG_ALL | WINOUT_WIN01_OBJ) | (WINOUT_WINOBJ_BG_ALL | WINOUT_WINOBJ_OBJ | WINOUT_WINOBJ_CLR))); SetGpuReg(REG_OFFSET_BLDCNT, (BLDCNT_TGT1_BG3 | BLDCNT_EFFECT_DARKEN)); - SetGpuReg(REG_OFFSET_BLDY, 0x10); + SetGpuReg(REG_OFFSET_BLDY, 16); if (GetBattlerSide(gBattleAnimAttacker) != B_SIDE_PLAYER || IsContest()) startX = 40; diff --git a/src/battle_main.c b/src/battle_main.c index 323053bdf..741461b0b 100644 --- a/src/battle_main.c +++ b/src/battle_main.c @@ -2047,7 +2047,7 @@ static u8 CreateNPCTrainerParty(struct Pokemon *party, u16 trainerNum, bool8 fir void sub_8038A04(void) // unused { if (REG_VCOUNT < 0xA0 && REG_VCOUNT >= 0x6F) - SetGpuReg(REG_OFFSET_BG0CNT, 0x9800); + SetGpuReg(REG_OFFSET_BG0CNT, BGCNT_SCREENBASE(24) | BGCNT_TXT256x512); } void VBlankCB_Battle(void) diff --git a/src/battle_transition.c b/src/battle_transition.c index ed518eaf8..1b484f7c5 100644 --- a/src/battle_transition.c +++ b/src/battle_transition.c @@ -1250,12 +1250,12 @@ static void sub_814669C(struct Task *task) task->tData2 = 0; task->tData4 = 0; task->tData5 = 0x4000; - sTransitionStructPtr->WININ = 63; + sTransitionStructPtr->WININ = WININ_WIN0_ALL; sTransitionStructPtr->WINOUT = 0; sTransitionStructPtr->WIN0H = DISPLAY_WIDTH; sTransitionStructPtr->WIN0V = DISPLAY_HEIGHT; - sTransitionStructPtr->BLDCNT = 0x3F41; - sTransitionStructPtr->BLDALPHA = (task->tData1 << 8) | (task->tData2); + sTransitionStructPtr->BLDCNT = BLDCNT_TGT1_BG0 | BLDCNT_EFFECT_BLEND | BLDCNT_TGT2_ALL; + sTransitionStructPtr->BLDALPHA = BLDALPHA_BLEND(task->tData2, task->tData1); for (i = 0; i < 160; i++) { @@ -1480,7 +1480,7 @@ static bool8 Phase2_BigPokeball_Func3(struct Task *task) task->tData2++; task->tData3 = 2; } - sTransitionStructPtr->BLDALPHA = (task->tData1 << 8) | task->tData2; + sTransitionStructPtr->BLDALPHA = BLDALPHA_BLEND(task->tData2, task->tData1); if (task->tData2 > 15) task->tState++; task->tData4 += 8; @@ -1500,7 +1500,7 @@ static bool8 Phase2_BigPokeball_Func4(struct Task *task) task->tData1--; task->tData3 = 2; } - sTransitionStructPtr->BLDALPHA = (task->tData1 << 8) | task->tData2; + sTransitionStructPtr->BLDALPHA = BLDALPHA_BLEND(task->tData2, task->tData1); if (task->tData1 == 0) task->tState++; task->tData4 += 8; @@ -1731,7 +1731,7 @@ static bool8 Phase2_Clockwise_BlackFade_Func1(struct Task *task) ScanlineEffect_Clear(); sTransitionStructPtr->WININ = 0; - sTransitionStructPtr->WINOUT = 63; + sTransitionStructPtr->WINOUT = WINOUT_WIN01_ALL; sTransitionStructPtr->WIN0H = -3855; sTransitionStructPtr->WIN0V = DISPLAY_HEIGHT; @@ -1999,7 +1999,7 @@ static bool8 Phase2_Wave_Func1(struct Task *task) InitTransitionStructVars(); ScanlineEffect_Clear(); - sTransitionStructPtr->WININ = 63; + sTransitionStructPtr->WININ = WININ_WIN0_ALL; sTransitionStructPtr->WINOUT = 0; sTransitionStructPtr->WIN0H = DISPLAY_WIDTH; sTransitionStructPtr->WIN0V = DISPLAY_HEIGHT; @@ -2111,8 +2111,8 @@ static bool8 Phase2_Mugshot_Func1(struct Task *task) task->tData1 = 0; task->tData2 = 1; task->tData3 = 239; - sTransitionStructPtr->WININ = 63; - sTransitionStructPtr->WINOUT = 62; + sTransitionStructPtr->WININ = WININ_WIN0_ALL; + sTransitionStructPtr->WINOUT = WINOUT_WIN01_BG1 | WINOUT_WIN01_BG2 | WINOUT_WIN01_BG3 | WINOUT_WIN01_OBJ | WINOUT_WIN01_CLR; sTransitionStructPtr->WIN0V = DISPLAY_HEIGHT; for (i = 0; i < 160; i++) @@ -2258,7 +2258,7 @@ static bool8 Phase2_Mugshot_Func6(struct Task *task) task->tState++; task->tData3 = 0; task->tData4 = 0; - sTransitionStructPtr->BLDCNT = 0xBF; + sTransitionStructPtr->BLDCNT = BLDCNT_TGT1_ALL | BLDCNT_EFFECT_LIGHTEN; SetVBlankCallback(VBlankCB1_Phase2_Mugshots); } return FALSE; @@ -2505,7 +2505,7 @@ static bool8 Phase2_Slice_Func1(struct Task *task) task->tData2 = 256; task->tData3 = 1; - sTransitionStructPtr->WININ = 63; + sTransitionStructPtr->WININ = WININ_WIN0_ALL; sTransitionStructPtr->WINOUT = 0; sTransitionStructPtr->WIN0V = DISPLAY_HEIGHT; sTransitionStructPtr->VBlank_DMA = FALSE; @@ -2606,7 +2606,7 @@ static bool8 Phase2_ShredSplit_Func1(struct Task *task) InitTransitionStructVars(); ScanlineEffect_Clear(); - sTransitionStructPtr->WININ = 63; + sTransitionStructPtr->WININ = WININ_WIN0_ALL; sTransitionStructPtr->WINOUT = 0; sTransitionStructPtr->WIN0V = DISPLAY_HEIGHT; @@ -2779,7 +2779,7 @@ static bool8 Phase2_Blackhole_Func1(struct Task *task) ScanlineEffect_Clear(); sTransitionStructPtr->WININ = 0; - sTransitionStructPtr->WINOUT = 63; + sTransitionStructPtr->WINOUT = WINOUT_WIN01_ALL; sTransitionStructPtr->WIN0H = DISPLAY_WIDTH; sTransitionStructPtr->WIN0V = DISPLAY_HEIGHT; @@ -3116,7 +3116,7 @@ static bool8 Phase2_Rayquaza_Func3(struct Task *task) InitTransitionStructVars(); ScanlineEffect_Clear(); - SetGpuReg(REG_OFFSET_BG0CNT, 0x9A08); + SetGpuReg(REG_OFFSET_BG0CNT, BGCNT_CHARBASE(2) | BGCNT_SCREENBASE(26) | BGCNT_TXT256x512); GetBg0TilesDst(&tilemap, &tileset); CpuFill16(0, tilemap, 0x800); CpuCopy16(sRayquaza_Tileset, tileset, 0x2000); @@ -3207,7 +3207,7 @@ static bool8 Phase2_Rayquaza_Func9(struct Task *task) u16 i; sTransitionStructPtr->WININ = 0; - sTransitionStructPtr->WINOUT = 63; + sTransitionStructPtr->WINOUT = WINOUT_WIN01_ALL; sTransitionStructPtr->WIN0H = DISPLAY_WIDTH; sTransitionStructPtr->WIN0V = DISPLAY_HEIGHT; @@ -3255,10 +3255,10 @@ static bool8 Phase2_WhiteFade_Func1(struct Task *task) InitTransitionStructVars(); ScanlineEffect_Clear(); - sTransitionStructPtr->BLDCNT = 0xBF; + sTransitionStructPtr->BLDCNT = BLDCNT_TGT1_ALL | BLDCNT_EFFECT_LIGHTEN; sTransitionStructPtr->BLDY = 0; - sTransitionStructPtr->WININ = 0x1E; - sTransitionStructPtr->WINOUT = 0x3F; + sTransitionStructPtr->WININ = WININ_WIN0_BG1 | WININ_WIN0_BG2 | WININ_WIN0_BG3 | WININ_WIN0_OBJ; + sTransitionStructPtr->WINOUT = WINOUT_WIN01_ALL; sTransitionStructPtr->WIN0V = DISPLAY_HEIGHT; for (i = 0; i < 160; i++) @@ -3314,10 +3314,10 @@ static bool8 Phase2_WhiteFade_Func4(struct Task *task) SetVBlankCallback(0); SetHBlankCallback(0); - sTransitionStructPtr->WIN0H = 0xF0; + sTransitionStructPtr->WIN0H = DISPLAY_WIDTH; sTransitionStructPtr->BLDY = 0; sTransitionStructPtr->BLDCNT = 0xFF; - sTransitionStructPtr->WININ = 0x3F; + sTransitionStructPtr->WININ = WININ_WIN0_ALL; SetVBlankCallback(VBlankCB1_Phase2_WhiteFade); @@ -3468,7 +3468,7 @@ static bool8 Phase2_Shards_Func1(struct Task *task) InitTransitionStructVars(); ScanlineEffect_Clear(); - sTransitionStructPtr->WININ = 0x3F; + sTransitionStructPtr->WININ = WININ_WIN0_ALL; sTransitionStructPtr->WINOUT = 0; sTransitionStructPtr->WIN0V = DISPLAY_HEIGHT; @@ -3895,8 +3895,8 @@ static bool8 Phase2_FrontierLogoWave_Func1(struct Task *task) task->tData5 = 0; task->tData6 = 16; task->tData7 = 2560; - sTransitionStructPtr->BLDCNT = 0x3F41; - sTransitionStructPtr->BLDALPHA = (task->tData6 << 8) | (task->tData5); + sTransitionStructPtr->BLDCNT = BLDCNT_TGT1_BG0 | BLDCNT_EFFECT_BLEND | BLDCNT_TGT2_ALL; + sTransitionStructPtr->BLDALPHA = BLDALPHA_BLEND(task->tData5, task->tData6); REG_BLDCNT = sTransitionStructPtr->BLDCNT; REG_BLDALPHA = sTransitionStructPtr->BLDALPHA; GetBg0TilesDst(&tilemap, &tileset); @@ -3965,7 +3965,7 @@ static bool8 Phase2_FrontierLogoWave_Func4(struct Task *task) else if (task->tData6 > 0) task->tData6--; - sTransitionStructPtr->BLDALPHA = (task->tData6 << 8) | (task->tData5); + sTransitionStructPtr->BLDALPHA = BLDALPHA_BLEND(task->tData5, task->tData6); } for (i = 0; i < 160; i++, var6 += var8) diff --git a/src/berry_blender.c b/src/berry_blender.c index 39e1dca08..d47aa707d 100644 --- a/src/berry_blender.c +++ b/src/berry_blender.c @@ -1426,7 +1426,7 @@ static void CB2_StartBlenderLink(void) sBerryBlender->centerScale += 4; if (sBerryBlender->centerScale > 255) { - SetGpuRegBits(REG_OFFSET_BG2CNT, 2); + SetGpuRegBits(REG_OFFSET_BG2CNT, BGCNT_PRIORITY(2)); sBerryBlender->mainState++; sBerryBlender->centerScale = 256; sBerryBlender->arrowPos = sArrowStartPos[sArrowStartPosIds[sBerryBlender->numPlayers - 2]]; @@ -1726,7 +1726,7 @@ static void CB2_StartBlenderLocal(void) sBerryBlender->mainState++; sBerryBlender->centerScale = 256; sBerryBlender->arrowPos = sArrowStartPos[sArrowStartPosIds[sBerryBlender->numPlayers - 2]]; - SetGpuRegBits(REG_OFFSET_BG2CNT, 2); + SetGpuRegBits(REG_OFFSET_BG2CNT, BGCNT_PRIORITY(2)); sBerryBlender->framesToWait = 0; PlaySE(SE_TRUCK_DOOR); PrintPlayerNames(); diff --git a/src/diploma.c b/src/diploma.c index 8652430e7..dca0912e3 100644 --- a/src/diploma.c +++ b/src/diploma.c @@ -51,18 +51,18 @@ void CB2_ShowDiploma(void) { SetVBlankCallback(NULL); SetGpuReg(REG_OFFSET_DISPCNT, DISPCNT_MODE_0); - SetGpuReg(REG_OFFSET_BG3CNT, DISPCNT_MODE_0); - SetGpuReg(REG_OFFSET_BG2CNT, DISPCNT_MODE_0); - SetGpuReg(REG_OFFSET_BG1CNT, DISPCNT_MODE_0); - SetGpuReg(REG_OFFSET_BG0CNT, DISPCNT_MODE_0); - SetGpuReg(REG_OFFSET_BG3HOFS, DISPCNT_MODE_0); - SetGpuReg(REG_OFFSET_BG3VOFS, DISPCNT_MODE_0); - SetGpuReg(REG_OFFSET_BG2HOFS, DISPCNT_MODE_0); - SetGpuReg(REG_OFFSET_BG2VOFS, DISPCNT_MODE_0); - SetGpuReg(REG_OFFSET_BG1HOFS, DISPCNT_MODE_0); - SetGpuReg(REG_OFFSET_BG1VOFS, DISPCNT_MODE_0); - SetGpuReg(REG_OFFSET_BG0HOFS, DISPCNT_MODE_0); - SetGpuReg(REG_OFFSET_BG0VOFS, DISPCNT_MODE_0); + SetGpuReg(REG_OFFSET_BG3CNT, 0); + SetGpuReg(REG_OFFSET_BG2CNT, 0); + SetGpuReg(REG_OFFSET_BG1CNT, 0); + SetGpuReg(REG_OFFSET_BG0CNT, 0); + SetGpuReg(REG_OFFSET_BG3HOFS, 0); + SetGpuReg(REG_OFFSET_BG3VOFS, 0); + SetGpuReg(REG_OFFSET_BG2HOFS, 0); + SetGpuReg(REG_OFFSET_BG2VOFS, 0); + SetGpuReg(REG_OFFSET_BG1HOFS, 0); + SetGpuReg(REG_OFFSET_BG1VOFS, 0); + SetGpuReg(REG_OFFSET_BG0HOFS, 0); + SetGpuReg(REG_OFFSET_BG0VOFS, 0); // why doesn't this one use the dma manager either? DmaFill16(3, 0, VRAM, VRAM_SIZE); DmaFill32(3, 0, OAM, OAM_SIZE); @@ -129,12 +129,12 @@ static void DisplayDiplomaText(void) { if (HasAllMons()) { - SetGpuReg(REG_OFFSET_BG1HOFS, DISPCNT_BG0_ON); + SetGpuReg(REG_OFFSET_BG1HOFS, DISPLAY_WIDTH + 16); StringCopy(gStringVar1, gText_DexNational); } else { - SetGpuReg(REG_OFFSET_BG1HOFS, DISPCNT_MODE_0); + SetGpuReg(REG_OFFSET_BG1HOFS, 0); StringCopy(gStringVar1, gText_DexHoenn); } StringExpandPlaceholders(gStringVar4, gText_PokedexDiploma); @@ -173,9 +173,9 @@ static void InitDiplomaBg(void) SetGpuReg(REG_OFFSET_DISPCNT, DISPCNT_OBJ_ON | DISPCNT_OBJ_1D_MAP); ShowBg(0); ShowBg(1); - SetGpuReg(REG_OFFSET_BLDCNT, DISPCNT_MODE_0); - SetGpuReg(REG_OFFSET_BLDALPHA, DISPCNT_MODE_0); - SetGpuReg(REG_OFFSET_BLDY, DISPCNT_MODE_0); + SetGpuReg(REG_OFFSET_BLDCNT, 0); + SetGpuReg(REG_OFFSET_BLDALPHA, 0); + SetGpuReg(REG_OFFSET_BLDY, 0); } static const struct WindowTemplate sDiplomaWinTemplates[2] = diff --git a/src/evolution_scene.c b/src/evolution_scene.c index 59316835f..39e917161 100644 --- a/src/evolution_scene.c +++ b/src/evolution_scene.c @@ -1125,7 +1125,7 @@ static void Task_TradeEvolutionScene(u8 taskId) var = gSprites[sEvoStructPtr->preEvoSpriteId].oam.paletteNum + 16; sEvoGraphicsTaskId = EvolutionSparkles_SpiralUpward(var); gTasks[taskId].tState++; - SetGpuReg(REG_OFFSET_BG3CNT, 0x603); + SetGpuReg(REG_OFFSET_BG3CNT, BGCNT_PRIORITY(3) | BGCNT_SCREENBASE(6)); } break; case T_EVOSTATE_SPARKLE_ARC: diff --git a/src/option_menu.c b/src/option_menu.c index a210c9502..0174b69db 100644 --- a/src/option_menu.c +++ b/src/option_menu.c @@ -187,7 +187,7 @@ void CB2_InitOptionMenu(void) SetGpuReg(REG_OFFSET_WIN0V, 0); SetGpuReg(REG_OFFSET_WININ, WININ_WIN0_BG0); SetGpuReg(REG_OFFSET_WINOUT, WINOUT_WIN01_BG0 | WINOUT_WIN01_BG1 | WINOUT_WIN01_CLR); - SetGpuReg(REG_OFFSET_BLDCNT, 193); + SetGpuReg(REG_OFFSET_BLDCNT, BLDCNT_TGT1_BG0 | BLDCNT_EFFECT_DARKEN); SetGpuReg(REG_OFFSET_BLDALPHA, 0); SetGpuReg(REG_OFFSET_BLDY, 4); SetGpuReg(REG_OFFSET_DISPCNT, DISPCNT_WIN0_ON | DISPCNT_OBJ_ON | DISPCNT_OBJ_1D_MAP); diff --git a/src/title_screen.c b/src/title_screen.c index 21d10495c..cf356cefa 100644 --- a/src/title_screen.c +++ b/src/title_screen.c @@ -600,7 +600,7 @@ void CB2_InitTitleScreen(void) SetGpuReg(REG_OFFSET_WINOUT, WINOUT_WIN01_BG_ALL | WINOUT_WIN01_OBJ | WINOUT_WINOBJ_ALL); SetGpuReg(REG_OFFSET_BLDCNT, BLDCNT_TGT1_BG2 | BLDCNT_EFFECT_LIGHTEN); SetGpuReg(REG_OFFSET_BLDALPHA, 0); - SetGpuReg(REG_OFFSET_BLDY, 0xC); + SetGpuReg(REG_OFFSET_BLDY, 12); SetGpuReg(REG_OFFSET_BG0CNT, BGCNT_PRIORITY(3) | BGCNT_CHARBASE(2) | BGCNT_SCREENBASE(26) | BGCNT_16COLOR | BGCNT_TXT256x256); SetGpuReg(REG_OFFSET_BG1CNT, BGCNT_PRIORITY(2) | BGCNT_CHARBASE(3) | BGCNT_SCREENBASE(27) | BGCNT_16COLOR | BGCNT_TXT256x256); SetGpuReg(REG_OFFSET_BG2CNT, BGCNT_PRIORITY(1) | BGCNT_CHARBASE(0) | BGCNT_SCREENBASE(9) | BGCNT_256COLOR | BGCNT_AFF256x256);