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.h99
1 files changed, 52 insertions, 47 deletions
diff --git a/include/field_weather.h b/include/field_weather.h
index 267650a2a..0bdebf747 100644
--- a/include/field_weather.h
+++ b/include/field_weather.h
@@ -1,7 +1,15 @@
#ifndef GUARD_WEATHER_H
#define GUARD_WEATHER_H
-struct Sprite;
+#include "sprite.h"
+
+// Controls how the weather should be changing the screen palettes.
+enum {
+ WEATHER_PAL_STATE_CHANGING_WEATHER,
+ WEATHER_PAL_STATE_SCREEN_FADING_IN,
+ WEATHER_PAL_STATE_SCREEN_FADING_OUT,
+ WEATHER_PAL_STATE_IDLE,
+};
struct Weather
{
@@ -23,21 +31,17 @@ struct Weather
struct Sprite *sandstormSprites2[5];
} s2;
} sprites;
- u8 unknown_200[2][32];
- u8 filler_240[0x460-0x240];
- u8 unk460[2][32];
- u8 filler4A0[0x6B6-0x4A0];
- s8 unknown_6B6;
- u8 filler_6B7[0xC0-0xB7];
- s8 unknown_6C0;
- s8 unknown_6C1;
- u8 unknown_6C2;
- u8 unknown_6C3;
- u16 unknown_6C4;
- u8 unknown_6C6;
- u8 unknown_6C7;
- u8 unknown_6C8;
- u8 unknown_6C9;
+ u8 gammaShifts[19][32];
+ u8 altGammaShifts[19][32];
+ s8 gammaIndex;
+ s8 gammaTargetIndex;
+ u8 gammaStepDelay;
+ u8 gammaStepFrameCounter;
+ u16 fadeDestColor;
+ u8 palProcessingState;
+ u8 fadeScreenCounter;
+ bool8 readyForInit;
+ u8 taskId;
u8 unknown_6CA;
u8 unknown_6CB;
u16 initStep;
@@ -45,9 +49,9 @@ struct Weather
u8 currWeather;
u8 nextWeather;
u8 weatherGfxLoaded;
- u8 unknown_6D3;
- u8 unknown_6D4;
- u8 unknown_6D5;
+ bool8 weatherChangeComplete;
+ u8 weatherPicSpritePalIndex;
+ u8 altGammaSpritePalIndex;
u16 unknown_6D6;
u8 unknown_6D8;
u8 unknown_6D9;
@@ -70,8 +74,8 @@ struct Weather
u16 fog1ScrollPosX;
u16 unknown_6F0;
u16 unknown_6F2;
- u8 unknown_6F4[6];
- u8 unknown_6FA;
+ u8 lightenedFogSpritePals[6];
+ u8 lightenedFogSpritePalsCount;
u8 fog1SpritesCreated;
u16 unknown_6FC;
u16 unknown_6FE;
@@ -104,8 +108,8 @@ struct Weather
u16 currBlendEVB;
u16 targetBlendEVA;
u16 targetBlendEVB;
- u8 unknown_738;
- u8 unknown_739;
+ u8 blendUpdateCounter;
+ u8 blendFrameCounter;
u8 blendDelay;
u8 filler_73B[0x3C-0x3B];
s16 unknown_73C;
@@ -113,42 +117,35 @@ struct Weather
s16 unknown_740;
s16 unknown_742;
u8 filler_744[0xD-4];
- s8 unknown_74D;
- u8 unknown_74E;
+ s8 loadDroughtPalsIndex;
+ u8 loadDroughtPalsOffset;
};
void StartWeather(void);
-void DoWeatherEffect(u8 effect);
+void ChangeWeather(u8 weather);
void sub_807C988(u8 effect);
void sub_807C9B4(u8 effect);
void Task_WeatherInit(u8);
void Task_WeatherMain(u8);
void sub_807CAE8(void);
void nullsub_38(void);
-void sub_807CB10(void);
-void sub_807CC24(void);
-void sub_807CCAC(void);
-u8 sub_807CDC4(void);
-u8 sub_807CE24(void);
-u8 sub_807CE7C(void);
-void nullsub_39(void);
+void SetWeatherScreenFadeOut(void);
-// ASM
-void sub_807CEBC(u8, u8, s8);
-//void sub_807D1BC(u8, u8, u8, u8, u16);
-void sub_807D1BC(u8 a, u8 a2, s8 c, u8 d, u16 e);
-void sub_807D304(s8 a, u8 arg2, u16 c);
-void sub_807D424(u8, u16);
-// ...
-void fade_screen(u8, u8);
+enum
+{
+ FADE_FROM_BLACK,
+ FADE_TO_BLACK,
+ FADE_FROM_WHITE,
+ FADE_TO_WHITE,
+};
+
+void FadeScreen(u8, u8);
// ...
-void sub_807D78C(u8 tag);
-void sub_807D874(u8);
+void UpdateSpritePaletteWithWeather(u8 tag);
+void ApplyWeatherGammaShiftToPal(u8);
// ...
void Weather_SetBlendCoeffs(u8, u8);
// ...
-void sub_807DE68(void);
-// ...
void PlayRainSoundEffect(void);
// ...
void SetSav1Weather(u32);
@@ -158,10 +155,18 @@ void SetSav1WeatherFromCurrMapHeader(void);
void DoCurrentWeather(void);
void sub_8080750();
-bool8 sub_807D770(void);
-bool8 sub_807DDFC(void);
+bool8 IsWeatherNotFadingIn(void);
+bool8 IsWeatherChangeComplete(void);
void SetWeather(u32);
void UpdateWeatherPerDay(u16);
+void PreservePaletteInWeather(u8 index);
+void ResetPreservedPalettesInWeather(void);
+extern void ResetDroughtWeatherPaletteLoading(void);
+void ResetDroughtWeatherPaletteLoading(void);
+bool8 LoadDroughtWeatherPalettes(void);
+u8 GetCurrentWeather(void);
+void LoadCustomWeatherSpritePalette(const u16 *palette);
+
extern struct Weather gWeather;