From 3936865455978ebaf2731cf1872cd9bb52ceb14e Mon Sep 17 00:00:00 2001 From: angelosa Date: Sun, 25 Feb 2024 16:55:30 +0100 Subject: [PATCH] video/pc_vga_s3: separate Vision864/964/968 from Trio64, fix SDD UVCONFIG.EXE detection --- src/devices/bus/pci/vision.cpp | 98 +++++++++++++------------ src/devices/bus/pci/vision.h | 24 +++--- src/devices/video/pc_vga_s3.cpp | 125 +++++++++++++++++++++++++------- src/devices/video/pc_vga_s3.h | 40 +++++++++- 4 files changed, 196 insertions(+), 91 deletions(-) diff --git a/src/devices/bus/pci/vision.cpp b/src/devices/bus/pci/vision.cpp index 15fd057c040..7ae4a42556a 100644 --- a/src/devices/bus/pci/vision.cpp +++ b/src/devices/bus/pci/vision.cpp @@ -5,7 +5,9 @@ S3 Vision 864 / 868 / 964 / 968 TODO: -- Downgrade S3_VGA (gets detected as Trio card with SDD UVCONFIG.EXE) +- Add Vision868 +- Add Trio32/Trio64, pillage roms from isa/svga_s3 +- Make ViRGE to derive from here rather than reinventing the wheel **************************************************************************************************/ @@ -21,22 +23,22 @@ TODO: #define LOGWARN(...) LOGMASKED(LOG_WARN, __VA_ARGS__) -DEFINE_DEVICE_TYPE(VISION864_PCI, vision864_device, "vision864", "S3 86C864 Vision864") +DEFINE_DEVICE_TYPE(VISION864_PCI, vision864_pci_device, "vision864", "S3 86C864 Vision864") // Vision868 -DEFINE_DEVICE_TYPE(VISION964_PCI, vision964_device, "vision964", "S3 86C964 Vision964") -DEFINE_DEVICE_TYPE(VISION968_PCI, vision968_device, "vision968", "S3 86C968 Vision968") +DEFINE_DEVICE_TYPE(VISION964_PCI, vision964_pci_device, "vision964", "S3 86C964 Vision964") +DEFINE_DEVICE_TYPE(VISION968_PCI, vision968_pci_device, "vision968", "S3 86C968 Vision968") -vision864_device::vision864_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock) +vision864_pci_device::vision864_pci_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock) : pci_card_device(mconfig, type, tag, owner, clock) , m_vga(*this, "vga") , m_bios(*this, "bios") { } -vision864_device::vision864_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) - : vision864_device(mconfig, VISION864_PCI, tag, owner, clock) +vision864_pci_device::vision864_pci_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) + : vision864_pci_device(mconfig, VISION864_PCI, tag, owner, clock) { // device IDs: // 88c0 = 86c864 DRAM v0 @@ -54,28 +56,28 @@ ROM_START( vision864 ) ROM_IGNORE( 0x8000 ) ROM_END -const tiny_rom_entry *vision864_device::device_rom_region() const +const tiny_rom_entry *vision864_pci_device::device_rom_region() const { return ROM_NAME(vision864); } -void vision864_device::device_add_mconfig(machine_config &config) +void vision864_pci_device::device_add_mconfig(machine_config &config) { screen_device &screen(SCREEN(config, "screen", SCREEN_TYPE_RASTER)); screen.set_raw(XTAL(25'174'800), 900, 0, 640, 526, 0, 480); - screen.set_screen_update("vga", FUNC(s3trio64_vga_device::screen_update)); + screen.set_screen_update("vga", FUNC(s3vision864_vga_device::screen_update)); - S3_TRIO64_VGA(config, m_vga, 0); + S3_VISION864_VGA(config, m_vga, 0); m_vga->set_screen("screen"); // 1MB, option for 2MB m_vga->set_vram_size(2*1024*1024); } -void vision864_device::device_start() +void vision864_pci_device::device_start() { pci_card_device::device_start(); -// add_map(64 * 1024 * 1024, M_MEM | M_DISABLED, FUNC(vision864_device::lfb_map)); +// add_map(64 * 1024 * 1024, M_MEM | M_DISABLED, FUNC(vision864_pci_device::lfb_map)); // set_map_address(0, 0x70000000); add_rom((u8 *)m_bios->base(), 0x8000); @@ -84,7 +86,7 @@ void vision864_device::device_start() // TODO: can't read the intr pin reg but still has an INTA# } -void vision864_device::device_reset() +void vision864_pci_device::device_reset() { pci_card_device::device_reset(); @@ -96,32 +98,32 @@ void vision864_device::device_reset() remap_cb(); } -void vision864_device::legacy_io_map(address_map &map) +void vision864_pci_device::legacy_io_map(address_map &map) { - map(0, 0x02f).m(m_vga, FUNC(s3trio64_vga_device::io_map)); + map(0, 0x02f).m(m_vga, FUNC(s3vision864_vga_device::io_map)); } -uint8_t vision864_device::vram_r(offs_t offset) +uint8_t vision864_pci_device::vram_r(offs_t offset) { - return downcast(m_vga.target())->mem_r(offset); + return downcast(m_vga.target())->mem_r(offset); } -void vision864_device::vram_w(offs_t offset, uint8_t data) +void vision864_pci_device::vram_w(offs_t offset, uint8_t data) { - downcast(m_vga.target())->mem_w(offset, data); + downcast(m_vga.target())->mem_w(offset, data); } -void vision864_device::map_extra(uint64_t memory_window_start, uint64_t memory_window_end, uint64_t memory_offset, address_space *memory_space, +void vision864_pci_device::map_extra(uint64_t memory_window_start, uint64_t memory_window_end, uint64_t memory_offset, address_space *memory_space, uint64_t io_window_start, uint64_t io_window_end, uint64_t io_offset, address_space *io_space) { if (BIT(command, 1)) { - memory_space->install_readwrite_handler(0xa0000, 0xbffff, read8sm_delegate(*this, FUNC(vision864_device::vram_r)), write8sm_delegate(*this, FUNC(vision864_device::vram_w))); + memory_space->install_readwrite_handler(0xa0000, 0xbffff, read8sm_delegate(*this, FUNC(vision864_pci_device::vram_r)), write8sm_delegate(*this, FUNC(vision864_pci_device::vram_w))); } if (BIT(command, 0)) { - io_space->install_device(0x03b0, 0x03df, *this, &vision864_device::legacy_io_map); + io_space->install_device(0x03b0, 0x03df, *this, &vision864_pci_device::legacy_io_map); } } @@ -131,13 +133,13 @@ void vision864_device::map_extra(uint64_t memory_window_start, uint64_t memory_w * *****************/ -vision964_device::vision964_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock) - : vision864_device(mconfig, type, tag, owner, clock) +vision964_pci_device::vision964_pci_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock) + : vision864_pci_device(mconfig, type, tag, owner, clock) { } -vision964_device::vision964_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) - : vision964_device(mconfig, VISION964_PCI, tag, owner, clock) +vision964_pci_device::vision964_pci_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) + : vision964_pci_device(mconfig, VISION964_PCI, tag, owner, clock) { // device IDs: // 88d0-88d1 = 86c964 VRAM v0-1 @@ -154,18 +156,18 @@ ROM_START( vision964 ) ROMX_LOAD( "mirocrystal.vbi", 0x0000, 0x8000, CRC(d0b0aa1c) SHA1(004e2432c4783f1539a7989e7d9ee422df09e695), ROM_BIOS(0) ) ROM_END -const tiny_rom_entry *vision964_device::device_rom_region() const +const tiny_rom_entry *vision964_pci_device::device_rom_region() const { return ROM_NAME(vision964); } -void vision964_device::device_add_mconfig(machine_config &config) +void vision964_pci_device::device_add_mconfig(machine_config &config) { screen_device &screen(SCREEN(config, "screen", SCREEN_TYPE_RASTER)); screen.set_raw(XTAL(25'174'800), 900, 0, 640, 526, 0, 480); - screen.set_screen_update("vga", FUNC(s3trio64_vga_device::screen_update)); + screen.set_screen_update("vga", FUNC(s3vision964_vga_device::screen_update)); - S3_TRIO64_VGA(config, m_vga, 0); + S3_VISION964_VGA(config, m_vga, 0); m_vga->set_screen("screen"); // 2MB/4MB/8MB m_vga->set_vram_size(4*1024*1024); @@ -178,8 +180,8 @@ void vision964_device::device_add_mconfig(machine_config &config) * *****************/ -vision968_device::vision968_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) - : vision964_device(mconfig, VISION968_PCI, tag, owner, clock) +vision968_pci_device::vision968_pci_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) + : vision964_pci_device(mconfig, VISION968_PCI, tag, owner, clock) { // device IDs: // 88f0-88f3 = 86c968 RAM v0-3 @@ -204,30 +206,30 @@ ROM_START( vision968 ) ROM_IGNORE( 0x8000 ) ROM_END -const tiny_rom_entry *vision968_device::device_rom_region() const +const tiny_rom_entry *vision968_pci_device::device_rom_region() const { return ROM_NAME(vision968); } -void vision968_device::device_add_mconfig(machine_config &config) +void vision968_pci_device::device_add_mconfig(machine_config &config) { screen_device &screen(SCREEN(config, "screen", SCREEN_TYPE_RASTER)); screen.set_raw(XTAL(25'174'800), 900, 0, 640, 526, 0, 480); - screen.set_screen_update("vga", FUNC(s3trio64_vga_device::screen_update)); + screen.set_screen_update("vga", FUNC(s3vision968_vga_device::screen_update)); - S3_TRIO64_VGA(config, m_vga, 0); + S3_VISION968_VGA(config, m_vga, 0); m_vga->set_screen("screen"); // 2MB/4MB/8MB m_vga->set_vram_size(4*1024*1024); -// m_vga->linear_config_changed().set(FUNC(s3trio64_vga_device::linear_config_changed_w)); +// m_vga->linear_config_changed().set(FUNC(s3vision864_vga_device::linear_config_changed_w)); } -void vision968_device::device_start() +void vision968_pci_device::device_start() { pci_card_device::device_start(); -// add_map(64 * 1024 * 1024, M_MEM | M_DISABLED, FUNC(vision968_device::lfb_map)); - add_map(64 * 1024 * 1024, M_MEM, FUNC(vision968_device::lfb_map)); +// add_map(64 * 1024 * 1024, M_MEM | M_DISABLED, FUNC(vision968_pci_device::lfb_map)); + add_map(64 * 1024 * 1024, M_MEM, FUNC(vision968_pci_device::lfb_map)); set_map_address(0, 0x70000000); add_rom((u8 *)m_bios->base(), 0x8000); @@ -237,7 +239,7 @@ void vision968_device::device_start() intr_pin = 1; } -void vision968_device::device_reset() +void vision968_pci_device::device_reset() { pci_card_device::device_reset(); @@ -250,15 +252,15 @@ void vision968_device::device_reset() } // TODO: 0x0200'0000 "mirror" (really an endian relocation?) -void vision968_device::lfb_map(address_map &map) +void vision968_pci_device::lfb_map(address_map &map) { - map(0x0000'0000, 0x00ff'ffff).rw(m_vga, FUNC(s3trio64_vga_device::mem_linear_r), FUNC(s3trio64_vga_device::mem_linear_w)); + map(0x0000'0000, 0x00ff'ffff).rw(m_vga, FUNC(s3vision864_vga_device::mem_linear_r), FUNC(s3vision864_vga_device::mem_linear_w)); // map(0x0100'0000, 0x0100'7fff) image transfer data - map(0x0100'8000, 0x0100'803f).m(FUNC(vision968_device::config_map)); + map(0x0100'8000, 0x0100'803f).m(FUNC(vision968_pci_device::config_map)); // map(0x0100'8100, 0x0100'816f) packed copro regs // map(0x0100'82e8, 0x0100'82e8) current ypos // map(0x0100'82ea, 0x0100'82ea) current ypos-2 - map(0x0100'83b0, 0x0100'83df).m(m_vga, FUNC(s3trio64_vga_device::io_map)); + map(0x0100'83b0, 0x0100'83df).m(m_vga, FUNC(s3vision968_vga_device::io_map)); // map(0x0100'8502, 0x0100'8502) (VGA $0102 alias) // map(0x0100'8504, 0x0100'8504) (VGA $42e8 alias) // map(0x0100'8508, 0x0100'8508) (VGA $46e8 alias) @@ -269,10 +271,10 @@ void vision968_device::lfb_map(address_map &map) // map(0x0101'8080, 0x0101'809f) Pixel formatter regs } -void vision968_device::map_extra(uint64_t memory_window_start, uint64_t memory_window_end, uint64_t memory_offset, address_space *memory_space, +void vision968_pci_device::map_extra(uint64_t memory_window_start, uint64_t memory_window_end, uint64_t memory_offset, address_space *memory_space, uint64_t io_window_start, uint64_t io_window_end, uint64_t io_offset, address_space *io_space) { - vision964_device::map_extra( + vision964_pci_device::map_extra( memory_window_start, memory_window_end, memory_offset, memory_space, io_window_start, io_window_end, io_offset, io_space ); diff --git a/src/devices/bus/pci/vision.h b/src/devices/bus/pci/vision.h index 33150702a76..f1e9439ddb6 100644 --- a/src/devices/bus/pci/vision.h +++ b/src/devices/bus/pci/vision.h @@ -10,17 +10,17 @@ #include "video/pc_vga_s3.h" -class vision864_device : public pci_card_device +class vision864_pci_device : public pci_card_device { public: - vision864_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); + vision864_pci_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); static constexpr feature_type imperfect_features() { return feature::GRAPHICS; } void legacy_io_map(address_map &map); protected: - vision864_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock); + vision864_pci_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock); virtual void device_start() override; virtual void device_reset() override; @@ -31,30 +31,30 @@ protected: virtual void map_extra(uint64_t memory_window_start, uint64_t memory_window_end, uint64_t memory_offset, address_space *memory_space, uint64_t io_window_start, uint64_t io_window_end, uint64_t io_offset, address_space *io_space) override; - required_device m_vga; + required_device m_vga; required_memory_region m_bios; private: u8 vram_r(offs_t offset); void vram_w(offs_t offset, uint8_t data); }; -class vision964_device : public vision864_device +class vision964_pci_device : public vision864_pci_device { public: - vision964_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); + vision964_pci_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); protected: - vision964_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock); + vision964_pci_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock); virtual void device_add_mconfig(machine_config &config) override; virtual const tiny_rom_entry *device_rom_region() const override; }; -class vision968_device : public vision964_device +class vision968_pci_device : public vision964_pci_device { public: - vision968_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); + vision968_pci_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); protected: virtual void device_add_mconfig(machine_config &config) override; @@ -69,8 +69,8 @@ protected: void lfb_map(address_map &map); }; -DECLARE_DEVICE_TYPE(VISION864_PCI, vision864_device) -DECLARE_DEVICE_TYPE(VISION964_PCI, vision964_device) -DECLARE_DEVICE_TYPE(VISION968_PCI, vision968_device) +DECLARE_DEVICE_TYPE(VISION864_PCI, vision864_pci_device) +DECLARE_DEVICE_TYPE(VISION964_PCI, vision964_pci_device) +DECLARE_DEVICE_TYPE(VISION968_PCI, vision968_pci_device) #endif // MAME_BUS_PCI_S3VISION_PCI_H diff --git a/src/devices/video/pc_vga_s3.cpp b/src/devices/video/pc_vga_s3.cpp index cc29993b972..9f29b4a5bf6 100644 --- a/src/devices/video/pc_vga_s3.cpp +++ b/src/devices/video/pc_vga_s3.cpp @@ -21,28 +21,29 @@ enum MACH8_DRAWING_SCAN }; +DEFINE_DEVICE_TYPE(S3_VISION864_VGA, s3vision864_vga_device, "s3_86c864_vga", "S3 86c864 Vision864 VGA i/f") +DEFINE_DEVICE_TYPE(S3_VISION964_VGA, s3vision964_vga_device, "s3_86c864_vga", "S3 86c964 Vision964 VGA i/f") +DEFINE_DEVICE_TYPE(S3_VISION968_VGA, s3vision968_vga_device, "s3_86c868_vga", "S3 86c968 Vision968 VGA i/f") +DEFINE_DEVICE_TYPE(S3_TRIO64_VGA, s3trio64_vga_device, "s3_86c764_vga", "S3 86c764 Trio64 VGA i/f") -DEFINE_DEVICE_TYPE(S3_TRIO64_VGA, s3trio64_vga_device, "s3_vga", "S3 86c764 Trio64 VGA i/f") - -s3trio64_vga_device::s3trio64_vga_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) - : s3trio64_vga_device(mconfig, S3_TRIO64_VGA, tag, owner, clock) +s3vision864_vga_device::s3vision864_vga_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) + : s3vision864_vga_device(mconfig, S3_VISION864_VGA, tag, owner, clock) { - } -s3trio64_vga_device::s3trio64_vga_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock) +s3vision864_vga_device::s3vision864_vga_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock) : svga_device(mconfig, type, tag, owner, clock) { - m_crtc_space_config = address_space_config("crtc_regs", ENDIANNESS_LITTLE, 8, 8, 0, address_map_constructor(FUNC(s3trio64_vga_device::crtc_map), this)); - m_seq_space_config = address_space_config("sequencer_regs", ENDIANNESS_LITTLE, 8, 8, 0, address_map_constructor(FUNC(s3trio64_vga_device::sequencer_map), this)); + m_crtc_space_config = address_space_config("crtc_regs", ENDIANNESS_LITTLE, 8, 8, 0, address_map_constructor(FUNC(s3vision864_vga_device::crtc_map), this)); + m_seq_space_config = address_space_config("sequencer_regs", ENDIANNESS_LITTLE, 8, 8, 0, address_map_constructor(FUNC(s3vision864_vga_device::sequencer_map), this)); } -void s3trio64_vga_device::device_add_mconfig(machine_config &config) +void s3vision864_vga_device::device_add_mconfig(machine_config &config) { IBM8514A(config, "8514a", 0).set_vga_owner(); } -TIMER_CALLBACK_MEMBER(s3trio64_vga_device::vblank_timer_cb) +TIMER_CALLBACK_MEMBER(s3vision864_vga_device::vblank_timer_cb) { // not sure if this is correct, but XF86_S3 seems to expect the viewport scrolling to be faster if(s3.memory_config & 0x08) @@ -53,7 +54,7 @@ TIMER_CALLBACK_MEMBER(s3trio64_vga_device::vblank_timer_cb) m_vblank_timer->adjust( screen().time_until_pos(vga.crtc.vert_blank_start + vga.crtc.vert_blank_end) ); } -void s3trio64_vga_device::device_start() +void s3vision864_vga_device::device_start() { svga_device::device_start(); memset(&s3, 0, sizeof(s3)); @@ -65,15 +66,12 @@ void s3trio64_vga_device::device_start() s3.cursor_bg[x] = 0x00; } m_8514 = subdevice("8514a"); - // set device ID - s3.id_high = 0x88; // CR2D - s3.id_low = 0x11; // CR2E - s3.revision = 0x00; // CR2F - s3.id_cr30 = 0xe1; // CR30 -// s3.id_cr30 = 0xc1; + + s3.id_high = s3.id_low = s3.revision = 0; // + s3.id_cr30 = 0xc1; } -void s3trio64_vga_device::device_reset() +void s3vision864_vga_device::device_reset() { vga_device::device_reset(); // Power-on strapping bits. Sampled at reset, but can be modified later. @@ -84,13 +82,13 @@ void s3trio64_vga_device::device_reset() s3.sr11 = 0x41; } -u16 s3trio64_vga_device::line_compare_mask() +u16 s3vision864_vga_device::line_compare_mask() { // TODO: pinpoint condition return svga.rgb8_en ? 0x7ff : 0x3ff; } -uint16_t s3trio64_vga_device::offset() +uint16_t s3vision864_vga_device::offset() { //popmessage("Offset: %04x %s %s %s",vga.crtc.offset,vga.crtc.dw?"DW":"--",vga.crtc.word_mode?"BYTE":"WORD",(s3.memory_config & 0x08)?"31":"--"); if(s3.memory_config & 0x08) @@ -98,7 +96,7 @@ uint16_t s3trio64_vga_device::offset() return vga_device::offset(); } -void s3trio64_vga_device::s3_define_video_mode() +void s3vision864_vga_device::s3_define_video_mode() { int divisor = 1; int xtal = ((vga.miscellaneous_output & 0xc) ? XTAL(28'636'363) : XTAL(25'174'800)).value(); @@ -151,7 +149,7 @@ void s3trio64_vga_device::s3_define_video_mode() recompute_params_clock(divisor, xtal); } -void s3trio64_vga_device::refresh_pitch_offset() +void s3vision864_vga_device::refresh_pitch_offset() { // bit 2 = bit 8 of offset register, but only if bits 4-5 of CR51 are 00h. vga.crtc.offset &= 0xff; @@ -161,7 +159,7 @@ void s3trio64_vga_device::refresh_pitch_offset() vga.crtc.offset |= (s3.cr51 & 0x30) << 4; } -void s3trio64_vga_device::crtc_map(address_map &map) +void s3vision864_vga_device::crtc_map(address_map &map) { svga_device::crtc_map(map); map(0x2d, 0x2d).lr8( @@ -665,7 +663,7 @@ bit 0 Vertical Total bit 10. Bit 10 of the Vertical Total register (3d4h ); } -void s3trio64_vga_device::sequencer_map(address_map &map) +void s3vision864_vga_device::sequencer_map(address_map &map) { svga_device::sequencer_map(map); // TODO: SR8 (unlocks SRD) @@ -721,7 +719,7 @@ void s3trio64_vga_device::sequencer_map(address_map &map) ); } -uint8_t s3trio64_vga_device::mem_r(offs_t offset) +uint8_t s3vision864_vga_device::mem_r(offs_t offset) { if (svga.rgb8_en || svga.rgb15_en || svga.rgb16_en || svga.rgb32_en) { @@ -755,7 +753,7 @@ uint8_t s3trio64_vga_device::mem_r(offs_t offset) return 0xff; } -void s3trio64_vga_device::mem_w(offs_t offset, uint8_t data) +void s3vision864_vga_device::mem_w(offs_t offset, uint8_t data) { ibm8514a_device* dev = get_8514(); // bit 4 of CR53 enables memory-mapped I/O @@ -1025,7 +1023,7 @@ void s3trio64_vga_device::mem_w(offs_t offset, uint8_t data) } -uint32_t s3trio64_vga_device::screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) +uint32_t s3vision864_vga_device::screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) { svga_device::screen_update(screen, bitmap, cliprect); @@ -1148,3 +1146,76 @@ uint32_t s3trio64_vga_device::screen_update(screen_device &screen, bitmap_rgb32 } return 0; } + +/****************** + * + * Vision 964 + * + *****************/ + +s3vision964_vga_device::s3vision964_vga_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) + : s3vision964_vga_device(mconfig, S3_VISION964_VGA, tag, owner, clock) +{ +} + +s3vision964_vga_device::s3vision964_vga_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock) + : s3vision864_vga_device(mconfig, type, tag, owner, clock) +{ +} + +void s3vision964_vga_device::device_start() +{ + s3vision864_vga_device::device_start(); + s3.id_high = s3.id_low = s3.revision = 0; // + s3.id_cr30 = 0xd0; // CR30, assume rev 0 +} + +/****************** + * + * Vision968 + * + *****************/ + +s3vision968_vga_device::s3vision968_vga_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) + : s3vision968_vga_device(mconfig, S3_VISION968_VGA, tag, owner, clock) +{ +} + +s3vision968_vga_device::s3vision968_vga_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock) + : s3vision964_vga_device(mconfig, type, tag, owner, clock) +{ +} + +void s3vision968_vga_device::device_start() +{ + s3vision964_vga_device::device_start(); + s3.id_high = 0x88; // CR2D + s3.id_low = 0xf0; // CR2E + s3.revision = 0x00; // CR2F + s3.id_cr30 = 0xe1; // CR30 +} + +/****************** + * + * Trio 64 + * + *****************/ + +s3trio64_vga_device::s3trio64_vga_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) + : s3trio64_vga_device(mconfig, S3_TRIO64_VGA, tag, owner, clock) +{ +} + +s3trio64_vga_device::s3trio64_vga_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock) + : s3vision968_vga_device(mconfig, type, tag, owner, clock) +{ +} + +void s3trio64_vga_device::device_start() +{ + s3vision968_vga_device::device_start(); + s3.id_high = 0x88; // CR2D + s3.id_low = 0x11; // CR2E + s3.revision = 0x00; // CR2F + s3.id_cr30 = 0xe1; // CR30 +} diff --git a/src/devices/video/pc_vga_s3.h b/src/devices/video/pc_vga_s3.h index 376ed18ca63..90d54dbad85 100644 --- a/src/devices/video/pc_vga_s3.h +++ b/src/devices/video/pc_vga_s3.h @@ -10,12 +10,11 @@ #include "screen.h" - -class s3trio64_vga_device : public svga_device +class s3vision864_vga_device : public svga_device { public: // construction/destruction - s3trio64_vga_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); + s3vision864_vga_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); virtual uint8_t mem_r(offs_t offset) override; virtual void mem_w(offs_t offset, uint8_t data) override; @@ -27,7 +26,7 @@ public: ibm8514a_device* get_8514() { return m_8514; } protected: - s3trio64_vga_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock); + s3vision864_vga_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock); // device-level overrides virtual void device_start() override; @@ -97,7 +96,40 @@ private: void refresh_pitch_offset(); }; +class s3vision964_vga_device : public s3vision864_vga_device +{ +public: + s3vision964_vga_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); + +protected: + s3vision964_vga_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock); + virtual void device_start() override; +}; + +class s3vision968_vga_device : public s3vision964_vga_device +{ +public: + s3vision968_vga_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); + +protected: + s3vision968_vga_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock); + virtual void device_start() override; +}; + +class s3trio64_vga_device : public s3vision968_vga_device +{ +public: + s3trio64_vga_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); + +protected: + s3trio64_vga_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock); + virtual void device_start() override; +}; + // device type definition +DECLARE_DEVICE_TYPE(S3_VISION864_VGA, s3vision864_vga_device) +DECLARE_DEVICE_TYPE(S3_VISION964_VGA, s3vision964_vga_device) +DECLARE_DEVICE_TYPE(S3_VISION968_VGA, s3vision968_vga_device) DECLARE_DEVICE_TYPE(S3_TRIO64_VGA, s3trio64_vga_device) #endif // MAME_VIDEO_PC_VGA_S3_H