}
}
+void get_screen_blanking_limits(int *hbstop, int *hbstrt, int *vbstop, int *vbstrt)
+{
+ *vbstop = vblank_bottom_stop;
+ *vbstrt = vblank_top_start;
+
+ int hblank_left = exthblank ? hblank_left_start : hblank_left_start_hard;
+ int hblank_right = exthblank ? hblank_right_stop : hblank_right_stop_hard;
+
+ *hbstop = hblank_left - visible_left_border;
+ *hbstrt = hblank_right - visible_left_border;
+}
+
static void reset_custom_limits(void)
{
gclow = gcloh = gclox = gcloy = 0;
#define AMIGA_WIDTH_MAX (754 / 2)
#define AMIGA_HEIGHT_MAX_PAL (576 / 2)
-#define AMIGA_HEIGHT_MAX_NTSC (484 / 2)
+#define AMIGA_HEIGHT_MAX_NTSC (486 / 2)
#define AMIGA_HEIGHT_MAX (AMIGA_HEIGHT_MAX_PAL)
// Cycles * 2 from start of scanline to first refresh slot (hsync strobe slot)
extern void freevidbuffer(int monid, struct vidbuffer *buf);
extern void check_prefs_picasso(void);
extern int get_vertical_visible_height(bool);
+extern void get_screen_blanking_limits(int*, int*, int*, int*);
/* Finally, stuff that shouldn't really be shared. */
uae_u8 amix1 = 255 - (currprefs.genlock_mix > 255 ? 255 : 0);
uae_u8 amix2 = 255 - amix1;
- int ah = (((yend - ystart) * 2) >> 0);
int aw = ((xend - xstart) >> 1);
+ if (avidinfo->xchange == 1) {
+ aw *= 2;
+ } else if (avidinfo->xchange == 4) {
+ aw /= 2;
+ }
+
+ int ah = (((yend - ystart) * 2) >> 0);
+ if (avidinfo->ychange == 2) {
+ ah /= 2;
+ }
if (ah < 16 || aw < 16) {
return false;
if (abs(genlock_image_height - ah) > 8) {
deltay = genlock_image_height * 65536 / ah;
}
- deltay <<= vdbl;
- deltax <<= hdbl;
- deltax >>= 1;
deltax -= currprefs.genlock_scale * 256;
deltay -= currprefs.genlock_scale * 256;
int offsety = 0;
if (deltax && deltay) {
- offsetx = ((aw - genlock_image_width) * 65536 / deltax) / 2;
- offsety = ((ah - genlock_image_height) * 65536 / deltay) / 2;
+ offsetx = (aw - (genlock_image_width * 65536 / deltax)) / 2;
+ offsety = (ah - (genlock_image_height * 65536 / deltay)) / 2;
if (currprefs.genlock_aspect) {
if (deltax < deltay) {
- offsetx = ((aw - genlock_image_width) * 65536 / deltay) / 2;
+ offsetx = (aw - (genlock_image_width * 65536 / deltay)) / 2;
deltax = deltay;
} else {
- offsety = ((ah - genlock_image_height) * 65536 / deltax) / 2;
+ offsety = (ah - (genlock_image_height * 65536 / deltax)) / 2;
deltay = deltax;
}
}
gen_xoffset += currprefs.genlock_offset_x;
gen_yoffset += currprefs.genlock_offset_y;
+ int vblank_top_start, vblank_bottom_stop;
+ int hblank_left_start, hblank_right_stop;
+
+ get_screen_blanking_limits(&hblank_left_start, &hblank_right_stop, &vblank_bottom_stop, &vblank_top_start);
+ vblank_bottom_stop <<= vdbl;
+ vblank_top_start <<= vdbl;
+
uae_u8 r = 0, g = 0, b = 0, a = 0;
for (y = ystart; y < yend; y++) {
int yoff = (y * 2 + oddlines) - src->yoffset;
continue;
if (yoff >= src->inheight)
continue;
+ if (y * 2 < vblank_top_start || y * 2 >= vblank_bottom_stop)
+ continue;
bool ztoggle = false;
uae_u8 *line = src->bufmem + yoff * src->rowbytes;
for (x = 0; x < src->inwidth; x++) {
uae_u8 *s2 = s + src->rowbytes;
uae_u8 *d2 = d + dst->rowbytes;
+ if (x < hblank_left_start || x >= hblank_right_stop)
+ continue;
if ((!zclken && is_transparent(*s_genlock)) || (zclken && ztoggle)) {
a = amix2;
if (genlock_error) {