git.y1.nz

gbdk-2020

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

commit ee78934caed94f06b0953d02c33adb77dd0fcffe
parent 8e5ffc95bd802ea04cd88ea0d5881d1284938745
Author: Toxa <untoxa@mail.ru>
Date:   Fri,  3 Sep 2021 22:20:51 +0300

RGB8() and RGBHTML() macros for CGB

Diffstat:
Mgbdk-lib/include/gb/cgb.h5+++--
Mgbdk-lib/libc/targets/z80/cls.s2++
2 files changed, 5 insertions(+), 2 deletions(-)

diff --git a/gbdk-lib/include/gb/cgb.h b/gbdk-lib/include/gb/cgb.h @@ -30,8 +30,9 @@ @see set_bkg_palette(), set_sprite_palette() */ -#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) | (((uint16_t)(g) & 0x1f) << 5) | (((uint16_t)(r) & 0x1f) << 0)) +#define RGB8(r, g, b) ((uint16_t)((r) >> 3) | ((uint16_t)((g) >> 3) << 5) | ((uint16_t)((b) >> 3) << 10)) +#define RGBHTML(RGB24bit) (RGB8((((RGB24bit) >> 16) & 0xFF), (((RGB24bit) >> 8) & 0xFF), ((RGB24bit) & 0xFF))) /** Common colors based on the EGA default palette. */ diff --git a/gbdk-lib/libc/targets/z80/cls.s b/gbdk-lib/libc/targets/z80/cls.s @@ -12,7 +12,9 @@ _cls:: ld (.curx), a ld a, #.SCREEN_Y_OFS ld (.cury), a + DISABLE_VBLANK_COPY ; switch OFF copy shadow SAT + ld hl, #(.VDP_TILEMAP + ((.SCREEN_Y_OFS * .VDP_MAP_WIDTH) * 2)) WRITE_VDP_CMD_HL

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