Document the water droplet data.

This commit is contained in:
Phlosioneer 2019-03-12 22:56:53 -04:00 committed by huderlem
parent d0115db565
commit 61344a4fee
3 changed files with 24 additions and 9 deletions

View File

@ -1,7 +1,7 @@
#ifndef GUARD_TITLE_SCREEN_H
#define GUARD_TITLE_SCREEN_H
extern const u16 gIntroWaterDropData[];
extern const u16 gIntroWaterDropAlphaBlend[];
void CB2_InitTitleScreen(void);

View File

@ -2427,7 +2427,7 @@ static void Task_IntroWaterDrops_1(u8 taskId)
| BLDCNT_TGT2_BG3
| BLDCNT_TGT2_OBJ
| BLDCNT_TGT2_BD);
SetGpuReg(REG_OFFSET_BLDALPHA, gIntroWaterDropData[31]);
SetGpuReg(REG_OFFSET_BLDALPHA, gIntroWaterDropAlphaBlend[31]);
SetGpuReg(REG_OFFSET_BLDY, 0);
gTasks[taskId].data[1] = 0x40;
gTasks[taskId].data[0]++;
@ -2439,11 +2439,11 @@ static void Task_IntroWaterDrops_1(u8 taskId)
gTasks[taskId].data[1]--;
tmp = gTasks[taskId].data[1] / 2;
SetGpuReg(REG_OFFSET_BLDALPHA, gIntroWaterDropData[tmp]);
SetGpuReg(REG_OFFSET_BLDALPHA, gIntroWaterDropAlphaBlend[tmp]);
}
else
{
SetGpuReg(REG_OFFSET_BLDALPHA, gIntroWaterDropData[0]);
SetGpuReg(REG_OFFSET_BLDALPHA, gIntroWaterDropAlphaBlend[0]);
gTasks[taskId].data[1] = 0x10;
gTasks[taskId].data[0]++;
}
@ -2470,7 +2470,7 @@ static void Task_IntroWaterDrops_2(u8 taskId)
| BLDCNT_TGT2_BG3
| BLDCNT_TGT2_OBJ
| BLDCNT_TGT2_BD);
SetGpuReg(REG_OFFSET_BLDALPHA, gIntroWaterDropData[0]);
SetGpuReg(REG_OFFSET_BLDALPHA, gIntroWaterDropAlphaBlend[0]);
SetGpuReg(REG_OFFSET_BLDY, 0);
gTasks[taskId].data[1] = 0;
gTasks[taskId].data[0]++;
@ -2482,11 +2482,11 @@ static void Task_IntroWaterDrops_2(u8 taskId)
gTasks[taskId].data[1]++;
tmp = gTasks[taskId].data[1] / 2;
SetGpuReg(REG_OFFSET_BLDALPHA, gIntroWaterDropData[tmp]);
SetGpuReg(REG_OFFSET_BLDALPHA, gIntroWaterDropAlphaBlend[tmp]);
}
else
{
SetGpuReg(REG_OFFSET_BLDALPHA, gIntroWaterDropData[31]);
SetGpuReg(REG_OFFSET_BLDALPHA, gIntroWaterDropAlphaBlend[31]);
gTasks[taskId].data[1] = 0x10;
gTasks[taskId].data[0]++;
}

View File

@ -64,7 +64,22 @@ static const u32 sTitleScreenRayquazaTilemap[] = INCBIN_U32("graphics/title_scre
static const u32 sTitleScreenLogoShineGfx[] = INCBIN_U32("graphics/title_screen/logo_shine.4bpp.lz");
static const u32 sTitleScreenCloudsGfx[] = INCBIN_U32("graphics/title_screen/clouds.4bpp.lz");
const u16 gIntroWaterDropData[] =
// This is BLDALPHA data. It's equivalent to:
//
// BLDALPHA_BLEND(0, 16)
// BLDALPHA_BLEND(1, 16)
// ...
// BLDALPHA_BLEND(14, 16)
// BLDALPHA_BLEND(15, 16)
// BLDALPHA_BLEND(16, 15)
// BLDALPHA_BLEND(16, 14)
// ...
// BLDALPHA_BLEND(16, 1)
// BLDALPHA_BLEND(16, 0)
// BLDALPHA_BLEND(16, 0)
// BLDALPHA_BLEND(16, 0)
// ... (repeated until array has 32 entries)
const u16 gIntroWaterDropAlphaBlend[] =
{
0x0010, 0x0110, 0x0210, 0x0310, 0x0410, 0x0510, 0x0610, 0x0710,
0x0810, 0x0910, 0x0a10, 0x0b10, 0x0c10, 0x0d10, 0x0e10, 0x0f10,
@ -324,7 +339,7 @@ static void SpriteCB_VersionBannerLeft(struct Sprite *sprite)
sprite->pos1.y++;
if (sprite->data[0] != 0)
sprite->data[0]--;
SetGpuReg(REG_OFFSET_BLDALPHA, gIntroWaterDropData[sprite->data[0]]);
SetGpuReg(REG_OFFSET_BLDALPHA, gIntroWaterDropAlphaBlend[sprite->data[0]]);
}
}