Document first rayquaza scene

This commit is contained in:
GriffinR 2020-08-26 16:31:37 -04:00
parent 95ea0e92e7
commit ba13e9ec95
7 changed files with 666 additions and 635 deletions

View File

@ -3309,57 +3309,57 @@ extern const u32 gBerryTag_Gfx[];
extern const u32 gBerryTag_Pal[];
// rayquaza scene gfx
extern const u32 gRaySceneGroudon_Gfx[];
extern const u32 gRaySceneGroudonShoulder_Gfx[];
extern const u32 gRaySceneGroudonClaw_Gfx[];
extern const u32 gRaySceneKyogre_Gfx[];
extern const u32 gRaySceneKyogre2_Gfx[];
extern const u32 gRaySceneKyogre3_Gfx[];
extern const u32 gRaySceneGroudon_Pal[];
extern const u32 gRaySceneKyogre_Pal[];
extern const u32 gRaySceneSmoke_Gfx[];
extern const u32 gRaySceneSmoke_Pal[];
extern const u32 gRaySceneRayquaza_Pal[];
extern const u32 gRaySceneRayquazaFly1_Gfx[];
extern const u32 gRaySceneRayquazaTail_Gfx[];
extern const u32 gRaySceneGroudonLeft_Gfx[];
extern const u32 gRaySceneGroudonTail_Gfx[];
extern const u32 gRaySceneKyogreRight_Gfx[];
extern const u32 gRaySceneRayquazaHover_Gfx[];
extern const u32 gRaySceneRayquazaFlyIn_Gfx[];
extern const u32 gRaySceneOvercast_Gfx[];
extern const u32 gRaySceneOvercast_Tilemap[];
extern const u32 gRaySceneRayquaza_Gfx[];
extern const u32 gRaySceneRayquaza_Tilemap[];
extern const u32 gRaySceneSplash_Gfx[];
extern const u32 gRaySceneGroudonLeft_Pal[];
extern const u32 gRaySceneKyogreRight_Pal[];
extern const u32 gRaySceneRayquazaHover_Pal[];
extern const u32 gRaySceneSplash_Pal[];
extern const u32 gRaySceneClouds_Gfx[];
extern const u32 gRaySceneClouds_Pal[];
extern const u32 gRaySceneClouds2_Tilemap[];
extern const u32 gRaySceneClouds1_Tilemap[];
extern const u32 gRaySceneClouds3_Tilemap[];
extern const u32 gRaySceneRayquazaLight_Gfx[];
extern const u32 gRaySceneRayquazaLight_Tilemap[];
extern const u32 gRaySceneOvercast2_Gfx[];
extern const u32 gRaySceneOvercast2_Tilemap[];
extern const u32 gRaySceneOvercast2_Pal[];
extern const u32 gRaySceneRayquazaChase_Gfx[];
extern const u32 gRaySceneChaseStreaks_Gfx[];
extern const u32 gRaySceneChaseBg_Gfx[];
extern const u32 gRayChaseRayquazaChase2_Tilemap[];
extern const u32 gRayChaseRayquazaChase_Tilemap[];
extern const u32 gRaySceneChaseStreaks_Tilemap[];
extern const u32 gRaySceneChaseBg_Tilemap[];
extern const u32 gRaySceneChase_Pal[];
extern const u32 gRaySceneHushRing_Tilemap[];
extern const u32 gRaySceneHushBg_Tilemap[];
extern const u32 gRaySceneHushRing_Map[];
extern const u32 gRaySceneHushBg_Pal[];
extern const u32 gRaySceneHushBg_Gfx[];
extern const u32 gRaySceneHushRing_Gfx[];
extern const u32 gRaySceneDuoFight_Groudon_Gfx[];
extern const u32 gRaySceneDuoFight_GroudonShoulder_Gfx[];
extern const u32 gRaySceneDuoFight_GroudonClaw_Gfx[];
extern const u32 gRaySceneDuoFight_Kyogre_Gfx[];
extern const u32 gRaySceneDuoFight_KyogreShoulder_Gfx[];
extern const u32 gRaySceneDuoFight_KyogreFin_Gfx[];
extern const u32 gRaySceneDuoFight_Groudon_Pal[];
extern const u32 gRaySceneDuoFight_Kyogre_Pal[];
extern const u32 gRaySceneTakesFlight_Smoke_Gfx[];
extern const u32 gRaySceneTakesFlight_Smoke_Pal[];
extern const u32 gRaySceneTakesFlight_Rayquaza_Pal[];
extern const u32 gRaySceneDescends_Rayquaza_Gfx[];
extern const u32 gRaySceneDescends_RayquazaTail_Gfx[];
extern const u32 gRaySceneChasesAway_Groudon_Gfx[];
extern const u32 gRaySceneChasesAway_GroudonTail_Gfx[];
extern const u32 gRaySceneChasesAway_Kyogre_Gfx[];
extern const u32 gRaySceneChasesAway_Rayquaza_Gfx[];
extern const u32 gRaySceneChasesAway_RayquazaTail_Gfx[];
extern const u32 gRaySceneTakesFlight_Bg_Gfx[];
extern const u32 gRaySceneTakesFlight_Bg_Tilemap[];
extern const u32 gRaySceneTakesFlight_Rayquaza_Gfx[];
extern const u32 gRaySceneTakesFlight_Rayquaza_Tilemap[];
extern const u32 gRaySceneChasesAway_KyogreSplash_Gfx[];
extern const u32 gRaySceneChasesAway_Groudon_Pal[];
extern const u32 gRaySceneChasesAway_Kyogre_Pal[];
extern const u32 gRaySceneChasesAway_Rayquaza_Pal[];
extern const u32 gRaySceneChasesAway_KyogreSplash_Pal[];
extern const u32 gRaySceneDuoFight_Clouds_Gfx[];
extern const u32 gRaySceneDuoFight_Clouds_Pal[];
extern const u32 gRaySceneDuoFight_Clouds2_Tilemap[];
extern const u32 gRaySceneDuoFight_Clouds1_Tilemap[];
extern const u32 gRaySceneDuoFight_Clouds3_Tilemap[];
extern const u32 gRaySceneDescends_Light_Gfx[];
extern const u32 gRaySceneDescends_Light_Tilemap[];
extern const u32 gRaySceneDescends_Bg_Gfx[];
extern const u32 gRaySceneDescends_Bg_Tilemap[];
extern const u32 gRaySceneDescends_Bg_Pal[];
extern const u32 gRaySceneCharges_Rayquaza_Gfx[];
extern const u32 gRaySceneCharges_Streaks_Gfx[];
extern const u32 gRaySceneCharges_Bg_Gfx[];
extern const u32 gRaySceneCharges_Rayquaza2_Tilemap[];
extern const u32 gRaySceneCharges_Rayquaza_Tilemap[];
extern const u32 gRaySceneCharges_Streaks_Tilemap[];
extern const u32 gRaySceneCharges_Bg_Tilemap[];
extern const u32 gRaySceneCharges_Bg_Pal[];
extern const u32 gRaySceneChasesAway_Ring_Tilemap[];
extern const u32 gRaySceneChasesAway_Bg_Tilemap[];
extern const u32 gRaySceneChasesAway_Ring_Map[];
extern const u32 gRaySceneChasesAway_Bg_Pal[];
extern const u32 gRaySceneChasesAway_Bg_Gfx[];
extern const u32 gRaySceneChasesAway_Ring_Gfx[];
// Pokeballs
extern const u32 gItemIcon_MasterBall[];

View File

@ -70,7 +70,7 @@ void BeginFastPaletteFade(u8);
void BeginHardwarePaletteFade(u8, u8, u8, u8, u8);
void BlendPalettes(u32 selectedPalettes, u8 coeff, u16 color);
void BlendPalettesUnfaded(u32, u8, u16);
void sub_80A2C44(u32 a1, s8 a2, u8 a3, u8 a4, u16 a5, u8 a6, u8 a7);
void BlendPalettesGradually(u32 selectedPalettes, s8 delay, u8 coeff, u8 coeffTarget, u16 color, u8 priority, u8 id);
void TintPalette_GrayScale(u16 *palette, u16 count);
void TintPalette_GrayScale2(u16 *palette, u16 count);
void TintPalette_SepiaTone(u16 *palette, u16 count);

View File

@ -384,7 +384,7 @@ static void InitContestMonPixels(u16 species, u8 whichSprite)
}
}
//#ifdef NONMATCHING
#ifdef NONMATCHING
// functionally equivalent.
static void _InitContestMonPixels(u8 *spriteGfx, u16 *palette, u16 (*destPixels)[64][64])
{
@ -399,22 +399,23 @@ static void _InitContestMonPixels(u8 *spriteGfx, u16 *palette, u16 (*destPixels)
{
for (pixelX = 0; pixelX < 8; pixelX++)
{
colorIndex = spriteGfx[(((tileY * 8) + tileX) * 32) + (pixelY << 2) + (pixelX >> 1)];
int offset = 32 * (8 * tileY + tileX) + (pixelY * 4 + pixelX / 2);
colorIndex = spriteGfx[offset];
if (pixelX & 1)
colorIndex >>= 4;
else
colorIndex &= 0xF;
if (colorIndex == 0) // transparent pixel
(*destPixels)[tileY * 8 + pixelY][tileX * 8 + pixelX] = 0x8000;
(*destPixels)[8 * tileY + pixelY][tileX * 8 + pixelX] = 0x8000;
else
(*destPixels)[tileY * 8 + pixelY][tileX * 8 + pixelX] = palette[colorIndex];
(*destPixels)[8 * tileY + pixelY][tileX * 8 + pixelX] = palette[colorIndex];
}
}
}
}
}
/*#else
#else
NAKED
static void _InitContestMonPixels(u8 *spriteGfx, u16 *palette, u16 (*destPixels)[64][64])
{
@ -516,7 +517,7 @@ _081303F8:\n\
pop {r0}\n\
bx r0");
}
#endif*/
#endif
#define VRAM_PICTURE_DATA(x, y) (((u16 *)(BG_SCREEN_ADDR(12)))[(y) * 32 + (x)])

View File

@ -1,62 +1,62 @@
// Scene 1 (RAY_ANIM_DUO_FIGHT / RAY_ANIM_DUO_FIGHT_PRE)
const u32 gRaySceneGroudon_Gfx[] = INCBIN_U32("graphics/rayquaza_scene/scene_1/groudon.4bpp.lz");
const u32 gRaySceneGroudonShoulder_Gfx[] = INCBIN_U32("graphics/rayquaza_scene/scene_1/groudon_shoulder.4bpp.lz");
const u32 gRaySceneGroudonClaw_Gfx[] = INCBIN_U32("graphics/rayquaza_scene/scene_1/groudon_claw.4bpp.lz");
const u32 gRaySceneKyogre_Gfx[] = INCBIN_U32("graphics/rayquaza_scene/scene_1/kyogre.4bpp.lz");
const u32 gRaySceneKyogre2_Gfx[] = INCBIN_U32("graphics/rayquaza_scene/scene_1/kyogre_shoulder.4bpp.lz");
const u32 gRaySceneKyogre3_Gfx[] = INCBIN_U32("graphics/rayquaza_scene/scene_1/kyogre_fin.4bpp.lz");
const u32 gRaySceneGroudon_Pal[] = INCBIN_U32("graphics/rayquaza_scene/scene_1/groudon.gbapal.lz");
const u32 gRaySceneKyogre_Pal[] = INCBIN_U32("graphics/rayquaza_scene/scene_1/kyogre.gbapal.lz");
const u32 gRaySceneClouds_Gfx[] = INCBIN_U32("graphics/rayquaza_scene/scene_1/clouds.4bpp.lz");
const u32 gRaySceneClouds_Pal[] = INCBIN_U32("graphics/rayquaza_scene/scene_1/clouds.gbapal.lz"); // pal 1 clouds, pal 2 rain
const u32 gRaySceneClouds1_Tilemap[] = INCBIN_U32("graphics/rayquaza_scene/scene_1/clouds1.bin.lz");
const u32 gRaySceneClouds2_Tilemap[] = INCBIN_U32("graphics/rayquaza_scene/scene_1/clouds2.bin.lz");
const u32 gRaySceneClouds3_Tilemap[] = INCBIN_U32("graphics/rayquaza_scene/scene_1/clouds3.bin.lz");
const u32 gRaySceneDuoFight_Groudon_Gfx[] = INCBIN_U32("graphics/rayquaza_scene/scene_1/groudon.4bpp.lz");
const u32 gRaySceneDuoFight_GroudonShoulder_Gfx[] = INCBIN_U32("graphics/rayquaza_scene/scene_1/groudon_shoulder.4bpp.lz");
const u32 gRaySceneDuoFight_GroudonClaw_Gfx[] = INCBIN_U32("graphics/rayquaza_scene/scene_1/groudon_claw.4bpp.lz");
const u32 gRaySceneDuoFight_Kyogre_Gfx[] = INCBIN_U32("graphics/rayquaza_scene/scene_1/kyogre.4bpp.lz");
const u32 gRaySceneDuoFight_KyogreShoulder_Gfx[] = INCBIN_U32("graphics/rayquaza_scene/scene_1/kyogre_shoulder.4bpp.lz");
const u32 gRaySceneDuoFight_KyogreFin_Gfx[] = INCBIN_U32("graphics/rayquaza_scene/scene_1/kyogre_fin.4bpp.lz");
const u32 gRaySceneDuoFight_Groudon_Pal[] = INCBIN_U32("graphics/rayquaza_scene/scene_1/groudon.gbapal.lz");
const u32 gRaySceneDuoFight_Kyogre_Pal[] = INCBIN_U32("graphics/rayquaza_scene/scene_1/kyogre.gbapal.lz");
const u32 gRaySceneDuoFight_Clouds_Gfx[] = INCBIN_U32("graphics/rayquaza_scene/scene_1/clouds.4bpp.lz");
const u32 gRaySceneDuoFight_Clouds_Pal[] = INCBIN_U32("graphics/rayquaza_scene/scene_1/clouds.gbapal.lz"); // pal 1 clouds, pal 2 rain
const u32 gRaySceneDuoFight_Clouds1_Tilemap[] = INCBIN_U32("graphics/rayquaza_scene/scene_1/clouds1.bin.lz");
const u32 gRaySceneDuoFight_Clouds2_Tilemap[] = INCBIN_U32("graphics/rayquaza_scene/scene_1/clouds2.bin.lz");
const u32 gRaySceneDuoFight_Clouds3_Tilemap[] = INCBIN_U32("graphics/rayquaza_scene/scene_1/clouds3.bin.lz");
// Scene 2 (RAY_ANIM_TAKES_FLIGHT)
const u32 gRaySceneSmoke_Gfx[] = INCBIN_U32("graphics/rayquaza_scene/scene_2/smoke.4bpp.lz");
const u32 gRaySceneSmoke_Pal[] = INCBIN_U32("graphics/rayquaza_scene/scene_2/smoke.gbapal.lz");
const u32 gRaySceneRayquaza_Gfx[] = INCBIN_U32("graphics/rayquaza_scene/scene_2/rayquaza.8bpp.lz");
const u32 gRaySceneRayquaza_Pal[] = INCBIN_U32("graphics/rayquaza_scene/scene_2/rayquaza.gbapal.lz");
const u32 gRaySceneRayquaza_Tilemap[] = INCBIN_U32("graphics/rayquaza_scene/scene_2/rayquaza.bin.lz");
const u32 gRaySceneOvercast_Gfx[] = INCBIN_U32("graphics/rayquaza_scene/scene_2/bg.4bpp.lz"); // uses pal 2 of gRaySceneRayquaza_Pal
const u32 gRaySceneOvercast_Tilemap[] = INCBIN_U32("graphics/rayquaza_scene/scene_2/bg.bin.lz");
const u32 gRaySceneTakesFlight_Smoke_Gfx[] = INCBIN_U32("graphics/rayquaza_scene/scene_2/smoke.4bpp.lz");
const u32 gRaySceneTakesFlight_Smoke_Pal[] = INCBIN_U32("graphics/rayquaza_scene/scene_2/smoke.gbapal.lz");
const u32 gRaySceneTakesFlight_Rayquaza_Gfx[] = INCBIN_U32("graphics/rayquaza_scene/scene_2/rayquaza.8bpp.lz");
const u32 gRaySceneTakesFlight_Rayquaza_Pal[] = INCBIN_U32("graphics/rayquaza_scene/scene_2/rayquaza.gbapal.lz");
const u32 gRaySceneTakesFlight_Rayquaza_Tilemap[] = INCBIN_U32("graphics/rayquaza_scene/scene_2/rayquaza.bin.lz");
const u32 gRaySceneTakesFlight_Bg_Gfx[] = INCBIN_U32("graphics/rayquaza_scene/scene_2/bg.4bpp.lz"); // uses pal 2 of gRaySceneTakesFlight_Rayquaza_Pal
const u32 gRaySceneTakesFlight_Bg_Tilemap[] = INCBIN_U32("graphics/rayquaza_scene/scene_2/bg.bin.lz");
// Scene 3 (RAY_ANIM_DESCENDS)
const u32 gRaySceneRayquazaFly1_Gfx[] = INCBIN_U32("graphics/rayquaza_scene/scene_3/rayquaza.4bpp.lz");
const u32 gRaySceneDescends_Rayquaza_Gfx[] = INCBIN_U32("graphics/rayquaza_scene/scene_3/rayquaza.4bpp.lz");
// for some reason there are an extra 0xC bytes at the end of the original 4bpp, so in order to produce the correct lz,
// we have to cat the bytes at the end with a make rule. not sure why those bytes are there, it may have been a bug in Game Freak's software.
const u32 gRaySceneRayquazaTail_Gfx[] = INCBIN_U32("graphics/rayquaza_scene/scene_3/rayquaza_tail_fix.4bpp.lz");
const u32 gRaySceneOvercast2_Gfx[] = INCBIN_U32("graphics/rayquaza_scene/scene_3/bg.4bpp.lz");
const u32 gRaySceneRayquazaLight_Gfx[] = INCBIN_U32("graphics/rayquaza_scene/scene_3/light.4bpp.lz"); // uses pal 2 of gRaySceneOvercast2_Pal
const u32 gRaySceneOvercast2_Pal[] = INCBIN_U32("graphics/rayquaza_scene/scene_3/bg.gbapal.lz");
const u32 gRaySceneOvercast2_Tilemap[] = INCBIN_U32("graphics/rayquaza_scene/scene_3/bg.bin.lz");
const u32 gRaySceneRayquazaLight_Tilemap[] = INCBIN_U32("graphics/rayquaza_scene/scene_3/light.bin.lz");
const u32 gRaySceneDescends_RayquazaTail_Gfx[] = INCBIN_U32("graphics/rayquaza_scene/scene_3/rayquaza_tail_fix.4bpp.lz");
const u32 gRaySceneDescends_Bg_Gfx[] = INCBIN_U32("graphics/rayquaza_scene/scene_3/bg.4bpp.lz");
const u32 gRaySceneDescends_Light_Gfx[] = INCBIN_U32("graphics/rayquaza_scene/scene_3/light.4bpp.lz"); // uses pal 2 of gRaySceneDescends_Bg_Pal
const u32 gRaySceneDescends_Bg_Pal[] = INCBIN_U32("graphics/rayquaza_scene/scene_3/bg.gbapal.lz");
const u32 gRaySceneDescends_Bg_Tilemap[] = INCBIN_U32("graphics/rayquaza_scene/scene_3/bg.bin.lz");
const u32 gRaySceneDescends_Light_Tilemap[] = INCBIN_U32("graphics/rayquaza_scene/scene_3/light.bin.lz");
// Scene 4 (RAY_ANIM_CHARGES)
const u32 gRaySceneChaseBg_Gfx[] = INCBIN_U32("graphics/rayquaza_scene/scene_4/bg.4bpp.lz");
const u32 gRaySceneChaseBg_Tilemap[] = INCBIN_U32("graphics/rayquaza_scene/scene_4/bg.bin.lz");
const u32 gRaySceneChaseStreaks_Gfx[] = INCBIN_U32("graphics/rayquaza_scene/scene_4/streaks.4bpp.lz");
const u32 gRaySceneChaseStreaks_Tilemap[] = INCBIN_U32("graphics/rayquaza_scene/scene_4/streaks.bin.lz");
const u32 gRaySceneRayquazaChase_Gfx[] = INCBIN_U32("graphics/rayquaza_scene/scene_4/rayquaza.4bpp.lz");
const u32 gRayChaseRayquazaChase_Tilemap[] = INCBIN_U32("graphics/rayquaza_scene/scene_4/rayquaza.bin.lz");
const u32 gRayChaseRayquazaChase2_Tilemap[] = INCBIN_U32("graphics/rayquaza_scene/scene_4/rayquaza2.bin.lz");
const u32 gRaySceneChase_Pal[] = INCBIN_U32("graphics/rayquaza_scene/scene_4/bg.gbapal.lz");
const u32 gRaySceneCharges_Bg_Gfx[] = INCBIN_U32("graphics/rayquaza_scene/scene_4/bg.4bpp.lz");
const u32 gRaySceneCharges_Bg_Tilemap[] = INCBIN_U32("graphics/rayquaza_scene/scene_4/bg.bin.lz");
const u32 gRaySceneCharges_Streaks_Gfx[] = INCBIN_U32("graphics/rayquaza_scene/scene_4/streaks.4bpp.lz");
const u32 gRaySceneCharges_Streaks_Tilemap[] = INCBIN_U32("graphics/rayquaza_scene/scene_4/streaks.bin.lz");
const u32 gRaySceneCharges_Rayquaza_Gfx[] = INCBIN_U32("graphics/rayquaza_scene/scene_4/rayquaza.4bpp.lz");
const u32 gRaySceneCharges_Rayquaza_Tilemap[] = INCBIN_U32("graphics/rayquaza_scene/scene_4/rayquaza.bin.lz");
const u32 gRaySceneCharges_Rayquaza2_Tilemap[] = INCBIN_U32("graphics/rayquaza_scene/scene_4/rayquaza2.bin.lz"); // TODO: Clarify
const u32 gRaySceneCharges_Bg_Pal[] = INCBIN_U32("graphics/rayquaza_scene/scene_4/bg.gbapal.lz");
// Scene 5 (RAY_ANIM_CHASES_AWAY)
const u32 gRaySceneGroudonLeft_Gfx[] = INCBIN_U32("graphics/rayquaza_scene/scene_5/groudon.4bpp.lz");
const u32 gRaySceneGroudonTail_Gfx[] = INCBIN_U32("graphics/rayquaza_scene/scene_5/groudon_tail.4bpp.lz");
const u32 gRaySceneKyogreRight_Gfx[] = INCBIN_U32("graphics/rayquaza_scene/scene_5/kyogre.4bpp.lz");
const u32 gRaySceneRayquazaHover_Gfx[] = INCBIN_U32("graphics/rayquaza_scene/scene_5/rayquaza.4bpp.lz");
const u32 gRaySceneRayquazaFlyIn_Gfx[] = INCBIN_U32("graphics/rayquaza_scene/scene_5/rayquaza_tail.4bpp.lz");
const u32 gRaySceneSplash_Gfx[] = INCBIN_U32("graphics/rayquaza_scene/scene_5/kyogre_splash.4bpp.lz");
const u32 gRaySceneGroudonLeft_Pal[] = INCBIN_U32("graphics/rayquaza_scene/scene_5/groudon.gbapal.lz");
const u32 gRaySceneKyogreRight_Pal[] = INCBIN_U32("graphics/rayquaza_scene/scene_5/kyogre.gbapal.lz");
const u32 gRaySceneRayquazaHover_Pal[] = INCBIN_U32("graphics/rayquaza_scene/scene_5/rayquaza.gbapal.lz");
const u32 gRaySceneSplash_Pal[] = INCBIN_U32("graphics/rayquaza_scene/scene_5/kyogre_splash.gbapal.lz");
const u32 gRaySceneHushBg_Gfx[] = INCBIN_U32("graphics/rayquaza_scene/scene_5/bg.4bpp.lz");
const u32 gRaySceneHushRing_Gfx[] = INCBIN_U32("graphics/rayquaza_scene/scene_5/ring.8bpp.lz");
const u32 gRaySceneHushBg_Tilemap[] = INCBIN_U32("graphics/rayquaza_scene/scene_5/bg.bin.lz");
const u32 gRaySceneHushRing_Tilemap[] = INCBIN_U32("graphics/rayquaza_scene/scene_5/ring.bin.lz");
const u32 gRaySceneHushRing_Map[] = INCBIN_U32("graphics/rayquaza_scene/scene_5/ring_map.bin.lz");
const u32 gRaySceneHushBg_Pal[] = INCBIN_U32("graphics/rayquaza_scene/scene_5/bg.gbapal.lz");
const u32 gRaySceneChasesAway_Groudon_Gfx[] = INCBIN_U32("graphics/rayquaza_scene/scene_5/groudon.4bpp.lz");
const u32 gRaySceneChasesAway_GroudonTail_Gfx[] = INCBIN_U32("graphics/rayquaza_scene/scene_5/groudon_tail.4bpp.lz");
const u32 gRaySceneChasesAway_Kyogre_Gfx[] = INCBIN_U32("graphics/rayquaza_scene/scene_5/kyogre.4bpp.lz");
const u32 gRaySceneChasesAway_Rayquaza_Gfx[] = INCBIN_U32("graphics/rayquaza_scene/scene_5/rayquaza.4bpp.lz");
const u32 gRaySceneChasesAway_RayquazaTail_Gfx[] = INCBIN_U32("graphics/rayquaza_scene/scene_5/rayquaza_tail.4bpp.lz");
const u32 gRaySceneChasesAway_KyogreSplash_Gfx[] = INCBIN_U32("graphics/rayquaza_scene/scene_5/kyogre_splash.4bpp.lz");
const u32 gRaySceneChasesAway_Groudon_Pal[] = INCBIN_U32("graphics/rayquaza_scene/scene_5/groudon.gbapal.lz");
const u32 gRaySceneChasesAway_Kyogre_Pal[] = INCBIN_U32("graphics/rayquaza_scene/scene_5/kyogre.gbapal.lz");
const u32 gRaySceneChasesAway_Rayquaza_Pal[] = INCBIN_U32("graphics/rayquaza_scene/scene_5/rayquaza.gbapal.lz");
const u32 gRaySceneChasesAway_KyogreSplash_Pal[] = INCBIN_U32("graphics/rayquaza_scene/scene_5/kyogre_splash.gbapal.lz");
const u32 gRaySceneChasesAway_Bg_Gfx[] = INCBIN_U32("graphics/rayquaza_scene/scene_5/bg.4bpp.lz");
const u32 gRaySceneChasesAway_Ring_Gfx[] = INCBIN_U32("graphics/rayquaza_scene/scene_5/ring.8bpp.lz");
const u32 gRaySceneChasesAway_Bg_Tilemap[] = INCBIN_U32("graphics/rayquaza_scene/scene_5/bg.bin.lz");
const u32 gRaySceneChasesAway_Ring_Tilemap[] = INCBIN_U32("graphics/rayquaza_scene/scene_5/ring.bin.lz");
const u32 gRaySceneChasesAway_Ring_Map[] = INCBIN_U32("graphics/rayquaza_scene/scene_5/ring_map.bin.lz"); // TODO: Clarify
const u32 gRaySceneChasesAway_Bg_Pal[] = INCBIN_U32("graphics/rayquaza_scene/scene_5/bg.gbapal.lz");

View File

@ -940,46 +940,62 @@ void TintPalette_CustomTone(u16 *palette, u16 count, u16 rTone, u16 gTone, u16 b
}
}
void sub_80A2C44(u32 a1, s8 a2, u8 a3, u8 a4, u16 a5, u8 a6, u8 a7)
#define tCoeff data[0]
#define tCoeffTarget data[1]
#define tCoeffDelta data[2]
#define tDelay data[3]
#define tDelayTimer data[4]
#define tPalettes 5 // data[5] and data[6], set/get via Set/GetWordTaskArg
#define tColor data[7]
#define tId data[8]
// Blend the selected palettes in a series of steps toward or away from the color.
// Only used by the Groudon/Kyogre fight scene to flash the screen for lightning
// One call is used to fade the bg from white, while another fades the duo from black
void BlendPalettesGradually(u32 selectedPalettes, s8 delay, u8 coeff, u8 coeffTarget, u16 color, u8 priority, u8 id)
{
u8 taskId;
taskId = CreateTask((void *)sub_80A2D54, a6);
gTasks[taskId].data[0] = a3;
gTasks[taskId].data[1] = a4;
taskId = CreateTask((void *)sub_80A2D54, priority);
gTasks[taskId].tCoeff = coeff;
gTasks[taskId].tCoeffTarget = coeffTarget;
if (a2 >= 0)
if (delay >= 0)
{
gTasks[taskId].data[3] = a2;
gTasks[taskId].data[2] = 1;
gTasks[taskId].tDelay = delay;
gTasks[taskId].tCoeffDelta = 1;
}
else
{
gTasks[taskId].data[3] = 0;
gTasks[taskId].data[2] = -a2 + 1;
gTasks[taskId].tDelay = 0;
gTasks[taskId].tCoeffDelta = -delay + 1;
}
if (a4 < a3)
gTasks[taskId].data[2] *= -1;
if (coeffTarget < coeff)
gTasks[taskId].tCoeffDelta *= -1;
SetWordTaskArg(taskId, 5, a1);
gTasks[taskId].data[7] = a5;
gTasks[taskId].data[8] = a7;
SetWordTaskArg(taskId, tPalettes, selectedPalettes);
gTasks[taskId].tColor = color;
gTasks[taskId].tId = id;
gTasks[taskId].func(taskId);
}
bool32 sub_80A2CF8(u8 var)
// Unused
static bool32 sub_80A2CF8(u8 id)
{
int i;
for (i = 0; i < NUM_TASKS; i++) // check all the tasks.
if ((gTasks[i].isActive == TRUE) && (gTasks[i].func == sub_80A2D54) && (gTasks[i].data[8] == var))
for (i = 0; i < NUM_TASKS; i++)
if ((gTasks[i].isActive == TRUE)
&& (gTasks[i].func == sub_80A2D54)
&& (gTasks[i].tId == id))
return TRUE;
return FALSE;
}
void sub_80A2D34(void)
// Unused
static void sub_80A2D34(void)
{
u8 taskId;
@ -992,39 +1008,37 @@ void sub_80A2D34(void)
}
}
void sub_80A2D54(u8 taskId)
static void sub_80A2D54(u8 taskId)
{
u32 wordVar;
u32 palettes;
s16 *data;
s16 temp;
s16 target;
data = gTasks[taskId].data;
wordVar = GetWordTaskArg(taskId, 5);
palettes = GetWordTaskArg(taskId, tPalettes);
if (++data[4] > data[3])
if (++tDelayTimer > tDelay)
{
data[4] = 0;
BlendPalettes(wordVar, data[0], data[7]);
temp = data[1];
if (data[0] == temp)
tDelayTimer = 0;
BlendPalettes(palettes, tCoeff, tColor);
target = tCoeffTarget;
if (tCoeff == target)
{
DestroyTask(taskId);
}
else
{
data[0] += data[2];
if (data[2] >= 0)
tCoeff += tCoeffDelta;
if (tCoeffDelta >= 0)
{
if (data[0] < temp)
{
if (tCoeff < target)
return;
}
}
else if (data[0] > temp)
else if (tCoeff > target)
{
return;
}
data[0] = temp;
tCoeff = target;
}
}
}

File diff suppressed because it is too large Load Diff

View File

@ -200,7 +200,7 @@ u8 GetTaskCount(void)
void SetWordTaskArg(u8 taskId, u8 dataElem, u32 value)
{
if (dataElem <= 14)
if (dataElem < NUM_TASK_DATA - 1)
{
gTasks[taskId].data[dataElem] = value;
gTasks[taskId].data[dataElem + 1] = value >> 16;
@ -209,7 +209,7 @@ void SetWordTaskArg(u8 taskId, u8 dataElem, u32 value)
u32 GetWordTaskArg(u8 taskId, u8 dataElem)
{
if (dataElem <= 14)
if (dataElem < NUM_TASK_DATA - 1)
return (u16)gTasks[taskId].data[dataElem] | (gTasks[taskId].data[dataElem + 1] << 16);
else
return 0;