cfgfile_dwrite (f, "gfx_filter_blur=%d\n", p->gfx_filter_blur);
cfgfile_dwrite (f, "gfx_filter_noise=%d\n", p->gfx_filter_noise);
cfgfile_dwrite (f, "gfx_filter_keep_aspect=%s\n", p->gfx_filter_keep_aspect ? "true" : "false");
+ cfgfile_dwrite (f, "gfx_autoscale=%s\n", p->gfx_filter_autoscale ? "true" : "false");
cfgfile_dwrite (f, "gfx_filter_aspect_ratio=%d:%d\n",
p->gfx_filter_aspect >= 0 ? (p->gfx_filter_aspect >> 8) : -1,
p->gfx_filter_aspect >= 0 ? (p->gfx_filter_aspect & 0xff) : -1);
|| cfgfile_intval (option, value, "gfx_filter_blur", &p->gfx_filter_blur, 1)
|| cfgfile_intval (option, value, "gfx_filter_noise", &p->gfx_filter_noise, 1)
|| cfgfile_yesno (option, value, "gfx_filter_keep_aspect", &p->gfx_filter_keep_aspect)
+ || cfgfile_yesno (option, value, "gfx_filter_autoscale", &p->gfx_filter_autoscale)
|| cfgfile_intval (option, value, "gfx_luminance", &p->gfx_luminance, 1)
|| cfgfile_intval (option, value, "gfx_contrast", &p->gfx_contrast, 1)
|| cfgfile_intval (option, value, "gfx_gamma", &p->gfx_gamma, 1)
p->gfx_filter_vert_zoom_mult = 0;
p->gfx_filter_filtermode = 0;
p->gfx_filter_scanlineratio = (1 << 4) | 1;
- p->gfx_filter_keep_aspect = 0;
+ p->gfx_filter_keep_aspect = 1;
p->gfx_filter_autoscale = 1;
strcpy (p->df[0], "df0.adf");
DIW_waiting_start, DIW_waiting_stop
};
-int plffirstline, plflastline;
+static int plffirstline, plflastline;
+int plffirstline_total, plflastline_total;
static int plfstrt_start, plfstrt, plfstop;
static int sprite_minx, sprite_maxx;
static int first_bpl_vpos;
static int last_diw_pix_hpos, last_ddf_pix_hpos;
static int last_decide_line_hpos, last_sprite_decide_line_hpos;
static int last_fetch_hpos, last_sprite_hpos;
-int diwfirstword, diwlastword;
+static int diwfirstword, diwlastword;
static enum diw_states diwstate, hdiwstate, ddfstate;
int first_planes_vpos, last_planes_vpos;
+int diwfirstword_total, diwlastword_total;
/* Sprite collisions */
static unsigned int clxdat, clxcon, clxcon2, clxcon_bpl_enable, clxcon_bpl_match;
record_sprite (next_lineno, nr, posns[i], sprdata[nr], sprdatb[nr], sprctl[nr]);
}
last_sprite_point = point;
+
+ if (bplcon3 & 2) {
+ if (vpos < first_planes_vpos || first_planes_vpos == 0)
+ first_planes_vpos = vpos;
+ if (vpos < plffirstline_total)
+ plffirstline_total = vpos;
+ if (vpos > last_planes_vpos)
+ last_planes_vpos = vpos;
+ if (vpos > plflastline_total)
+ plflastline_total = vpos;
+ }
}
STATIC_INLINE int sprites_differ (struct draw_info *dip, struct draw_info *dip_old)
ddfstate = DIW_waiting_start;
first_planes_vpos = 0;
last_planes_vpos = 0;
+ diwfirstword_total = max_diwlastword;
+ diwlastword_total = 0;
+ plflastline_total = 0;
+ plffirstline_total = maxvpos;
}
void init_hardware_for_drawing_frame (void)
hsync_counter++;
//copper_check (2);
+
if (vpos == minfirstline) {
if (GET_PLANES (bplcon0) > 0)
first_planes_vpos = minfirstline;
if (GET_PLANES (bplcon0) > 0)
last_planes_vpos = vpos - 1;
}
+ if (vpos >= first_planes_vpos && vpos <= last_planes_vpos) {
+ if (diwlastword > diwlastword_total)
+ diwlastword_total = diwlastword;
+ if (diwfirstword < diwfirstword_total)
+ diwfirstword_total = diwfirstword;
+ }
+ if (plffirstline < plffirstline_total)
+ plffirstline_total = plffirstline;
+ if (plflastline > plflastline_total)
+ plflastline_total = plflastline;
+
#if 0
{
}
-extern int plffirstline, plflastline;
+extern int plffirstline_total, plflastline_total;
extern int first_planes_vpos, last_planes_vpos;
+extern int diwfirstword_total, diwlastword_total;
#define MIN_DISPLAY_W 256
#define MIN_DISPLAY_H 192
#define MAX_DISPLAY_W 344
#define MAX_DISPLAY_H 272
+static int gclow, gcloh, gclox, gcloy;
+
int get_custom_limits (int *pw, int *ph, int *pdx, int *pdy)
{
int w, h, dx, dy, y1, y2, dbl1, dbl2;
- static int ow, oh, ox, oy;
int ret = 0;
- *pw = ow;
- *ph = oh;
- *pdx = ox;
- *pdy = oy;
+ *pw = gclow;
+ *ph = gcloh;
+ *pdx = gclox;
+ *pdy = gcloy;
- if (ow > 0 && oh > 0)
+ if (gclow > 0 && gcloh > 0)
ret = -1;
- w = diwlastword - diwfirstword;
- dx = diwfirstword - visible_left_border;
- y2 = plflastline > last_planes_vpos ? last_planes_vpos : plflastline;
- y1 = plffirstline > first_planes_vpos ? plffirstline : first_planes_vpos;
+ w = diwlastword_total - diwfirstword_total;
+ dx = diwfirstword_total - visible_left_border;
+ y2 = plflastline_total > last_planes_vpos ? last_planes_vpos : plflastline_total;
+ y1 = plffirstline_total > first_planes_vpos ? plffirstline_total: first_planes_vpos;
if (y1 < minfirstline)
y1 = first_planes_vpos;
h = y2 - y1;
- dy = plffirstline - minfirstline;
+ dy = plffirstline_total - minfirstline;
if (dy < 0)
dy = first_planes_vpos - minfirstline;
if (w == 0 || h == 0)
return 0;
- if (ow == w && oh == h && ox == dx && oy == dy)
- return ret;
-
- if (w <= 0 || h <= 0 || dx <= 0 || dy <= 0)
- return ret;
- if (dx > gfxvidinfo.width / 4)
- return ret;
- if (dy > gfxvidinfo.height / 4)
- return ret;
-
if ((w >> currprefs.gfx_resolution) < MIN_DISPLAY_W)
w = MIN_DISPLAY_W << currprefs.gfx_resolution;
if ((h >> dbl1) < MIN_DISPLAY_H)
if ((h >> dbl1) > MAX_DISPLAY_H)
h = MAX_DISPLAY_H << dbl1;
- ow = w;
- oh = h;
- ox = dx;
- oy = dy;
+ if (gclow == w && gcloh == h && gclox == dx && gcloy == dy)
+ return ret;
+
+ if (w <= 0 || h <= 0 || dx <= 0 || dy <= 0)
+ return ret;
+ if (dx > gfxvidinfo.width / 4)
+ return ret;
+ if (dy > gfxvidinfo.height / 4)
+ return ret;
+
+ gclow = w;
+ gcloh = h;
+ gclox = dx;
+ gcloy = dy;
*pw = w;
*ph = h;
*pdx = dx;
*pdy = dy;
+
+ write_log ("%dx%d %dx%d\n", w, h, dx, dy);
return 1;
}
{
int w, h, dx, dy, dbl1, dbl2, y1, y2;
- w = diwlastword - diwfirstword;
- dx = diwfirstword - visible_left_border;
- y2 = plflastline > last_planes_vpos ? last_planes_vpos : plflastline;
- y1 = plffirstline > first_planes_vpos ? plffirstline : first_planes_vpos;
+ w = diwlastword_total - diwfirstword_total;
+ dx = diwfirstword_total - visible_left_border;
+ y2 = plflastline_total > last_planes_vpos ? last_planes_vpos : plflastline_total;
+ y1 = plffirstline_total > first_planes_vpos ? plffirstline_total : first_planes_vpos;
h = y2 - y1;
- dy = plffirstline - minfirstline;
+ dy = plffirstline_total - minfirstline;
if (*pw > 0)
w = *pw;
sprite_buffer_res = currprefs.gfx_resolution;
if (doublescan > 0 && sprite_buffer_res < RES_SUPERHIRES)
sprite_buffer_res++;
+
+ gclow = gcloh = gclox = gcloy = 0;
}
void drawing_init (void)
{
fixup_prefs_dim2 (&prefs->gfx_size_fs);
fixup_prefs_dim2 (&prefs->gfx_size_win);
- if (prefs->gfx_filter == 0) {
+ if (prefs->gfx_filter == 0 && prefs->gfx_filter_autoscale)
prefs->gfx_filter = 1;
- prefs->gfx_filter_horiz_zoom = 0;
- prefs->gfx_filter_vert_zoom = 0;
- prefs->gfx_filtershader[0] = 0;
+ if (prefs->gfx_filter_autoscale) {
prefs->gfx_filter_horiz_zoom_mult = 0;
prefs->gfx_filter_vert_zoom_mult = 0;
- prefs->gfx_filter_filtermode = 0;
- prefs->gfx_filter_autoscale = 1;
- prefs->gfx_filter_keep_aspect = 0;
}
}
#define WINUAEPUBLICBETA 1
-#define WINUAEBETA "5"
+#define WINUAEBETA "6"
#define WINUAEDATE MAKEBD(2008, 12, 26)
#define WINUAEEXTRA ""
#define WINUAEREV ""
if (xratio > yratio) {
diff = diffx - diffx * yratio / xratio;
- dr->right += diff;
- dr->left -= diff;
+ dr->right += diff / 2;
+ dr->left -= diff / 2;
} else {
diff = diffx - diffx * xratio / yratio;
- dr->bottom += diff;
- dr->top -= diff;
+ dr->bottom += diff / 2;
+ dr->top -= diff / 2;
}
}
diff = dr->right - dr->left;
vv3 = TRUE;
if (v && uf->x[0])
vv4 = TRUE;
-// ew (hDlg, IDC_FILTERENABLE, TRUE);
- ew (hDlg, IDC_FILTERMODE, v);
-// CheckDlgButton (hDlg, IDC_FILTERENABLE, v);
ew (hDlg, IDC_FILTERHZ, v);
ew (hDlg, IDC_FILTERVZ, v);
ew (hDlg, IDC_FILTERHZMULT, v && !as);
ew (hDlg, IDC_FILTERFILTER, vv);
ew (hDlg, IDC_FILTERKEEPASPECT, v);
ew (hDlg, IDC_FILTERASPECT, v);
- ew (hDlg, IDC_FILTERAUTORES, v);
ew (hDlg, IDC_FILTERPRESETSAVE, filterpreset_builtin < 0);
ew (hDlg, IDC_FILTERPRESETLOAD, filterpreset_selected > 0);
SendDlgItemMessage (hDlg, IDC_FILTERVO, TBM_SETPAGESIZE, 0, 1);
SendDlgItemMessage (hDlg, IDC_FILTERMODE, CB_RESETCONTENT, 0, 0L);
+ WIN32GUI_LoadUIString (IDS_NONE, tmp, MAX_DPATH);
+ SendDlgItemMessage (hDlg, IDC_FILTERMODE, CB_ADDSTRING, 0, (LPARAM)tmp);
uf = &uaefilters[0];
nofilter = 0; fltnum = 0;
- i = 0; j = 0;
+ i = 0; j = 1;
while (uaefilters[i].name) {
switch (uaefilters[i].type)
{
tmp[0] = 0;
SendDlgItemMessage (hDlg, IDC_FILTERMODE, CB_GETLBTEXT, (WPARAM)item, (LPARAM)tmp);
workprefs.gfx_filtershader[0] = 0;
- if (item > UAE_FILTER_PAL) {
- item = UAE_FILTER_DIRECT3D - 1;
- sprintf (workprefs.gfx_filtershader, "%s.fx", tmp + 5);
- }
- workprefs.gfx_filter = 1;
- if (1) { //IsDlgButtonChecked (hDlg, IDC_FILTERENABLE)) {
+ workprefs.gfx_filter = 0;
+ if (item > 0) {
+ item--;
+ if (item > UAE_FILTER_PAL) {
+ item = UAE_FILTER_DIRECT3D - 1;
+ sprintf (workprefs.gfx_filtershader, "%s.fx", tmp + 5);
+ }
workprefs.gfx_filter = uaefilters[item].type;
item = SendDlgItemMessage (hDlg, IDC_FILTERFILTER, CB_GETCURSEL, 0, 0L);
if (item != CB_ERR)
switch (msg)
{
case WM_INITDIALOG:
- //ShowWindow (GetDlgItem(hDlg, IDC_FILTERAUTORES), SW_HIDE);
pages[HW3D_ID] = hDlg;
currentpage = HW3D_ID;
SendDlgItemMessage (hDlg, IDC_FILTERASPECT, CB_RESETCONTENT, 0, 0);
filter_preset (hDlg, wParam);
recursive++;
break;
-// case IDC_FILTERENABLE:
-// filter_handle (hDlg);
-// break;
case IDC_FILTERAUTORES:
workprefs.gfx_filter_autoscale = IsDlgButtonChecked (hDlg, IDC_FILTERAUTORES);
+ if (workprefs.gfx_filter_autoscale && workprefs.gfx_filter == 0)
+ workprefs.gfx_filter = 1;
+ values_to_hw3ddlg (hDlg);
+ enable_for_hw3ddlg (hDlg);
break;
case IDC_FILTERKEEPASPECT:
currprefs.gfx_filter_keep_aspect = workprefs.gfx_filter_keep_aspect = IsDlgButtonChecked (hDlg, IDC_FILTERKEEPASPECT);
+
+Beta 6:
+
+- Spheris Legacy top/bottom border autoscaling fixed
+- screen width checking only stored final display size before vblank
+ (game with wide gamescreen and narrow scoreboard at the bottom would
+ have used scoreboard's width)
+- autoscale saved to config file
+- non-filtered mode is back but enabling autoscale will automatically
+ enable null filter if current selection was no filter
+
Beta 5: WARNING: big changes. 1.6 version change expected.
- KS loader 16-bit odd/even rom image to 32-bit merging fixed