Merge branch 'master' of https://github.com/pret/pokeemerald into field_map_obj_helpers
This commit is contained in:
@@ -1,12 +1,6 @@
|
||||
#ifndef GUARD_BLEND_PALETTE_H
|
||||
#define GUARD_BLEND_PALETTE_H
|
||||
|
||||
// Exported type declarations
|
||||
void BlendPalette(u16 palOffset, u16 numEntries, u8 coeff, u16 blendColor);
|
||||
|
||||
// Exported RAM declarations
|
||||
|
||||
// Exported ROM declarations
|
||||
|
||||
void BlendPalette(u16, u16, u8, u16);
|
||||
|
||||
#endif //GUARD_BLEND_PALETTE_H
|
||||
#endif // GUARD_BLEND_PALETTE_H
|
||||
|
||||
15
include/constants/rgb.h
Normal file
15
include/constants/rgb.h
Normal file
@@ -0,0 +1,15 @@
|
||||
#ifndef GUARD_RGB_H
|
||||
#define GUARD_RGB_H
|
||||
|
||||
#define RGB(r, g, b) ((r) | ((g) << 5) | ((b) << 10))
|
||||
|
||||
#define RGB_BLACK RGB(0, 0, 0)
|
||||
#define RGB_WHITE RGB(31, 31, 31)
|
||||
#define RGB_RED RGB(31, 0, 0)
|
||||
#define RGB_GREEN RGB(0, 31, 0)
|
||||
#define RGB_BLUE RGB(0, 0, 31)
|
||||
#define RGB_YELLOW RGB(31, 31, 0)
|
||||
#define RGB_MAGENTA RGB(31, 0, 31)
|
||||
#define RGB_CYAN RGB(0, 31, 31)
|
||||
|
||||
#endif // GUARD_RGB_H
|
||||
@@ -1,12 +1,175 @@
|
||||
#ifndef GUARD_WEATHER_H
|
||||
#define GUARD_WEATHER_H
|
||||
|
||||
void fade_screen(u8, s8);
|
||||
#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
|
||||
{
|
||||
union
|
||||
{
|
||||
struct
|
||||
{
|
||||
struct Sprite *rainSprites[24];
|
||||
struct Sprite *snowflakeSprites[101];
|
||||
struct Sprite *cloudSprites[3];
|
||||
} s1;
|
||||
struct
|
||||
{
|
||||
u8 filler0[0xA0];
|
||||
struct Sprite *fog1Sprites[20];
|
||||
struct Sprite *ashSprites[20];
|
||||
struct Sprite *fog2Sprites[20];
|
||||
struct Sprite *sandstormSprites1[20];
|
||||
struct Sprite *sandstormSprites2[5];
|
||||
} s2;
|
||||
} sprites;
|
||||
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;
|
||||
u16 finishStep;
|
||||
u8 currWeather;
|
||||
u8 nextWeather;
|
||||
u8 weatherGfxLoaded;
|
||||
bool8 weatherChangeComplete;
|
||||
u8 weatherPicSpritePalIndex;
|
||||
u8 altGammaSpritePalIndex;
|
||||
u16 unknown_6D6;
|
||||
u8 unknown_6D8;
|
||||
u8 unknown_6D9;
|
||||
u8 rainSpriteCount;
|
||||
u8 unknown_6DB;
|
||||
u8 unknown_6DC;
|
||||
u8 rainStrength;
|
||||
/*0x6DE*/ u8 cloudSpritesCreated;
|
||||
u8 filler_6DF[1];
|
||||
u16 unknown_6E0;
|
||||
u16 unknown_6E2;
|
||||
u8 snowflakeSpriteCount;
|
||||
u8 unknown_6E5;
|
||||
u16 unknown_6E6;
|
||||
u16 thunderCounter;
|
||||
u8 unknown_6EA;
|
||||
u8 unknown_6EB;
|
||||
u8 unknown_6EC;
|
||||
u8 unknown_6ED;
|
||||
u16 fog1ScrollPosX;
|
||||
u16 unknown_6F0;
|
||||
u16 unknown_6F2;
|
||||
u8 lightenedFogSpritePals[6];
|
||||
u8 lightenedFogSpritePalsCount;
|
||||
u8 fog1SpritesCreated;
|
||||
u16 unknown_6FC;
|
||||
u16 unknown_6FE;
|
||||
u8 ashSpritesCreated;
|
||||
u8 filler_701[3];
|
||||
u32 unknown_704;
|
||||
u32 unknown_708;
|
||||
u8 filler_70C[2];
|
||||
u16 unknown_70E;
|
||||
u16 unknown_710;
|
||||
u16 unknown_712;
|
||||
u16 unknown_714;
|
||||
u8 sandstormSprites1Created;
|
||||
u8 sandstormSprites2Created;
|
||||
u16 unknown_718;
|
||||
u16 unknown_71A;
|
||||
u16 unknown_71C;
|
||||
u16 unknown_71E;
|
||||
u16 unknown_720;
|
||||
u16 unknown_722;
|
||||
u8 fog2SpritesCreated;
|
||||
u8 filler_725[1];
|
||||
u16 unknown_726;
|
||||
u16 unknown_728;
|
||||
u16 unknown_72A;
|
||||
u16 unknown_72C;
|
||||
u8 unknown_72E;
|
||||
u8 filler_72F;
|
||||
u16 currBlendEVA;
|
||||
u16 currBlendEVB;
|
||||
u16 targetBlendEVA;
|
||||
u16 targetBlendEVB;
|
||||
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];
|
||||
s8 loadDroughtPalsIndex;
|
||||
u8 loadDroughtPalsOffset;
|
||||
};
|
||||
|
||||
void StartWeather(void);
|
||||
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 SetWeatherScreenFadeOut(void);
|
||||
|
||||
enum
|
||||
{
|
||||
FADE_FROM_BLACK,
|
||||
FADE_TO_BLACK,
|
||||
FADE_FROM_WHITE,
|
||||
FADE_TO_WHITE,
|
||||
};
|
||||
|
||||
void FadeScreen(u8, s8);
|
||||
// ...
|
||||
void UpdateSpritePaletteWithWeather(u8 tag);
|
||||
void ApplyWeatherGammaShiftToPal(u8);
|
||||
// ...
|
||||
void Weather_SetBlendCoeffs(u8, u8);
|
||||
// ...
|
||||
void PlayRainSoundEffect(void);
|
||||
// ...
|
||||
void SetSav1Weather(u32);
|
||||
u8 GetSav1Weather(void);
|
||||
void sub_80AEDBC(void);
|
||||
|
||||
void SetSav1WeatherFromCurrMapHeader(void);
|
||||
// ...
|
||||
void DoCurrentWeather(void);
|
||||
void sub_8080750();
|
||||
|
||||
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;
|
||||
|
||||
extern struct Weather *const gWeatherPtr;
|
||||
|
||||
#endif // GUARD_WEATHER_H
|
||||
|
||||
@@ -60,11 +60,6 @@
|
||||
|
||||
#define TOTAL_OBJ_TILE_COUNT 1024
|
||||
|
||||
#define RGB(r, g, b) ((r) | ((g) << 5) | ((b) << 10))
|
||||
|
||||
#define RGB_BLACK RGB(0, 0, 0)
|
||||
#define RGB_WHITE RGB(31, 31, 31)
|
||||
|
||||
#define WIN_RANGE(a, b) (((a) << 8) | (b))
|
||||
|
||||
#endif // GUARD_GBA_DEFINES
|
||||
|
||||
@@ -70,6 +70,8 @@ void warp1_set_2(s8 mapGroup, s8 mapNum, s8 warpNum);
|
||||
void c2_load_new_map(void);
|
||||
void copy_saved_warp2_bank_and_enter_x_to_warp1(u8 unused);
|
||||
void mapldr_default(void);
|
||||
u8 get_map_light_from_warp0(void);
|
||||
bool8 is_light_level_1_2_3_5_or_6(u8 a1);
|
||||
|
||||
void IncrementGameStat(u8);
|
||||
u32 GetGameStat(u8);
|
||||
|
||||
@@ -1,7 +1,10 @@
|
||||
#ifndef GUARD_POKEMON_ANIMATION_H
|
||||
#define GUARD_POKEMON_ANIMATION_H
|
||||
|
||||
void LaunchAnimationTaskForFrontSprite(struct Sprite* sprite, u8 frontAnimId);
|
||||
void LaunchAnimationTaskForBackSprite(struct Sprite* sprite, u8 backAnimId);
|
||||
u8 GetSpeciesBackAnimSet(u16 species);
|
||||
void LaunchAnimationTaskForFrontSprite(struct Sprite *sprite, u8 frontAnimId);
|
||||
void StartMonSummaryAnimation(struct Sprite *sprite, u8 frontAnimId);
|
||||
void LaunchAnimationTaskForBackSprite(struct Sprite *sprite, u8 backAnimSet);
|
||||
void SetSpriteCB_MonAnimDummy(struct Sprite *sprite);
|
||||
|
||||
#endif // GUARD_POKEMON_ANIMATION_H
|
||||
|
||||
47
include/scanline_effect.h
Normal file
47
include/scanline_effect.h
Normal file
@@ -0,0 +1,47 @@
|
||||
#ifndef GUARD_SCANLINE_EFFECT_H
|
||||
#define GUARD_SCANLINE_EFFECT_H
|
||||
|
||||
// DMA control value to ransfer a single 16-bit value at HBlank
|
||||
#define SCANLINE_EFFECT_DMACNT_16BIT (((DMA_ENABLE | DMA_START_HBLANK | DMA_REPEAT | DMA_SRC_INC | DMA_DEST_INC | DMA_16BIT | DMA_DEST_RELOAD) << 16) | 1)
|
||||
|
||||
#define SCANLINE_EFFECT_REG_BG0HOFS (REG_ADDR_BG0HOFS - REG_ADDR_BG0HOFS)
|
||||
#define SCANLINE_EFFECT_REG_BG0VOFS (REG_ADDR_BG0VOFS - REG_ADDR_BG0HOFS)
|
||||
#define SCANLINE_EFFECT_REG_BG1HOFS (REG_ADDR_BG1HOFS - REG_ADDR_BG0HOFS)
|
||||
#define SCANLINE_EFFECT_REG_BG1VOFS (REG_ADDR_BG1VOFS - REG_ADDR_BG0HOFS)
|
||||
#define SCANLINE_EFFECT_REG_BG2HOFS (REG_ADDR_BG2HOFS - REG_ADDR_BG0HOFS)
|
||||
#define SCANLINE_EFFECT_REG_BG2VOFS (REG_ADDR_BG2VOFS - REG_ADDR_BG0HOFS)
|
||||
#define SCANLINE_EFFECT_REG_BG3HOFS (REG_ADDR_BG3HOFS - REG_ADDR_BG0HOFS)
|
||||
#define SCANLINE_EFFECT_REG_BG3VOFS (REG_ADDR_BG3VOFS - REG_ADDR_BG0HOFS)
|
||||
|
||||
struct ScanlineEffectParams
|
||||
{
|
||||
volatile void *dmaDest;
|
||||
u32 dmaControl;
|
||||
u8 initState;
|
||||
u8 unused9;
|
||||
};
|
||||
|
||||
struct ScanlineEffect
|
||||
{
|
||||
void *dmaSrcBuffers[2];
|
||||
volatile void *dmaDest;
|
||||
u32 dmaControl;
|
||||
void (*setFirstScanlineReg)(void);
|
||||
u8 srcBuffer;
|
||||
u8 state;
|
||||
u8 unused16;
|
||||
u8 unused17;
|
||||
u8 waveTaskId;
|
||||
};
|
||||
|
||||
extern struct ScanlineEffect gScanlineEffect;
|
||||
|
||||
extern u16 gScanlineEffectRegBuffers[][0x3C0];
|
||||
|
||||
void ScanlineEffect_Stop(void);
|
||||
void ScanlineEffect_Clear(void);
|
||||
void ScanlineEffect_SetParams(struct ScanlineEffectParams);
|
||||
void ScanlineEffect_InitHBlankDmaTransfer(void);
|
||||
u8 ScanlineEffect_InitWave(u8 startLine, u8 endLine, u8 frequency, u8 amplitude, u8 delayInterval, u8 regOffset, bool8 a7);
|
||||
|
||||
#endif // GUARD_SCANLINE_EFFECT_H
|
||||
@@ -233,6 +233,7 @@ extern s16 gSpriteCoordOffsetX;
|
||||
extern s16 gSpriteCoordOffsetY;
|
||||
|
||||
extern struct Sprite gSprites[];
|
||||
extern struct OamMatrix gOamMatrices[];
|
||||
|
||||
void ResetSpriteData(void);
|
||||
void AnimateSprites(void);
|
||||
|
||||
8
include/time_events.h
Normal file
8
include/time_events.h
Normal file
@@ -0,0 +1,8 @@
|
||||
#ifndef GUARD_TIME_EVENTS_H
|
||||
#define GUARD_TIME_EVENTS_H
|
||||
|
||||
void UpdateMirageRnd(u16);
|
||||
u8 IsMirageIslandPresent(void);
|
||||
void UpdateBirchState(u16);
|
||||
|
||||
#endif // GUARD_TIME_EVENTS_H
|
||||
@@ -1,22 +0,0 @@
|
||||
#ifndef GUARD_unknown_task_H
|
||||
#define GUARD_unknown_task_H
|
||||
|
||||
// Exported type declarations
|
||||
struct UnknownTaskStruct
|
||||
{
|
||||
volatile void *dest;
|
||||
u32 control;
|
||||
u8 unk8;
|
||||
u8 unk9;
|
||||
};
|
||||
|
||||
extern struct UnknownTaskStruct gUnknown_0831AC70;
|
||||
|
||||
// Exported RAM declarations
|
||||
|
||||
// Exported ROM declarations
|
||||
void ScanlineEffect_Stop(void);
|
||||
void sub_80BA038(struct UnknownTaskStruct arg0);
|
||||
void sub_80BA0A8(void);
|
||||
|
||||
#endif // GUARD_unknown_task_H
|
||||
Reference in New Issue
Block a user