git.y1.nz

SameBoy

Accurate GB/GBC emulator
download: https://git.y1.nz/archives/sameboy.tar.gz
README | Files | Log | Refs | LICENSE

commit 779ffe3e1ba5af43675db8251ec5b481d5c04a3d
parent ab07f955e4cc427d54886899af8335ff16120500
Author: Lior Halphon <LIJI32@gmail.com>
Date:   Wed,  3 Aug 2022 01:06:34 +0300

Fix desaturation

Diffstat:
MCore/display.c22+++++++++++-----------
1 file changed, 11 insertions(+), 11 deletions(-)

diff --git a/Core/display.c b/Core/display.c @@ -305,12 +305,12 @@ uint32_t GB_convert_rgb15(GB_gameboy_t *gb, uint16_t color, bool for_border) new_b = b; if (gb->color_correction_mode == GB_COLOR_CORRECTION_REDUCE_CONTRAST) { r = new_r; - g = new_r; - b = new_r; + g = new_g; + b = new_b; - new_r = new_r * 7 / 8 + ( g + b) / 16; - new_g = new_g * 7 / 8 + (r + b) / 16; - new_b = new_b * 7 / 8 + (r + g ) / 16; + new_r = new_r * 15 / 16 + ( g + b) / 32; + new_g = new_g * 15 / 16 + (r + b) / 32; + new_b = new_b * 15 / 16 + (r + g ) / 32; if (agb) { new_r = new_r * (224 - 40) / 255 + 20; @@ -325,12 +325,12 @@ uint32_t GB_convert_rgb15(GB_gameboy_t *gb, uint16_t color, bool for_border) } else if (gb->color_correction_mode == GB_COLOR_CORRECTION_LOW_CONTRAST) { r = new_r; - g = new_r; - b = new_r; - - new_r = new_r * 7 / 8 + ( g + b) / 16; - new_g = new_g * 7 / 8 + (r + b) / 16; - new_b = new_b * 7 / 8 + (r + g ) / 16; + g = new_g; + b = new_b; + + new_r = new_r * 15 / 16 + ( g + b) / 32; + new_g = new_g * 15 / 16 + (r + b) / 32; + new_b = new_b * 15 / 16 + (r + g ) / 32; if (agb) { new_r = new_r * (167 - 27) / 255 + 27;

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