summaryrefslogtreecommitdiff
path: root/include/field_weather.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/field_weather.h')
-rw-r--r--include/field_weather.h83
1 files changed, 50 insertions, 33 deletions
diff --git a/include/field_weather.h b/include/field_weather.h
index 1af320151..9c6a4ab7a 100644
--- a/include/field_weather.h
+++ b/include/field_weather.h
@@ -4,6 +4,21 @@
#include "sprite.h"
#include "constants/field_weather.h"
+#define TAG_WEATHER_START 0x1200
+enum {
+ GFXTAG_CLOUD = TAG_WEATHER_START,
+ GFXTAG_FOG_H,
+ GFXTAG_ASH,
+ GFXTAG_FOG_D,
+ GFXTAG_SANDSTORM,
+ GFXTAG_BUBBLE,
+ GFXTAG_RAIN,
+};
+enum {
+ PALTAG_WEATHER = TAG_WEATHER_START,
+ PALTAG_WEATHER_2
+};
+
struct Weather
{
union
@@ -31,12 +46,12 @@ struct Weather
u8 gammaStepDelay;
u8 gammaStepFrameCounter;
u16 fadeDestColor;
- /*0x6C6*/ u8 palProcessingState;
- /*0x6C7*/ u8 fadeScreenCounter;
- /*0x6C8*/ bool8 readyForInit;
- /*0x6C9*/ u8 taskId;
- /*0x6CA*/ u8 unknown_6CA;
- u8 unknown_6CB;
+ u8 palProcessingState;
+ u8 fadeScreenCounter;
+ bool8 readyForInit;
+ u8 taskId;
+ u8 fadeInFirstFrame;
+ u8 fadeInTimer;
u16 initStep;
u16 finishStep;
u8 currWeather;
@@ -45,6 +60,7 @@ struct Weather
bool8 weatherChangeComplete;
u8 weatherPicSpritePalIndex;
u8 altGammaSpritePalIndex;
+ // Rain
u16 rainSpriteVisibleCounter;
u8 curRainSpriteIndex;
u8 targetRainSpriteCount;
@@ -52,37 +68,41 @@ struct Weather
u8 rainSpriteVisibleDelay;
u8 isDownpour;
u8 rainStrength;
- /*0x6DE*/ u8 cloudSpritesCreated;
- u8 filler_6DF[1];
+ u8 cloudSpritesCreated;
+ // Snow
u16 snowflakeVisibleCounter;
- u16 unknown_6E2;
+ u16 snowflakeTimer;
u8 snowflakeSpriteCount;
u8 targetSnowflakeSpriteCount;
- u16 unknown_6E6;
+ // Thunderstorm
+ u16 thunderDelay;
u16 thunderCounter;
- u8 unknown_6EA;
- u8 unknown_6EB;
- u8 unknown_6EC;
- u8 thunderTriggered;
+ bool8 thunderAllowEnd;
+ bool8 thunderSkipShort;
+ u8 thunderShortRetries;
+ bool8 thunderTriggered;
+ // Horizontal fog
u16 fogHScrollPosX;
u16 fogHScrollCounter;
u16 fogHScrollOffset;
u8 lightenedFogSpritePals[6];
u8 lightenedFogSpritePalsCount;
u8 fogHSpritesCreated;
+ // Ash
u16 ashBaseSpritesX;
- u16 unknown_6FE;
+ u16 ashUnused;
u8 ashSpritesCreated;
- u8 filler_701[3];
+ // Sandstorm
u32 sandstormXOffset;
u32 sandstormYOffset;
- u8 filler_70C[2];
+ u16 sandstormUnused;
u16 sandstormBaseSpritesX;
u16 sandstormPosY;
u16 sandstormWaveIndex;
u16 sandstormWaveCounter;
u8 sandstormSpritesCreated;
u8 sandstormSwirlSpritesCreated;
+ // Diagonal fog
u16 fogDBaseSpritesX;
u16 fogDPosY;
u16 fogDScrollXCounter;
@@ -90,13 +110,13 @@ struct Weather
u16 fogDXOffset;
u16 fogDYOffset;
u8 fogDSpritesCreated;
- u8 filler_725[1];
+ // Bubbles
u16 bubblesDelayCounter;
u16 bubblesDelayIndex;
u16 bubblesCoordsIndex;
u16 bubblesSpriteCount;
u8 bubblesSpritesCreated;
- u8 filler_72F;
+
u16 currBlendEVA;
u16 currBlendEVB;
u16 targetBlendEVA;
@@ -104,12 +124,12 @@ struct Weather
u8 blendUpdateCounter;
u8 blendFrameCounter;
u8 blendDelay;
- u8 filler_73B[0x3C-0x3B];
- s16 unknown_73C;
- s16 unknown_73E;
- s16 unknown_740;
- s16 unknown_742;
- u8 filler_744[0xD-4];
+ // Drought
+ s16 droughtBrightnessStage;
+ s16 droughtLastBrightnessStage;
+ s16 droughtTimer;
+ s16 droughtState;
+ u8 droughtUnused[9];
s8 loadDroughtPalsIndex;
u8 loadDroughtPalsOffset;
};
@@ -117,7 +137,7 @@ struct Weather
// field_weather.c
extern struct Weather gWeather;
extern struct Weather *const gWeatherPtr;
-extern const u16 gUnknown_083970E8[];
+extern const u16 gFogPalette[];
// field_weather_effect.c
extern const u8 gWeatherFogHorizontalTiles[];
@@ -126,29 +146,26 @@ void StartWeather(void);
void SetNextWeather(u8 weather);
void SetCurrentAndNextWeather(u8 weather);
void SetCurrentAndNextWeatherNoDelay(u8 weather);
-void sub_80ABC48(s8 gammaIndex);
+void ApplyWeatherGammaShiftIfIdle(s8 gammaIndex);
void sub_80ABC7C(u8 gammaIndex, u8 gammaTargetIndex, u8 gammaStepDelay);
void FadeScreen(u8 mode, s8 delay);
bool8 IsWeatherNotFadingIn(void);
void UpdateSpritePaletteWithWeather(u8 spritePaletteIndex);
void ApplyWeatherGammaShiftToPal(u8 paletteIndex);
-u8 sub_80ABF20(void);
void LoadCustomWeatherSpritePalette(const u16 *palette);
void ResetDroughtWeatherPaletteLoading(void);
bool8 LoadDroughtWeatherPalettes(void);
-void sub_80ABFE0(s8 gammaIndex);
-void sub_80ABFF0(void);
-void sub_80AC01C(void);
+void DroughtStateInit(void);
+void DroughtStateRun(void);
void Weather_SetBlendCoeffs(u8 eva, u8 evb);
void Weather_SetTargetBlendCoeffs(u8 eva, u8 evb, int delay);
bool8 Weather_UpdateBlend(void);
-void sub_80AC274(u8 a);
u8 GetCurrentWeather(void);
void SetRainStrengthFromSoundEffect(u16 soundEffect);
void PlayRainStoppingSoundEffect(void);
u8 IsWeatherChangeComplete(void);
void SetWeatherScreenFadeOut(void);
-void sub_80AC3E4(void);
+void SetWeatherPalStateIdle(void);
void PreservePaletteInWeather(u8 preservedPalIndex);
void ResetPreservedPalettesInWeather(void);