Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed map preview fade-in for weathers that set BLDALPHA. #23

Open
wants to merge 1 commit into
base: map-previews
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions src/field_weather.c
Original file line number Diff line number Diff line change
Expand Up @@ -127,11 +127,11 @@ static const u8 sBasePaletteColorMapTypes[32] =
COLOR_MAP_DARK_CONTRAST,
COLOR_MAP_DARK_CONTRAST,
COLOR_MAP_DARK_CONTRAST,
COLOR_MAP_DARK_CONTRAST,
COLOR_MAP_NONE,
COLOR_MAP_NONE,
COLOR_MAP_NONE, // shops; map previews
COLOR_MAP_NONE, // map popup
COLOR_MAP_NONE, // text boxes
// sprite palettes
COLOR_MAP_CONTRAST,
COLOR_MAP_CONTRAST, // shadows; fog
COLOR_MAP_DARK_CONTRAST,
COLOR_MAP_CONTRAST,
COLOR_MAP_CONTRAST,
Expand Down
7 changes: 5 additions & 2 deletions src/map_preview.c
Original file line number Diff line number Diff line change
Expand Up @@ -500,7 +500,7 @@ void MapPreview_StartForestTransition(u8 mapsec)
taskId = CreateTask(Task_RunMapPreviewScreenForest, 0);
gTasks[taskId].data[2] = GetBgAttribute(0, BG_ATTR_PRIORITY);
gTasks[taskId].data[4] = GetGpuReg(REG_OFFSET_BLDCNT);
gTasks[taskId].data[5] = GetGpuReg(REG_OFFSET_BLDALPHA);
gTasks[taskId].data[5] = GetGpuReg(REG_OFFSET_BLDALPHA); // now unused
gTasks[taskId].data[3] = GetGpuReg(REG_OFFSET_DISPCNT);
gTasks[taskId].data[6] = GetGpuReg(REG_OFFSET_WININ);
gTasks[taskId].data[7] = GetGpuReg(REG_OFFSET_WINOUT);
Expand Down Expand Up @@ -569,13 +569,15 @@ static void Task_RunMapPreviewScreenForest(u8 taskId)
}
break;
case 2:
SetGpuReg(REG_OFFSET_BLDALPHA, BLDALPHA_BLEND(16, 0));
if (IsWeatherNotFadingIn())
{
Overworld_PlaySpecialMapMusic();
data[0]++;
}
break;
case 3:
SetGpuReg(REG_OFFSET_BLDALPHA, BLDALPHA_BLEND(16, 0));
data[1]++;
if (data[1] > data[10])
{
Expand Down Expand Up @@ -617,7 +619,8 @@ static void Task_RunMapPreviewScreenForest(u8 taskId)
SetBgAttribute(0, BG_ATTR_PRIORITY, data[2]);
SetGpuReg(REG_OFFSET_DISPCNT, data[3]);
SetGpuReg(REG_OFFSET_BLDCNT, data[4]);
SetGpuReg(REG_OFFSET_BLDALPHA, data[5]);
// Restore current weather's requested blend settings
SetGpuReg(REG_OFFSET_BLDALPHA, BLDALPHA_BLEND(gWeatherPtr->currBlendEVA, gWeatherPtr->currBlendEVB));
SetGpuReg(REG_OFFSET_WININ, data[6]);
SetGpuReg(REG_OFFSET_WINOUT, data[7]);
DestroyTask(taskId);
Expand Down