voodoo: Use CRTC registers for vblank start. Fixes viper regression caused by last voodoo commit. (nw)

This commit is contained in:
Ted Green 2018-01-06 12:26:53 -07:00
parent 0e6222c005
commit aa690885bf

View File

@ -4950,6 +4950,9 @@ WRITE32_MEMBER( voodoo_banshee_device::banshee_io_w )
int vtotal = banshee.crtc[6]; int vtotal = banshee.crtc[6];
vtotal |= ((banshee.crtc[7] >> 0) & 0x1) << 8; vtotal |= ((banshee.crtc[7] >> 0) & 0x1) << 8;
vtotal |= ((banshee.crtc[7] >> 5) & 0x1) << 9; vtotal |= ((banshee.crtc[7] >> 5) & 0x1) << 9;
int vstart = banshee.crtc[0x10];
vstart |= ((banshee.crtc[7] >> 2) & 0x1) << 8;
vstart |= ((banshee.crtc[7] >> 7) & 0x1) << 9;
// Get pll k, m and n from pllCtrl0 // Get pll k, m and n from pllCtrl0
const uint32_t k = (banshee.io[io_pllCtrl0] >> 0) & 0x3; const uint32_t k = (banshee.io[io_pllCtrl0] >> 0) & 0x3;
@ -4966,16 +4969,15 @@ WRITE32_MEMBER( voodoo_banshee_device::banshee_io_w )
width = (fbi.width * banshee.io[io_vidOverlayDudx]) / 1048576; width = (fbi.width * banshee.io[io_vidOverlayDudx]) / 1048576;
if (banshee.io[io_vidOverlayDvdy] != 0) if (banshee.io[io_vidOverlayDvdy] != 0)
height = (fbi.height * banshee.io[io_vidOverlayDvdy]) / 1048576; height = (fbi.height * banshee.io[io_vidOverlayDvdy]) / 1048576;
if (LOG_REGISTERS) if (LOG_REGISTERS)
logerror("configure screen: htotal: %d vtotal: %d width: %d height: %d refresh: %f\n", logerror("configure screen: htotal: %d vtotal: %d vstart: %d width: %d height: %d refresh: %f\n",
htotal, vtotal, width, height, 1.0 / frame_period); htotal, vtotal, vstart, width, height, 1.0 / frame_period);
if (htotal > 0 && vtotal > 0) { if (htotal > 0 && vtotal > 0) {
rectangle visarea(0, width - 1, 0, height - 1); rectangle visarea(0, width - 1, 0, height - 1);
screen->configure(htotal, vtotal, visarea, DOUBLE_TO_ATTOSECONDS(frame_period)); screen->configure(htotal, vtotal, visarea, DOUBLE_TO_ATTOSECONDS(frame_period));
// Set the vsync to start at top of screen // Set the vsync start
fbi.vsyncscan = height; fbi.vsyncscan = vstart;
adjust_vblank_timer(this); adjust_vblank_timer(this);
} }
if (LOG_REGISTERS) if (LOG_REGISTERS)