cfgfile_dwrite_strarr(f, _T("gfx_overscanmode"), overscanmodes, p->gfx_overscanmode);
cfgfile_dwrite(f, _T("gfx_monitorblankdelay"), _T("%d"), p->gfx_monitorblankdelay);
cfgfile_dwrite(f, _T("gfx_rotation"), _T("%d"), p->gfx_rotation);
- cfgfile_dwrite (f, _T("gfx_bordercolor"), _T("0x%08x"), p->gfx_bordercolor);
+ cfgfile_dwrite(f, _T("gfx_bordercolor"), _T("0x%08x"), p->gfx_bordercolor);
+ cfgfile_dwrite_bool(f, _T("gfx_ntscpixels"), p->gfx_ntscpixels);
#ifdef GFXFILTER
for (int j = 0; j < MAX_FILTERDATA; j++) {
|| cfgfile_intval(option, value, _T("gfx_vertical_extra"), &p->gfx_extraheight, 1)
|| cfgfile_intval(option, value, _T("gfx_monitorblankdelay"), &p->gfx_monitorblankdelay, 1)
|| cfgfile_intval(option, value, _T("gfx_bordercolor"), &p->gfx_bordercolor, 1)
+ || cfgfile_yesno(option, value, _T("gfx_ntscpixels"), &p->gfx_ntscpixels)
|| cfgfile_intval (option, value, _T("floppy0sound"), &p->floppyslots[0].dfxclick, 1)
|| cfgfile_intval (option, value, _T("floppy1sound"), &p->floppyslots[1].dfxclick, 1)
f->enable = true;
}
p->gf[2].enable = false;
+ p->gfx_ntscpixels = 1;
p->rtg_horiz_zoom_mult = 1.0;
p->rtg_vert_zoom_mult = 1.0;
bool ispal(int *lines)
{
if (lines) {
- *lines = current_linear_vpos_visible;
+ if (current_linear_vpos_visible) {
+ *lines = current_linear_vpos_visible;
+ } else {
+ *lines = currprefs.ntscmode ? (MAXVPOS_NTSC + 1) - (VBLANK_ENDLINE_NTSC - 1) : (MAXVPOS_PAL + 1) - (VBLANK_ENDLINE_PAL - 1);
+ }
}
if (programmedmode == 1) {
return currprefs.ntscmode == 0;
}
- return current_linear_vpos_nom >= MAXVPOS_NTSC + (MAXVPOS_PAL - MAXVPOS_NTSC) / 2;
+ if (current_linear_vpos_nom) {
+ return current_linear_vpos_nom >= MAXVPOS_NTSC + (MAXVPOS_PAL - MAXVPOS_NTSC) / 2;
+ }
+ return currprefs.ntscmode == 0;
}
void custom_end_drawing(void)
int gfx_overscanmode;
int gfx_monitorblankdelay;
int gfx_rotation;
- int gfx_ntscpixels;
+ bool gfx_ntscpixels;
uae_u32 gfx_bordercolor;
struct gfx_filterdata gf[3];
#define IDC_LM_IDOUBLED3 1200
#define IDC_CPU0 1200
#define IDC_CPU1 1201
+#define IDC_SCALENTSC 1201
#define IDC_CPU2 1202
#define IDC_CPU3 1203
#define IDC_CPU4 1204
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 "Always stretch NTSC mode [] NTSC modes are strecthed to match PAL mode",IDC_SCALENTSC,
+ "Button",BS_AUTOCHECKBOX | WS_TABSTOP,14,231,125,10
END
IDD_HARDDRIVE DIALOGEX 0, 0, 397, 208
#include <float.h>
-#define AUTORESIZE_FRAME_DELAY 10
+#define AUTORESIZE_FRAME_DELAY 4
static float filteroffsetx, filteroffsety, filterxmult = 1.0, filterymult = 1.0;
return false;
}
+static float getpalntscratio(float dstratio, int keep_aspect, int palntscadjust)
+{
+ int lh = 0;
+ bool isp = ispal(&lh);
+ float palntscratio = dstratio;
+ if (lh > 1) {
+ float palh = (313 - 25) * 2 + 1.0f;
+ float ntsch = (263 - 20) * 2 + 1.0f;
+ float ll = lh * 2 + 1.0f;
+ if (abs(lh - (263 - 20)) <= 22) {
+ ll = ntsch;
+ }
+ if (abs(lh - (313 - 25)) <= 22) {
+ ll = palh;
+ }
+ if (currprefs.ntscmode) {
+ if (palntscadjust && !isp) {
+ palntscratio = palntscratio * palh / ll;
+ }
+ if (keep_aspect == 2 && isp) {
+ palntscratio = palntscratio * 0.93f;
+ } else if (keep_aspect == 1 && !isp) {
+ palntscratio = palntscratio * 0.98f;
+ }
+ } else {
+ if (palntscadjust && !isp) {
+ palntscratio = palntscratio * palh / ll;
+ }
+ if (keep_aspect == 2 && isp) {
+ palntscratio = palntscratio * 0.95f;
+ } else if (keep_aspect == 1 && !isp) {
+ palntscratio = palntscratio * 0.95f;
+ }
+ }
+ }
+ return palntscratio;
+}
+
static bool get_aspect(int monid, float *dstratiop, float *srcratiop, float *xmultp, float *ymultp, bool doautoaspect, float autoaspectratio, int keep_aspect, int filter_aspect)
{
struct amigadisplay *ad = &adisplays[monid];
int idx = ad->gf_index;
int keep_aspect = currprefs.gf[idx].gfx_filter_keep_aspect;
int filter_aspect = currprefs.gf[idx].gfx_filter_aspect;
- int palntscadjust = 1;
+ int palntscadjust = currprefs.gfx_ntscpixels;
int autoselect = 0;
float filter_horiz_zoom = currprefs.gf[idx].gfx_filter_horiz_zoom / 1000.0f;
if (!specialmode && scalemode == AUTOSCALE_STATIC_AUTO) {
filter_aspect = 0;
keep_aspect = 0;
- palntscadjust = 1;
if (ds->dstwidth >= 640 && ds->dstwidth <= 800 && ds->dstheight >= 480 && ds->dstheight <= 600 && !programmedmode) {
autoselect = 1;
scalemode = AUTOSCALE_NONE;
if (scalemode == AUTOSCALE_CENTER) {
- int ww = cw * ds->scale;
- int hh = ch * ds->scale;
+ int scalex = ds->scale;
+ int scaley = ds->scale;
+
+ int ww = cw * scalex;
+ int hh = ch * scaley;
ds->outwidth = ds->dstwidth * ds->scale;
ds->outheight = ds->dstheight * ds->scale;
float scalex = currprefs.gf[idx].gfx_filter_horiz_zoom_mult > 0 ? currprefs.gf[idx].gfx_filter_horiz_zoom_mult : 1.0f;
float scaley = currprefs.gf[idx].gfx_filter_vert_zoom_mult > 0 ? currprefs.gf[idx].gfx_filter_vert_zoom_mult : 1.0f;
+ float palntscratio = getpalntscratio(dstratio, keep_aspect, palntscadjust);
+ scaley = scaley * palntscratio / dstratio;
+
ds->outwidth = (int)(cw * ds->scale);
ds->outheight = (int)(ch * ds->scale);
ds->xoffset += cx * ds->scale;
gmh->gfx_size_win.width = ww;
gmh->gfx_size_win.height = hh;
fixup_prefs_dimensions (&changed_prefs);
- if (oldwinw != gmh->gfx_size_win.width || oldwinh != gmh->gfx_size_win.height)
+ if (oldwinw != gmh->gfx_size_win.width || oldwinh != gmh->gfx_size_win.height) {
set_config_changed ();
+ }
}
ds->xoffset += -(gmh->gfx_size_win.width - ww + 1) / 2;
ds->yoffset += -(gmh->gfx_size_win.height - hh + 1) / 2;
}
{
- int lh = 0;
- bool isp = ispal(&lh);
- if (lh > 1) {
- float palntscratio = dstratio;
- float palh = (312 - 25) * 2 + 1.0f;
- float ntsch = (262 - 20) * 2 + 1.0f;
- float ll = (lh - 23) * 2 + 1.0f;
- if (abs(lh - (262 - 20)) <= 22) {
- ll = ntsch;
- }
- if (abs(lh - (312 - 25)) <= 22) {
- ll = palh;
- }
- if (currprefs.gfx_ntscpixels) {
- if (!isp) {
- palntscratio = palntscratio * palh / ll;
- }
- if (currprefs.ntscmode) {
- if (keep_aspect == 2 && isp) {
- palntscratio = palntscratio * 0.93f;
- }
- else if (keep_aspect == 1 && !isp) {
- palntscratio = palntscratio * 0.98f;
- }
- } else {
- if (keep_aspect == 2 && isp) {
- palntscratio = palntscratio * 0.95f;
- }
- else if (keep_aspect == 1 && !isp) {
- palntscratio = palntscratio * 0.95f;
- }
- }
- } else {
- if (currprefs.ntscmode) {
- if (palntscadjust && isp) {
- palntscratio = palntscratio * ntsch / ll;
- }
- if (keep_aspect == 2 && isp) {
- palntscratio = palntscratio * 0.93f;
- } else if (keep_aspect == 1 && !isp) {
- palntscratio = palntscratio * 0.98f;
- }
- } else {
- if (palntscadjust && !isp) {
- palntscratio = palntscratio * palh / ll;
- }
- if (keep_aspect == 2 && isp) {
- palntscratio = palntscratio * 0.95f;
- } else if (keep_aspect == 1 && !isp) {
- palntscratio = palntscratio * 0.95f;
- }
- }
- }
- if (palntscratio != dstratio) {
- ymult = ymult * palntscratio / dstratio;
- }
- }
+ float palntscratio = getpalntscratio(dstratio, keep_aspect, palntscadjust);
+ ymult = ymult * palntscratio / dstratio;
}
if (srcratio > dstratio) {
c |= currprefs.gfx_scandoubler != changed_prefs.gfx_scandoubler ? (2 | 8) : 0;
c |= currprefs.gfx_threebitcolors != changed_prefs.gfx_threebitcolors ? (256) : 0;
c |= currprefs.gfx_grayscale != changed_prefs.gfx_grayscale ? (512) : 0;
+ c |= currprefs.gfx_ntscpixels != changed_prefs.gfx_ntscpixels ? (512) : 0;
c |= currprefs.gfx_monitorblankdelay != changed_prefs.gfx_monitorblankdelay ? (512) : 0;
c |= currprefs.gfx_display_sections != changed_prefs.gfx_display_sections ? (512) : 0;
currprefs.gfx_scandoubler = changed_prefs.gfx_scandoubler;
currprefs.gfx_threebitcolors = changed_prefs.gfx_threebitcolors;
currprefs.gfx_grayscale = changed_prefs.gfx_grayscale;
+ currprefs.gfx_ntscpixels = changed_prefs.gfx_ntscpixels;
currprefs.gfx_monitorblankdelay = changed_prefs.gfx_monitorblankdelay;
currprefs.gfx_display_sections = changed_prefs.gfx_display_sections;
case IDC_HF_TYPE:
res = xSendDlgItemMessage (hDlg, IDC_HF_TYPE, CB_GETCURSEL, 0, 0);
sethfdostype (hDlg, (int)res);
- ew (hDlg, IDC_HF_DOSTYPE, res >= 4);
+ ew (hDlg, IDC_HF_DOSTYPE, res >= 5);
break;
case IDC_HF_CREATE:
{
CheckDlgButton (hDlg, IDC_FILTERKEEPASPECT, workprefs.gf[filter_nativertg].gfx_filter_keep_aspect);
CheckDlgButton (hDlg, IDC_FILTERKEEPAUTOSCALEASPECT, workprefs.gf[filter_nativertg].gfx_filter_keep_autoscale_aspect != 0);
+ CheckDlgButton(hDlg, IDC_SCALENTSC, workprefs.gfx_ntscpixels);
xSendDlgItemMessage (hDlg, IDC_FILTERASPECT2, CB_SETCURSEL,
workprefs.gf[filter_nativertg].gfx_filter_keep_aspect, 0);
case IDC_FILTERPRESETDELETE:
filter_preset (hDlg, wParam);
break;
+ case IDC_SCALENTSC:
+ currprefs.gfx_ntscpixels = workprefs.gfx_ntscpixels = ischecked(hDlg, IDC_SCALENTSC);
+ enable_for_hw3ddlg(hDlg);
+ values_to_hw3ddlg(hDlg, false);
+ updatedisplayarea(-1);
+ break;
case IDC_FILTERKEEPASPECT:
{
if (ischecked (hDlg, IDC_FILTERKEEPASPECT))