Fix bldcnt gpu reg args

This commit is contained in:
DizzyEggg 2018-12-26 13:43:07 +01:00
parent 7f6f6c33ab
commit 7e4db39da5
12 changed files with 32 additions and 32 deletions

View File

@ -2283,7 +2283,7 @@ static void ScriptCmd_setalpha(void)
sBattleAnimScriptPtr++;
half1 = *(sBattleAnimScriptPtr++);
half2 = *(sBattleAnimScriptPtr++) << 8;
SetGpuReg(REG_OFFSET_BLDCNT, 0x3F40);
SetGpuReg(REG_OFFSET_BLDCNT, BLDCNT_EFFECT_BLEND | BLDCNT_TGT2_ALL);
SetGpuReg(REG_OFFSET_BLDALPHA, half1 | half2);
}

View File

@ -3134,7 +3134,7 @@ void sub_8105EB0(u8 taskId)
SetGpuReg(REG_OFFSET_WIN0V, gBattle_WIN0V);
SetGpuReg(REG_OFFSET_WININ, 0x3F1F);
SetGpuReg(REG_OFFSET_WINOUT, 0x3F3F);
SetGpuReg(REG_OFFSET_BLDCNT, 0xC8);
SetGpuReg(REG_OFFSET_BLDCNT, BLDCNT_TGT1_BG3 | BLDCNT_EFFECT_DARKEN);
SetGpuReg(REG_OFFSET_BLDY, 0x10);
gTasks[taskId].data[0] = win0v;
gTasks[taskId].data[1] = win0h;

View File

@ -3220,7 +3220,7 @@ void sub_815CED8(u8 taskId)
gSprites[spriteId].oam.objMode = ST_OAM_OBJ_BLEND;
FillPalette(RGB(31, 31, 31), (gSprites[spriteId].oam.paletteNum << 4) + 0x100, 32);
gSprites[spriteId].oam.priority = priority;
SetGpuReg(REG_OFFSET_BLDCNT, 0x3F40);
SetGpuReg(REG_OFFSET_BLDCNT, BLDCNT_EFFECT_BLEND | BLDCNT_TGT2_ALL);
SetGpuReg(REG_OFFSET_BLDALPHA, BLDALPHA_BLEND(gTasks[taskId].data[1], 16 - gTasks[taskId].data[1]));
gTasks[taskId].data[0] = spriteId;

View File

@ -67,7 +67,7 @@ static const u16 sUnknown_08618138[] = {
0x7fff, 0x7fff, 0x318c, 0x675a,
0x043c, 0x3aff, 0x0664, 0x4bd2,
0x6546, 0x7b14, 0x7fff, 0x318c,
0x675a, 0x0000, 0x0000, 0x0000
0x675a, 0, 0, 0
};
static const u8 sUnknown_08618158[] = {10, 11, 12};
@ -124,7 +124,7 @@ void CB2_InitBerryFixProgram(void)
ResetSpriteData();
ResetTasks();
ScanlineEffect_Stop();
SetGpuReg(REG_OFFSET_DISPCNT, 0x0000);
SetGpuReg(REG_OFFSET_DISPCNT, 0);
berry_fix_mb_manager = AllocZeroed(0x50);
berry_fix_mb_manager->state = 0;
berry_fix_mb_manager->unk1 = 6;
@ -203,13 +203,13 @@ static void berry_fix_gpu_set(void)
{
s32 width, left;
SetGpuReg(REG_OFFSET_BG0CNT, 0x0000);
SetGpuReg(REG_OFFSET_BG1CNT, 0x0000);
SetGpuReg(REG_OFFSET_BG0HOFS, 0x0000);
SetGpuReg(REG_OFFSET_BG0VOFS, 0x0000);
SetGpuReg(REG_OFFSET_BG1HOFS, 0x0000);
SetGpuReg(REG_OFFSET_BG1VOFS, 0x0000);
SetGpuReg(REG_OFFSET_BLDCNT, 0x0000);
SetGpuReg(REG_OFFSET_BG0CNT, 0);
SetGpuReg(REG_OFFSET_BG1CNT, 0);
SetGpuReg(REG_OFFSET_BG0HOFS, 0);
SetGpuReg(REG_OFFSET_BG0VOFS, 0);
SetGpuReg(REG_OFFSET_BG1HOFS, 0);
SetGpuReg(REG_OFFSET_BG1VOFS, 0);
SetGpuReg(REG_OFFSET_BLDCNT, 0);
DmaFill32(3, 0, VRAM, VRAM_SIZE);
DmaFill32(3, 0, OAM, OAM_SIZE);

View File

@ -2219,7 +2219,7 @@ static void sub_8177050(struct Sprite *sprite)
}
else
{
SetGpuReg(REG_OFFSET_BLDCNT, 0xF40);
SetGpuReg(REG_OFFSET_BLDCNT, BLDCNT_EFFECT_BLEND | BLDCNT_TGT2_BG0 | BLDCNT_TGT2_BG1 | BLDCNT_TGT2_BG2 | BLDCNT_TGT2_BG3);
SetGpuReg(REG_OFFSET_BLDALPHA, 0x10);
sprite->oam.objMode = 1;
sprite->data[3] = 16;

View File

@ -1479,7 +1479,7 @@ static void InitMovingBackgroundTask(bool8 isLink)
if (!isLink)
{
SetGpuReg(REG_OFFSET_BLDCNT, 0x442);
SetGpuReg(REG_OFFSET_BLDCNT, BLDCNT_TGT1_BG1 | BLDCNT_EFFECT_BLEND | BLDCNT_TGT2_BG2);
SetGpuReg(REG_OFFSET_BLDALPHA, 0x808);
SetGpuReg(REG_OFFSET_DISPCNT, DISPCNT_OBJ_ON | DISPCNT_BG2_ON | DISPCNT_BG1_ON | DISPCNT_BG0_ON | DISPCNT_OBJ_1D_MAP);
@ -1491,7 +1491,7 @@ static void InitMovingBackgroundTask(bool8 isLink)
}
else
{
SetGpuReg(REG_OFFSET_BLDCNT, 0x842);
SetGpuReg(REG_OFFSET_BLDCNT, BLDCNT_TGT1_BG1 | BLDCNT_EFFECT_BLEND | BLDCNT_TGT2_BG3);
SetGpuReg(REG_OFFSET_BLDALPHA, 0x808);
SetGpuReg(REG_OFFSET_DISPCNT, DISPCNT_OBJ_ON | DISPCNT_BG3_ON | DISPCNT_BG1_ON | DISPCNT_BG0_ON | DISPCNT_OBJ_1D_MAP);
}

View File

@ -376,7 +376,7 @@ static void sub_80F9C90(u8 taskId)
task->data[7] = GetGpuReg(REG_OFFSET_BLDCNT);
task->data[8] = GetGpuReg(REG_OFFSET_BLDY);
SetGpuReg(REG_OFFSET_BLDCNT, 0xBF);
SetGpuReg(REG_OFFSET_BLDCNT, BLDCNT_TGT1_ALL | BLDCNT_EFFECT_LIGHTEN);
SetGpuReg(REG_OFFSET_BLDY, 0x10);
break;
@ -452,7 +452,7 @@ static void sub_80F9DFC(u8 taskId)
{
task->data[5] = 0x50;
task->data[6] = 0x51;
SetGpuReg(REG_OFFSET_BLDCNT, 0xBF);
SetGpuReg(REG_OFFSET_BLDCNT, BLDCNT_TGT1_ALL | BLDCNT_EFFECT_LIGHTEN);
SetGpuReg(REG_OFFSET_BLDY, 0x10);
}
SetGpuReg(REG_OFFSET_WIN0V, WIN_RANGE(task->data[5], task->data[6]));

View File

@ -355,7 +355,7 @@ static bool8 InitHallOfFameScreen(void)
gMain.state++;
break;
case 2:
SetGpuReg(REG_OFFSET_BLDCNT, 0x3F42);
SetGpuReg(REG_OFFSET_BLDCNT, BLDCNT_TGT1_BG1 | BLDCNT_EFFECT_BLEND | BLDCNT_TGT2_ALL);
SetGpuReg(REG_OFFSET_BLDALPHA, 0x710);
SetGpuReg(REG_OFFSET_BLDY, 0);
sub_8174FAC();
@ -817,7 +817,7 @@ void CB2_DoHallOfFamePC(void)
{
u8 taskId, i;
SetGpuReg(REG_OFFSET_BLDCNT, 0x3F42);
SetGpuReg(REG_OFFSET_BLDCNT, BLDCNT_TGT1_BG1 | BLDCNT_EFFECT_BLEND | BLDCNT_TGT2_ALL);
SetGpuReg(REG_OFFSET_BLDALPHA, 0x710);
SetGpuReg(REG_OFFSET_BLDY, 0);
taskId = CreateTask(Task_HofPC_CopySaveData, 0);

View File

@ -425,7 +425,7 @@ void CB2_ChooseStarter(void)
SetGpuReg(REG_OFFSET_WINOUT, 0x1F);
SetGpuReg(REG_OFFSET_WIN0H, 0);
SetGpuReg(REG_OFFSET_WIN0V, 0);
SetGpuReg(REG_OFFSET_BLDCNT, 0xFE);
SetGpuReg(REG_OFFSET_BLDCNT, BLDCNT_TGT1_BG1 | BLDCNT_TGT1_BG2 | BLDCNT_TGT1_BG3 | BLDCNT_TGT1_OBJ | BLDCNT_TGT1_BD | BLDCNT_EFFECT_DARKEN);
SetGpuReg(REG_OFFSET_BLDALPHA, 0);
SetGpuReg(REG_OFFSET_BLDY, 7);
SetGpuReg(REG_OFFSET_DISPCNT, DISPCNT_WIN0_ON | DISPCNT_OBJ_ON | DISPCNT_OBJ_1D_MAP);

View File

@ -553,7 +553,7 @@ void CB2_InitTitleScreen(void)
SetGpuReg(REG_OFFSET_WIN1V, 0);
SetGpuReg(REG_OFFSET_WININ, 0x1F1F);
SetGpuReg(REG_OFFSET_WINOUT, 0x3F1F);
SetGpuReg(REG_OFFSET_BLDCNT, 0x84);
SetGpuReg(REG_OFFSET_BLDCNT, BLDCNT_TGT1_BG2 | BLDCNT_EFFECT_LIGHTEN);
SetGpuReg(REG_OFFSET_BLDALPHA, 0);
SetGpuReg(REG_OFFSET_BLDY, 0xC);
SetGpuReg(REG_OFFSET_BG0CNT, BGCNT_PRIORITY(3) | BGCNT_CHARBASE(2) | BGCNT_SCREENBASE(26) | BGCNT_16COLOR | BGCNT_TXT256x256);
@ -615,7 +615,7 @@ static void Task_TitleScreenPhase1(u8 taskId)
SetGpuReg(REG_OFFSET_DISPCNT, DISPCNT_MODE_1 | DISPCNT_OBJ_1D_MAP | DISPCNT_BG2_ON | DISPCNT_OBJ_ON);
SetGpuReg(REG_OFFSET_WININ, 0);
SetGpuReg(REG_OFFSET_WINOUT, 0);
SetGpuReg(REG_OFFSET_BLDCNT, 0x3F50);
SetGpuReg(REG_OFFSET_BLDCNT, BLDCNT_TGT1_OBJ | BLDCNT_EFFECT_BLEND | BLDCNT_TGT2_ALL);
SetGpuReg(REG_OFFSET_BLDALPHA, 0x10);
SetGpuReg(REG_OFFSET_BLDY, 0);
@ -652,7 +652,7 @@ static void Task_TitleScreenPhase2(u8 taskId)
else
{
gTasks[taskId].tSkipToNext = TRUE;
SetGpuReg(REG_OFFSET_BLDCNT, 0x2142);
SetGpuReg(REG_OFFSET_BLDCNT, BLDCNT_TGT1_BG1 | BLDCNT_EFFECT_BLEND | BLDCNT_TGT2_BG0 | BLDCNT_TGT2_BD);
SetGpuReg(REG_OFFSET_BLDALPHA, 0xF06);
SetGpuReg(REG_OFFSET_BLDY, 0);
SetGpuReg(REG_OFFSET_DISPCNT, DISPCNT_MODE_1

View File

@ -337,7 +337,7 @@ static bool8 sub_81DAACC(struct Task *task)
else
{
sub_81DA700();
SetGpuReg(REG_OFFSET_BLDCNT, 0x3F41);
SetGpuReg(REG_OFFSET_BLDCNT, BLDCNT_TGT1_BG0 | BLDCNT_EFFECT_BLEND | BLDCNT_TGT2_ALL);
SetGpuReg(REG_OFFSET_BLDALPHA, 0x1000);
ChangeBgX(0, 0, 0);
ChangeBgY(0, 0, 0);

View File

@ -585,11 +585,11 @@ static void WallClockVblankCallback(void)
static void LoadWallClockGraphics(void)
{
SetVBlankCallback(NULL);
SetGpuReg(REG_OFFSET_DISPCNT, 0x0000);
SetGpuReg(REG_OFFSET_BG3CNT, 0x0000);
SetGpuReg(REG_OFFSET_BG2CNT, 0x0000);
SetGpuReg(REG_OFFSET_BG1CNT, 0x0000);
SetGpuReg(REG_OFFSET_BG0CNT, 0x0000);
SetGpuReg(REG_OFFSET_DISPCNT, 0);
SetGpuReg(REG_OFFSET_BG3CNT, 0);
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);
@ -633,9 +633,9 @@ static void WallClockInit(void)
EnableInterrupts(INTR_FLAG_VBLANK);
SetVBlankCallback(WallClockVblankCallback);
SetMainCallback2(WallClockMainCallback);
SetGpuReg(REG_OFFSET_BLDCNT, 0x0000);
SetGpuReg(REG_OFFSET_BLDALPHA, 0x0000);
SetGpuReg(REG_OFFSET_BLDY, 0x0000);
SetGpuReg(REG_OFFSET_BLDCNT, 0);
SetGpuReg(REG_OFFSET_BLDALPHA, 0);
SetGpuReg(REG_OFFSET_BLDY, 0);
SetGpuReg(REG_OFFSET_DISPCNT, DISPCNT_OBJ_1D_MAP | DISPCNT_OBJ_ON);
ShowBg(0);
ShowBg(2);