From b0106699cbd1dee19eaf79a6ebb10229ec99fa3a Mon Sep 17 00:00:00 2001 From: angelosa Date: Sat, 9 Dec 2023 16:27:52 +0100 Subject: video/voodoo_pci.cpp: add Voodoo Banshee x86 BIOSes [VGA Legacy MKIII] --- src/devices/video/voodoo_pci.cpp | 44 +++++++++++++++++++++++++++++++++++++++- src/devices/video/voodoo_pci.h | 25 +++++++++++++++++++++++ src/mame/misc/xtom3d.cpp | 2 +- 3 files changed, 69 insertions(+), 2 deletions(-) diff --git a/src/devices/video/voodoo_pci.cpp b/src/devices/video/voodoo_pci.cpp index e27413c8851..856b5fcc589 100644 --- a/src/devices/video/voodoo_pci.cpp +++ b/src/devices/video/voodoo_pci.cpp @@ -49,6 +49,9 @@ DEFINE_DEVICE_TYPE(VOODOO_2_PCI, voodoo_2_pci_device, "voodoo_2_pci", "Voodoo 2 DEFINE_DEVICE_TYPE(VOODOO_BANSHEE_PCI, voodoo_banshee_pci_device, "voodoo_banshee_pci", "Voodoo Banshee PCI") DEFINE_DEVICE_TYPE(VOODOO_3_PCI, voodoo_3_pci_device, "voodoo_3_pci", "Voodoo 3 PCI") +DEFINE_DEVICE_TYPE(VOODOO_BANSHEE_X86_PCI, voodoo_banshee_x86_pci_device, "banshee_x86", "Voodoo Banshee PCI (x86)") + + void voodoo_pci_device::config_map(address_map &map) { pci_device::config_map(map); @@ -71,8 +74,13 @@ voodoo_2_pci_device::voodoo_2_pci_device(const machine_config &mconfig, const ch { } +voodoo_banshee_pci_device::voodoo_banshee_pci_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, u32 clock) + : voodoo_pci_device(mconfig, type, tag, owner, clock), m_voodoo(*this, "voodoo") +{ +} + voodoo_banshee_pci_device::voodoo_banshee_pci_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock) - : voodoo_pci_device(mconfig, VOODOO_BANSHEE_PCI, tag, owner, clock), m_voodoo(*this, "voodoo") + : voodoo_banshee_pci_device(mconfig, VOODOO_BANSHEE_PCI, tag, owner, clock) { } @@ -100,6 +108,10 @@ void voodoo_1_pci_device::device_start() add_map(16 * 1024 * 1024, M_MEM | M_PREF, *m_voodoo, FUNC(voodoo_1_device::core_map)); bank_infos[0].adr = 0xff000000; + // TODO: verify int settings across the arch (should be same, following is from Voodoo 3) + //intr_line = 5; + // INTA# + //intr_pin = 1; } void voodoo_2_pci_device::device_start() @@ -248,3 +260,33 @@ void voodoo_pci_device::vga_w(offs_t offset, u32 data, u32 mem_mask) // map to I/O space at offset 0xb0 m_generic_voodoo->write(0xb0/4 + offset, data, mem_mask); } + +// x86 cards, same with additional BIOS ROM + +voodoo_banshee_x86_pci_device::voodoo_banshee_x86_pci_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock) + : voodoo_banshee_pci_device(mconfig, VOODOO_BANSHEE_X86_PCI, tag, owner, clock) + , m_vga_rom(*this, "vga_rom") +{ +} + +void voodoo_banshee_x86_pci_device::device_start() +{ + voodoo_banshee_pci_device::device_start(); + + add_rom((u8 *)m_vga_rom->base(), 0x8000); + expansion_rom_base = 0xc0000; +} + +ROM_START( voodoo_banshee ) + ROM_REGION32_LE( 0x8000, "vga_rom", ROMREGION_ERASEFF ) + ROM_SYSTEM_BIOS( 0, "gainward", "Gainward Dragon 4000" ) + ROMX_LOAD( "gainward.bin", 0x000000, 0x008000, CRC(a53df538) SHA1(679f94619eac11c59effb89fe44bb74f589e3050), ROM_BIOS(0) ) + ROM_IGNORE( 0x8000 ) + ROM_SYSTEM_BIOS( 1, "atrend", "A-Trend Helios 3D" ) + ROMX_LOAD( "a-trend.vbi", 0x000000, 0x008000, CRC(117a9e6f) SHA1(48b0bc08d142be3aa0d937ee56afd299b3b20386), ROM_BIOS(1) ) +ROM_END + +const tiny_rom_entry *voodoo_banshee_x86_pci_device::device_rom_region() const +{ + return ROM_NAME(voodoo_banshee); +} diff --git a/src/devices/video/voodoo_pci.h b/src/devices/video/voodoo_pci.h index c56358b2c2f..c43f41e2f3a 100644 --- a/src/devices/video/voodoo_pci.h +++ b/src/devices/video/voodoo_pci.h @@ -101,6 +101,8 @@ public: voodoo_banshee_pci_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock); protected: + voodoo_banshee_pci_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, u32 clock); + virtual void device_start() override; virtual void device_add_mconfig(machine_config &config) override; @@ -109,6 +111,28 @@ protected: required_device m_voodoo; }; +class voodoo_banshee_x86_pci_device : public voodoo_banshee_pci_device +{ +public: + template + voodoo_banshee_x86_pci_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock, T &&cpu_tag, U &&screen_tag) + : voodoo_banshee_x86_pci_device(mconfig, tag, owner, clock) + { + set_cpu(std::forward(cpu_tag)); + set_screen(std::forward(screen_tag)); + } + + voodoo_banshee_x86_pci_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock); + +protected: + virtual void device_start() override; + + virtual const tiny_rom_entry *device_rom_region() const override; + +private: + required_memory_region m_vga_rom; +}; + class voodoo_3_pci_device : public voodoo_pci_device { public: @@ -134,6 +158,7 @@ protected: DECLARE_DEVICE_TYPE(VOODOO_1_PCI, voodoo_1_pci_device) DECLARE_DEVICE_TYPE(VOODOO_2_PCI, voodoo_2_pci_device) DECLARE_DEVICE_TYPE(VOODOO_BANSHEE_PCI, voodoo_banshee_pci_device) +DECLARE_DEVICE_TYPE(VOODOO_BANSHEE_X86_PCI, voodoo_banshee_x86_pci_device) DECLARE_DEVICE_TYPE(VOODOO_3_PCI, voodoo_3_pci_device) #endif // MAME_VIDEO_VOODOO_PCI_H diff --git a/src/mame/misc/xtom3d.cpp b/src/mame/misc/xtom3d.cpp index 425a420c2fd..1bb14f15e16 100644 --- a/src/mame/misc/xtom3d.cpp +++ b/src/mame/misc/xtom3d.cpp @@ -393,7 +393,7 @@ void xtom3d_state::xtom3d(machine_config &config) // Expansion slots, mapping SVGA for debugging #if ENABLE_VOODOO - VOODOO_BANSHEE_PCI(config, m_voodoo, 0, m_maincpu, "screen"); // "pci:0d.0" J4D2 + VOODOO_BANSHEE_X86_PCI(config, m_voodoo, 0, m_maincpu, "screen"); // "pci:0d.0" J4D2 // TODO: confirm values m_voodoo->set_fbmem(16); m_voodoo->set_status_cycles(1000); -- cgit v1.2.3