From f45cf97dc6a5b5a29d8fa8d9dd93f12af92bd252 Mon Sep 17 00:00:00 2001 From: Toni Wilen Date: Sun, 6 Nov 2022 18:55:13 +0200 Subject: [PATCH] Interlace filter config --- cfgfile.cpp | 65 ++++++++++++++++++++++------------- custom.cpp | 4 +-- drawing.cpp | 18 +++++++++- include/drawing.h | 4 +-- include/options.h | 4 ++- include/xwin.h | 1 + od-win32/direct3d.cpp | 2 +- od-win32/direct3d11.cpp | 2 +- od-win32/resources/resource.h | 2 ++ od-win32/resources/winuae.rc | 2 ++ od-win32/win32gfx.cpp | 15 ++++++-- od-win32/win32gui.cpp | 45 ++++++++++++++++++++---- 12 files changed, 122 insertions(+), 42 deletions(-) diff --git a/cfgfile.cpp b/cfgfile.cpp index 9bee6815..c183e54f 100644 --- a/cfgfile.cpp +++ b/cfgfile.cpp @@ -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 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; diff --git a/custom.cpp b/custom.cpp index 36bb700b..2dc95fe4 100644 --- a/custom.cpp +++ b/custom.cpp @@ -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); } diff --git a/drawing.cpp b/drawing.cpp index 702fc3c5..9d01e72f 100644 --- a/drawing.cpp +++ b/drawing.cpp @@ -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; } diff --git a/include/drawing.h b/include/drawing.h index 20ab9a5a..4cbc83ca 100644 --- a/include/drawing.h +++ b/include/drawing.h @@ -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); diff --git a/include/options.h b/include/options.h index 1a73edac..f173b811 100644 --- a/include/options.h +++ b/include/options.h @@ -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; diff --git a/include/xwin.h b/include/xwin.h index fb538986..d28f6aa2 100644 --- a/include/xwin.h +++ b/include/xwin.h @@ -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; diff --git a/od-win32/direct3d.cpp b/od-win32/direct3d.cpp index dc4d1c0c..fbde1207 100644 --- a/od-win32/direct3d.cpp +++ b/od-win32/direct3d.cpp @@ -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); diff --git a/od-win32/direct3d11.cpp b/od-win32/direct3d11.cpp index 246a2c7d..5f1ea3bc 100644 --- a/od-win32/direct3d11.cpp +++ b/od-win32/direct3d11.cpp @@ -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; diff --git a/od-win32/resources/resource.h b/od-win32/resources/resource.h index 3c48e294..d76f4cff 100644 --- a/od-win32/resources/resource.h +++ b/od-win32/resources/resource.h @@ -414,6 +414,7 @@ #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 @@ -1078,6 +1079,7 @@ #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 diff --git a/od-win32/resources/winuae.rc b/od-win32/resources/winuae.rc index 4fc3c9e5..3196102d 100644 --- a/od-win32/resources/winuae.rc +++ b/od-win32/resources/winuae.rc @@ -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 diff --git a/od-win32/win32gfx.cpp b/od-win32/win32gfx.cpp index 8e260fcf..dac544f5 100644 --- a/od-win32/win32gfx.cpp +++ b/od-win32/win32gfx.cpp @@ -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)); diff --git a/od-win32/win32gui.cpp b/od-win32/win32gui.cpp index 0bd1c142..d519eb02 100644 --- a/od-win32/win32gui.cpp +++ b/od-win32/win32gui.cpp @@ -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); } -- 2.47.3