diff --git a/src/video/vid_8514a.c b/src/video/vid_8514a.c index 3505d1e0b..a94b974b0 100644 --- a/src/video/vid_8514a.c +++ b/src/video/vid_8514a.c @@ -914,7 +914,7 @@ ibm8514_accel_out(uint16_t port, uint32_t val, svga_t *svga, int len) if (!(port & 1)) { if (((dev->disp_cntl & 0x60) == 0x20) || (((dev->disp_cntl & 0x60) == 0x40) && !(dev->accel.advfunc_cntl & 0x04))) { dev->hsync_start = val; - dev->hblankstart = (dev->hsync_start & 0x07) + 1; + dev->hblankstart = (dev->hsync_start & 0x07); } } ibm8514_log("IBM 8514/A: H_SYNC_STRT write 0AE8 = %d\n", val + 1); diff --git a/src/video/vid_ati28800.c b/src/video/vid_ati28800.c index be9654aca..368312fcb 100644 --- a/src/video/vid_ati28800.c +++ b/src/video/vid_ati28800.c @@ -408,7 +408,7 @@ ati28800_recalctimings(svga_t *svga) int clock_sel; if (ati28800->regs[0xad] & 0x08) - svga->hblankstart = ((ati28800->regs[0x0d] >> 2) << 8) + svga->crtc[2] + 1; + svga->hblankstart = ((ati28800->regs[0x0d] >> 2) << 8) + svga->crtc[2]; clock_sel = ((svga->miscout >> 2) & 3) | ((ati28800->regs[0xbe] & 0x10) >> 1) | ((ati28800->regs[0xb9] & 2) << 1); @@ -492,8 +492,7 @@ ati28800_recalctimings(svga_t *svga) else { svga->render = svga_render_15bpp_highres; svga->hdisp >>= 1; - svga->hblankstart = ((svga->hblankstart - 1) >> 1) + 1; - svga->hblank_end_val >>= 1; + svga->dots_per_clock >>= 1; svga->rowoffset <<= 1; svga->ma_latch <<= 1; } diff --git a/src/video/vid_ati_mach64.c b/src/video/vid_ati_mach64.c index cdd906067..9aa396383 100644 --- a/src/video/vid_ati_mach64.c +++ b/src/video/vid_ati_mach64.c @@ -516,7 +516,7 @@ mach64_recalctimings(svga_t *svga) svga->htotal = (mach64->crtc_h_total_disp & 255) + 1; svga->hdisp_time = svga->hdisp = ((mach64->crtc_h_total_disp >> 16) & 255) + 1; svga->hblankstart = (mach64->crtc_h_sync_strt_wid & 255) + - ((mach64->crtc_h_sync_strt_wid >> 8) & 7) + 1; + ((mach64->crtc_h_sync_strt_wid >> 8) & 7); svga->hblank_end_val = (svga->hblankstart + ((mach64->crtc_h_sync_strt_wid >> 16) & 31) - 1) & 63; svga->vsyncstart = (mach64->crtc_v_sync_strt_wid & 2047) + 1; diff --git a/src/video/vid_ati_mach8.c b/src/video/vid_ati_mach8.c index 5628e149a..b49806177 100644 --- a/src/video/vid_ati_mach8.c +++ b/src/video/vid_ati_mach8.c @@ -2547,7 +2547,7 @@ mach_recalctimings(svga_t *svga) int clock_sel; if (mach->regs[0xad] & 0x08) - svga->hblankstart = ((mach->regs[0x0d] >> 2) << 8) + svga->crtc[2] + 1; + svga->hblankstart = ((mach->regs[0x0d] >> 2) << 8) + svga->crtc[2]; clock_sel = ((svga->miscout >> 2) & 3) | ((mach->regs[0xbe] & 0x10) >> 1) | ((mach->regs[0xb9] & 2) << 1); @@ -3636,7 +3636,7 @@ mach_accel_out_call(uint16_t port, uint8_t val, mach_t *mach, svga_t *svga, ibm8 if (!(port & 1)) { if (((dev->disp_cntl & 0x60) == 0x20) || (((dev->disp_cntl & 0x60) == 0x40) && !(dev->accel.advfunc_cntl & 0x04)) || (mach->accel.clock_sel & 0x01)) { dev->hsync_start = val; - dev->hblankstart = (dev->hsync_start & 0x07) + 1; + dev->hblankstart = (dev->hsync_start & 0x07); } } mach_log("ATI 8514/A: H_SYNC_STRT write 0AE8 = %d\n", val + 1); diff --git a/src/video/vid_chips_69000.c b/src/video/vid_chips_69000.c index 9e5e74370..04a543884 100644 --- a/src/video/vid_chips_69000.c +++ b/src/video/vid_chips_69000.c @@ -1886,10 +1886,10 @@ chips_69000_pci_write(int func, int addr, uint8_t val, void *p) } case 0x13: { - if (!(chips->pci_conf_status & PCI_COMMAND_MEM)) { + // if (!(chips->pci_conf_status & PCI_COMMAND_MEM)) { chips->linear_mapping.base = val << 24; - break; - } + // break; + // } mem_mapping_set_addr(&chips->linear_mapping, val << 24, (1 << 24)); break; } diff --git a/src/video/vid_cl54xx.c b/src/video/vid_cl54xx.c index 5d376effe..e83d4593f 100644 --- a/src/video/vid_cl54xx.c +++ b/src/video/vid_cl54xx.c @@ -1750,7 +1750,7 @@ gd54xx_recalctimings(svga_t *svga) uint8_t rdmask; uint8_t linedbl = svga->dispend * 9 / 10 >= svga->hdisp; - svga->hblankstart = svga->crtc[2] + 1; + svga->hblankstart = svga->crtc[2]; if (svga->crtc[0x1b] & ((svga->crtc[0x27] >= CIRRUS_ID_CLGD5424) ? 0xa0 : 0x20)) { /* Special blanking mode: the blank start and end become components of the window generator, @@ -1763,7 +1763,7 @@ gd54xx_recalctimings(svga_t *svga) svga->hblank_end_mask = 0x000000ff; if (svga->crtc[0x1b] & 0x20) { - svga->hblankstart = svga->crtc[1]/* + ((svga->crtc[3] >> 5) & 3)*/ + 1; + svga->hblankstart = svga->crtc[1]/* + ((svga->crtc[3] >> 5) & 3) + 1*/; svga->hblank_end_val = svga->htotal - 1 /* + ((svga->crtc[3] >> 5) & 3)*/; /* In this mode, the dots per clock are always 8 or 16, never 9 or 18. */ diff --git a/src/video/vid_et4000.c b/src/video/vid_et4000.c index 6d52fc91b..fa671e2f6 100644 --- a/src/video/vid_et4000.c +++ b/src/video/vid_et4000.c @@ -650,7 +650,7 @@ et4000_recalctimings(svga_t *svga) svga->ma_latch |= (svga->crtc[0x33] & 3) << 16; - svga->hblankstart = (((svga->crtc[0x3f] & 0x10) >> 4) << 8) + svga->crtc[2] + 1; + svga->hblankstart = (((svga->crtc[0x3f] & 0x10) >> 4) << 8) + svga->crtc[2]; if (svga->crtc[0x35] & 1) svga->vblankstart += 0x400; @@ -690,14 +690,12 @@ et4000_recalctimings(svga_t *svga) case 15: case 16: svga->hdisp /= 2; - svga->hblankstart /= 2; - svga->hblank_end_val /= 2; + svga->dots_per_clock /= 2; break; case 24: svga->hdisp /= 3; - svga->hblankstart /= 3; - svga->hblank_end_val /= 3; + svga->dots_per_clock /= 3; break; default: diff --git a/src/video/vid_et4000w32.c b/src/video/vid_et4000w32.c index 259fefffb..7adb6bc89 100644 --- a/src/video/vid_et4000w32.c +++ b/src/video/vid_et4000w32.c @@ -432,7 +432,7 @@ et4000w32p_recalctimings(svga_t *svga) svga->ma_latch |= (svga->crtc[0x33] & 0x7) << 16; - svga->hblankstart = (((svga->crtc[0x3f] & 0x10) >> 4) << 8) + svga->crtc[2] + 1; + svga->hblankstart = (((svga->crtc[0x3f] & 0x10) >> 4) << 8) + svga->crtc[2]; if (svga->crtc[0x35] & 0x01) svga->vblankstart += 0x400; diff --git a/src/video/vid_ht216.c b/src/video/vid_ht216.c index 35d335ed2..b87d93665 100644 --- a/src/video/vid_ht216.c +++ b/src/video/vid_ht216.c @@ -714,7 +714,7 @@ ht216_recalctimings(svga_t *svga) svga->vram_display_mask = (ht216->ht_regs[0xf6] & 0x40) ? ht216->vram_mask : 0x3ffff; if (ht216->ht_regs[0xe0] & 0x20) - svga->hblankstart = ((ht216->ht_regs[0xca] >> 2) << 8) + svga->crtc[4] + 1; + svga->hblankstart = ((ht216->ht_regs[0xca] >> 2) << 8) + svga->crtc[4]; } static void diff --git a/src/video/vid_mga.c b/src/video/vid_mga.c index b85eb5ad9..f40385fef 100644 --- a/src/video/vid_mga.c +++ b/src/video/vid_mga.c @@ -945,7 +945,7 @@ mystique_recalctimings(svga_t *svga) if (mystique->crtcext_regs[1] & CRTCX_R1_HTOTAL8) svga->htotal |= 0x100; - svga->hblankstart = (((mystique->crtcext_regs[1] & 0x02) >> 2) << 8) + svga->crtc[2] + 1; + svga->hblankstart = (((mystique->crtcext_regs[1] & 0x02) >> 2) << 8) + svga->crtc[2]; if (mystique->crtcext_regs[2] & CRTCX_R2_VTOTAL10) svga->vtotal |= 0x400; diff --git a/src/video/vid_s3.c b/src/video/vid_s3.c index 41e21faa9..27c364898 100644 --- a/src/video/vid_s3.c +++ b/src/video/vid_s3.c @@ -3312,7 +3312,7 @@ s3_recalctimings(svga_t *svga) if (svga->crtc[0x33] & 0x20) { /* The S3 version of the Cirrus' special blanking mode, with identical behavior. */ svga->hblankstart = (((svga->crtc[0x5d] & 0x02) >> 1) << 8) + svga->crtc[1]/* + - ((svga->crtc[3] >> 5) & 3)*/ + 1; + ((svga->crtc[3] >> 5) & 3) + 1*/; svga->hblank_end_val = svga->htotal - 1 /* + ((svga->crtc[3] >> 5) & 3)*/; svga->monitor->mon_overscan_y = 0; @@ -3324,7 +3324,7 @@ s3_recalctimings(svga_t *svga) if (s3->chip >= S3_VISION964) svga->hblank_end_mask = 0x7f; } else if (s3->chip >= S3_86C801) { - svga->hblankstart = (((svga->crtc[0x5d] & 0x04) >> 2) << 8) + svga->crtc[2] + 1; + svga->hblankstart = (((svga->crtc[0x5d] & 0x04) >> 2) << 8) + svga->crtc[2]; if (s3->chip >= S3_VISION964) { /* NOTE: The S3 Trio64V+ datasheet says this is bit 7, but then where is bit 6? @@ -4160,7 +4160,7 @@ s3_trio64v_recalctimings(svga_t *svga) if ((svga->crtc[0x33] & 0x20) || ((svga->crtc[0x67] & 0xc) == 0xc)) { /* The S3 version of the Cirrus' special blanking mode, with identical behavior. */ svga->hblankstart = (((svga->crtc[0x5d] & 0x02) >> 1) << 8) + svga->crtc[1]/* + - ((svga->crtc[3] >> 5) & 3)*/ + 1; + ((svga->crtc[3] >> 5) & 3) + 1*/; svga->hblank_end_val = svga->htotal - 1 /* + ((svga->crtc[3] >> 5) & 3)*/; svga->monitor->mon_overscan_y = 0; @@ -4169,7 +4169,7 @@ s3_trio64v_recalctimings(svga_t *svga) /* Also make sure vertical blanking starts on display end. */ svga->vblankstart = svga->dispend; } else { - svga->hblankstart = (((svga->crtc[0x5d] & 0x04) >> 2) << 8) + svga->crtc[2] + 1; + svga->hblankstart = (((svga->crtc[0x5d] & 0x04) >> 2) << 8) + svga->crtc[2]; /* NOTE: The S3 Trio64V+ datasheet says this is bit 7, but then where is bit 6? The datasheets for the pre-Trio64V+ cards say +64, which implies bit 6, diff --git a/src/video/vid_s3_virge.c b/src/video/vid_s3_virge.c index 1cb6424fb..be6382ec9 100644 --- a/src/video/vid_s3_virge.c +++ b/src/video/vid_s3_virge.c @@ -827,7 +827,7 @@ s3_virge_recalctimings(svga_t *svga) if ((svga->crtc[0x33] & 0x20) || ((svga->crtc[0x67] & 0xc) == 0xc)) { /* The S3 version of the Cirrus' special blanking mode, with identical behavior. */ svga->hblankstart = (((svga->crtc[0x5d] & 0x02) >> 1) << 8) + svga->crtc[1]/* + - ((svga->crtc[3] >> 5) & 3)*/ + 1; + ((svga->crtc[3] >> 5) & 3) + 1*/; svga->hblank_end_val = svga->htotal - 1 /* + ((svga->crtc[3] >> 5) & 3)*/; svga->monitor->mon_overscan_y = 0; @@ -836,7 +836,7 @@ s3_virge_recalctimings(svga_t *svga) /* Also make sure vertical blanking starts on display end. */ svga->vblankstart = svga->dispend; } else { - svga->hblankstart = (((svga->crtc[0x5d] & 0x04) >> 2) << 8) + svga->crtc[2] + 1; + svga->hblankstart = (((svga->crtc[0x5d] & 0x04) >> 2) << 8) + svga->crtc[2]; svga->hblank_end_val = (svga->crtc[3] & 0x1f) | (((svga->crtc[5] & 0x80) >> 7) << 5) | (((svga->crtc[0x5d] & 0x08) >> 3) << 6); diff --git a/src/video/vid_svga.c b/src/video/vid_svga.c index b298fc4e1..d0f02929d 100644 --- a/src/video/vid_svga.c +++ b/src/video/vid_svga.c @@ -750,7 +750,7 @@ svga_recalctimings(svga_t *svga) } else svga->monitor->mon_overscan_x = 16; - svga->hblankstart = svga->crtc[2] + 1; + svga->hblankstart = svga->crtc[2]; svga->hblank_end_val = (svga->crtc[3] & 0x1f) | ((svga->crtc[5] & 0x80) ? 0x20 : 0x00); svga->hblank_end_mask = 0x0000003f; diff --git a/src/video/vid_voodoo_banshee.c b/src/video/vid_voodoo_banshee.c index f03f6efd4..098e919d4 100644 --- a/src/video/vid_voodoo_banshee.c +++ b/src/video/vid_voodoo_banshee.c @@ -558,10 +558,10 @@ banshee_recalctimings(svga_t *svga) that is, no overscan and relying on display end to blank. */ if (banshee->vgaInit0 & 0x40) { svga->hblankstart = svga->crtc[1]/* + ((svga->crtc[3] >> 5) & 3)*/ + - (((svga->crtc[0x1a] & 0x04) >> 2) << 8) + 1; + (((svga->crtc[0x1a] & 0x04) >> 2) << 8); svga->hblank_end_mask = 0x0000007f; } else { - svga->hblankstart = svga->crtc[1]/* + ((svga->crtc[3] >> 5) & 3)*/ + 1; + svga->hblankstart = svga->crtc[1]/* + ((svga->crtc[3] >> 5) & 3)*/; svga->hblank_end_mask = 0x0000003f; } svga->hblank_end_val = svga->htotal - 1 /* + ((svga->crtc[3] >> 5) & 3)*/; @@ -579,12 +579,12 @@ banshee_recalctimings(svga_t *svga) svga->linedbl = 0; } else { if (banshee->vgaInit0 & 0x40) { - svga->hblankstart = (((svga->crtc[0x1a] & 0x10) >> 4) << 8) + svga->crtc[2] + 1; + svga->hblankstart = (((svga->crtc[0x1a] & 0x10) >> 4) << 8) + svga->crtc[2]; svga->hblank_end_val = (svga->crtc[3] & 0x1f) | (((svga->crtc[5] & 0x80) >> 7) << 5) | (((svga->crtc[0x1a] & 0x20) >> 5) << 6); svga->hblank_end_mask = 0x0000007f; } else { - svga->hblankstart = svga->crtc[2] + 1; + svga->hblankstart = svga->crtc[2]; svga->hblank_end_val = (svga->crtc[3] & 0x1f) | (((svga->crtc[5] & 0x80) >> 7) << 5); svga->hblank_end_mask = 0x0000003f; } @@ -652,9 +652,6 @@ banshee_recalctimings(svga_t *svga) if (banshee->vidProcCfg & VIDPROCCFG_2X_MODE) { svga->hdisp *= 2; - // svga->htotal *= 2; - // svga->hblankstart *= 2; - // svga->hblank_end_val *= 2; svga->dots_per_clock *= 2; }