}
visible_left_start = visible_left_border + dx;
visible_right_stop = visible_left_start + w;
- if (currprefs.gfx_overscanmode >= OVERSCANMODE_BROADCAST) {
+ if (dx <= 0 && currprefs.gfx_overscanmode >= OVERSCANMODE_BROADCAST) {
visible_right_stop += 2 << currprefs.gfx_resolution;
}
}
int startypos = linear_vpos_vb_end << vshift;
visible_top_start = startypos + dy;
visible_bottom_stop = startypos + dy + h;
- if (currprefs.gfx_overscanmode < OVERSCANMODE_BROADCAST) {
+ if (dy <= 0 && currprefs.gfx_overscanmode < OVERSCANMODE_BROADCAST) {
visible_top_start += 1 << vshift;
visible_bottom_stop -= 1 << vshift;
}
h = y2 - y1 + 1;
dy = y1 - minfirstline_linear;
- dy--;
if (plffirstline_total >= 30000) {
// no planes enabled during frame
visible_left_border += 4 << currprefs.gfx_resolution;
}
}
+ visible_right_border = visible_left_border + w;
visible_left_border &= ~((1 << currprefs.gfx_resolution) - 1);
-
- //write_log (_T("%d %d %d %d\n"), max_diwlastword, vidinfo->inbuffer->width, currprefs.gfx_resolution, visible_left_border);
+ visible_right_border &= ~((1 << currprefs.gfx_resolution) - 1);
linetoscr_x_adjust = xoffset;
center_horizontal_offset = xoffset;
- visible_right_border = maxdiw + w + ((ew > 0 ? ew : 0) << currprefs.gfx_resolution);
- if (visible_right_border > maxdiw + ((ew > 0 ? ew : 0) << currprefs.gfx_resolution)) {
- visible_right_border = maxdiw + ((ew > 0 ? ew : 0) << currprefs.gfx_resolution);
- }
-
int max_drawn_amiga_line_tmp = max_drawn_amiga_line;
if (max_drawn_amiga_line_tmp > vidinfo->inbuffer->inheight) {
max_drawn_amiga_line_tmp = vidinfo->inbuffer->inheight;
int rshift = hresolution_inv;
int hbstrt_offset2 = (hbstrt_offset - internal_pixel_start_cnt) >> rshift;
int hbstop_offset2 = (hbstop_offset - internal_pixel_start_cnt) >> rshift;
+ if (exthblankon_aga) {
+ hbstrt_offset2 -= 2 >> rshift;
+ hbstop_offset2 -= 2 >> rshift;
+ }
uae_u32 *hbstrt_ptr1 = buf1t && hbstrt_offset2 >= 0 ? buf1t + hbstrt_offset2 : NULL;
uae_u32 *hbstop_ptr1 = buf1t && hbstop_offset2 >= 0 ? buf1t - hbstop_offset2 : NULL;
uae_u32 *hbstrt_ptr2 = buf2t && hbstrt_offset2 >= 0 ? buf2t + hbstrt_offset2 : NULL;
}
}
}
- int right = strlong_seen ? denise_hblank_extra_right - (1 << currprefs.gfx_resolution) : denise_hblank_extra_right;
- if ((denise_hblank_extra_left > visible_left_border || visible_right_border > right) && currprefs.gfx_overscanmode < OVERSCANMODE_EXTREME) {
+ if ((denise_hblank_extra_left > visible_left_border || visible_right_border > denise_hblank_extra_right) && currprefs.gfx_overscanmode < OVERSCANMODE_EXTREME) {
int ww1 = denise_hblank_extra_left > visible_left_border ? (denise_hblank_extra_left - visible_left_border) << 0 : 0;
- int ww2 = visible_right_border > right ? (visible_right_border - right) << 0 : 0;
+ int ww2 = visible_right_border > denise_hblank_extra_right ? (visible_right_border - denise_hblank_extra_right) << 0 : 0;
+
+ hbstrt_ptr1 = hbstop_ptr1 ? hbstop_ptr1 + denise_hblank_extra_right - visible_left_border : NULL;
+ hbstrt_ptr2 = hbstop_ptr2 ? hbstop_ptr2 + denise_hblank_extra_right - visible_left_border : NULL;
+
for (int i = 0; i < 4; i++) {
int add = 1 << hresolution;
uae_u32 *ptr, *ptrs, *ptre;
- int lolshift = 0;
+ int lolshift = lol || no_denise_lol ? 0 : add;
int w = 0;
switch (i)
{
ptr = hbstrt_ptr1;
ptrs = buf1t;
ptre = buf1;
- lolshift = no_denise_lol ? (lol ? add : -add) : (lol ? add : 0);
w = ww2;
break;
case 1:
ptr = hbstrt_ptr2;
ptrs = buf2t;
ptre = buf2;
- lolshift = no_denise_lol ? (lol ? add : -add) : (lol ? add : 0);
w = ww2;
break;
case 2:
ptr = hbstop_ptr1;
ptrs = buf1t;
ptre = buf1;
- lolshift = lol || no_denise_lol ? 0 : add;
w = ww1;
break;
case 3:
ptr = hbstop_ptr2;
ptrs = buf2t;
ptre = buf2;
- lolshift = lol || no_denise_lol ? 0 : add;
w = ww1;
break;
}
if (ptr && w) {
int lolshift2 = strlong_seen ? lolshift : 0;
uae_u32 *p1 = ptr + lolshift2;
- if (i >= 2) {
- if (p1 + w > ptrs && p1 < ptre) {
- int wxadd = 0;
- if (p1 < ptrs) {
- wxadd = addrdiff(ptrs, p1);
- w -= wxadd;
- p1 += wxadd;
- }
- if (p1 + w > ptre) {
- int wadd = addrdiff(p1 + w, ptre);
- w -= wadd;
- }
- if (w > 0) {
- memset(p1, DEBUG_TVOVERSCAN_H_GRAYSCALE_RIGHT, w * sizeof(uae_u32));
- if (bufg) {
- uae_u8 *gp1 = (p1 - ptrs) + bufg + wxadd;
- memset(gp1, 0, w);
- }
- }
+ if (p1 + w > ptrs && p1 < ptre) {
+ int wxadd = 0;
+ if (p1 < ptrs) {
+ wxadd = addrdiff(ptrs, p1);
+ w -= wxadd;
+ p1 += wxadd;
}
- } else {
- if (p1 - w < ptre && p1 >= ptrs) {
- int wxadd = 0;
- p1 -= w;
- if (p1 < ptrs) {
- wxadd = addrdiff(ptrs, p1);
- p1 += wxadd;
- w -= wxadd;
- }
- if (p1 + w > ptre) {
- int wadd = addrdiff(p1 + w, ptre);
- w -= wadd;
- }
- if (w > 0) {
- memset(p1, DEBUG_TVOVERSCAN_H_GRAYSCALE_LEFT, w * sizeof(uae_u32));
- if (bufg) {
- uae_u8 *gp1 = (p1 - ptrs) + bufg + wxadd;
- memset(gp1, 0, w);
- }
+ if (p1 + w > ptre) {
+ int wadd = addrdiff(p1 + w, ptre);
+ w -= wadd;
+ }
+ if (w > 0) {
+ memset(p1, DEBUG_TVOVERSCAN_H_GRAYSCALE_RIGHT, w * sizeof(uae_u32));
+ if (bufg) {
+ uae_u8 *gp1 = (p1 - ptrs) + bufg + wxadd;
+ memset(gp1, 0, w);
}
}
}
// detect horizontal blanking
if (!denise_vblank_active) {
+ int ipc = internal_pixel_cnt + (denise_strlong_seen ? lol * 8 : 0);
linear_denise_frame_hbstrt = hbstrt_offset + (denise_strlong_seen ? lol * 8 : 0);
linear_denise_frame_hbstop = hbstop_offset;
//write_log("%d %d\n", linear_denise_frame_hbstrt, linear_denise_frame_hbstop);
linear_denise_frame_hbstop_sel = -1;
} else {
if (linear_denise_frame_hbstrt_sel > linear_denise_frame_hbstop_sel) {
- linear_denise_frame_hbstrt_sel -= internal_pixel_cnt;
+ linear_denise_frame_hbstrt_sel -= ipc;
}
}
linear_denise_frame_hbstrt_sel += linear_denise_strobe_offset + 2 * 8;
linear_denise_frame_hbstop_sel += linear_denise_strobe_offset + 2 * 8;
denise_hbstrt_relative_cnt = 0;
- if (abs(ss - linear_denise_frame_hbstrt_sel) >= 16 || abs(ee - linear_denise_frame_hbstop_sel) >= 16) {
+ if (ss != linear_denise_frame_hbstrt_sel || ee != linear_denise_frame_hbstop_sel) {
denise_blanking_changed = true;
}
}