Write palette IDs in hex
This commit is contained in:
@@ -67,6 +67,12 @@
|
||||
#define DISPLAY_WIDTH 240
|
||||
#define DISPLAY_HEIGHT 160
|
||||
|
||||
#define PLTT_SIZEOF(n) ((n) * sizeof(u16))
|
||||
#define PLTT_SIZE_4BPP PLTT_SIZEOF(16)
|
||||
#define PLTT_SIZE_8BPP PLTT_SIZEOF(256)
|
||||
|
||||
#define PLTT_OFFSET_4BPP(n) ((n) * PLTT_SIZE_4BPP)
|
||||
|
||||
#define TILE_SIZE_4BPP 32
|
||||
#define TILE_SIZE_8BPP 64
|
||||
|
||||
|
||||
@@ -18,6 +18,13 @@
|
||||
#define PALETTES_OBJECTS 0xFFFF0000
|
||||
#define PALETTES_ALL (PALETTES_BG | PALETTES_OBJECTS)
|
||||
|
||||
#define PLTT_ID(n) ((n) * 16)
|
||||
#define BG_PLTT_OFFSET 0x000
|
||||
#define OBJ_PLTT_OFFSET 0x100
|
||||
#define BG_PLTT_ID(n) (BG_PLTT_OFFSET + PLTT_ID(n))
|
||||
#define OBJ_PLTT_ID(n) (OBJ_PLTT_OFFSET + PLTT_ID(n))
|
||||
#define OBJ_PLTT_ID2(n) (PLTT_ID((n) + 16))
|
||||
|
||||
enum
|
||||
{
|
||||
FAST_FADE_IN_FROM_WHITE,
|
||||
@@ -74,4 +81,14 @@ void TintPalette_GrayScale2(u16 *palette, u16 count);
|
||||
void TintPalette_SepiaTone(u16 *palette, u16 count);
|
||||
void TintPalette_CustomTone(u16 *palette, u16 count, u16 rTone, u16 gTone, u16 bTone);
|
||||
|
||||
extern inline void SetBackdropFromColor(u16 color)
|
||||
{
|
||||
FillPalette(color, 0x00, PLTT_SIZEOF(1));
|
||||
}
|
||||
|
||||
extern inline void SetBackdropFromPalette(const u16 *palette)
|
||||
{
|
||||
LoadPalette(palette, 0x00, PLTT_SIZEOF(1));
|
||||
}
|
||||
|
||||
#endif // GUARD_PALETTE_H
|
||||
|
||||
Reference in New Issue
Block a user