Continue documenting generic arguments

This commit is contained in:
GriffinR
2022-06-01 12:41:57 -04:00
parent a8437493c1
commit 34438e6bc4
71 changed files with 1246 additions and 1076 deletions
+34 -23
View File
@@ -14,11 +14,9 @@
#include "trig.h"
#include "gpu_regs.h"
// EWRAM
EWRAM_DATA static u8 gCurrentAbnormalWeather = 0;
EWRAM_DATA static u16 gUnusedWeatherRelated = 0;
// CONST
const u16 gCloudsWeatherPalette[] = INCBIN_U16("graphics/weather/cloud.gbapal");
const u16 gSandstormWeatherPalette[] = INCBIN_U16("graphics/weather/sandstorm.gbapal");
const u8 gWeatherFogDiagonalTiles[] = INCBIN_U8("graphics/weather/fog_diagonal.4bpp");
@@ -2427,34 +2425,39 @@ static void UpdateBubbleSprite(struct Sprite *sprite)
//------------------------------------------------------------------------------
// Unused function.
static void UnusedSetCurrentAbnormalWeather(u32 a0, u32 a1)
static void UnusedSetCurrentAbnormalWeather(u32 weather, u32 unknown)
{
gCurrentAbnormalWeather = a0;
gUnusedWeatherRelated = a1;
gCurrentAbnormalWeather = weather;
gUnusedWeatherRelated = unknown;
}
#define tState data[0]
#define tWeatherA data[1]
#define tWeatherB data[2]
#define tDelay data[15]
static void Task_DoAbnormalWeather(u8 taskId)
{
s16 *data = gTasks[taskId].data;
switch (data[0])
switch (tState)
{
case 0:
if (data[15]-- <= 0)
if (tDelay-- <= 0)
{
SetNextWeather(data[1]);
gCurrentAbnormalWeather = data[1];
data[15] = 600;
data[0]++;
SetNextWeather(tWeatherA);
gCurrentAbnormalWeather = tWeatherA;
tDelay = 600;
tState++;
}
break;
case 1:
if (data[15]-- <= 0)
if (tDelay-- <= 0)
{
SetNextWeather(data[2]);
gCurrentAbnormalWeather = data[2];
data[15] = 600;
data[0] = 0;
SetNextWeather(tWeatherB);
gCurrentAbnormalWeather = tWeatherB;
tDelay = 600;
tState = 0;
}
break;
}
@@ -2465,25 +2468,33 @@ static void CreateAbnormalWeatherTask(void)
u8 taskId = CreateTask(Task_DoAbnormalWeather, 0);
s16 *data = gTasks[taskId].data;
data[15] = 600;
tDelay = 600;
if (gCurrentAbnormalWeather == WEATHER_DOWNPOUR)
{
data[1] = WEATHER_DROUGHT;
data[2] = WEATHER_DOWNPOUR;
// Currently Downpour, next will be Drought
tWeatherA = WEATHER_DROUGHT;
tWeatherB = WEATHER_DOWNPOUR;
}
else if (gCurrentAbnormalWeather == WEATHER_DROUGHT)
{
data[1] = WEATHER_DOWNPOUR;
data[2] = WEATHER_DROUGHT;
// Currently Drought, next will be Downpour
tWeatherA = WEATHER_DOWNPOUR;
tWeatherB = WEATHER_DROUGHT;
}
else
{
// Default to starting with Downpour
gCurrentAbnormalWeather = WEATHER_DOWNPOUR;
data[1] = WEATHER_DROUGHT;
data[2] = WEATHER_DOWNPOUR;
tWeatherA = WEATHER_DROUGHT;
tWeatherB = WEATHER_DOWNPOUR;
}
}
#undef tState
#undef tWeatherA
#undef tWeatherB
#undef tDelay
static u8 TranslateWeatherNum(u8);
static void UpdateRainCounter(u8, u8);