From: Toni Wilen Date: Fri, 13 Mar 2026 15:34:49 +0000 (+0200) Subject: Black level calibration debug mode X-Git-Url: https://git.unchartedbackwaters.co.uk/w/?a=commitdiff_plain;h=0f51c176b5fde856815e5f4b7103f9dbe393b5b8;p=francis%2Fwinuae.git Black level calibration debug mode --- diff --git a/cfgfile.cpp b/cfgfile.cpp index c619b4c3..0766f2fe 100644 --- a/cfgfile.cpp +++ b/cfgfile.cpp @@ -275,6 +275,7 @@ static const TCHAR *kbtype[] = { _T("ax000_6570-036"), NULL }; +static const TCHAR *blcalib[] = { _T("off"), _T("on"), _T("debug"), NULL }; struct hdcontrollerconfig { @@ -2669,7 +2670,7 @@ void cfgfile_save_options (struct zfile *f, struct uae_prefs *p, int type) if (p->chipset_refreshrate > 0) cfgfile_write (f, _T("chipset_refreshrate"), _T("%f"), p->chipset_refreshrate); cfgfile_dwrite_bool(f, _T("chipset_subpixel"), p->chipset_hr); - cfgfile_dwrite_bool(f, _T("chipset_black_level_calibration"), p->display_calibration); + cfgfile_dwrite_strarr(f, _T("chipset_black_level_calibration"), blcalib, p->display_calibration); for (int i = 0; i < MAX_CHIPSET_REFRESH_TOTAL; i++) { struct chipset_refresh *cr = &p->cr[i]; @@ -6437,7 +6438,8 @@ static int cfgfile_parse_hardware (struct uae_prefs *p, const TCHAR *option, TCH if (cfgfile_yesno(option, value, _T("chipset_subpixel"), &p->chipset_hr)) { return 1; } - if (cfgfile_yesno(option, value, _T("chipset_black_level_calibration"), &p->display_calibration)) { + + if (cfgfile_strval(option, value, _T("chipset_black_level_calibration"), &p->display_calibration, blcalib, 0)) { return 1; } @@ -8716,7 +8718,7 @@ void default_prefs (struct uae_prefs *p, bool reset, int type) p->blitter_cycle_exact = true; p->chipset_mask = CSMASK_ECS_AGNUS; p->chipset_hr = false; - p->display_calibration = false; + p->display_calibration = 0; p->genlock = 0; p->genlock_image = 0; p->genlock_mix = 0; diff --git a/drawing.cpp b/drawing.cpp index f0af053e..821ad329 100644 --- a/drawing.cpp +++ b/drawing.cpp @@ -5504,13 +5504,13 @@ static void emulate_black_level_calibration(uae_u32 *b1, uae_u32 *b2, uae_u32 *d return; } -#if 1 - db[off] = 0xff0000; - db[off + (clen << shift) - 1] = 0xff0000; + if (currprefs.display_calibration > 1) { + db[off] = 0xff0000; + db[off + (clen << shift) - 1] = 0xff0000; - b1[off] = 0xff0000; - b1[off + (clen << shift) - 1] = 0xff0000; -#endif + b1[off] = 0xff0000; + b1[off + (clen << shift) - 1] = 0xff0000; + } int outc[3]; for (int i = 0; i < 3; i++) { diff --git a/include/options.h b/include/options.h index b9c533ed..d5c621bb 100644 --- a/include/options.h +++ b/include/options.h @@ -651,7 +651,7 @@ struct uae_prefs { float blitter_speed_throttle; unsigned int chipset_mask; bool chipset_hr; - bool display_calibration; + int display_calibration; int keyboard_mode; bool keyboard_nkro; bool ntscmode;