gbdk-2020 | GameBoy Development Kit |
| download: https://git.y1.nz/archives/gbdk.tar.gz | |
| README | Files | Log | Refs | LICENSE |
commit 0dbb5651993d4b69d354f77b1c92252afd146c81 parent 522f8704e508f4d1451af086b5d372a3ffc654ea Author: Toxa <untoxa@mail.ru> Date: Fri, 12 Aug 2022 00:39:03 +0300 remove a few warnings when compiling programs which use the color definition macros Diffstat:
| M | gbdk-lib/include/gb/cgb.h | 8 | ++++---- |
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/gbdk-lib/include/gb/cgb.h b/gbdk-lib/include/gb/cgb.h @@ -30,7 +30,7 @@ @see set_bkg_palette(), set_sprite_palette(), RGB8(), RGBHTML() */ -#define RGB(r, g, b) ((((uint16_t)(b) & 0x1f) << 10) | (((uint16_t)(g) & 0x1f) << 5) | (((uint16_t)(r) & 0x1f) << 0)) +#define RGB(r, g, b) ((uint16_t)((((b) & 0x1f) << 10) | (((g) & 0x1f) << 5) | (((r) & 0x1f) << 0))) /** Macro to create a CGB palette color entry out of 8-bit color components. @@ -44,7 +44,7 @@ @see set_bkg_palette(), set_sprite_palette(), RGB(), RGBHTML() */ -#define RGB8(r, g, b) ((uint16_t)((r) >> 3) | ((uint16_t)((g) >> 3) << 5) | ((uint16_t)((b) >> 3) << 10)) +#define RGB8(r, g, b) ((uint16_t)((((r) >> 3) & 0x1f) | ((((g) >> 3) & 0x1f) << 5) | ((((b) >> 3) & 0x1f) << 10))) /** Macro to convert a 24 Bit RGB color to a CGB palette color entry. @@ -56,7 +56,7 @@ @see set_bkg_palette(), set_sprite_palette(), RGB(), RGB8() */ -#define RGBHTML(RGB24bit) (RGB8((((RGB24bit) >> 16) & 0xFF), (((RGB24bit) >> 8) & 0xFF), ((RGB24bit) & 0xFF))) +#define RGBHTML(RGB24bit) (RGB8((((RGB24bit) >> 16) & 0xff), (((RGB24bit) >> 8) & 0xff), ((RGB24bit) & 0xff))) /** Common colors based on the EGA default palette. */ @@ -143,7 +143,7 @@ void set_bkg_palette_entry(uint8_t palette, uint8_t entry, uint16_t rgb_data) OL @see set_sprite_palette(), RGB() @see OAMF_CGB_PAL0, OAMF_CGB_PAL1, OAMF_CGB_PAL2, OAMF_CGB_PAL3 - @see OAMF_CGB_PAL4, OAMF_CGB_PAL5, OAMF_CGB_PAL6, OAMF_CGB_PAL7 + @see OAMF_CGB_PAL4, OAMF_CGB_PAL5, OAMF_CGB_PAL6, OAMF_CGB_PAL7 */ void set_sprite_palette_entry(uint8_t palette, uint8_t entry, uint16_t rgb_data) OLDCALL;
This webpage is intended to be an accessible preview of this repository. To get a fuller picture, clone it and use the git CLI.