GBDK 2020 Docs 4.4.0 API Documentation for GBDK 2020

cgb.h
Go to the documentation of this file.
1
17 #ifndef _CGB_H
18 #define _CGB_H
19
20 #include <types.h>
21 #include <stdint.h>
22
33 #define RGB(r, g, b) ((uint16_t)((((b) & 0x1f) << 10) | ((uint16_t)(((g) & 0x1f) << 5)) | ((r) & 0x1f)))
34
47 #define RGB8(r, g, b) (((uint16_t)((((b) >> 3) & 0x1f) << 10)) | ((uint16_t)((((g) >> 3) & 0x1f) << 5)) | (((r) >> 3) & 0x1f))
48
59 #define RGBHTML(RGB24bit) (RGB8((((RGB24bit) >> 16) & 0xff), (((RGB24bit) >> 8) & 0xff), ((RGB24bit) & 0xff)))
60
63 #define RGB_RED RGB(31, 0, 0)
64 #define RGB_DARKRED RGB(15, 0, 0)
65 #define RGB_GREEN RGB( 0, 31, 0)
66 #define RGB_DARKGREEN RGB( 0, 15, 0)
67 #define RGB_BLUE RGB( 0, 0, 31)
68 #define RGB_DARKBLUE RGB( 0, 0, 15)
69 #define RGB_YELLOW RGB(31, 31, 0)
70 #define RGB_DARKYELLOW RGB(21, 21, 0)
71 #define RGB_CYAN RGB( 0, 31, 31)
72 #define RGB_AQUA RGB(28, 5, 22)
73 #define RGB_PINK RGB(31, 0, 31)
74 #define RGB_PURPLE RGB(21, 0, 21)
75 #define RGB_BLACK RGB( 0, 0, 0)
76 #define RGB_DARKGRAY RGB(10, 10, 10)
77 #define RGB_LIGHTGRAY RGB(21, 21, 21)
78 #define RGB_WHITE RGB(31, 31, 31)
79
80 #define RGB_LIGHTFLESH RGB(30, 20, 15)
81 #define RGB_BROWN RGB(10, 10, 0)
82 #define RGB_ORANGE RGB(30, 20, 0)
83 #define RGB_TEAL RGB(15, 15, 0)
84
85 typedef uint16_t palette_color_t;
104 void set_bkg_palette(uint8_t first_palette, uint8_t nb_palettes, const palette_color_t *rgb_data) OLDCALL;
105
123 void set_sprite_palette(uint8_t first_palette, uint8_t nb_palettes, const palette_color_t *rgb_data) OLDCALL;
124
136 void set_bkg_palette_entry(uint8_t palette, uint8_t entry, uint16_t rgb_data) OLDCALL;
137
148 void set_sprite_palette_entry(uint8_t palette, uint8_t entry, uint16_t rgb_data) OLDCALL;
149
160 void cpu_slow(void);
161
174 void cpu_fast(void);
175
184 void set_default_palette(void);
185
188 void cgb_compatibility(void);
189
190 #endif /* _CGB_H */
OLDCALL
#define OLDCALL
Definition: types.h:21
set_bkg_palette
void set_bkg_palette(uint8_t first_palette, uint8_t nb_palettes, const palette_color_t *rgb_data) OLDCALL
set_default_palette
void set_default_palette(void)
cpu_slow
void cpu_slow(void)
cgb_compatibility
void cgb_compatibility(void)
Definition: sms.h:588
set_sprite_palette
void set_sprite_palette(uint8_t first_palette, uint8_t nb_palettes, const palette_color_t *rgb_data) OLDCALL
cpu_fast
void cpu_fast(void)
Definition: msx.h:551
set_bkg_palette_entry
void set_bkg_palette_entry(uint8_t palette, uint8_t entry, uint16_t rgb_data) OLDCALL
set_sprite_palette_entry
void set_sprite_palette_entry(uint8_t palette, uint8_t entry, uint16_t rgb_data) OLDCALL
palette_color_t
uint16_t palette_color_t
Definition: cgb.h:85
stdint.h
uint8_t
unsigned char uint8_t
Definition: stdint.h:51
uint16_t
unsigned short int uint16_t
Definition: stdint.h:52