ArcadeVGA cards can still work as expected also integer aspect ration can be as well maintained. All You have to do is use cleanstretch hack from cabmame and/or apply/fix code from ddraw part:
Code:
-//============================================================ // compute_blit_surface_size //============================================================
void renderer_dd::compute_blit_surface_size() { INT32 newwidth, newheight; int xscale, yscale; RECT client;
// start with the minimum size window().target()->compute_minimum_size(newwidth, newheight);
// get the window's client rectangle GetClientRect(window().m_hwnd, &client);
// hardware stretch case: apply prescale if (video_config.hwstretch) { int prescale = (window().prescale() < 1) ? 1 : window().prescale();
// clamp the prescale to something smaller than the target bounds xscale = prescale; while (xscale > 1 && newwidth * xscale > rect_width(&client)) xscale--; yscale = prescale; while (yscale > 1 && newheight * yscale > rect_height(&client)) yscale--; }
// non stretch case else { INT32 target_width = rect_width(&client); INT32 target_height = rect_height(&client); float desired_aspect = 1.0f;
// compute the appropriate visible area if we're trying to keepaspect if (video_config.keepaspect) { osd_monitor_info *monitor = window().winwindow_video_window_monitor(NULL); window().target()->compute_visible_area(target_width, target_height, monitor->aspect(), window().target()->orientation(), target_width, target_height); desired_aspect = (float)target_width / (float)target_height; }
// compute maximum integral scaling to fit the window xscale = (target_width + 2) / newwidth; yscale = (target_height + 2) / newheight;
// try a little harder to keep the aspect ratio if desired if (video_config.keepaspect) { // if we could stretch more in the X direction, and that makes a better fit, bump the xscale while (newwidth * (xscale + 1) <= rect_width(&client) && better_mode(newwidth * xscale, newheight * yscale, newwidth * (xscale + 1), newheight * yscale, desired_aspect)) xscale++;
// if we could stretch more in the Y direction, and that makes a better fit, bump the yscale while (newheight * (yscale + 1) <= rect_height(&client) && better_mode(newwidth * xscale, newheight * yscale, newwidth * xscale, newheight * (yscale + 1), desired_aspect)) yscale++;
// now that we've maxed out, see if backing off the maximally stretched one makes a better fit if (rect_width(&client) - newwidth * xscale < rect_height(&client) - newheight * yscale) { while (xscale > 1 && better_mode(newwidth * xscale, newheight * yscale, newwidth * (xscale - 1), newheight * yscale, desired_aspect)) xscale--; } else { while (yscale > 1 && better_mode(newwidth * xscale, newheight * yscale, newwidth * xscale, newheight * (yscale - 1), desired_aspect)) yscale--; } } }
// ensure at least a scale factor of 1 if (xscale == 0) xscale = 1; if (yscale == 0) yscale = 1;
// apply the final scale newwidth *= xscale; newheight *= yscale; if (newwidth != blitwidth || newheight != blitheight) { // force some updates update_outer_rects(); osd_printf_verbose("DirectDraw: New blit size = %dx%d\n", newwidth, newheight); } blitwidth = newwidth; blitheight = newheight; }
Edited by haynor666 (02/20/16 04:05 PM)
|