Misc reg constant cleanup

This commit is contained in:
GriffinR 2021-04-15 03:00:01 -04:00
parent 8368b753df
commit f94540c2b8
9 changed files with 49 additions and 49 deletions

View File

@ -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;

View File

@ -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;

View File

@ -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)

View File

@ -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)

View File

@ -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();

View File

@ -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] =

View File

@ -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:

View File

@ -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);

View File

@ -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);