]> git.unchartedbackwaters.co.uk Git - francis/winuae.git/commitdiff
Interlace filter config
authorToni Wilen <twilen@winuae.net>
Sun, 6 Nov 2022 16:55:13 +0000 (18:55 +0200)
committerToni Wilen <twilen@winuae.net>
Sun, 6 Nov 2022 16:55:13 +0000 (18:55 +0200)
12 files changed:
cfgfile.cpp
custom.cpp
drawing.cpp
include/drawing.h
include/options.h
include/xwin.h
od-win32/direct3d.cpp
od-win32/direct3d11.cpp
od-win32/resources/resource.h
od-win32/resources/winuae.rc
od-win32/win32gfx.cpp
od-win32/win32gui.cpp

index 9bee6815cb62b59b8258c9ad7fca9774a7bd43cf..c183e54f52da0b79507d687feefb18d6f1a65e80 100644 (file)
@@ -2336,9 +2336,12 @@ void cfgfile_save_options (struct zfile *f, struct uae_prefs *p, int type)
        cfgfile_dwrite(f, _T("gfx_monitorblankdelay"), _T("%d"), p->gfx_monitorblankdelay);
 
 #ifdef GFXFILTER
-       for (int j = 0; j < 2; j++) {
+       for (int j = 0; j < MAX_FILTERDATA; j++) {
                struct gfx_filterdata *gf = &p->gf[j];
-               const TCHAR *ext = j == 0 ? NULL : _T("_rtg");
+               const TCHAR *ext = j == 0 ? NULL : (j == 1 ? _T("_rtg") : _T("_lace"));
+               if (j == 2) {
+                       cfgfile_dwrite_bool(f, _T("gfx_filter_enable"), ext, gf->enable);
+               }
                for (int i = 0; i <MAX_FILTERSHADERS; i++) {
                        if (gf->gfx_filtershader[i][0])
                                cfgfile_write_ext (f, _T("gfx_filter_pre"), ext, _T("D3D:%s"), gf->gfx_filtershader[i]);
@@ -3642,15 +3645,13 @@ static int cfgfile_parse_host (struct uae_prefs *p, TCHAR *option, TCHAR *value)
        }
 
 #ifdef GFXFILTER
-       for (int j = 0; j < 2; j++) {
+       for (int j = 0; j < MAX_FILTERDATA; j++) {
                struct gfx_filterdata *gf = &p->gf[j];
-               const TCHAR *ext = j == 0 ? NULL : _T("_rtg");
-               if (cfgfile_strval (option, value, _T("gfx_filter_autoscale"), ext, &gf->gfx_filter_autoscale, j == 0 ? autoscale : autoscale_rtg, 0)
+               const TCHAR *ext = j == 0 ? NULL : (j == 1 ? _T("_rtg") : _T("_lace"));
+               if (cfgfile_strval (option, value, _T("gfx_filter_autoscale"), ext, &gf->gfx_filter_autoscale, j == 0 || j == 2 ? autoscale : autoscale_rtg, 0)
                        || cfgfile_strval (option, value, _T("gfx_filter_keep_aspect"), ext, &gf->gfx_filter_keep_aspect, aspects, 0)
-                       || cfgfile_strval (option, value, _T("gfx_filter_autoscale_limit"), ext, &gf->gfx_filter_integerscalelimit, autoscalelimit, 0))
-                       return 1;
-
-               if (cfgfile_floatval(option, value, _T("gfx_filter_vert_zoomf"), ext, &gf->gfx_filter_vert_zoom)
+                       || cfgfile_strval (option, value, _T("gfx_filter_autoscale_limit"), ext, &gf->gfx_filter_integerscalelimit, autoscalelimit, 0)
+                       || cfgfile_floatval(option, value, _T("gfx_filter_vert_zoomf"), ext, &gf->gfx_filter_vert_zoom)
                        || cfgfile_floatval(option, value, _T("gfx_filter_horiz_zoomf"), ext, &gf->gfx_filter_horiz_zoom)
                        || cfgfile_floatval(option, value, _T("gfx_filter_vert_zoom_multf"), ext, &gf->gfx_filter_vert_zoom_mult)
                        || cfgfile_floatval(option, value, _T("gfx_filter_horiz_zoom_multf"), ext, &gf->gfx_filter_horiz_zoom_mult)
@@ -3675,8 +3676,11 @@ static int cfgfile_parse_host (struct uae_prefs *p, TCHAR *option, TCHAR *value)
                        || cfgfile_intval(option, value, _T("gfx_filter_noise"), ext, &gf->gfx_filter_noise, 1)
                        || cfgfile_intval(option, value, _T("gfx_filter_bilinear"), ext, &gf->gfx_filter_bilinear, 1)
                        || cfgfile_intval(option, value, _T("gfx_filter_keep_autoscale_aspect"), ext, &gf->gfx_filter_keep_autoscale_aspect, 1)
+                       || cfgfile_intval(option, value, _T("gfx_filter_enable"), ext, &gf->enable, 1)
                        || cfgfile_string(option, value, _T("gfx_filter_mask"), ext, gf->gfx_filtermask[2 * MAX_FILTERSHADERS], sizeof gf->gfx_filtermask[2 * MAX_FILTERSHADERS] / sizeof (TCHAR)))
-                       return 1;
+                       {
+                               return 1;
+                       }
        }
 #endif
 
@@ -3870,9 +3874,9 @@ static int cfgfile_parse_host (struct uae_prefs *p, TCHAR *option, TCHAR *value)
        }
 
 #ifdef GFXFILTER
-       for (int j = 0; j < 2; j++) {
+       for (int j = 0; j < MAX_FILTERDATA; j++) {
                struct gfx_filterdata *gf = &p->gf[j];
-               if ((j == 0 && _tcscmp (option, _T("gfx_filter_overlay")) == 0) || (j == 1 && _tcscmp (option, _T("gfx_filter_overlay_rtg")) == 0)) {
+               if ((j == 0 && _tcscmp (option, _T("gfx_filter_overlay")) == 0) || (j == 1 && _tcscmp(option, _T("gfx_filter_overlay_rtg")) == 0) || (j == 2 && _tcscmp(option, _T("gfx_filter_overlay_lace")) == 0)) {
                        TCHAR *s = _tcschr (value, ',');
                        gf->gfx_filteroverlay_overscan = 0;
                        gf->gfx_filteroverlay_pos.x = 0;
@@ -3895,18 +3899,19 @@ static int cfgfile_parse_host (struct uae_prefs *p, TCHAR *option, TCHAR *value)
                }
 
                if ((j == 0 && (_tcscmp (option, _T("gfx_filtermask_pre")) == 0 || _tcscmp (option, _T("gfx_filtermask_post")) == 0)) ||
-                       (j == 1 && (_tcscmp (option, _T("gfx_filtermask_pre_rtg")) == 0 || _tcscmp (option, _T("gfx_filtermask_post_rtg")) == 0))) {
-                       if (_tcscmp (option, _T("gfx_filtermask_pre")) == 0 || _tcscmp (option, _T("gfx_filtermask_pre_rtg")) == 0) {
+                       (j == 1 && (_tcscmp(option, _T("gfx_filtermask_pre_rtg")) == 0 || _tcscmp(option, _T("gfx_filtermask_post_rtg")) == 0)) ||
+                       (j == 2 && (_tcscmp(option, _T("gfx_filtermask_pre_lace")) == 0 || _tcscmp(option, _T("gfx_filtermask_post_lace")) == 0))) {
+                       if (_tcscmp(option, _T("gfx_filtermask_pre")) == 0 || _tcscmp(option, _T("gfx_filtermask_pre_rtg")) == 0 || _tcscmp(option, _T("gfx_filtermask_pre_lace")) == 0) {
                                for (int i = 0; i < MAX_FILTERSHADERS; i++) {
                                        if (gf->gfx_filtermask[i][0] == 0) {
-                                               _tcscpy (gf->gfx_filtermask[i], value);
+                                               _tcscpy(gf->gfx_filtermask[i], value);
                                                break;
                                        }
                                }
                        } else {
                                for (int i = 0; i < MAX_FILTERSHADERS; i++) {
                                        if (gf->gfx_filtermask[i + MAX_FILTERSHADERS][0] == 0) {
-                                               _tcscpy (gf->gfx_filtermask[i + MAX_FILTERSHADERS], value);
+                                               _tcscpy(gf->gfx_filtermask[i + MAX_FILTERSHADERS], value);
                                                break;
                                        }
                                }
@@ -3915,24 +3920,25 @@ static int cfgfile_parse_host (struct uae_prefs *p, TCHAR *option, TCHAR *value)
                }
 
                if ((j == 0 && (_tcscmp (option, _T("gfx_filter_pre")) == 0 || _tcscmp (option, _T("gfx_filter_post")) == 0)) ||
-                       (j == 1 && (_tcscmp (option, _T("gfx_filter_pre_rtg")) == 0 || _tcscmp (option, _T("gfx_filter_post_rtg")) == 0))) {
-                       TCHAR *s = _tcschr (value, ':');
+                       (j == 1 && (_tcscmp (option, _T("gfx_filter_pre_rtg")) == 0 || _tcscmp (option, _T("gfx_filter_post_rtg")) == 0)) ||
+                       (j == 2 && (_tcscmp(option, _T("gfx_filter_pre_lace")) == 0 || _tcscmp(option, _T("gfx_filter_post_lace")) == 0))) {
+                       TCHAR *s = _tcschr(value, ':');
                        if (s) {
                                *s++ = 0;
                                if (!_tcscmp (value, _T("D3D"))) {
                                        if (!p->gfx_api)
                                                p->gfx_api = 1;
-                                       if (_tcscmp (option, _T("gfx_filter_pre")) == 0 || _tcscmp (option, _T("gfx_filter_pre_rtg")) == 0) {
+                                       if (_tcscmp(option, _T("gfx_filter_pre")) == 0 || _tcscmp(option, _T("gfx_filter_pre_rtg")) == 0 || _tcscmp(option, _T("gfx_filter_pre_lace")) == 0) {
                                                for (int i = 0; i < MAX_FILTERSHADERS; i++) {
                                                        if (gf->gfx_filtershader[i][0] == 0) {
-                                                               _tcscpy (gf->gfx_filtershader[i], s);
+                                                               _tcscpy(gf->gfx_filtershader[i], s);
                                                                break;
                                                        }
                                                }
                                        } else {
                                                for (int i = 0; i < MAX_FILTERSHADERS; i++) {
                                                        if (gf->gfx_filtershader[i + MAX_FILTERSHADERS][0] == 0) {
-                                                               _tcscpy (gf->gfx_filtershader[i + MAX_FILTERSHADERS], s);
+                                                               _tcscpy(gf->gfx_filtershader[i + MAX_FILTERSHADERS], s);
                                                                break;
                                                        }
                                                }
@@ -3942,7 +3948,7 @@ static int cfgfile_parse_host (struct uae_prefs *p, TCHAR *option, TCHAR *value)
                        return 1;
                }
 
-               if ((j == 0 && _tcscmp (option, _T("gfx_filter")) == 0) || (j == 1 && _tcscmp (option, _T("gfx_filter_rtg")) == 0)) {
+               if ((j == 0 && _tcscmp (option, _T("gfx_filter")) == 0) || (j == 1 && _tcscmp(option, _T("gfx_filter_rtg")) == 0) || (j == 2 && _tcscmp(option, _T("gfx_filter_lace")) == 0)) {
                        TCHAR *s = _tcschr (value, ':');
                        gf->gfx_filter = 0;
                        if (s) {
@@ -3988,6 +3994,10 @@ static int cfgfile_parse_host (struct uae_prefs *p, TCHAR *option, TCHAR *value)
                        cfgfile_strval(option, value, _T("gfx_filter_mode_rtg"), &gf->gfx_filter_filtermodeh, filtermode2, 0);
                        return 1;
                }
+               if (j == 2 && _tcscmp(option, _T("gfx_filter_mode_lace")) == 0) {
+                       cfgfile_strval(option, value, _T("gfx_filter_mode_lace"), &gf->gfx_filter_filtermodeh, filtermode2, 0);
+                       return 1;
+               }
                if (j == 0 && _tcscmp(option, _T("gfx_filter_mode2")) == 0) {
                        cfgfile_strval(option, value, _T("gfx_filter_mode2"), &gf->gfx_filter_filtermodev, filtermode2v, 0);
                        return 1;
@@ -3996,9 +4006,14 @@ static int cfgfile_parse_host (struct uae_prefs *p, TCHAR *option, TCHAR *value)
                        cfgfile_strval(option, value, _T("gfx_filter_mode2_rtg"), &gf->gfx_filter_filtermodev, filtermode2v, 0);
                        return 1;
                }
+               if (j == 2 && _tcscmp(option, _T("gfx_filter_mode2_lace")) == 0) {
+                       cfgfile_strval(option, value, _T("gfx_filter_mode2_lace"), &gf->gfx_filter_filtermodev, filtermode2v, 0);
+                       return 1;
+               }
 
                if ((j == 0 && cfgfile_string (option, value, _T("gfx_filter_aspect_ratio"), tmpbuf, sizeof tmpbuf / sizeof (TCHAR))) ||
-                       (j == 1 && cfgfile_string (option, value, _T("gfx_filter_aspect_ratio_rtg"), tmpbuf, sizeof tmpbuf / sizeof (TCHAR)))) {
+                       (j == 1 && cfgfile_string(option, value, _T("gfx_filter_aspect_ratio_rtg"), tmpbuf, sizeof tmpbuf / sizeof(TCHAR))) ||
+                       (j == 2 && cfgfile_string(option, value, _T("gfx_filter_aspect_ratio_lace"), tmpbuf, sizeof tmpbuf / sizeof(TCHAR)))) {
                        int v1, v2;
                        TCHAR *s;
 
@@ -8218,7 +8233,7 @@ void default_prefs (struct uae_prefs *p, bool reset, int type)
        p->cs_ciatype[1] = 0;
        p->cs_memorypatternfill = true;
 
-       for (int i = APMODE_NATIVE; i <= APMODE_RTG; i++) {
+       for (int i = 0; i < MAX_FILTERDATA; i++) {
                struct gfx_filterdata *f = &p->gf[i];
                f->gfx_filter = 0;
                f->gfx_filter_scanlineratio = (1 << 4) | 1;
@@ -8238,7 +8253,9 @@ void default_prefs (struct uae_prefs *p, bool reset, int type)
                f->gfx_filteroverlay_overscan = 0;
                f->gfx_filter_left_border = -1;
                f->gfx_filter_top_border = -1;
+               f->enable = true;
        }
+       p->gf[2].enable = false;
 
        p->rtg_horiz_zoom_mult = 1.0;
        p->rtg_vert_zoom_mult = 1.0;
index 36bb700bec4451f903be184d7f7cfb2f751f2aae..2dc95fe46558c572f8de59198a904b8610f5b63d 100644 (file)
@@ -11203,12 +11203,12 @@ static void vsync_handler_post(void)
        }
        lof_prev_lastline = lof_lastline;
        if (lof_togglecnt_lace >= LOF_TOGGLES_NEEDED) {
-               interlace_changed = notice_interlace_seen(true);
+               interlace_changed = notice_interlace_seen(monid, true);
                if (interlace_changed) {
                        notice_screen_contents_lost(monid);
                }
        } else if (lof_togglecnt_nlace >= LOF_TOGGLES_NEEDED) {
-               interlace_changed = notice_interlace_seen(false);
+               interlace_changed = notice_interlace_seen(monid, false);
                if (interlace_changed) {
                        notice_screen_contents_lost(monid);
                }
index 702fc3c59f29ac6f4829e338f72b8a4f7858e1b1..9d01e72f09e5dae6baf7a924c96ba9b1202c77b2 100644 (file)
@@ -5104,13 +5104,17 @@ void notice_resolution_seen (int res, bool lace)
                frame_res_lace = lace;
 }
 
-bool notice_interlace_seen (bool lace)
+bool notice_interlace_seen (int monid, bool lace)
 {
+       struct amigadisplay *ad = &adisplays[0];
        bool changed = false;
+       bool interlace_on = false;
+
        // non-lace to lace switch (non-lace active at least one frame)?
        if (lace) {
                if (interlace_seen == 0) {
                        changed = true;
+                       interlace_on = true;
                        //write_log (_T("->lace PC=%x\n"), m68k_getpc ());
                }
                interlace_seen = currprefs.gfx_vresolution ? 1 : -1;
@@ -5121,6 +5125,18 @@ bool notice_interlace_seen (bool lace)
                }
                interlace_seen = 0;
        }
+
+       if (changed) {
+               if (currprefs.gf[2].enable && memcmp(&currprefs.gf[0], &currprefs.gf[2], sizeof(struct gfx_filterdata))) {
+                       changed_prefs.gf[0].changed = true;
+                       changed_prefs.gf[2].changed = true;
+                       ad->interlace_on = interlace_on;
+                       set_config_changed();
+               } else {
+                       ad->interlace_on = false;
+               }
+       }
+
        return changed;
 }
 
index 20ab9a5ad9c78b1b0c334b3a9d021ed238f439da..4cbc83ca9ef4e3f92421e73e327249b9f6e6a167 100644 (file)
@@ -363,8 +363,8 @@ extern void draw_lines(int end, int section);
 extern void init_hardware_for_drawing_frame (void);
 extern void reset_drawing (void);
 extern void drawing_init (void);
-extern bool notice_interlace_seen (bool);
-extern void notice_resolution_seen (int, bool);
+extern bool notice_interlace_seen(int, bool);
+extern void notice_resolution_seen(int, bool);
 extern bool frame_drawn (int monid);
 extern void redraw_frame(void);
 extern void full_redraw_all(void);
index 1a73edacb62ae1d8c2a79da6c730b3faa62bde43..f173b811756e1641704cd812e3728dab744b3c81 100644 (file)
@@ -351,8 +351,10 @@ struct apmode
 #define MAX_LUA_STATES 16
 
 
+#define MAX_FILTERDATA 3
 struct gfx_filterdata
 {
+       int enable;
        int gfx_filter;
        TCHAR gfx_filtershader[2 * MAX_FILTERSHADERS + 1][MAX_DPATH];
        TCHAR gfx_filtermask[2 * MAX_FILTERSHADERS + 1][MAX_DPATH];
@@ -585,7 +587,7 @@ struct uae_prefs {
        int gfx_overscanmode;
        int gfx_monitorblankdelay;
 
-       struct gfx_filterdata gf[2];
+       struct gfx_filterdata gf[3];
 
        float rtg_horiz_zoom_mult;
        float rtg_vert_zoom_mult;
index fb53898635c98ef52857187af64277c074e53c48..d28f6aa2ab5d89bb418d91b6c5a9bf29e0056bd5 100644 (file)
@@ -164,6 +164,7 @@ struct amigadisplay
        volatile bool picasso_requested_on;
        bool picasso_requested_forced_on;
        bool picasso_on;
+       bool interlace_on;
        int picasso_redraw_necessary;
        int custom_frame_redraw_necessary;
        int frame_redraw_necessary;
index dc4d1c0c41a9546e40d2cd204483bd6a5f47d47c..fbde1207ea39ff15b5e93a01369feaf9c8735f3e 100644 (file)
@@ -2654,7 +2654,7 @@ static const TCHAR *D3D_init2 (struct d3dstruct *d3d, HWND ahwnd, int w_w, int w
        struct apmode ap;
        D3DADAPTER_IDENTIFIER9 did;
 
-       d3d->filterd3didx = ad->picasso_on;
+       d3d->filterd3didx = ad->picasso_on ? 1 : (ad->interlace_on ? 2 : 0);
        d3d->filterd3d = &currprefs.gf[d3d->filterd3didx];
 
        D3D_free2 (d3d);
index 246a2c7d239fe43d08b08a8966c7cc012de557f7..5f1ea3bc9c0913ed4a9ed9f33f67d96c36d6acbd 100644 (file)
@@ -3407,7 +3407,7 @@ static int xxD3D11_init2(HWND ahwnd, int monid, int w_w, int w_h, int t_w, int t
 
        write_log(_T("D3D11 init start. (%d*%d) (%d*%d) RTG=%d Depth=%d.\n"), w_w, w_h, t_w, t_h, ad->picasso_on, depth);
 
-       d3d->filterd3didx = ad->picasso_on;
+       d3d->filterd3didx = ad->picasso_on ? 1 : (ad->interlace_on ? 2 : 0);
        d3d->filterd3d = &currprefs.gf[d3d->filterd3didx];
 
        d3d->delayedfs = 0;
index 3c48e2945354640c62f9feca8a68e9cdde9fa80c..d76f4cff704947875a13bd3c4c89491c420ce00d 100644 (file)
 #define IDS_UNMAPPED_ADDRESS            419
 #define IDS_GENLOCK_OPTIONS             420
 #define IDS_READONLYCONFIRMATION        421
+#define IDS_SCREEN_NATIVELACE           422
 #define IDS_QS_MODELS                   1000
 #define IDS_QS_MODEL_A500               1001
 #define IDS_QS_MODEL_A500P              1002
 #define IDC_FILTERKEEPAUTOSCALEASPECT   1710
 #define IDC_CS_CIAA_TOD1                1711
 #define IDC_SOUND_VOLCNT                1711
+#define IDC_FILTERENABLE                1711
 #define IDC_CS_CIAA_TOD2                1712
 #define IDC_CS_EXT                      1712
 #define IDC_CS_CIAA_TOD3                1713
index 4fc3c9e5694a1cb97162af710ccc4c0aeec74c38..3196102dfb6cf1560bd04a92e5ba211105652d20 100644 (file)
@@ -968,6 +968,7 @@ BEGIN
     PUSHBUTTON      "Load",IDC_FILTERPRESETLOAD,205,280,55,14
     PUSHBUTTON      "Save",IDC_FILTERPRESETSAVE,265,280,55,14
     PUSHBUTTON      "Delete",IDC_FILTERPRESETDELETE,325,280,55,14
+    CONTROL         "Enabled",IDC_FILTERENABLE,"Button",BS_AUTOCHECKBOX | BS_LEFT | WS_GROUP | WS_TABSTOP,9,22,126,11
 END
 
 IDD_HARDDRIVE DIALOGEX 0, 0, 397, 219
@@ -2181,6 +2182,7 @@ BEGIN
     IDS_GENLOCK_OPTIONS     "Noise (built-in)\nTest card (built-in)\nImage file (png)\nVideo file\nCapture device\nAmerican Laser Games LaserDisc Player\nSony LaserDisc Player\nPioneer LaserDisc Player\n"
     IDS_READONLYCONFIRMATION 
                             "Selected configuration file is write protected.\nDo you want to overwrite it?\n%s\n"
+    IDS_SCREEN_NATIVELACE   "Native (Interlaced)"
 END
 
 STRINGTABLE
index 8e260fcf2620a12360cdc1f27ea1cd6814e2764b..dac544f5ab7e4f8cddb09b920ddca87b67c97fa8 100644 (file)
@@ -2139,6 +2139,14 @@ int check_prefs_changed_gfx(void)
                                gfc->changed = false;
                                c |= 16;
                        }
+               } else {
+                       struct gfx_filterdata *gfc1 = &changed_prefs.gf[0];
+                       struct gfx_filterdata *gfc2 = &changed_prefs.gf[2];
+                       if (gfc1->changed || gfc2->changed) {
+                               gfc1->changed = false;
+                               gfc2->changed = false;
+                               c |= 16;
+                       }
                }
        }
        monitors[0] = true;
@@ -2164,11 +2172,12 @@ int check_prefs_changed_gfx(void)
        c |= currprefs.gfx_api_options != changed_prefs.gfx_api_options ? (1 | 8 | 32) : 0;
        c |= currprefs.lightboost_strobo != changed_prefs.lightboost_strobo ? (2|16) : 0;
 
-       for (int j = 0; j < 2; j++) {
+       for (int j = 0; j < MAX_FILTERDATA; j++) {
                struct gfx_filterdata *gf = &currprefs.gf[j];
                struct gfx_filterdata *gfc = &changed_prefs.gf[j];
 
-               c |= gf->gfx_filter != gfc->gfx_filter ? (2|8) : 0;
+               c |= gf->gfx_filter != gfc->gfx_filter ? (2 | 8) : 0;
+               c |= gf->gfx_filter != gfc->gfx_filter ? (2 | 8) : 0;
 
                for (int i = 0; i <= 2 * MAX_FILTERSHADERS; i++) {
                        c |= _tcscmp (gf->gfx_filtershader[i], gfc->gfx_filtershader[i]) ? (2|8) : 0;
@@ -2299,7 +2308,7 @@ int check_prefs_changed_gfx(void)
                        display_change_requested = 0;
                }
 
-               for (int j = 0; j < 2; j++) {
+               for (int j = 0; j < MAX_FILTERDATA; j++) {
                        struct gfx_filterdata *gf = &currprefs.gf[j];
                        struct gfx_filterdata *gfc = &changed_prefs.gf[j];
                        memcpy(gf, gfc, sizeof(struct gfx_filterdata));
index 0bd1c1425ff19f7afc7c2c3e3bf7e6a982ab009b..d519eb02f33268af040b8aff9d650432fc0b1118 100644 (file)
@@ -19713,7 +19713,8 @@ static int filter_nativertg;
 
 static void enable_for_hw3ddlg (HWND hDlg)
 {
-       int v = workprefs.gf[filter_nativertg].gfx_filter ? TRUE : FALSE;
+       struct gfx_filterdata *gf = &workprefs.gf[filter_nativertg];
+       int v = gf->gfx_filter ? TRUE : FALSE;
        int scalemode = workprefs.gf[filter_nativertg].gfx_filter_autoscale;
        int vv = FALSE, vv2 = FALSE, vv3 = FALSE, vv4 = FALSE;
        int as = FALSE;
@@ -19738,12 +19739,20 @@ static void enable_for_hw3ddlg (HWND hDlg)
                vv2 = TRUE;
        }
        v = vv = vv2 = vv3 = vv4 = TRUE;
-       if (filter_nativertg) {
+       if (filter_nativertg == 1) {
                vv4 = FALSE;
        }
        if (scalemode == AUTOSCALE_STATIC_AUTO || scalemode == AUTOSCALE_STATIC_NOMINAL || scalemode == AUTOSCALE_STATIC_MAX)
                as = TRUE;
 
+       if (filter_nativertg == 2) {
+               ew(hDlg, IDC_FILTERENABLE, TRUE);
+               setchecked(hDlg, IDC_FILTERENABLE, gf->enable);
+       } else {
+               ew(hDlg, IDC_FILTERENABLE, FALSE);
+               setchecked(hDlg, IDC_FILTERENABLE, TRUE);
+       }
+
        ew(hDlg, IDC_FILTERHZMULT, v && !as);
        ew(hDlg, IDC_FILTERVZMULT, v && !as);
        ew(hDlg, IDC_FILTERHZ, v && vv4);
@@ -19941,7 +19950,7 @@ static void values_to_hw3ddlg (HWND hDlg, bool initdialog)
        xSendDlgItemMessage (hDlg, IDC_FILTERAUTOSCALE, CB_RESETCONTENT, 0, 0L);
        WIN32GUI_LoadUIString (IDS_AUTOSCALE_DISABLED, txt, sizeof (txt) / sizeof (TCHAR));
        xSendDlgItemMessage (hDlg, IDC_FILTERAUTOSCALE, CB_ADDSTRING, 0, (LPARAM)txt);
-       if (!filter_nativertg) {
+       if (filter_nativertg != 1) {
                WIN32GUI_LoadUIString (IDS_AUTOSCALE_DEFAULT, txt, sizeof (txt) / sizeof (TCHAR));
                xSendDlgItemMessage (hDlg, IDC_FILTERAUTOSCALE, CB_ADDSTRING, 0, (LPARAM)txt);
                WIN32GUI_LoadUIString (IDS_AUTOSCALE_TV, txt, sizeof (txt) / sizeof (TCHAR));
@@ -20028,7 +20037,15 @@ static void values_to_hw3ddlg (HWND hDlg, bool initdialog)
        xSendDlgItemMessage (hDlg, IDC_FILTERVO, TBM_SETRANGE, TRUE, MAKELONG (yrange1, yrange2));
        xSendDlgItemMessage (hDlg, IDC_FILTERVO, TBM_SETPAGESIZE, 0, 1);
 
-       xSendDlgItemMessage (hDlg, IDC_FILTER_NATIVERTG, CB_SETCURSEL, filter_nativertg, 0);
+       int v = 0;
+       if (filter_nativertg == 0) {
+               v = 0;
+       } else if (filter_nativertg == 1) {
+               v = 2;
+       } else {
+               v = 1;
+       }
+       xSendDlgItemMessage (hDlg, IDC_FILTER_NATIVERTG, CB_SETCURSEL, v, 0);
 
        xSendDlgItemMessage (hDlg, IDC_FILTERMODE, CB_RESETCONTENT, 0, 0L);
        WIN32GUI_LoadUIString (IDS_NONE, tmp, MAX_DPATH);
@@ -20037,7 +20054,7 @@ static void values_to_hw3ddlg (HWND hDlg, bool initdialog)
        fltnum = 0;
        i = 0; j = 1;
        while (uaefilters[i].name) {
-               if (filter_nativertg && uaefilters[i].type > 1) {
+               if (filter_nativertg >= 2 && uaefilters[i].type > 1) {
                        i++;
                        continue;
                }
@@ -20499,7 +20516,9 @@ static INT_PTR CALLBACK hw3dDlgProc (HWND hDlg, UINT msg, WPARAM wParam, LPARAM
 
                xSendDlgItemMessage (hDlg, IDC_FILTER_NATIVERTG, CB_RESETCONTENT, 0, 0L);
                WIN32GUI_LoadUIString (IDS_SCREEN_NATIVE, tmp, sizeof tmp / sizeof (TCHAR));
-               xSendDlgItemMessage (hDlg, IDC_FILTER_NATIVERTG, CB_ADDSTRING, 0, (LPARAM)tmp);
+               xSendDlgItemMessage(hDlg, IDC_FILTER_NATIVERTG, CB_ADDSTRING, 0, (LPARAM)tmp);
+               WIN32GUI_LoadUIString(IDS_SCREEN_NATIVELACE, tmp, sizeof tmp / sizeof(TCHAR));
+               xSendDlgItemMessage(hDlg, IDC_FILTER_NATIVERTG, CB_ADDSTRING, 0, (LPARAM)tmp);
                WIN32GUI_LoadUIString (IDS_SCREEN_RTG, tmp, sizeof tmp / sizeof (TCHAR));
                xSendDlgItemMessage (hDlg, IDC_FILTER_NATIVERTG, CB_ADDSTRING, 0, (LPARAM)tmp);
 
@@ -20585,6 +20604,7 @@ static INT_PTR CALLBACK hw3dDlgProc (HWND hDlg, UINT msg, WPARAM wParam, LPARAM
                                enable_for_hw3ddlg (hDlg);
                                values_to_hw3ddlg (hDlg, false);
                                updatedisplayarea(-1);
+                               break;
                        }
                case IDC_FILTERKEEPAUTOSCALEASPECT:
                        {
@@ -20594,6 +20614,11 @@ static INT_PTR CALLBACK hw3dDlgProc (HWND hDlg, UINT msg, WPARAM wParam, LPARAM
                                updatedisplayarea(-1);
                        }
                        break;
+               case IDC_FILTERENABLE:
+                       if (filter_nativertg == 2) {
+                               workprefs.gf[filter_nativertg].enable = ischecked(hDlg, IDC_FILTERENABLE);
+                       }
+                       break;
                default:
                        if (HIWORD (wParam) == CBN_SELCHANGE || HIWORD (wParam) == CBN_KILLFOCUS)  {
                                switch (LOWORD (wParam))
@@ -20601,7 +20626,13 @@ static INT_PTR CALLBACK hw3dDlgProc (HWND hDlg, UINT msg, WPARAM wParam, LPARAM
                                case IDC_FILTER_NATIVERTG:
                                        item = xSendDlgItemMessage (hDlg, IDC_FILTER_NATIVERTG, CB_GETCURSEL, 0, 0L);
                                        if (item != CB_ERR) {
-                                               filter_nativertg = item;
+                                               if (item == 0) {
+                                                       filter_nativertg = 0;
+                                               } else if (item == 1) {
+                                                       filter_nativertg = 2;
+                                               } else {
+                                                       filter_nativertg = 1;
+                                               }
                                                values_to_hw3ddlg (hDlg, false);
                                                enable_for_hw3ddlg (hDlg);
                                        }