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]);
}
#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)
|| 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
}
#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;
}
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;
}
}
}
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;
}
}
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) {
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;
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;
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;
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;
}
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);
}
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;
}
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;
}
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);
#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];
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;
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;
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);
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;
#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
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
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
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;
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;
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));
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;
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);
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));
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);
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;
}
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);
enable_for_hw3ddlg (hDlg);
values_to_hw3ddlg (hDlg, false);
updatedisplayarea(-1);
+ break;
}
case IDC_FILTERKEEPAUTOSCALEASPECT:
{
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))
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);
}