mirror of
https://github.com/Ninjdai1/pokeemerald.git
synced 2024-11-16 19:47:35 +01:00
71 lines
2.2 KiB
C
71 lines
2.2 KiB
C
#ifndef GUARD_PALETTE_H
|
|
#define GUARD_PALETTE_H
|
|
|
|
#define gPaletteFade_selectedPalettes (gPaletteFade.multipurpose1) // normal and fast fade
|
|
#define gPaletteFade_blendCnt (gPaletteFade.multipurpose1) // hardware fade
|
|
#define gPaletteFade_delay (gPaletteFade.multipurpose2) // normal and hardware fade
|
|
#define gPaletteFade_submode (gPaletteFade.multipurpose2) // fast fade
|
|
|
|
#define PLTT_BUFFER_SIZE 0x200
|
|
#define PLTT_DECOMP_BUFFER_SIZE (PLTT_BUFFER_SIZE * 2)
|
|
|
|
enum
|
|
{
|
|
FAST_FADE_IN_FROM_WHITE,
|
|
FAST_FADE_OUT_TO_WHITE,
|
|
FAST_FADE_IN_FROM_BLACK,
|
|
FAST_FADE_OUT_TO_BLACK,
|
|
};
|
|
|
|
struct PaletteFadeControl
|
|
{
|
|
u32 multipurpose1;
|
|
u8 delayCounter:6;
|
|
u16 y:5; // blend coefficient
|
|
u16 targetY:5; // target blend coefficient
|
|
u16 blendColor:15;
|
|
bool16 active:1;
|
|
u16 multipurpose2:6;
|
|
bool16 yDec:1; // whether blend coefficient is decreasing
|
|
bool16 bufferTransferDisabled:1;
|
|
u16 mode:2;
|
|
bool16 shouldResetBlendRegisters:1;
|
|
bool16 hardwareFadeFinishing:1;
|
|
u16 softwareFadeFinishingCounter:5;
|
|
bool16 softwareFadeFinishing:1;
|
|
bool16 objPaletteToggle:1;
|
|
u8 deltaY:4; // rate of change of blend coefficient
|
|
};
|
|
|
|
extern struct PaletteFadeControl gPaletteFade;
|
|
extern u32 gPlttBufferTransferPending;
|
|
extern u8 gPaletteDecompressionBuffer[];
|
|
extern u16 gPlttBufferUnfaded[];
|
|
extern u16 gPlttBufferFaded[];
|
|
|
|
void LoadCompressedPalette(const void *, u16, u16);
|
|
void LoadPalette(const void *, u16, u16);
|
|
void FillPalette(u16, u16, u16);
|
|
void TransferPlttBuffer(void);
|
|
u8 UpdatePaletteFade(void);
|
|
void ResetPaletteFade(void);
|
|
void ReadPlttIntoBuffers(void);
|
|
bool8 BeginNormalPaletteFade(u32, s8, u8, u8, u16);
|
|
bool8 unref_sub_8073D3C(u32, u8, u8, u8, u16);
|
|
void unref_sub_8073D84(u8, u32 *);
|
|
void ResetPaletteStructByUid(u16);
|
|
void ResetPaletteStruct(u8);
|
|
void ResetPaletteFadeControl();
|
|
void unref_sub_8074168(u16);
|
|
void unref_sub_8074194(u16);
|
|
void InvertPlttBuffer(u32);
|
|
void TintPlttBuffer(u32, s8, s8, s8);
|
|
void UnfadePlttBuffer(u32);
|
|
void BeginFastPaletteFade(u8);
|
|
void BeginHardwarePaletteFade(u8, u8, u8, u8, u8);
|
|
void BlendPalettes(u32, u8, u16);
|
|
void BlendPalettesUnfaded(u32, u8, u16);
|
|
void sub_80A2C44(u32 a1, s8 a2, u8 a3, u8 a4, u16 a5, u8 a6, u8 a7);
|
|
|
|
#endif // GUARD_PALETTE_H
|