ad->framecnt = 1;
}
-STATIC_INLINE int xshift (int x, int shift)
+STATIC_INLINE int xshift(int x, int shift)
{
if (shift < 0)
return x >> (-shift);
return x << shift;
}
-int coord_native_to_amiga_x (int x)
+int coord_native_to_amiga_x(int x)
{
x += visible_left_border;
return x;
}
-int coord_native_to_amiga_y (int y)
+int coord_native_to_amiga_y(int y)
{
- if (!native2amiga_line_map || y < 0 || y >= native2amiga_line_map_height)
- return -1;
+ if (!native2amiga_line_map || y < 0) {
+ return 0;
+ }
+ if (y >= native2amiga_line_map_height) {
+ y = native2amiga_line_map_height - 1;
+ }
return native2amiga_line_map[y] + thisframe_y_adjust - minfirstline;
}
}
x = (int)(x * fmx);
y = (int)(y * fmy);
- x -= (int)(fdx * fmx) - 1;
- y -= (int)(fdy * fmy) - 2;
+ x -= (int)(fdx * 1.0) - 0;
+ y -= (int)(fdy * 1.0) - 2;
+ if (x < 0) {
+ ob = true;
+ x = 0;
+ }
+ if (x * fmx >= vidinfo->outbuffer->outwidth) {
+ ob = true;
+ x = vidinfo->outbuffer->outwidth - 1;
+ }
+ if (y < 0) {
+ ob = true;
+ y = 0;
+ }
+ if (y * fmy >= vidinfo->outbuffer->outheight) {
+ ob = true;
+ y = vidinfo->outbuffer->outheight - 1;
+ }
x = coord_native_to_amiga_x(x);
if (y >= 0) {
y = coord_native_to_amiga_y(y) * 2;
}
- if (x < 0 || y < 0 || x >= vidinfo->outbuffer->outwidth || y >= vidinfo->outbuffer->outheight) {
- ob = true;
- }
}
*xp = x;
*yp = y;
int srcratio, dstratio;
int srcwidth, srcheight;
+ int outwidth, outheight;
+
srcwidth = state->Width;
srcheight = state->Height;
if (!srcwidth || !srcheight)
picasso_offset_y = -yy;
mx = mul;
my = mul;
+ outwidth = srcwidth;
+ outheight = srcheight;
ds->mode = 1;
} else if (mon->scalepicasso == RTG_MODE_CENTER) {
int xx = (mon->currentmode.native_width - srcwidth) / 2;
picasso_offset_y = -yy;
ds->outwidth = mon->currentmode.native_width;
ds->outheight = mon->currentmode.native_height;
+ outwidth = ds->outwidth;
+ outheight = ds->outheight;
mx = my = 1.0;
} else {
if (currprefs.win32_rtgscaleaspectratio < 0) {
ds->outheight = srcheight;
picasso_offset_x = (state->Width - xx) / 2;
}
+ outwidth = ds->outwidth;
+ outheight = ds->outheight;
}
ds->xoffset += picasso_offset_x;
picasso_offset_x /= state->HLineDBL;
picasso_offset_y /= state->VLineDBL;
- picasso_offset_mx = (float)(srcwidth * mx * state->HLineDBL) / ds->dstwidth;
- picasso_offset_my = (float)(srcheight * my * state->VLineDBL) / ds->dstheight;
+ picasso_offset_mx = (float)(srcwidth * mx * state->HLineDBL) / outwidth;
+ picasso_offset_my = (float)(srcheight * my * state->VLineDBL) / outheight;
}
static uae_u8 *gfx_lock_picasso2(int monid, bool fullupdate)