Fix desaturation
@@ -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;
+ 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 * (167 - 27) / 255 + 27;
