From e7b7965ff91e4a298b766ea2c9857e90b9899072 Mon Sep 17 00:00:00 2001 From: mahlemiut Date: Sat, 17 May 2014 10:52:17 +0000 Subject: [PATCH] at: added preliminary ATi Graphics Ultra Pro (mach32) ISA video card. [Barry Rodewald] --- .gitattributes | 2 + src/emu/bus/bus.mak | 1 + src/emu/bus/isa/isa_cards.c | 1 + src/emu/bus/isa/mach32.c | 73 +++++++++++++++++++ src/emu/bus/isa/mach32.h | 135 ++++++++++++++++++++++++++++++++++++ src/emu/bus/isa/vga_ati.c | 100 +++++++++++++++++++++++++- src/emu/bus/isa/vga_ati.h | 25 ++++++- src/emu/video/pc_vga.c | 40 +++++++++-- src/emu/video/pc_vga.h | 4 ++ 9 files changed, 372 insertions(+), 9 deletions(-) create mode 100644 src/emu/bus/isa/mach32.c create mode 100644 src/emu/bus/isa/mach32.h diff --git a/.gitattributes b/.gitattributes index 7bce2bca0ac..ee30c9f9bb6 100644 --- a/.gitattributes +++ b/.gitattributes @@ -874,6 +874,8 @@ src/emu/bus/isa/isa_cards.c svneol=native#text/plain src/emu/bus/isa/isa_cards.h svneol=native#text/plain src/emu/bus/isa/lpt.c svneol=native#text/plain src/emu/bus/isa/lpt.h svneol=native#text/plain +src/emu/bus/isa/mach32.c svneol=native#text/plain +src/emu/bus/isa/mach32.h svneol=native#text/plain src/emu/bus/isa/mc1502_fdc.c svneol=native#text/plain src/emu/bus/isa/mc1502_fdc.h svneol=native#text/plain src/emu/bus/isa/mc1502_rom.c svneol=native#text/plain diff --git a/src/emu/bus/bus.mak b/src/emu/bus/bus.mak index 53c15c10834..2890bb2ffb1 100644 --- a/src/emu/bus/bus.mak +++ b/src/emu/bus/bus.mak @@ -355,6 +355,7 @@ BUSOBJS += $(BUSOBJ)/isa/svga_cirrus.o BUSOBJS += $(BUSOBJ)/isa/ega.o BUSOBJS += $(BUSOBJ)/isa/vga.o BUSOBJS += $(BUSOBJ)/isa/vga_ati.o +BUSOBJS += $(BUSOBJ)/isa/mach32.o BUSOBJS += $(BUSOBJ)/isa/svga_tseng.o BUSOBJS += $(BUSOBJ)/isa/svga_s3.o BUSOBJS += $(BUSOBJ)/isa/s3virge.o diff --git a/src/emu/bus/isa/isa_cards.c b/src/emu/bus/isa/isa_cards.c index 2865b1147fe..553d16cb855 100644 --- a/src/emu/bus/isa/isa_cards.c +++ b/src/emu/bus/isa/isa_cards.c @@ -90,4 +90,5 @@ SLOT_INTERFACE_START( pc_isa16_cards ) SLOT_INTERFACE("s3virgedx", ISA16_S3VIRGEDX) SLOT_INTERFACE("dms3d2kp", ISA16_DMS3D2KPRO) SLOT_INTERFACE("gfxultra", ISA16_VGA_GFXULTRA) + SLOT_INTERFACE("gfxultrap", ISA16_SVGA_GFXULTRAPRO) SLOT_INTERFACE_END diff --git a/src/emu/bus/isa/mach32.c b/src/emu/bus/isa/mach32.c new file mode 100644 index 00000000000..76e6669ff0e --- /dev/null +++ b/src/emu/bus/isa/mach32.c @@ -0,0 +1,73 @@ +/* + * mach32.c + * + * Implementation of the ATi Mach32 video chip + * Based on ati_vga and mach8 + * + * Created on: 16/05/2014 + */ + +#include "mach32.h" + +const device_type ATIMACH32 = &device_creator; +const device_type ATIMACH32_8514A = &device_creator; + +// 8514/A device +mach32_8514a_device::mach32_8514a_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) + : mach8_device(mconfig, ATIMACH32_8514A, "ATi mach32 (2D acceleration module)", tag, owner, clock, "mach32_8514a", __FILE__) +{ +} + +mach32_8514a_device::mach32_8514a_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) + : mach8_device(mconfig, type, name, tag, owner, clock, shortname, source) +{ +} + + +// SVGA device +mach32_device::mach32_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) + : ati_vga_device(mconfig, ATIMACH32, "ATi mach32", tag, owner, clock, "mach32", __FILE__), + m_8514a(*this,"8514a") +{ +} + +mach32_device::mach32_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) + : ati_vga_device(mconfig, type, name, tag, owner, clock, shortname, source), + m_8514a(*this,"8514a") +{ +} + +static MACHINE_CONFIG_FRAGMENT( mach32_8514a ) + MCFG_DEVICE_ADD("8514a", ATIMACH32_8514A, 0) + MCFG_EEPROM_SERIAL_93C56_ADD("ati_eeprom") +MACHINE_CONFIG_END + +machine_config_constructor mach32_device::device_mconfig_additions() const +{ + return MACHINE_CONFIG_NAME( mach32_8514a ); +} + +void mach32_8514a_device::device_start() +{ + mach8_device::device_start(); + // 017h 68800-AX + // 177h 68800-LX + // 2F7h 68800-6 + // The 68800-3 appears to return 0 for this field (undocumented) + m_chip_ID = 0x000; + m_membounds = 0; +} + +void mach32_8514a_device::device_reset() +{ +} + +void mach32_device::device_start() +{ + ati_vga_device::device_start(); +} + +void mach32_device::device_reset() +{ + ati_vga_device::device_reset(); +} diff --git a/src/emu/bus/isa/mach32.h b/src/emu/bus/isa/mach32.h new file mode 100644 index 00000000000..cd92d822890 --- /dev/null +++ b/src/emu/bus/isa/mach32.h @@ -0,0 +1,135 @@ +/* + * mach32.h + * + * Created on: 16/05/2014 + */ + +#ifndef MACH32_H_ +#define MACH32_H_ + +#include "emu.h" +#include "video/pc_vga.h" +#include "machine/eepromser.h" + +// 8514/A module of the Mach32 +class mach32_8514a_device : public mach8_device +{ +public: + // construction/destruction + mach32_8514a_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + mach32_8514a_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); + + DECLARE_READ16_MEMBER(mach32_chipid_r) { return m_chip_ID; } + DECLARE_WRITE16_MEMBER(mach32_clksel_w) { mach8.clksel = data; } // read only on the mach8 + DECLARE_READ16_MEMBER(mach32_mem_boundary_r) { return m_membounds; } + DECLARE_WRITE16_MEMBER(mach32_mem_boundary_w) { m_membounds = data; if(data & 0x10) logerror("ATI: Unimplemented memory boundary activated."); } + +protected: + virtual void device_start(); + virtual void device_reset(); + + UINT16 m_chip_ID; + UINT16 m_membounds; +}; + +// main SVGA device +class mach32_device : public ati_vga_device +{ +public: + // construction/destruction + mach32_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + mach32_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); + + required_device m_8514a; // provides accelerated 2D drawing, derived from the Mach8 device + + // map 8514/A functions to 8514/A module + DECLARE_READ16_MEMBER(mach8_ec0_r) { return m_8514a->mach8_ec0_r(space,offset,mem_mask); } + DECLARE_WRITE16_MEMBER(mach8_ec0_w) { m_8514a->mach8_ec0_w(space,offset,data,mem_mask); } + DECLARE_READ16_MEMBER(mach8_ec1_r) { return m_8514a->mach8_ec1_r(space,offset,mem_mask); } + DECLARE_WRITE16_MEMBER(mach8_ec1_w) { m_8514a->mach8_ec1_w(space,offset,data,mem_mask); } + DECLARE_READ16_MEMBER(mach8_ec2_r) { return m_8514a->mach8_ec2_r(space,offset,mem_mask); } + DECLARE_WRITE16_MEMBER(mach8_ec2_w) { m_8514a->mach8_ec2_w(space,offset,data,mem_mask); } + DECLARE_READ16_MEMBER(mach8_ec3_r) { return m_8514a->mach8_ec3_r(space,offset,mem_mask); } + DECLARE_WRITE16_MEMBER(mach8_ec3_w) { m_8514a->mach8_ec3_w(space,offset,data,mem_mask); } + DECLARE_READ16_MEMBER(mach8_ext_fifo_r) { return m_8514a->mach8_ext_fifo_r(space,offset,mem_mask); } + DECLARE_WRITE16_MEMBER(mach8_linedraw_index_w) { m_8514a->mach8_linedraw_index_w(space,offset,data,mem_mask); } + DECLARE_READ16_MEMBER(mach8_bresenham_count_r) { return m_8514a->mach8_bresenham_count_r(space,offset,mem_mask); } + DECLARE_WRITE16_MEMBER(mach8_bresenham_count_w) { m_8514a->mach8_bresenham_count_w(space,offset,data,mem_mask); } + DECLARE_WRITE16_MEMBER(mach8_linedraw_w) { m_8514a->mach8_linedraw_w(space,offset,data,mem_mask); } + DECLARE_READ16_MEMBER(mach8_linedraw_r) { return m_8514a->mach8_linedraw_r(space,offset,mem_mask); } + DECLARE_READ16_MEMBER(mach8_scratch0_r) { return m_8514a->mach8_scratch0_r(space,offset,mem_mask); } + DECLARE_WRITE16_MEMBER(mach8_scratch0_w) { m_8514a->mach8_scratch0_w(space,offset,data,mem_mask); } + DECLARE_READ16_MEMBER(mach8_scratch1_r) { return m_8514a->mach8_scratch1_r(space,offset,mem_mask); } + DECLARE_WRITE16_MEMBER(mach8_scratch1_w) { m_8514a->mach8_scratch1_w(space,offset,data,mem_mask); } + DECLARE_READ16_MEMBER(mach8_config1_r) { return m_8514a->mach8_config1_r(space,offset,mem_mask); } + DECLARE_READ16_MEMBER(mach8_config2_r) { return m_8514a->mach8_config2_r(space,offset,mem_mask); } + DECLARE_READ16_MEMBER(mach8_sourcex_r) { return m_8514a->mach8_sourcex_r(space,offset,mem_mask); } + DECLARE_READ16_MEMBER(mach8_sourcey_r) { return m_8514a->mach8_sourcey_r(space,offset,mem_mask); } + DECLARE_WRITE16_MEMBER(mach8_ext_leftscissor_w) { m_8514a->mach8_ext_leftscissor_w(space,offset,data,mem_mask); } + DECLARE_WRITE16_MEMBER(mach8_ext_topscissor_w) { m_8514a->mach8_ext_topscissor_w(space,offset,data,mem_mask); } + + DECLARE_READ16_MEMBER(ibm8514_vtotal_r) { return m_8514a->ibm8514_vtotal_r(space,offset,mem_mask); } + DECLARE_WRITE16_MEMBER(ibm8514_vtotal_w) { m_8514a->ibm8514_vtotal_w(space,offset,data,mem_mask); } + DECLARE_READ16_MEMBER(ibm8514_htotal_r) { return m_8514a->ibm8514_htotal_r(space,offset,mem_mask); } + DECLARE_WRITE16_MEMBER(ibm8514_htotal_w) { m_8514a->ibm8514_htotal_w(space,offset,data,mem_mask); } + DECLARE_READ16_MEMBER(ibm8514_vdisp_r) { return m_8514a->ibm8514_vdisp_r(space,offset,mem_mask); } + DECLARE_WRITE16_MEMBER(ibm8514_vdisp_w) { m_8514a->ibm8514_vdisp_w(space,offset,data,mem_mask); } + DECLARE_READ16_MEMBER(ibm8514_vsync_r) { return m_8514a->ibm8514_vsync_r(space,offset,mem_mask); } + DECLARE_WRITE16_MEMBER(ibm8514_vsync_w) { m_8514a->ibm8514_vsync_w(space,offset,data,mem_mask); } + DECLARE_READ16_MEMBER(ibm8514_substatus_r) { return m_8514a->ibm8514_substatus_r(space,offset,mem_mask); } + DECLARE_WRITE16_MEMBER(ibm8514_subcontrol_w) { m_8514a->ibm8514_subcontrol_w(space,offset,data,mem_mask); } + DECLARE_READ16_MEMBER(ibm8514_subcontrol_r) { return m_8514a->ibm8514_subcontrol_r(space,offset,mem_mask); } + DECLARE_READ16_MEMBER(ibm8514_currentx_r) { return m_8514a->ibm8514_currentx_r(space,offset,mem_mask); } + DECLARE_WRITE16_MEMBER(ibm8514_currentx_w) { m_8514a->ibm8514_currentx_w(space,offset,data,mem_mask); } + DECLARE_READ16_MEMBER(ibm8514_currenty_r) { return m_8514a->ibm8514_currenty_r(space,offset,mem_mask); } + DECLARE_WRITE16_MEMBER(ibm8514_currenty_w) { m_8514a->ibm8514_currenty_w(space,offset,data,mem_mask); } + DECLARE_READ16_MEMBER(ibm8514_desty_r) { return m_8514a->ibm8514_desty_r(space,offset,mem_mask); } + DECLARE_WRITE16_MEMBER(ibm8514_desty_w) { m_8514a->ibm8514_desty_w(space,offset,data,mem_mask); } + DECLARE_READ16_MEMBER(ibm8514_destx_r) { return m_8514a->ibm8514_destx_r(space,offset,mem_mask); } + DECLARE_WRITE16_MEMBER(ibm8514_destx_w) { m_8514a->ibm8514_destx_w(space,offset,data,mem_mask); } + DECLARE_READ16_MEMBER(ibm8514_line_error_r) { return m_8514a->ibm8514_line_error_r(space,offset,mem_mask); } + DECLARE_WRITE16_MEMBER(ibm8514_line_error_w) { m_8514a->ibm8514_line_error_w(space,offset,data,mem_mask); } + DECLARE_READ16_MEMBER(ibm8514_width_r) { return m_8514a->ibm8514_width_r(space,offset,mem_mask); } + DECLARE_WRITE16_MEMBER(ibm8514_width_w) { m_8514a->ibm8514_width_w(space,offset,data,mem_mask); } + DECLARE_READ16_MEMBER(ibm8514_gpstatus_r) { return m_8514a->ibm8514_gpstatus_r(space,offset,mem_mask); } + DECLARE_WRITE16_MEMBER(ibm8514_cmd_w) { m_8514a->ibm8514_cmd_w(space,offset,data,mem_mask); } + DECLARE_READ16_MEMBER(ibm8514_ssv_r) { return m_8514a->ibm8514_ssv_r(space,offset,mem_mask); } + DECLARE_WRITE16_MEMBER(ibm8514_ssv_w) { m_8514a->ibm8514_ssv_w(space,offset,data,mem_mask); } + DECLARE_READ16_MEMBER(ibm8514_fgcolour_r) { return m_8514a->ibm8514_fgcolour_r(space,offset,mem_mask); } + DECLARE_WRITE16_MEMBER(ibm8514_fgcolour_w) { m_8514a->ibm8514_fgcolour_w(space,offset,data,mem_mask); } + DECLARE_READ16_MEMBER(ibm8514_bgcolour_r) { return m_8514a->ibm8514_bgcolour_r(space,offset,mem_mask); } + DECLARE_WRITE16_MEMBER(ibm8514_bgcolour_w) { m_8514a->ibm8514_bgcolour_w(space,offset,data,mem_mask); } + DECLARE_READ16_MEMBER(ibm8514_read_mask_r) { return m_8514a->ibm8514_read_mask_r(space,offset,mem_mask); } + DECLARE_WRITE16_MEMBER(ibm8514_read_mask_w) { m_8514a->ibm8514_read_mask_w(space,offset,data,mem_mask); } + DECLARE_READ16_MEMBER(ibm8514_write_mask_r) { return m_8514a->ibm8514_write_mask_r(space,offset,mem_mask); } + DECLARE_WRITE16_MEMBER(ibm8514_write_mask_w) { m_8514a->ibm8514_write_mask_w(space,offset,data,mem_mask); } + DECLARE_READ16_MEMBER(ibm8514_backmix_r) { return m_8514a->ibm8514_backmix_r(space,offset,mem_mask); } + DECLARE_WRITE16_MEMBER(ibm8514_backmix_w) { m_8514a->ibm8514_backmix_w(space,offset,data,mem_mask); } + DECLARE_READ16_MEMBER(ibm8514_foremix_r) { return m_8514a->ibm8514_foremix_r(space,offset,mem_mask); } + DECLARE_WRITE16_MEMBER(ibm8514_foremix_w) { m_8514a->ibm8514_foremix_w(space,offset,data,mem_mask); } + DECLARE_READ16_MEMBER(ibm8514_multifunc_r) { return m_8514a->ibm8514_multifunc_r(space,offset,mem_mask); } + DECLARE_WRITE16_MEMBER(ibm8514_multifunc_w) { m_8514a->ibm8514_multifunc_w(space,offset,data,mem_mask); } + DECLARE_READ16_MEMBER(ibm8514_pixel_xfer_r) { return m_8514a->ibm8514_pixel_xfer_r(space,offset,mem_mask); } + DECLARE_WRITE16_MEMBER(ibm8514_pixel_xfer_w) { m_8514a->ibm8514_pixel_xfer_w(space,offset,data,mem_mask); } + + // Mach32 specific handlers + DECLARE_READ16_MEMBER(mach32_chipid_r) { return m_8514a->mach32_chipid_r(space,offset,mem_mask); } + DECLARE_READ16_MEMBER(mach8_clksel_r) { return m_8514a->mach8_clksel_r(space,offset,mem_mask); } + DECLARE_WRITE16_MEMBER(mach32_clksel_w) { m_8514a->mach32_clksel_w(space,offset,data,mem_mask); } // read only on the mach8 + DECLARE_READ16_MEMBER(mach32_mem_boundary_r) { return m_8514a->mach32_mem_boundary_r(space,offset,mem_mask); } + DECLARE_WRITE16_MEMBER(mach32_mem_boundary_w) { m_8514a->mach32_mem_boundary_w(space,offset,data,mem_mask); } // read only on the mach8 + DECLARE_READ16_MEMBER(mach32_status_r) { return vga_vblank() << 1; } +protected: + // device-level overrides + virtual void device_start(); + virtual void device_reset(); + virtual machine_config_constructor device_mconfig_additions() const; + +private: +}; + +// device type definition +extern const device_type ATIMACH32; +extern const device_type ATIMACH32_8514A; + +#endif /* MACH32_H_ */ diff --git a/src/emu/bus/isa/vga_ati.c b/src/emu/bus/isa/vga_ati.c index 4637a99ac14..72537e34865 100644 --- a/src/emu/bus/isa/vga_ati.c +++ b/src/emu/bus/isa/vga_ati.c @@ -1,14 +1,18 @@ /* * isa_vga_ati.c * - * Implementation of the ATi Graphics Ultra ISA Video card + * ATi Graphics Ultra ISA Video card * - Uses ATi 28800-6 (VGA Wonder) and ATi 38800-1 (Mach8, 8514/A clone) * + * ATi Graphics Ultra Pro ISA Video card + * - ATi 68800-3 (Mach32, combined VGA and 8514/A) + * * Created on: 9/09/2012 */ #include "emu.h" #include "vga_ati.h" +#include "mach32.h" #include "video/pc_vga.h" ROM_START( gfxultra ) @@ -17,11 +21,17 @@ ROM_START( gfxultra ) ROM_IGNORE( 0x8000 ) ROM_END +ROM_START( gfxultrp ) + ROM_REGION(0x8000,"gfxultrapro", 0) + ROM_LOAD("gfxultrapro.bin", 0x00000, 0x8000, CRC(4e5effd7) SHA1(84ad3abf7653e4734bf39f5d5c8b88e74527e8ce) ) +ROM_END + //************************************************************************** // GLOBAL VARIABLES //************************************************************************** const device_type ISA16_VGA_GFXULTRA = &device_creator; +const device_type ISA16_SVGA_GFXULTRAPRO = &device_creator; static MACHINE_CONFIG_FRAGMENT( vga_ati ) MCFG_SCREEN_ADD("screen", RASTER) @@ -33,6 +43,16 @@ static MACHINE_CONFIG_FRAGMENT( vga_ati ) MCFG_DEVICE_ADD("vga", ATI_VGA, 0) MACHINE_CONFIG_END +static MACHINE_CONFIG_FRAGMENT( vga_mach32 ) + MCFG_SCREEN_ADD("screen", RASTER) + MCFG_SCREEN_RAW_PARAMS(XTAL_25_1748MHz,900,0,640,526,0,480) + MCFG_SCREEN_UPDATE_DEVICE("vga", mach32_device, screen_update) + + MCFG_PALETTE_ADD("palette", 0x100) + + MCFG_DEVICE_ADD("vga", ATIMACH32, 0) +MACHINE_CONFIG_END + //------------------------------------------------- // machine_config_additions - device-specific // machine configurations @@ -43,6 +63,11 @@ machine_config_constructor isa16_vga_gfxultra_device::device_mconfig_additions() return MACHINE_CONFIG_NAME( vga_ati ); } +machine_config_constructor isa16_vga_gfxultrapro_device::device_mconfig_additions() const +{ + return MACHINE_CONFIG_NAME( vga_mach32 ); +} + //------------------------------------------------- // rom_region - device-specific ROM region //------------------------------------------------- @@ -52,6 +77,11 @@ const rom_entry *isa16_vga_gfxultra_device::device_rom_region() const return ROM_NAME( gfxultra ); } +const rom_entry *isa16_vga_gfxultrapro_device::device_rom_region() const +{ + return ROM_NAME( gfxultrp ); +} + //************************************************************************** // LIVE DEVICE //************************************************************************** @@ -61,7 +91,13 @@ const rom_entry *isa16_vga_gfxultra_device::device_rom_region() const //------------------------------------------------- isa16_vga_gfxultra_device::isa16_vga_gfxultra_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : - device_t(mconfig, ISA16_VGA_GFXULTRA, "ATi Graphics Ultra Graphics Card", tag, owner, clock, "gfxultra", __FILE__), + device_t(mconfig, ISA16_VGA_GFXULTRA, "ATi Graphics Ultra Card", tag, owner, clock, "gfxultra", __FILE__), + device_isa16_card_interface(mconfig, *this) +{ +} + +isa16_vga_gfxultrapro_device::isa16_vga_gfxultrapro_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : + device_t(mconfig, ISA16_SVGA_GFXULTRAPRO, "ATi Graphics Ultra Pro Card", tag, owner, clock, "gfxultrp", __FILE__), device_isa16_card_interface(mconfig, *this) { } @@ -70,6 +106,7 @@ isa16_vga_gfxultra_device::isa16_vga_gfxultra_device(const machine_config &mconf // device_start - device-specific startup //------------------------------------------------- READ8_MEMBER(isa16_vga_gfxultra_device::input_port_0_r ) { return 0xff; } //return space.machine().root_device().ioport("IN0")->read(); } +READ8_MEMBER(isa16_vga_gfxultrapro_device::input_port_0_r ) { return 0xff; } //return space.machine().root_device().ioport("IN0")->read(); } void isa16_vga_gfxultra_device::device_start() { @@ -124,6 +161,61 @@ void isa16_vga_gfxultra_device::device_start() m_isa->install_memory(0xa0000, 0xbffff, 0, 0, read8_delegate(FUNC(ati_vga_device::mem_r),m_vga), write8_delegate(FUNC(ati_vga_device::mem_w),m_vga)); } +void isa16_vga_gfxultrapro_device::device_start() +{ + set_isa_device(); + + m_vga = subdevice("vga"); + + m_isa->install_rom(this, 0xc0000, 0xc7fff, 0, 0, "vga", "gfxultrapro"); + + m_isa->install_device(0x1ce, 0x1cf, 0, 0, read8_delegate(FUNC(mach32_device::ati_port_ext_r),m_vga), write8_delegate(FUNC(mach32_device::ati_port_ext_w),m_vga)); + m_isa->install16_device(0x2e8, 0x2eb, 0, 0, read16_delegate(FUNC(mach32_device::mach32_status_r),m_vga), write16_delegate(FUNC(mach32_device::ibm8514_htotal_w),m_vga)); + m_isa->install_device(0x3b0, 0x3bf, 0, 0, read8_delegate(FUNC(mach32_device::port_03b0_r),m_vga), write8_delegate(FUNC(mach32_device::port_03b0_w),m_vga)); + m_isa->install_device(0x3c0, 0x3cf, 0, 0, read8_delegate(FUNC(mach32_device::port_03c0_r),m_vga), write8_delegate(FUNC(mach32_device::port_03c0_w),m_vga)); + m_isa->install_device(0x3d0, 0x3df, 0, 0, read8_delegate(FUNC(mach32_device::port_03d0_r),m_vga), write8_delegate(FUNC(mach32_device::port_03d0_w),m_vga)); + m_isa->install16_device(0x12e8, 0x12eb, 0, 0, read16_delegate(FUNC(mach32_device::ibm8514_vtotal_r),m_vga), write16_delegate(FUNC(mach32_device::ibm8514_vtotal_w),m_vga)); + m_isa->install16_device(0x12ec, 0x12ef, 0, 0, read16_delegate(FUNC(mach32_device::mach8_config1_r),m_vga), write16_delegate()); + m_isa->install16_device(0x16e8, 0x16eb, 0, 0, read16_delegate(FUNC(mach32_device::ibm8514_vdisp_r),m_vga), write16_delegate(FUNC(mach32_device::ibm8514_vdisp_w),m_vga)); + m_isa->install16_device(0x16ec, 0x16ef, 0, 0, read16_delegate(FUNC(mach32_device::mach8_config2_r),m_vga), write16_delegate()); + m_isa->install16_device(0x1ae8, 0x1aeb, 0, 0, read16_delegate(FUNC(mach32_device::ibm8514_vsync_r),m_vga), write16_delegate(FUNC(mach32_device::ibm8514_vsync_w),m_vga)); + m_isa->install16_device(0x26e8, 0x26eb, 0, 0, read16_delegate(FUNC(mach32_device::ibm8514_htotal_r),m_vga),write16_delegate()); + m_isa->install16_device(0x2ee8, 0x2eeb, 0, 0, read16_delegate(FUNC(mach32_device::ibm8514_subcontrol_r),m_vga),write16_delegate()); + m_isa->install16_device(0x42e8, 0x42eb, 0, 0, read16_delegate(FUNC(mach32_device::ibm8514_substatus_r),m_vga), write16_delegate(FUNC(mach32_device::ibm8514_subcontrol_w),m_vga)); + m_isa->install16_device(0x42ec, 0x42ef, 0, 0, read16_delegate(FUNC(mach32_device::mach32_mem_boundary_r),m_vga), write16_delegate(FUNC(mach32_device::mach32_mem_boundary_w),m_vga)); + m_isa->install16_device(0x4aec, 0x4aef, 0, 0, read16_delegate(FUNC(mach32_device::mach8_clksel_r),m_vga), write16_delegate(FUNC(mach32_device::mach32_clksel_w),m_vga)); + m_isa->install16_device(0x52e8, 0x52eb, 0, 0, read16_delegate(FUNC(mach32_device::mach8_ec0_r),m_vga), write16_delegate(FUNC(mach32_device::mach8_ec0_w),m_vga)); + m_isa->install16_device(0x52ec, 0x52ef, 0, 0, read16_delegate(FUNC(mach32_device::mach8_scratch0_r),m_vga), write16_delegate(FUNC(mach32_device::mach8_scratch0_w),m_vga)); + m_isa->install16_device(0x56e8, 0x56eb, 0, 0, read16_delegate(FUNC(mach32_device::mach8_ec1_r),m_vga), write16_delegate(FUNC(mach32_device::mach8_ec1_w),m_vga)); + m_isa->install16_device(0x56ec, 0x56ef, 0, 0, read16_delegate(FUNC(mach32_device::mach8_scratch0_r),m_vga), write16_delegate(FUNC(mach32_device::mach8_scratch0_w),m_vga)); + m_isa->install16_device(0x5ae8, 0x5aeb, 0, 0, read16_delegate(FUNC(mach32_device::mach8_ec2_r),m_vga), write16_delegate(FUNC(mach32_device::mach8_ec2_w),m_vga)); + m_isa->install16_device(0x5ee8, 0x5eeb, 0, 0, read16_delegate(FUNC(mach32_device::mach8_ec3_r),m_vga), write16_delegate(FUNC(mach32_device::mach8_ec3_w),m_vga)); + m_isa->install16_device(0x82e8, 0x82eb, 0, 0, read16_delegate(FUNC(mach32_device::ibm8514_currenty_r),m_vga), write16_delegate(FUNC(mach32_device::ibm8514_currenty_w),m_vga)); + m_isa->install16_device(0x86e8, 0x86eb, 0, 0, read16_delegate(FUNC(mach32_device::ibm8514_currentx_r),m_vga), write16_delegate(FUNC(mach32_device::ibm8514_currentx_w),m_vga)); + m_isa->install16_device(0x8ae8, 0x8aeb, 0, 0, read16_delegate(FUNC(mach32_device::ibm8514_desty_r),m_vga), write16_delegate(FUNC(mach32_device::ibm8514_desty_w),m_vga)); + m_isa->install16_device(0x8ee8, 0x8eeb, 0, 0, read16_delegate(FUNC(mach32_device::ibm8514_destx_r),m_vga), write16_delegate(FUNC(mach32_device::ibm8514_destx_w),m_vga)); + m_isa->install16_device(0x92e8, 0x92eb, 0, 0, read16_delegate(FUNC(mach32_device::ibm8514_line_error_r),m_vga), write16_delegate(FUNC(mach32_device::ibm8514_line_error_w),m_vga)); + m_isa->install16_device(0x96e8, 0x96eb, 0, 0, read16_delegate(FUNC(mach32_device::ibm8514_width_r),m_vga), write16_delegate(FUNC(mach32_device::ibm8514_width_w),m_vga)); + m_isa->install16_device(0x96ec, 0x96ef, 0, 0, read16_delegate(FUNC(mach32_device::mach8_bresenham_count_r),m_vga), write16_delegate(FUNC(mach32_device::mach8_bresenham_count_w),m_vga)); + m_isa->install16_device(0x9ae8, 0x9aeb, 0, 0, read16_delegate(FUNC(mach32_device::ibm8514_gpstatus_r),m_vga), write16_delegate(FUNC(mach32_device::ibm8514_cmd_w),m_vga)); + m_isa->install16_device(0x9aec, 0x9aef, 0, 0, read16_delegate(FUNC(mach32_device::mach8_ext_fifo_r),m_vga), write16_delegate(FUNC(mach32_device::mach8_linedraw_index_w),m_vga)); + m_isa->install16_device(0x9ee8, 0x9eeb, 0, 0, read16_delegate(FUNC(mach32_device::ibm8514_ssv_r),m_vga), write16_delegate(FUNC(mach32_device::ibm8514_ssv_w),m_vga)); + m_isa->install16_device(0xa2e8, 0xa2eb, 0, 0, read16_delegate(FUNC(mach32_device::ibm8514_bgcolour_r),m_vga), write16_delegate(FUNC(mach32_device::ibm8514_bgcolour_w),m_vga)); + m_isa->install16_device(0xa6e8, 0xa6eb, 0, 0, read16_delegate(FUNC(mach32_device::ibm8514_fgcolour_r),m_vga), write16_delegate(FUNC(mach32_device::ibm8514_fgcolour_w),m_vga)); + m_isa->install16_device(0xaae8, 0xaaeb, 0, 0, read16_delegate(FUNC(mach32_device::ibm8514_write_mask_r),m_vga), write16_delegate(FUNC(mach32_device::ibm8514_write_mask_w),m_vga)); + m_isa->install16_device(0xaee8, 0xaeeb, 0, 0, read16_delegate(FUNC(mach32_device::ibm8514_read_mask_r),m_vga), write16_delegate(FUNC(mach32_device::ibm8514_read_mask_w),m_vga)); + m_isa->install16_device(0xb6e8, 0xb6eb, 0, 0, read16_delegate(FUNC(mach32_device::ibm8514_backmix_r),m_vga), write16_delegate(FUNC(mach32_device::ibm8514_backmix_w),m_vga)); + m_isa->install16_device(0xbae8, 0xbaeb, 0, 0, read16_delegate(FUNC(mach32_device::ibm8514_foremix_r),m_vga), write16_delegate(FUNC(mach32_device::ibm8514_foremix_w),m_vga)); + m_isa->install16_device(0xbee8, 0xbeeb, 0, 0, read16_delegate(FUNC(mach32_device::ibm8514_multifunc_r),m_vga), write16_delegate(FUNC(mach32_device::ibm8514_multifunc_w),m_vga)); + m_isa->install16_device(0xe2e8, 0xe2eb, 0, 0, read16_delegate(FUNC(mach32_device::ibm8514_pixel_xfer_r),m_vga), write16_delegate(FUNC(mach32_device::ibm8514_pixel_xfer_w),m_vga)); + m_isa->install16_device(0xdaec, 0xdaef, 0, 0, read16_delegate(FUNC(mach32_device::mach8_sourcex_r),m_vga), write16_delegate(FUNC(mach32_device::mach8_ext_leftscissor_w),m_vga)); + m_isa->install16_device(0xdeec, 0xdeef, 0, 0, read16_delegate(FUNC(mach32_device::mach8_sourcey_r),m_vga), write16_delegate(FUNC(mach32_device::mach8_ext_topscissor_w),m_vga)); + m_isa->install16_device(0xfaec, 0xfaef, 0, 0, read16_delegate(FUNC(mach32_device::mach32_chipid_r),m_vga), write16_delegate()); + m_isa->install16_device(0xfeec, 0xfeef, 0, 0, read16_delegate(FUNC(mach32_device::mach8_linedraw_r),m_vga), write16_delegate(FUNC(mach32_device::mach8_linedraw_w),m_vga)); + + m_isa->install_memory(0xa0000, 0xbffff, 0, 0, read8_delegate(FUNC(mach32_device::mem_r),m_vga), write8_delegate(FUNC(mach32_device::mem_w),m_vga)); +} + //------------------------------------------------- // device_reset - device-specific reset //------------------------------------------------- @@ -131,3 +223,7 @@ void isa16_vga_gfxultra_device::device_start() void isa16_vga_gfxultra_device::device_reset() { } + +void isa16_vga_gfxultrapro_device::device_reset() +{ +} diff --git a/src/emu/bus/isa/vga_ati.h b/src/emu/bus/isa/vga_ati.h index 4f7161cc6a1..ced53e01b16 100644 --- a/src/emu/bus/isa/vga_ati.h +++ b/src/emu/bus/isa/vga_ati.h @@ -1,7 +1,7 @@ /* * isa_vga_ati.h * - * Header for ATi Graphics Ultra ISA video card + * Header for ATi Graphics Ultra/Graphics Ultra Pro ISA video cards * * Created on: 9/09/2012 */ @@ -13,6 +13,7 @@ #include "emu.h" #include "isa.h" #include "video/pc_vga.h" +#include "mach32.h" //************************************************************************** // TYPE DEFINITIONS @@ -42,9 +43,31 @@ private: mach8_device *m_8514; }; +class isa16_vga_gfxultrapro_device : + public device_t, + public device_isa16_card_interface +{ +public: + // construction/destruction + isa16_vga_gfxultrapro_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + + // optional information overrides + virtual machine_config_constructor device_mconfig_additions() const; + virtual const rom_entry *device_rom_region() const; + + DECLARE_READ8_MEMBER(input_port_0_r); +protected: + // device-level overrides + virtual void device_start(); + virtual void device_reset(); +private: + mach32_device *m_vga; +}; + // device type definition extern const device_type ISA16_VGA_GFXULTRA; +extern const device_type ISA16_SVGA_GFXULTRAPRO; #endif /* ISA_VGA_ATI_H_ */ diff --git a/src/emu/video/pc_vga.c b/src/emu/video/pc_vga.c index 1881b6f9c57..336bb33b8dc 100644 --- a/src/emu/video/pc_vga.c +++ b/src/emu/video/pc_vga.c @@ -275,7 +275,9 @@ void ati_vga_device::device_start() { svga_device::device_start(); memset(&ati, 0, sizeof(ati)); + save_pointer(ati.ext_reg,"ATi Extended Registers",64); m_8514 = subdevice("8514a"); + ati.vga_chip_id = 0x06; // 28800-6 } void s3_vga_device::device_start() @@ -5303,8 +5305,16 @@ READ8_MEMBER(ati_vga_device::mem_r) { if(svga.rgb8_en || svga.rgb15_en || svga.rgb16_en || svga.rgb24_en) { - offset &= 0xffff; - return vga.memory[(offset+svga.bank_r*0x10000)]; + if(ati.ext_reg[0x3d] & 0x04) + { + offset &= 0x1ffff; + return vga.memory[(offset+svga.bank_r*0x20000)]; + } + else + { + offset &= 0xffff; + return vga.memory[(offset+svga.bank_r*0x10000)]; + } } return vga_device::mem_r(space,offset,mem_mask); @@ -5314,8 +5324,16 @@ WRITE8_MEMBER(ati_vga_device::mem_w) { if(svga.rgb8_en || svga.rgb15_en || svga.rgb16_en || svga.rgb24_en) { - offset &= 0xffff; - vga.memory[(offset+svga.bank_w*0x10000)] = data; + if(ati.ext_reg[0x3d] & 0x04) + { + offset &= 0x1ffff; + vga.memory[(offset+svga.bank_w*0x20000)] = data; + } + else + { + offset &= 0xffff; + vga.memory[(offset+svga.bank_w*0x10000)] = data; + } } else vga_device::mem_w(space,offset,data,mem_mask); @@ -5336,8 +5354,14 @@ READ8_MEMBER(ati_vga_device::ati_port_ext_r) case 0x20: ret = 0x10; // 512kB memory break; + case 0x28: // Vertical line counter (high) + ret = (machine().first_screen()->vpos() >> 8) & 0x03; + break; + case 0x29: // Vertical line counter (low) + ret = machine().first_screen()->vpos() & 0xff; // correct? + break; case 0x2a: - ret = 0x06; // Chip revision (6 for the 28800-6, 5 for the 28800-5) + ret = ati.vga_chip_id; // Chip revision (6 for the 28800-6, 5 for the 28800-5) break; case 0x37: { @@ -5346,8 +5370,13 @@ READ8_MEMBER(ati_vga_device::ati_port_ext_r) ret |= eep->do_read() << 3; } break; + case 0x3d: + ret = ati.ext_reg[ati.ext_reg_select] & 0x0f; + ret |= 0x10; // EGA DIP switch emulation + break; default: ret = ati.ext_reg[ati.ext_reg_select]; + logerror("ATI: Extended VGA register 0x01CE index %02x read\n",ati.ext_reg_select); } break; } @@ -5398,7 +5427,6 @@ WRITE8_MEMBER(ati_vga_device::ati_port_ext_w) //logerror("ATI: Memory Page Select write %02x (read: %i write %i)\n",data,svga.bank_r,svga.bank_w); break; case 0x33: // EEPROM - if(data & 0x04) { eeprom_serial_93cxx_device* eep = subdevice("ati_eeprom"); diff --git a/src/emu/video/pc_vga.h b/src/emu/video/pc_vga.h index 7782f3b5b02..282ea401e9e 100644 --- a/src/emu/video/pc_vga.h +++ b/src/emu/video/pc_vga.h @@ -398,6 +398,8 @@ public: READ16_MEMBER(mach8_sourcey_r); WRITE16_MEMBER(mach8_ext_leftscissor_w); WRITE16_MEMBER(mach8_ext_topscissor_w); + READ16_MEMBER(mach8_clksel_r) { return mach8.clksel; } + protected: virtual void device_start(); struct @@ -405,6 +407,7 @@ protected: UINT16 scratch0; UINT16 scratch1; UINT16 linedraw; + UINT16 clksel; } mach8; }; @@ -522,6 +525,7 @@ private: { UINT8 ext_reg[64]; UINT8 ext_reg_select; + UINT8 vga_chip_id; } ati; mach8_device* m_8514; };