static diw_states diwstate, hdiwstate;
static int diwstate_vpos;
static int bpl_hstart;
-static bool exthblank, exthblank_state;
+static bool exthblank, exthblank_state, hcenterblank_state;
static int last_diw_hpos, last_diw_hpos2;
static int last_recorded_diw_hpos;
static int last_hblank_start;
// HCENTER blanking (ECS Denise only)
if (hcenter_v2 && vs_state_on && vpos < maxvpos_display_vsync && lof_display) {
int chpos = pos;
- if (hcenter_v2_end == 0xffff && hcenter_v2 < chpos && hcenter_v2 >= last_recorded_diw_hpos) {
- cc = &curr_color_changes[next_color_change];
- cc->linepos = hcenter_v2;
- cc->regno = RECORDED_REGISTER_CHANGE_OFFSET + 0x200;
- cc->value = 1;
- next_color_change++;
- cc[1].regno = -1;
- last_recorded_diw_hpos = cc->linepos;
- hcenter_v2_end = hcenter_v2;
- hcenter_v2_end += ((beamcon0 & BEAMCON0_PAL) ? 8 : 9) << CCK_SHRES_SHIFT;
- if (hcenter_v2_end >= maxhpos << CCK_SHRES_SHIFT) {
- hcenter_v2_end -= maxhpos << CCK_SHRES_SHIFT;
+ if (!hcenterblank_state && hcenter_v2 < chpos && hcenter_v2 >= last_recorded_diw_hpos) {
+ hcenterblank_state = true;
+ if ((bplcon0 & 1) && (bplcon3 & 1)) {
+ cc = &curr_color_changes[next_color_change];
+ cc->linepos = hcenter_v2;
+ cc->regno = RECORDED_REGISTER_CHANGE_OFFSET + 0x200;
+ cc->value = 1;
+ next_color_change++;
+ cc[1].regno = -1;
+ last_recorded_diw_hpos = cc->linepos;
+ if (debug_dma) {
+ record_dma_event(DMA_EVENT_HBS, diw_to_hpos(cc->linepos), vpos);
+ }
}
- if (debug_dma) {
- record_dma_event(DMA_EVENT_HBS, diw_to_hpos(cc->linepos), vpos);
- }
- }
- if (!exthblank_state && hcenter_v2_end < chpos && hcenter_v2_end >= last_recorded_diw_hpos) {
- cc = &curr_color_changes[next_color_change];
- cc->linepos = hcenter_v2_end;
- cc->regno = RECORDED_REGISTER_CHANGE_OFFSET + 0x200;
- cc->value = 0;
- next_color_change++;
- cc[1].regno = -1;
- last_recorded_diw_hpos = cc->linepos;
- hcenter_v2_end = 0xffff;
- if (debug_dma) {
- record_dma_event(DMA_EVENT_HBE, diw_to_hpos(cc->linepos), vpos);
+ }
+ if (hcenterblank_state && hcenter_v2_end < chpos && hcenter_v2_end >= last_recorded_diw_hpos) {
+ hcenterblank_state = false;
+ if ((bplcon0 & 1) && (bplcon3 & 1)) {
+ cc = &curr_color_changes[next_color_change];
+ cc->linepos = hcenter_v2_end;
+ cc->regno = RECORDED_REGISTER_CHANGE_OFFSET + 0x200;
+ cc->value = 0;
+ next_color_change++;
+ cc[1].regno = -1;
+ last_recorded_diw_hpos = cc->linepos;
+ if (debug_dma) {
+ record_dma_event(DMA_EVENT_HBE, diw_to_hpos(cc->linepos), vpos);
+ }
}
}
}
}
}
- if (bplcon0_planes_changed) {
- if (!bprun && hpos == last_bpl1dat_hpos) {
- flush_display(fm);
- toscr_nr_planes_shifter = toscr_nr_planes_shifter_new;
- bplcon0_planes_changed = false;
- }
- }
-
fetch_cycle++;
toscr_nbits += toscr_res2p;
last_bpl1dat_hpos = -1;
last_bpl1dat_hpos_early = false;
last_hblank_start = -1;
+ hcenterblank_state = false;
}
int vsynctimebase_orig;
static void set_hcenter(void)
{
- if (!aga_mode && ecs_denise && (bplcon0 & 1) && (bplcon3 & 1)) {
+ if (!aga_mode && ecs_denise) {
if (beamcon0 & (BEAMCON0_VARVSYEN | BEAMCON0_VARCSYEN)) {
hcenter_v2 = (hcenter & 0xff) << CCK_SHRES_SHIFT;
} else {
hcenter_v2 = 132 << CCK_SHRES_SHIFT;
}
+ uae_u16 hc = hcenter_v2;
+ hcenter_v2 -= 3;
+ if (hc >= (1 << CCK_SHRES_SHIFT) && hcenter_v2 < (1 << CCK_SHRES_SHIFT)) {
+ hcenter_v2 += maxhpos << CCK_SHRES_SHIFT;
+ }
+ hcenter_v2 = adjust_hr(hcenter_v2);
+ if (hcenter_v2 < (1 << CCK_SHRES_SHIFT)) {
+ hcenter_v2 = 0;
+ }
+ hcenter_v2_end = hcenter_v2;
+ hcenter_v2_end += ((beamcon0 & BEAMCON0_PAL) ? 8 : 9) << CCK_SHRES_SHIFT;
+ if (hcenter_v2_end >= maxhpos << CCK_SHRES_SHIFT) {
+ hcenter_v2_end -= maxhpos << CCK_SHRES_SHIFT;
+ }
} else {
hcenter_v2 = 0;
}
- uae_u16 hc = hcenter_v2;
- hcenter_v2 -= 3;
- if (hc >= (1 << CCK_SHRES_SHIFT) && hcenter_v2 < (1 << CCK_SHRES_SHIFT)) {
- hcenter_v2 += maxhpos << CCK_SHRES_SHIFT;
- }
- hcenter_v2 = adjust_hr(hcenter_v2);
- if (hcenter_v2 < (1 << CCK_SHRES_SHIFT)) {
- hcenter_v2 = 0;
- }
}
static void updateextblk(void)
} else if (currprefs.gfx_overscanmode == OVERSCANMODE_EXTREME) {
maxhpos_display += EXTRAWIDTH_EXTREME;
maxvpos_display_vsync += 2;
+ hsstop_detect -= 4;
minfirstline--;
} else if (currprefs.gfx_overscanmode == OVERSCANMODE_BROADCAST) {
maxhpos_display += EXTRAWIDTH_BROADCAST;
maxvpos_display_vsync++;
minfirstline--;
+ hsstop_detect -= 1;
}
}
}
if (beamcon0 & (BEAMCON0_VARVSYEN | BEAMCON0_VARCSYEN)) {
- if (maxvpos_display_vsync >= vsstrt) {
- maxvpos_display_vsync = vsstrt;
+ if (maxvpos_display_vsync >= vsstrt + 3) {
+ maxvpos_display_vsync = vsstrt + 3;
}
if (maxvpos_display_vsync < 0) {
maxvpos_display_vsync = 0;
if (ecs_denise || (!ecs_denise && hpos >= 0x2e)) {
beginning_of_plane_block(hpos);
bprun_pipeline_flush_delay = maxhpos;
+ if (bplcon0_planes_changed) {
+ flush_display(fetchmode);
+ toscr_nr_planes_shifter = toscr_nr_planes_shifter_new;
+ bplcon0_planes_changed = false;
+ }
}
}
}
hbstrt = (239 << CCK_SHRES_SHIFT) - 3;
doblank = true;
}
+
+ if (currprefs.cs_dipagnus && hbstop < (48 << CCK_SHRES_SHIFT) - 3) {
+ hbstop = (48 << CCK_SHRES_SHIFT) - 3;
+ }
+
if (doblank && programmedmode != 1) {
// reposition to sync
// use hardwired hblank emulation as overscan blanking.
int bottom = fd->gfx_filter_bottom_border < 0 ? 0 : fd->gfx_filter_bottom_border;
// backwards compatibility, old 0x38 start is gone.
- left += (0x38 * 4) >> (RES_MAX - currprefs.gfx_resolution);
- right += (0x38 * 4) >> (RES_MAX - currprefs.gfx_resolution);
+ if (left > 0) {
+ left += (0x38 * 4) >> (RES_MAX - currprefs.gfx_resolution);
+ right += (0x38 * 4) >> (RES_MAX - currprefs.gfx_resolution);
+ }
if (left > visible_left_start)
visible_left_start = left;
bool vbarea = vp < vblank_top_start || vp >= vblank_bottom_stop;
extborder = false; // reset here because it always have start and end in same scanline
+ if (!ecs_denise) {
+ // used for OCS Denise blanking bug when not ECS Denise or AGA.
+ exthblank = false;
+ }
for (i = dip_for_drawing->first_color_change; i <= dip_for_drawing->last_color_change; i++) {
int regno = curr_color_changes[i].regno;
uae_u32 value = curr_color_changes[i].value;
}
} else if (value & COLOR_CHANGE_BLANK) {
if (value & 1) {
- hposblank = 1;
+ exthblank = true;
} else {
- hposblank = 0;
+ exthblank = false;
}
} else if (value & COLOR_CHANGE_BRDBLANK) {
colors_for_drawing.extra &= ~(1 << CE_BORDERBLANK);
} else if (ew == -1) {
// wide mode
int hs = hsync_end_left_border * 2;
- if (currprefs.gfx_overscanmode >= OVERSCANMODE_BROADCAST) {
- hs++;
- }
visible_left_border = hs << currprefs.gfx_resolution;
if (visible_left_border + w > maxdiw) {
visible_left_border += (maxdiw - (visible_left_border + w) - 1) / 2;