video/voodoo_banshee.cpp: implement legacy VGA clock setups

This commit is contained in:
angelosa 2023-12-10 03:15:29 +01:00
parent 10d546b19d
commit 13727e13c7
3 changed files with 21 additions and 6 deletions

View File

@ -1277,6 +1277,8 @@ void voodoo_banshee_device::internal_vga_w(offs_t offset, u8 data)
// graphics controller access
case banshee_vga_regs::gfxControllerData:
m_vga_regs.write_gc(logoffs = m_vga_regs.gfx_controller_index(), data);
if (logoffs == 6)
recompute_video();
logtype = "vga_gc_w";
break;
@ -1285,6 +1287,10 @@ void voodoo_banshee_device::internal_vga_w(offs_t offset, u8 data)
m_vga_regs.write_crtc(logoffs = m_vga_regs.crtc_index(), data);
logtype = "vga_crtc_w";
break;
case banshee_vga_regs::inputStatus0:
recompute_video();
break;
}
if (LOG_REGISTERS)
@ -1481,21 +1487,30 @@ void voodoo_banshee_device::recompute_video()
else
vstop |= vstart & ~0xf;
if (vstart == 0 || vstop == 0)
return;
// check misc output bits 3-2 and alpha_dis, x86 cares and pumpit1 in particular wants regular 00 VGA 25 MHz setting.
const u8 misc_vga_output = m_vga_regs.read(banshee_vga_regs::inputStatus0);
const u8 alpha_dis = misc_vga_output & 8 ? 1 : BIT(m_vga_regs.read_gc(6), 0) ? 1 : 8;
// get pll k, m and n from pllCtrl0
const u32 pll0 = m_io_regs.read(banshee_io_regs::pllCtrl0);
const u32 k = BIT(pll0, 0, 2);
const u32 m = BIT(pll0, 2, 6);
const u32 n = BIT(pll0, 8, 8);
const double video_clock = (XTAL(14'318'181) * (n + 2) / ((m + 2) << k)).dvalue();
const double video_clock = misc_vga_output & 8
? (XTAL(14'318'181) * (n + 2) / ((m + 2) << k)).dvalue()
: (misc_vga_output & 4 ? XTAL(28'636'363) : XTAL(25'174'800)).dvalue();
const double frame_period = vtotal * htotal / video_clock;
// compute scaled screen size, using the overlay fraction if specified
u32 dudx = m_io_regs.read(banshee_io_regs::vidOverlayDudx);
u32 dvdy = m_io_regs.read(banshee_io_regs::vidOverlayDvdy);
u32 width = (dudx != 0) ? ((m_width * dudx) >> 20) : m_width;
u32 height = (dvdy != 0) ? ((m_height * dvdy) >> 20) : m_height;
u32 width = ((dudx != 0) ? ((m_width * dudx) >> 20) : m_width) * alpha_dis;
u32 height = ((dvdy != 0) ? ((m_height * dvdy) >> 20) : m_height) * alpha_dis;
if (LOG_REGISTERS)
logerror("configure screen: htotal: %d vtotal: %d vstart: %d vstop: %d width: %d height: %d refresh: %f\n", htotal, vtotal, vstart, vstop, width, height, 1.0 / frame_period);
logerror("configure screen: htotal: %d vtotal: %d vstart: %d vstop: %d width: %d height: %d misc_vga: %02x alpha_dis %d refresh: %f\n", htotal, vtotal, vstart, vstop, width, height, misc_vga_output, alpha_dis, 1.0 / frame_period);
// configure the screen
rectangle visarea(0, width - 1, 0, height - 1);

View File

@ -1430,7 +1430,7 @@ private:
u8 m_regs[0x20]; // core VGA registers
u8 m_crtc[0x27]; // CRTC registers
u8 m_seq[0x05]; // sequencer registers
u8 m_gc[0x05]; // graphics controller registers
u8 m_gc[0x09]; // graphics controller registers
u8 m_attr[0x15]; // attribute registers
u8 m_attr_flip_flop; // attribute flip-flop
};

View File

@ -3489,7 +3489,7 @@ GAME(2000, gticlub2, kviper, viper, gticlub2, viper_state, init_viperc
GAME(2000, gticlub2ea,gticlub2, viper, gticlub2ea, viper_state, init_vipercf, ROT0, "Konami", "Driving Party: Racing in Italy (ver EAA)", MACHINE_NOT_WORKING)
GAME(2001, jpark3, kviper, viper, jpark3, viper_state, init_vipercf, ROT0, "Konami", "Jurassic Park III (ver EBC)", MACHINE_NOT_WORKING)
GAME(2001, jpark3u, jpark3, viper, jpark3, viper_state, init_vipercf, ROT0, "Konami", "Jurassic Park III (ver UBC)", MACHINE_NOT_WORKING)
GAME(2001, mocapglf, kviper, viper_omz, mocapglf, viper_subscreen_state, init_vipercf, ROT90, "Konami", "Mocap Golf (ver UAA)", MACHINE_NOT_WORKING)
GAME(2001, mocapglf, kviper, viper_omz, mocapglf, viper_subscreen_state, init_vipercf, ROT90, "Konami", "Mocap Golf (ver EAA:B)", MACHINE_NOT_WORKING)
GAME(2001, mocapb, kviper, viper_fullbody, mocapb, viper_state, init_vipercf, ROT90, "Konami", "Mocap Boxing (ver AAB)", MACHINE_NOT_WORKING)
GAME(2001, mocapbj, mocapb, viper_fullbody, mocapb, viper_state, init_vipercf, ROT90, "Konami", "Mocap Boxing (ver JAA)", MACHINE_NOT_WORKING)
GAME(2000, p911, kviper, viper_fullbody, p911, viper_state, init_vipercf, ROT90, "Konami", "The Keisatsukan: Shinjuku 24-ji (ver AAE)", MACHINE_NOT_WORKING)