From 5c78c35501d355d0875687eb24b17d7a9a6cb04e Mon Sep 17 00:00:00 2001 From: cracyc Date: Fri, 18 Mar 2016 16:10:38 -0500 Subject: [PATCH] trident: add support for doubled horiz width in tvga9000 (nw) --- src/devices/bus/isa/trident.cpp | 26 +++++++++++++++++++++----- src/devices/bus/isa/trident.h | 15 ++++++++++++++- src/mame/drivers/pcat_dyn.cpp | 1 + 3 files changed, 36 insertions(+), 6 deletions(-) diff --git a/src/devices/bus/isa/trident.cpp b/src/devices/bus/isa/trident.cpp index 85b83d968cc..b97f35abc78 100644 --- a/src/devices/bus/isa/trident.cpp +++ b/src/devices/bus/isa/trident.cpp @@ -12,18 +12,31 @@ #include "trident.h" #include "debugger.h" -const device_type TRIDENT_VGA = &device_creator; +const device_type TRIDENT_VGA = &device_creator; +const device_type TVGA9000_VGA = &device_creator; #define CRTC_PORT_ADDR ((vga.miscellaneous_output&1)?0x3d0:0x3b0) #define LOG (1) #define LOG_ACCEL (1) -trident_vga_device::trident_vga_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) - : svga_device(mconfig, TRIDENT_VGA, "Trident TGUI9680", tag, owner, clock, "trident_vga", __FILE__) +trident_vga_device::trident_vga_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, const char *shortname, const char *source) + : svga_device(mconfig, type, name, tag, owner, clock, shortname, source) { } +tgui9860_device::tgui9860_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) + : trident_vga_device(mconfig, TRIDENT_VGA, "Trident TGUI9680", tag, owner, clock, "trident_vga", __FILE__) +{ + m_version = 0xd3; // 0xd3 identifies at TGUI9660XGi (set to 0xe3 to identify at TGUI9440AGi) +} + +tvga9000_device::tvga9000_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) + : trident_vga_device(mconfig, TVGA9000_VGA, "Trident TVGA9000", tag, owner, clock, "tvga9000_vga", __FILE__) +{ + m_version = 0x43; +} + UINT8 trident_vga_device::READPIXEL8(INT16 x, INT16 y) { return (vga.memory[((y & 0xfff)*offset() + (x & 0xfff)) % vga.svga_intf.vram_size]); @@ -174,7 +187,7 @@ void trident_vga_device::device_start() void trident_vga_device::device_reset() { svga_device::device_reset(); - svga.id = 0xd3; // 0xd3 identifies at TGUI9660XGi (set to 0xe3 to identify at TGUI9440AGi) + svga.id = m_version; tri.revision = 0x01; // revision identifies as TGUI9680 tri.new_mode = false; // start up in old mode tri.dac_active = false; @@ -377,11 +390,14 @@ void trident_vga_device::trident_define_video_mode() switch((tri.pixel_depth & 0x0c) >> 2) { case 0: - default: if(!(tri.pixel_depth & 0x10)) svga.rgb8_en = 1; break; + default: if(!(tri.pixel_depth & 0x10) || (tri.cr1e & 0x80)) svga.rgb8_en = 1; break; case 1: if((tri.dac & 0xf0) == 0x30) svga.rgb16_en = 1; else svga.rgb15_en = 1; break; case 2: svga.rgb32_en = 1; break; } + if((tri.cr1e & 0x80) && (svga.id == 0x43)) + divisor = 2; + recompute_params_clock(divisor, xtal); } diff --git a/src/devices/bus/isa/trident.h b/src/devices/bus/isa/trident.h index db470ec2838..47ba8d3f8e4 100644 --- a/src/devices/bus/isa/trident.h +++ b/src/devices/bus/isa/trident.h @@ -16,7 +16,7 @@ class trident_vga_device : public svga_device { public: // construction/destruction - trident_vga_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + trident_vga_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, const char *shortname, const char *source); virtual READ8_MEMBER(port_03c0_r) override; virtual WRITE8_MEMBER(port_03c0_w) override; @@ -113,6 +113,7 @@ protected: INT16 accel_mem_y; UINT32 accel_transfer; } tri; + UINT8 m_version; private: UINT8 trident_seq_reg_read(UINT8 index); void trident_seq_reg_write(UINT8 index, UINT8 data); @@ -146,8 +147,20 @@ private: UINT32 handle_rop(UINT32 src, UINT32 dst); }; +class tgui9860_device : public trident_vga_device +{ +public: + tgui9860_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); +}; + +class tvga9000_device : public trident_vga_device +{ +public: + tvga9000_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); +}; // device type definition extern const device_type TRIDENT_VGA; +extern const device_type TVGA9000_VGA; #endif /* TRIDENT_H_ */ diff --git a/src/mame/drivers/pcat_dyn.cpp b/src/mame/drivers/pcat_dyn.cpp index 351301aafa8..db385937cfe 100644 --- a/src/mame/drivers/pcat_dyn.cpp +++ b/src/mame/drivers/pcat_dyn.cpp @@ -106,6 +106,7 @@ static MACHINE_CONFIG_START( pcat_dyn, pcat_dyn_state ) MCFG_FRAGMENT_ADD( pcvideo_trident_vga ) MCFG_SCREEN_MODIFY("screen") MCFG_SCREEN_REFRESH_RATE(60) + MCFG_DEVICE_REPLACE("vga", TVGA9000_VGA, 0) MCFG_FRAGMENT_ADD( pcat_common )