git.y1.nz

gbdk-2020

GameBoy Development Kit
download: https://git.y1.nz/archives/gbdk.tar.gz
README | Files | Log | Refs | LICENSE

commit 1e02d4106a45adf014f636a6e67c8cbe5969c425
parent eb28cbcc003fd7c3a6ea4c7b589ca925e51fef78
Author: Toxa <untoxa@mail.ru>
Date:   Tue,  1 Nov 2022 11:51:03 +0300

fix RGB and RGB8 macros

Diffstat:
Mgbdk-lib/include/gb/cgb.h4++--
1 file changed, 2 insertions(+), 2 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) | (((g) & 0x1f) << 5) | (((r) & 0x1f) << 0))) +#define RGB(r, g, b) ((uint16_t)((((b) & 0x1f) << 10) | ((uint16_t)(((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) & 0x1f) | ((((g) >> 3) & 0x1f) << 5) | ((((b) >> 3) & 0x1f) << 10))) +#define RGB8(r, g, b) (((uint16_t)((((b) >> 3) & 0x1f) << 10)) | ((uint16_t)((((g) >> 3) & 0x1f) << 5)) | (((r) >> 3) & 0x1f)) /** Macro to convert a 24 Bit RGB color to a CGB palette color entry.

This webpage is intended to be an accessible preview of this repository. To get a fuller picture, clone it and use the git CLI.