trident: add support for doubled horiz width in tvga9000 (nw)

This commit is contained in:
cracyc 2016-03-18 16:10:38 -05:00
parent 5933e0d3da
commit 5c78c35501
3 changed files with 36 additions and 6 deletions

View File

@ -12,18 +12,31 @@
#include "trident.h"
#include "debugger.h"
const device_type TRIDENT_VGA = &device_creator<trident_vga_device>;
const device_type TRIDENT_VGA = &device_creator<tgui9860_device>;
const device_type TVGA9000_VGA = &device_creator<tvga9000_device>;
#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);
}

View File

@ -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_ */

View File

@ -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 )