init_custom ();
}
#ifdef GFXFILTER
- currprefs.gf[0].gfx_filter_horiz_zoom = changed_prefs.gf[0].gfx_filter_horiz_zoom;
- currprefs.gf[0].gfx_filter_vert_zoom = changed_prefs.gf[0].gfx_filter_vert_zoom;
- currprefs.gf[0].gfx_filter_horiz_offset = changed_prefs.gf[0].gfx_filter_horiz_offset;
- currprefs.gf[0].gfx_filter_vert_offset = changed_prefs.gf[0].gfx_filter_vert_offset;
- currprefs.gf[0].gfx_filter_scanlines = changed_prefs.gf[0].gfx_filter_scanlines;
+ struct gfx_filterdata *fd = &currprefs.gf[0];
+ struct gfx_filterdata *fdcp = &changed_prefs.gf[0];
+
+ fd->gfx_filter_horiz_zoom = fdcp->gfx_filter_horiz_zoom;
+ fd->gfx_filter_vert_zoom = fdcp->gfx_filter_vert_zoom;
+ fd->gfx_filter_horiz_offset = fdcp->gfx_filter_horiz_offset;
+ fd->gfx_filter_vert_offset = fdcp->gfx_filter_vert_offset;
+ fd->gfx_filter_scanlines = fdcp->gfx_filter_scanlines;
+
+ fd->gfx_filter_left_border = fdcp->gfx_filter_left_border;
+ fd->gfx_filter_right_border = fdcp->gfx_filter_right_border;
+ fd->gfx_filter_top_border = fdcp->gfx_filter_top_border;
+ fd->gfx_filter_bottom_border = fdcp->gfx_filter_bottom_border;
#endif
}
#endif
-bool ispal (void)
+bool isvga(void)
+{
+ if (!(beamcon0 & 0x80))
+ return false;
+ if (hblank_hz >= 20000)
+ return true;
+ return false;
+}
+
+bool ispal(void)
{
if (beamcon0 & 0x80)
return currprefs.ntscmode == 0;
}
}
+void check_custom_limits(void)
+{
+ int vls = visible_left_start;
+ int vrs = visible_right_stop;
+ int vts = visible_top_start;
+ int vbs = visible_bottom_stop;
+
+ struct gfx_filterdata *fd = &currprefs.gf[0];
+ int left = fd->gfx_filter_left_border >> (RES_MAX - currprefs.gfx_resolution);
+ int right = fd->gfx_filter_right_border >> (RES_MAX - currprefs.gfx_resolution);
+ int top = fd->gfx_filter_top_border;
+ int bottom = fd->gfx_filter_bottom_border;
+
+ if (left > visible_left_start)
+ visible_left_start = left;
+ if (right > left && right < visible_right_stop)
+ visible_right_stop = right;
+
+ if (top > visible_top_start)
+ visible_top_start = top;
+ if (bottom > top && bottom < visible_bottom_stop)
+ visible_bottom_stop = bottom;
+
+ set_blanking_limits ();
+}
+
void set_custom_limits (int w, int h, int dx, int dy)
{
int vls = visible_left_start;
visible_top_start = min_ypos_for_screen + dy;
visible_bottom_stop = visible_top_start + h;
}
+
if (vls != visible_left_start || vrs != visible_right_stop ||
vts != visible_top_start || vbs != visible_bottom_stop)
notice_screen_contents_lost ();
- set_blanking_limits ();
+
+ check_custom_limits();
}
void store_custom_limits (int w, int h, int x, int y)
}
}
-static void fill_line_border (void)
+static void fill_line_border (int lineno)
{
int lastpos = visible_left_border;
int endpos = visible_left_border + gfxvidinfo.drawbuffer.inwidth;
+ if (lineno < visible_top_start || lineno >= visible_bottom_stop) {
+ int b = hposblank;
+ hposblank = 3;
+ fill_line2(lastpos, gfxvidinfo.drawbuffer.inwidth);
+ hposblank = b;
+ return;
+ }
+
// full hblank
if (hposblank) {
hposblank = 3;
// blanked border line
int tmp = hposblank;
hposblank = 1;
- fill_line_border ();
+ fill_line_border(lineno);
hposblank = tmp;
} else {
// normal border line
- fill_line_border ();
+ fill_line_border(lineno);
}
do_flush_line (vb, gfx_ypos);
if (do_double) {
if (dh == dh_buf) {
xlinebuffer = row_map[follow_ypos] - linetoscr_x_adjust_bytes;
- fill_line_border ();
+ fill_line_border(lineno);
}
/* If dh == dh_line, do_flush_line will re-use the rendered line
* from linemem. */
// top or bottom blanking region
int tmp = hposblank;
hposblank = 1;
- fill_line_border ();
+ fill_line_border(lineno);
hposblank = tmp;
do_flush_line(vb, gfx_ypos);
gfxvidinfo.drawbuffer.xoffset = (DISPLAY_LEFT_SHIFT << RES_MAX) + (visible_left_border << (RES_MAX - currprefs.gfx_resolution));
gfxvidinfo.drawbuffer.yoffset = thisframe_y_adjust << VRES_MAX;
- struct gfx_filterdata *f = &currprefs.gf[0];
- if (f->gfx_filter_left_border > 0 && f->gfx_filter_left_border > visible_left_border)
- visible_left_border = f->gfx_filter_left_border;
- if (f->gfx_filter_right_border > 0 && f->gfx_filter_right_border < visible_right_border)
- visible_right_border = f->gfx_filter_right_border;
- if (f->gfx_filter_top_border > 0 && f->gfx_filter_top_border > visible_top_start)
- visible_top_start = f->gfx_filter_top_border;
- if (f->gfx_filter_bottom_border > 0 && f->gfx_filter_bottom_border < visible_bottom_stop)
- visible_bottom_stop = f->gfx_filter_bottom_border;
-
center_reset = false;
horizontal_changed = false;
vertical_changed = false;
int scalemode = currprefs.gf[picasso_on].gfx_filter_autoscale;
int oscalemode = changed_prefs.gf[picasso_on].gfx_filter_autoscale;
+ if (scalemode == AUTOSCALE_OVERSCAN_BLANK) {
+ oscalemode = scalemode = AUTOSCALE_NONE;
+ }
if (!specialmode && scalemode == AUTOSCALE_STATIC_AUTO) {
if (currprefs.gfx_apmode[0].gfx_fullscreen) {
if (currprefs.gf[picasso_on].gfx_filter_keep_aspect || currprefs.gf[picasso_on].gfx_filter_aspect != 0) {
if (currprefs.gf[picasso_on].gfx_filter_keep_aspect) {
- if (currprefs.ntscmode) {
- dstratio = dstratio * 1.21f;
- if (currprefs.gf[picasso_on].gfx_filter_keep_aspect == 2 && ispal ())
+ if (isvga()) {
+ if (currprefs.gf[picasso_on].gfx_filter_keep_aspect == 1)
dstratio = dstratio * 0.93f;
- else if (currprefs.gf[picasso_on].gfx_filter_keep_aspect == 1 && !ispal ())
- dstratio = dstratio * 0.98f;
} else {
- if (currprefs.gf[picasso_on].gfx_filter_keep_aspect == 2 && ispal ())
- dstratio = dstratio * 0.95f;
- else if (currprefs.gf[picasso_on].gfx_filter_keep_aspect == 1 && !ispal ())
- dstratio = dstratio * 0.95f;
+ if (currprefs.ntscmode) {
+ dstratio = dstratio * 1.21f;
+ if (currprefs.gf[picasso_on].gfx_filter_keep_aspect == 2 && ispal ())
+ dstratio = dstratio * 0.93f;
+ else if (currprefs.gf[picasso_on].gfx_filter_keep_aspect == 1 && !ispal ())
+ dstratio = dstratio * 0.98f;
+ } else {
+ if (currprefs.gf[picasso_on].gfx_filter_keep_aspect == 2 && ispal ())
+ dstratio = dstratio * 0.95f;
+ else if (currprefs.gf[picasso_on].gfx_filter_keep_aspect == 1 && !ispal ())
+ dstratio = dstratio * 0.95f;
+ }
}
}
aspect = true;
OffsetRect (dr, mrsx, mrsy);
}
+ check_custom_limits();
+
fpux_restore (&fpuv);
#if 0