From: Toni Wilen Date: Wed, 10 Feb 2016 16:28:37 +0000 (+0200) Subject: Added third dark palette fix formula. X-Git-Tag: 3300~85 X-Git-Url: https://git.unchartedbackwaters.co.uk/w/?a=commitdiff_plain;h=7f4686637ba2260598e804caded86d58e9575c08;p=francis%2Fwinuae.git Added third dark palette fix formula. --- diff --git a/cfgfile.cpp b/cfgfile.cpp index 678dafc3..0fbe3e22 100644 --- a/cfgfile.cpp +++ b/cfgfile.cpp @@ -287,6 +287,7 @@ static const TCHAR *serialcrlf[] = { }; static const TCHAR *threebitcolors[] = { _T("disabled"), + _T("3to4to8bit"), _T("3to4bit"), _T("3to8bit"), NULL diff --git a/gfxutil.cpp b/gfxutil.cpp index f2b86134..936c349b 100644 --- a/gfxutil.cpp +++ b/gfxutil.cpp @@ -150,13 +150,15 @@ static void video_calc_gammatable (void) for (int i = 0; i < (256 * 3); i++) { for (int j = 0; j < 3; j++) { - int val = i - 256; + float val = i - 256; float v; - if (currprefs.gfx_threebitcolors == 1) { + if (currprefs.gfx_threebitcolors == 2) { val *= 2; - } else if (currprefs.gfx_threebitcolors == 2) { - val = (val + (val & 7)) * 2; + } else if (currprefs.gfx_threebitcolors == 3) { + val = (val * 252.0) / 119.0; + } else if (currprefs.gfx_threebitcolors == 1) { + val = (val * 252.0) / 238.0; } if (currprefs.gfx_luminance == 0 && currprefs.gfx_contrast == 0 && currprefs.gfx_gamma == 0) {