]> git.unchartedbackwaters.co.uk Git - francis/winuae.git/commitdiff
Black level calibration debug mode
authorToni Wilen <twilen@winuae.net>
Fri, 13 Mar 2026 15:34:49 +0000 (17:34 +0200)
committerToni Wilen <twilen@winuae.net>
Fri, 13 Mar 2026 15:34:49 +0000 (17:34 +0200)
cfgfile.cpp
drawing.cpp
include/options.h

index c619b4c3d7625f6c05fda827e208e8900a423653..0766f2feb2b2da6d279ea1f7cae07345397ffdfa 100644 (file)
@@ -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;
index f0af053e6d7196f2ceae714762ba557dd92240a9..821ad32975e753f10b5ed3f77fefe54872b1173f 100644 (file)
@@ -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++) {
index b9c533ed61aa379590f3430ca0ef9a15f108db10..d5c621bbb3ba11c0ed48fb80c1e196c707dd98eb 100644 (file)
@@ -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;