Merge pull request #1718 from AsparagusEduardo/pret_cleanEvoScene

Cleaned by comparing evolution_scene.c with pokefirered
This commit is contained in:
GriffinR 2022-07-27 21:54:34 -04:00 committed by GitHub
commit 456d45985f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
7 changed files with 56 additions and 56 deletions

View File

@ -426,7 +426,7 @@ void AnimTask_MoveAttackerMementoShadow(u8 taskId)
GetBattleAnimBg1Data(&animBg);
task->data[10] = gBattle_BG1_Y;
SetGpuReg(REG_OFFSET_BLDCNT, BLDCNT_TGT2_ALL | BLDCNT_EFFECT_BLEND | BLDCNT_TGT1_BG1);
FillPalette(0, animBg.paletteId * 16, 32);
FillPalette(RGB_BLACK, animBg.paletteId * 16, 32);
scanlineParams.dmaDest = &REG_BG1VOFS;
var0 = WINOUT_WIN01_BG1;
if (!IsContest())
@ -436,7 +436,7 @@ void AnimTask_MoveAttackerMementoShadow(u8 taskId)
{
task->data[10] = gBattle_BG2_Y;
SetGpuReg(REG_OFFSET_BLDCNT, BLDCNT_TGT2_ALL | BLDCNT_EFFECT_BLEND | BLDCNT_TGT1_BG2);
FillPalette(0, 144, 32);
FillPalette(RGB_BLACK, 144, 32);
scanlineParams.dmaDest = &REG_BG2VOFS;
var0 = WINOUT_WIN01_BG2;
if (!IsContest())
@ -566,12 +566,12 @@ void AnimTask_MoveTargetMementoShadow(u8 taskId)
{
GetBattleAnimBg1Data(&animBg);
task->data[10] = gBattle_BG1_Y;
FillPalette(0, animBg.paletteId * 16, 32);
FillPalette(RGB_BLACK, animBg.paletteId * 16, 32);
}
else
{
task->data[10] = gBattle_BG2_Y;
FillPalette(0, 9 * 16, 32);
FillPalette(RGB_BLACK, 9 * 16, 32);
}
SetAllBattlersSpritePriority(3);

View File

@ -1037,7 +1037,7 @@ static void Cmd_jumpifaffectedbyprotect(void)
}
}
bool8 JumpIfMoveAffectedByProtect(u16 move)
static bool8 JumpIfMoveAffectedByProtect(u16 move)
{
bool8 affected = FALSE;
if (DEFENDER_IS_PROTECTED)

View File

@ -276,7 +276,7 @@ static bool8 InitBerryTagScreen(void)
gMain.state++;
break;
case 14:
BlendPalettes(PALETTES_ALL, 0x10, 0);
BlendPalettes(PALETTES_ALL, 0x10, RGB_BLACK);
gMain.state++;
break;
case 15:

View File

@ -212,7 +212,7 @@ void EvolutionScene(struct Pokemon* mon, u16 postEvoSpecies, bool8 canStopEvo, u
u16 currSpecies;
u32 trainerId, personality;
const struct CompressedSpritePalette* pokePal;
u8 ID;
u8 id;
SetHBlankCallback(NULL);
SetVBlankCallback(NULL);
@ -267,11 +267,11 @@ void EvolutionScene(struct Pokemon* mon, u16 postEvoSpecies, bool8 canStopEvo, u
SetMultiuseSpriteTemplateToPokemon(currSpecies, B_POSITION_OPPONENT_LEFT);
gMultiuseSpriteTemplate.affineAnims = gDummySpriteAffineAnimTable;
sEvoStructPtr->preEvoSpriteId = ID = CreateSprite(&gMultiuseSpriteTemplate, 120, 64, 30);
sEvoStructPtr->preEvoSpriteId = id = CreateSprite(&gMultiuseSpriteTemplate, 120, 64, 30);
gSprites[ID].callback = SpriteCallbackDummy_2;
gSprites[ID].oam.paletteNum = 1;
gSprites[ID].invisible = TRUE;
gSprites[id].callback = SpriteCallbackDummy_2;
gSprites[id].oam.paletteNum = 1;
gSprites[id].invisible = TRUE;
// postEvo sprite
DecompressPicFromTable_2(&gMonFrontPicTable[postEvoSpecies],
@ -282,21 +282,21 @@ void EvolutionScene(struct Pokemon* mon, u16 postEvoSpecies, bool8 canStopEvo, u
SetMultiuseSpriteTemplateToPokemon(postEvoSpecies, B_POSITION_OPPONENT_RIGHT);
gMultiuseSpriteTemplate.affineAnims = gDummySpriteAffineAnimTable;
sEvoStructPtr->postEvoSpriteId = ID = CreateSprite(&gMultiuseSpriteTemplate, 120, 64, 30);
gSprites[ID].callback = SpriteCallbackDummy_2;
gSprites[ID].oam.paletteNum = 2;
gSprites[ID].invisible = TRUE;
sEvoStructPtr->postEvoSpriteId = id = CreateSprite(&gMultiuseSpriteTemplate, 120, 64, 30);
gSprites[id].callback = SpriteCallbackDummy_2;
gSprites[id].oam.paletteNum = 2;
gSprites[id].invisible = TRUE;
LoadEvoSparkleSpriteAndPal();
sEvoStructPtr->evoTaskId = ID = CreateTask(Task_EvolutionScene, 0);
gTasks[ID].tState = 0;
gTasks[ID].tPreEvoSpecies = currSpecies;
gTasks[ID].tPostEvoSpecies = postEvoSpecies;
gTasks[ID].tCanStop = canStopEvo;
gTasks[ID].tLearnsFirstMove = TRUE;
gTasks[ID].tEvoWasStopped = FALSE;
gTasks[ID].tPartyId = partyId;
sEvoStructPtr->evoTaskId = id = CreateTask(Task_EvolutionScene, 0);
gTasks[id].tState = 0;
gTasks[id].tPreEvoSpecies = currSpecies;
gTasks[id].tPostEvoSpecies = postEvoSpecies;
gTasks[id].tCanStop = canStopEvo;
gTasks[id].tLearnsFirstMove = TRUE;
gTasks[id].tEvoWasStopped = FALSE;
gTasks[id].tPartyId = partyId;
memcpy(&sEvoStructPtr->savedPalette, &gPlttBufferUnfaded[0x20], sizeof(sEvoStructPtr->savedPalette));
@ -310,7 +310,7 @@ void EvolutionScene(struct Pokemon* mon, u16 postEvoSpecies, bool8 canStopEvo, u
static void CB2_EvolutionSceneLoadGraphics(void)
{
u8 ID;
u8 id;
const struct CompressedSpritePalette* pokePal;
u16 postEvoSpecies;
u32 trainerId, personality;
@ -360,10 +360,10 @@ static void CB2_EvolutionSceneLoadGraphics(void)
SetMultiuseSpriteTemplateToPokemon(postEvoSpecies, B_POSITION_OPPONENT_RIGHT);
gMultiuseSpriteTemplate.affineAnims = gDummySpriteAffineAnimTable;
sEvoStructPtr->postEvoSpriteId = ID = CreateSprite(&gMultiuseSpriteTemplate, 120, 64, 30);
sEvoStructPtr->postEvoSpriteId = id = CreateSprite(&gMultiuseSpriteTemplate, 120, 64, 30);
gSprites[ID].callback = SpriteCallbackDummy_2;
gSprites[ID].oam.paletteNum = 2;
gSprites[id].callback = SpriteCallbackDummy_2;
gSprites[id].oam.paletteNum = 2;
SetGpuReg(REG_OFFSET_DISPCNT, DISPCNT_OBJ_ON | DISPCNT_BG_ALL_ON | DISPCNT_OBJ_1D_MAP);
@ -433,14 +433,14 @@ static void CB2_TradeEvolutionSceneLoadGraphics(void)
break;
case 5:
{
u8 ID;
u8 id;
SetMultiuseSpriteTemplateToPokemon(postEvoSpecies, B_POSITION_OPPONENT_LEFT);
gMultiuseSpriteTemplate.affineAnims = gDummySpriteAffineAnimTable;
sEvoStructPtr->postEvoSpriteId = ID = CreateSprite(&gMultiuseSpriteTemplate, 120, 64, 30);
sEvoStructPtr->postEvoSpriteId = id = CreateSprite(&gMultiuseSpriteTemplate, 120, 64, 30);
gSprites[ID].callback = SpriteCallbackDummy_2;
gSprites[ID].oam.paletteNum = 2;
gSprites[id].callback = SpriteCallbackDummy_2;
gSprites[id].oam.paletteNum = 2;
gMain.state++;
LinkTradeDrawWindow();
}
@ -451,7 +451,7 @@ static void CB2_TradeEvolutionSceneLoadGraphics(void)
LoadWirelessStatusIndicatorSpriteGfx();
CreateWirelessStatusIndicatorSprite(0, 0);
}
BlendPalettes(PALETTES_ALL, 0x10, 0);
BlendPalettes(PALETTES_ALL, 0x10, RGB_BLACK);
gMain.state++;
break;
case 7:
@ -471,7 +471,7 @@ void TradeEvolutionScene(struct Pokemon* mon, u16 postEvoSpecies, u8 preEvoSprit
u16 currSpecies;
u32 trainerId, personality;
const struct CompressedSpritePalette* pokePal;
u8 ID;
u8 id;
GetMonData(mon, MON_DATA_NICKNAME, name);
StringCopy_Nickname(gStringVar1, name);
@ -496,21 +496,21 @@ void TradeEvolutionScene(struct Pokemon* mon, u16 postEvoSpecies, u8 preEvoSprit
SetMultiuseSpriteTemplateToPokemon(postEvoSpecies, B_POSITION_OPPONENT_LEFT);
gMultiuseSpriteTemplate.affineAnims = gDummySpriteAffineAnimTable;
sEvoStructPtr->postEvoSpriteId = ID = CreateSprite(&gMultiuseSpriteTemplate, 120, 64, 30);
sEvoStructPtr->postEvoSpriteId = id = CreateSprite(&gMultiuseSpriteTemplate, 120, 64, 30);
gSprites[ID].callback = SpriteCallbackDummy_2;
gSprites[ID].oam.paletteNum = 2;
gSprites[ID].invisible = TRUE;
gSprites[id].callback = SpriteCallbackDummy_2;
gSprites[id].oam.paletteNum = 2;
gSprites[id].invisible = TRUE;
LoadEvoSparkleSpriteAndPal();
sEvoStructPtr->evoTaskId = ID = CreateTask(Task_TradeEvolutionScene, 0);
gTasks[ID].tState = 0;
gTasks[ID].tPreEvoSpecies = currSpecies;
gTasks[ID].tPostEvoSpecies = postEvoSpecies;
gTasks[ID].tLearnsFirstMove = TRUE;
gTasks[ID].tEvoWasStopped = FALSE;
gTasks[ID].tPartyId = partyId;
sEvoStructPtr->evoTaskId = id = CreateTask(Task_TradeEvolutionScene, 0);
gTasks[id].tState = 0;
gTasks[id].tPreEvoSpecies = currSpecies;
gTasks[id].tPostEvoSpecies = postEvoSpecies;
gTasks[id].tLearnsFirstMove = TRUE;
gTasks[id].tEvoWasStopped = FALSE;
gTasks[id].tPartyId = partyId;
gBattle_BG0_X = 0;
gBattle_BG0_Y = 0;
@ -521,7 +521,7 @@ void TradeEvolutionScene(struct Pokemon* mon, u16 postEvoSpecies, u8 preEvoSprit
gBattle_BG3_X = 256;
gBattle_BG3_Y = 0;
gTextFlags.useAlternateDownArrow = 1;
gTextFlags.useAlternateDownArrow = TRUE;
SetVBlankCallback(VBlankCB_TradeEvolutionScene);
SetMainCallback2(CB2_TradeEvolutionSceneUpdate);
@ -839,9 +839,9 @@ static void Task_EvolutionScene(u8 taskId)
case EVOSTATE_CANCEL_MSG:
if (EvoScene_IsMonAnimFinished(sEvoStructPtr->preEvoSpriteId))
{
if (gTasks[taskId].tEvoWasStopped)
if (gTasks[taskId].tEvoWasStopped) // FRLG auto cancellation
StringExpandPlaceholders(gStringVar4, gText_EllipsisQuestionMark);
else // Fire Red leftover probably
else
StringExpandPlaceholders(gStringVar4, gText_PkmnStoppedEvolving);
BattlePutTextOnWindow(gStringVar4, B_WIN_MSG);
@ -1223,7 +1223,7 @@ static void Task_TradeEvolutionScene(u8 taskId)
{
DestroyTask(taskId);
FREE_AND_SET_NULL(sEvoStructPtr);
gTextFlags.useAlternateDownArrow = 0;
gTextFlags.useAlternateDownArrow = FALSE;
SetMainCallback2(gCB2_AfterEvolution);
}
break;
@ -1644,7 +1644,7 @@ static void PauseBgPaletteAnim(void)
if (taskId != TASK_NONE)
gTasks[taskId].tPaused = TRUE;
FillPalette(0, 0xA0, 0x20);
FillPalette(RGB_BLACK, 0xA0, 0x20);
}
#undef tPaused
@ -1658,7 +1658,7 @@ static void StopBgAnimation(void)
if ((taskId = FindTaskIdByFunc(Task_AnimateBg)) != TASK_NONE)
DestroyTask(taskId);
FillPalette(0, 0xA0, 0x20);
FillPalette(RGB_BLACK, 0xA0, 0x20);
RestoreBgAfterAnim();
}

View File

@ -1595,7 +1595,7 @@ void CB2_LinkError(void)
ResetSpriteData();
FreeAllSpritePalettes();
ResetPaletteFadeControl();
FillPalette(0, 0, 2);
FillPalette(RGB_BLACK, 0, 2);
ResetTasks();
ScanlineEffect_Stop();
if (gWirelessCommType)

View File

@ -102,7 +102,7 @@ void CB2_InitMysteryEventMenu(void)
BuildOamBuffer();
RunTextPrinters();
UpdatePaletteFade();
FillPalette(0, 0, 2);
FillPalette(RGB_BLACK, 0, 2);
SetMainCallback2(CB2_MysteryEventMenu);
}
}

View File

@ -1627,7 +1627,7 @@ static void Task_DuoFightAnim(u8 taskId)
StopMapMusic();
}
BlendPalettes(PALETTES_ALL, 0x10, 0);
BlendPalettes(PALETTES_ALL, 0x10, RGB_BLACK);
BeginNormalPaletteFade(PALETTES_ALL, 0, 0x10, 0, RGB_BLACK);
SetVBlankCallback(VBlankCB_DuoFight);
PlaySE(SE_DOWNPOUR);
@ -2284,7 +2284,7 @@ static void Task_RayDescendsAnim(u8 taskId)
LoadDescendsSceneGfx();
SetGpuRegBits(REG_OFFSET_BLDCNT, BLDCNT_TGT1_BG0 | BLDCNT_TGT2_BG1 | BLDCNT_TGT2_BG2 | BLDCNT_TGT2_BG3 | BLDCNT_TGT2_OBJ | BLDCNT_EFFECT_BLEND);
SetGpuReg(REG_OFFSET_BLDALPHA, BLDALPHA_BLEND(0, 16));
BlendPalettes(PALETTES_ALL, 0x10, 0);
BlendPalettes(PALETTES_ALL, 0x10, RGB_BLACK);
SetVBlankCallback(VBlankCB_RayquazaScene);
sRayScene->revealedLightLine = 0;
sRayScene->revealedLightTimer = 0;
@ -2501,7 +2501,7 @@ static void Task_RayChargesAnim(u8 taskId)
InitChargesSceneBgs();
LoadChargesSceneGfx();
SetWindowsHideVertBorders();
BlendPalettes(PALETTES_ALL, 0x10, 0);
BlendPalettes(PALETTES_ALL, 0x10, RGB_BLACK);
SetVBlankCallback(VBlankCB_RayquazaScene);
tState = 0;
tTimer = 0;
@ -2697,7 +2697,7 @@ static void Task_RayChasesAwayAnim(u8 taskId)
ClearGpuRegBits(REG_OFFSET_DISPCNT, DISPCNT_BG2_ON);
SetGpuReg(REG_OFFSET_BLDCNT, BLDCNT_TGT1_BG0 | BLDCNT_TGT2_BG1 | BLDCNT_EFFECT_BLEND);
SetGpuReg(REG_OFFSET_BLDALPHA, BLDALPHA_BLEND(9, 14));
BlendPalettes(PALETTES_ALL, 0x10, 0);
BlendPalettes(PALETTES_ALL, 0x10, RGB_BLACK);
SetVBlankCallback(VBlankCB_RayquazaScene);
tState = 0;
tTimer = 0;