19#define VDPPALETTE_REDSFT 1
20#define VDPPALETTE_GREENSFT 5
21#define VDPPALETTE_BLUESFT 9
23#define VDPPALETTE_REDMASK 0x000E
24#define VDPPALETTE_GREENMASK 0x00E0
25#define VDPPALETTE_BLUEMASK 0x0E00
26#define VDPPALETTE_COLORMASK 0x0EEE
35#define RGB24_TO_VDPCOLOR(color) ((((((color) + 0x100000) < 0xFF0000 ? (color) + 0x100000 : 0xFF0000) >> (20)) & VDPPALETTE_REDMASK) | ((((((color) & 0xff00) + 0x1000) < 0xFF00 ? ((color) & 0xff00) + 0x1000 : 0xFF00) >> ((1 * 4) + 4)) & VDPPALETTE_GREENMASK) | ((((((color) & 0xff) + 0x10) < 0xFF ? ((color) & 0xff) + 0x10 : 0xFF) << 4) & VDPPALETTE_BLUEMASK))
48#define RGB3_3_3_TO_VDPCOLOR(r, g, b) ((((r) & 7) << VDPPALETTE_REDSFT) | (((g) & 7) << VDPPALETTE_GREENSFT) | (((b) & 7) << VDPPALETTE_BLUESFT))
61#define RGB8_8_8_TO_VDPCOLOR(r, g, b) RGB24_TO_VDPCOLOR(((((b) << 0) & 0xFF) | (((g) & 0xFF) << 8) | (((r) & 0xFF) << 16)))
83extern const u16*
const palette_black;
88extern const u16 palette_grey[16];
93extern const u16 palette_red[16];
98extern const u16 palette_green[16];
103extern const u16 palette_blue[16];
109extern u16 fadeCurrentPal[64];
114extern u16 fadeEndPal[64];
216#define PAL_setColorsDMA(index, pal, count) _Pragma("GCC error \"This method is deprecated, use PAL_setColors(..) instead.\"")
221#define PAL_setPaletteColorsDMA(index, pal) _Pragma("GCC error \"This method is deprecated, use PAL_setPaletteColors(..) instead.\"")
226#define PAL_setPaletteDMA(numPal, pal) _Pragma("GCC error \"This method is deprecated, use PAL_setPalette(..) instead.\"")
Basic SGDK library configuration file.
TransferMethod
VRAM transfer method.
Definition dma.h:52
void PAL_fadeToPalette(u16 numPal, const u16 *pal, u16 numFrame, bool async)
Fade current palette to specified one.
Definition pal.c:436
void PAL_interruptFade(void)
Interrupt any asynchronous palette fading effect.
Definition pal.c:484
void PAL_fadeInPalette(u16 numPal, const u16 *pal, u16 numFrame, bool async)
Fade in (black to specified color) effect.
Definition pal.c:446
void PAL_fadeTo(u16 fromCol, u16 toCol, const u16 *pal, u16 numFrame, bool async)
Fade current color palette to specified one.
Definition pal.c:407
void PAL_setPalette(u16 numPal, const u16 *pal, TransferMethod tm)
Set a complete palette (16 colors) into CRAM.
Definition pal.c:284
bool PAL_isManualFadeDone(void)
Returns TRUE if the manual fading operation is complete, FALSE otherwise. WARNING: This method is no...
Definition pal.c:384
void PAL_getColors(u16 index, u16 *dest, u16 count)
Read count RGB colors from CRAM starting at specified index and store them in specified destination p...
Definition pal.c:213
void PAL_getPalette(u16 numPal, u16 *dest)
Get a complete palette (16 colors) from CRAM.
Definition pal.c:245
void PAL_fadeAll(const u16 *palSrc, const u16 *palDst, u16 numFrame, bool async)
Global palette fading effect.
Definition pal.c:452
void PAL_fadeInAll(const u16 *pal, u16 numFrame, bool async)
Fade in (black to specified color) effect.
Definition pal.c:467
void PAL_fadeIn(u16 fromCol, u16 toCol, const u16 *pal, u16 numFrame, bool async)
Fade in (black to specified color) effect.
Definition pal.c:425
bool PAL_doFadeStep(void)
Update palette to process one frame/iteration of current fade operation (see PAL_initFade(....
Definition pal.c:342
void PAL_fadeOutPalette(u16 numPal, u16 numFrame, bool async)
Fade out (current color to black) effect.
Definition pal.c:441
void PAL_fade(u16 fromCol, u16 toCol, const u16 *palSrc, const u16 *palDst, u16 numFrame, bool async)
General palette fading effect.
Definition pal.c:389
void PAL_setPaletteColors(u16 index, const Palette *pal, TransferMethod tm)
Write the given Palette RGB colors into CRAM for the specified palette entries.
Definition pal.c:279
void PAL_setColor(u16 index, u16 value)
Set RGB color into CRAM for the specified palette entry.
Definition pal.c:266
bool PAL_isDoingFade(void)
Returns TRUE if we are currently doing an asynchronous palette fading operation. WARNING: This metho...
Definition pal.c:473
void PAL_fadeToAll(const u16 *pal, u16 numFrame, bool async)
Palettes fade to specified one.
Definition pal.c:457
void PAL_fadePalette(u16 numPal, const u16 *palSrc, const u16 *palDst, u16 numFrame, bool async)
Do palette fade effect.
Definition pal.c:431
void PAL_fadeOut(u16 fromCol, u16 toCol, u16 numFrame, bool async)
Fade out (current color to black) effect.
Definition pal.c:420
void PAL_fadeOutAll(u16 numFrame, bool async)
Fade out (current color to black) effect.
Definition pal.c:462
bool PAL_initFade(u16 fromCol, u16 toCol, const u16 *palSrc, const u16 *palDst, u16 numFrame)
Initialize a fading operation that will be manually controlled through PAL_doFadeStep() calls IMPORTA...
Definition pal.c:290
void PAL_waitFadeCompletion(void)
Wait for (asynchronous) palette fading operation to complete.
Definition pal.c:478
u16 PAL_getColor(u16 index)
Returns RGB color value from CRAM for the specified palette entry.
Definition pal.c:204
void PAL_setColors(u16 index, const u16 *pal, u16 count, TransferMethod tm)
Write RGB colors into CRAM for the specified palette entries.
Definition pal.c:274
Palette structure contains color data.
Definition pal.h:73
unsigned short u16
Definition types.h:100