}
}
-static void tvadjust(int *hbstrt_offset, int *hbstop_offset, struct linestate *ls)
+static void tvadjust(int *hbstrt_offset, int *hbstop_offset, int rshift, struct linestate *ls)
{
- if (currprefs.gfx_overscanmode < OVERSCANMODE_EXTREME) {
- int right = denise_strlong_seen ? denise_hblank_extra_right - (1 << currprefs.gfx_resolution) : denise_hblank_extra_right;
+ if (currprefs.gfx_overscanmode < OVERSCANMODE_OVERSCAN) {
+
+ int hbstop_left = (ls->hbstop_offset - ls->internal_pixel_start_cnt) >> rshift;
+ int hbstop_right = hbstop_left + denise_hblank_extra_right - visible_left_border;
+
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;
+
if (hbstrt_offset && ww2 > 0) {
*hbstrt_offset -= ww2;
}
- int hbstop_left = *hbstop_offset - ls->internal_pixel_start_cnt;
if (hbstop_left > 0) {
ww1 -= hbstop_left;
}
int hbstrt_offset = ls->hbstrt_offset >> rshift;
int hbstop_offset = ls->hbstop_offset >> rshift;
- tvadjust(&hbstrt_offset, &hbstop_offset, ls);
+ tvadjust(&hbstrt_offset, &hbstop_offset, rshift, ls);
int draw_end = ls->internal_pixel_cnt >> rshift;
int draw_startoffset = ls->internal_pixel_start_cnt >> rshift;
}
// if HAM: need to clear left hblank after line has been drawn
- tvadjust(&hbstrt_offset, ham ? NULL : &hbstop_offset, ls);
+ tvadjust(&hbstrt_offset, ham ? NULL : &hbstop_offset, rshift, ls);
// negative checks are needed to handle always-on HDIW
int hstop_offset_adjusted = ls->hstop_offset;