summaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
author Olivier Galibert <galibert@pobox.com>2024-01-13 23:31:19 +0100
committer Olivier Galibert <galibert@pobox.com>2024-01-13 23:34:05 +0100
commit828a54af4e35a29a5a9ecde5f4adba20274d8750 (patch)
tree51214262b3cd681f9f5b594cafc91a95802f7604
parentce6c7e3d44e11cd8431546e4b90f88805e85b4a4 (diff)
newpci: Create a first stab at slottable cards. Embrace the future insanity
sw1000xg: Add a very temporary placeholder
-rw-r--r--scripts/src/bus.lua24
-rw-r--r--scripts/src/video.lua61
-rw-r--r--src/devices/bus/pci/geforce.cpp (renamed from src/devices/video/geforce.cpp)0
-rw-r--r--src/devices/bus/pci/geforce.h (renamed from src/devices/video/geforce.h)0
-rw-r--r--src/devices/bus/pci/mga2064w.cpp (renamed from src/devices/video/mga2064w.cpp)2
-rw-r--r--src/devices/bus/pci/mga2064w.h (renamed from src/devices/video/mga2064w.h)4
-rw-r--r--src/devices/bus/pci/pci_slot.cpp83
-rw-r--r--src/devices/bus/pci/pci_slot.h76
-rw-r--r--src/devices/bus/pci/riva128.cpp (renamed from src/devices/video/riva128.cpp)4
-rw-r--r--src/devices/bus/pci/riva128.h (renamed from src/devices/video/riva128.h)4
-rw-r--r--src/devices/bus/pci/rivatnt.cpp (renamed from src/devices/video/rivatnt.cpp)0
-rw-r--r--src/devices/bus/pci/rivatnt.h (renamed from src/devices/video/rivatnt.h)0
-rw-r--r--src/devices/bus/pci/sw1000xg.cpp42
-rw-r--r--src/devices/bus/pci/sw1000xg.h28
-rw-r--r--src/devices/bus/pci/virge_pci.cpp (renamed from src/devices/video/virge_pci.cpp)2
-rw-r--r--src/devices/bus/pci/virge_pci.h (renamed from src/devices/video/virge_pci.h)4
-rw-r--r--src/devices/machine/i82371sb.cpp4
-rw-r--r--src/devices/machine/i82371sb.h5
-rw-r--r--src/devices/machine/pci.cpp29
-rw-r--r--src/devices/machine/pci.h1
-rw-r--r--src/emu/dislot.h6
-rw-r--r--src/mame/jaleco/jaleco_vj_pc.cpp5
-rw-r--r--src/mame/mame.lst2
-rw-r--r--src/mame/midway/midqslvr.cpp4
-rw-r--r--src/mame/misc/comebaby.cpp4
-rw-r--r--src/mame/misc/ez2d.cpp6
-rw-r--r--src/mame/misc/matrix.cpp4
-rw-r--r--src/mame/misc/odyssey.cpp4
-rw-r--r--src/mame/misc/silverball.cpp4
-rw-r--r--src/mame/misc/xtom3d.cpp4
-rw-r--r--src/mame/pc/nforcepc.cpp4
-rw-r--r--src/mame/pc/pcipc.cpp44
32 files changed, 326 insertions, 138 deletions
diff --git a/scripts/src/bus.lua b/scripts/src/bus.lua
index 435b1bc6e96..94a23b3e2f2 100644
--- a/scripts/src/bus.lua
+++ b/scripts/src/bus.lua
@@ -5410,3 +5410,27 @@ if (BUSES["WAVEBLASTER"]~=null) then
MAME_DIR .. "src/devices/bus/waveblaster/wg130.h",
}
end
+
+---------------------------------------------------
+--
+--@src/devices/bus/pci/pci_slot.h,BUSES["PCI"] = true
+---------------------------------------------------
+
+if (BUSES["PCI"]~=null) then
+ files {
+ MAME_DIR .. "src/devices/bus/pci/pci_slot.cpp",
+ MAME_DIR .. "src/devices/bus/pci/pci_slot.h",
+ MAME_DIR .. "src/devices/bus/pci/virge_pci.cpp",
+ MAME_DIR .. "src/devices/bus/pci/virge_pci.h",
+ MAME_DIR .. "src/devices/bus/pci/riva128.cpp",
+ MAME_DIR .. "src/devices/bus/pci/riva128.h",
+ MAME_DIR .. "src/devices/bus/pci/rivatnt.cpp",
+ MAME_DIR .. "src/devices/bus/pci/rivatnt.h",
+ MAME_DIR .. "src/devices/bus/pci/geforce.cpp",
+ MAME_DIR .. "src/devices/bus/pci/geforce.h",
+ MAME_DIR .. "src/devices/bus/pci/mga2064w.cpp",
+ MAME_DIR .. "src/devices/bus/pci/mga2064w.h",
+ MAME_DIR .. "src/devices/bus/pci/sw1000xg.cpp",
+ MAME_DIR .. "src/devices/bus/pci/sw1000xg.h",
+ }
+end
diff --git a/scripts/src/video.lua b/scripts/src/video.lua
index 69277f16e61..299ba9ba502 100644
--- a/scripts/src/video.lua
+++ b/scripts/src/video.lua
@@ -283,42 +283,6 @@ end
--------------------------------------------------
--
---@src/devices/video/riva128.h,VIDEOS["RIVA128"] = true
---------------------------------------------------
-
-if (VIDEOS["RIVA128"]~=null) then
- files {
- MAME_DIR .. "src/devices/video/riva128.cpp",
- MAME_DIR .. "src/devices/video/riva128.h",
- }
-end
-
---------------------------------------------------
---
---@src/devices/video/rivatnt.h,VIDEOS["RIVATNT"] = true
---------------------------------------------------
-
-if (VIDEOS["RIVATNT"]~=null) then
- files {
- MAME_DIR .. "src/devices/video/rivatnt.cpp",
- MAME_DIR .. "src/devices/video/rivatnt.h",
- }
-end
-
---------------------------------------------------
---
---@src/devices/video/geforce.h,VIDEOS["GEFORCE"] = true
---------------------------------------------------
-
-if (VIDEOS["GEFORCE"]~=null) then
- files {
- MAME_DIR .. "src/devices/video/geforce.cpp",
- MAME_DIR .. "src/devices/video/geforce.h",
- }
-end
-
---------------------------------------------------
---
--@src/devices/video/gf4500.h,VIDEOS["GF4500"] = true
--------------------------------------------------
@@ -931,18 +895,6 @@ end
--------------------------------------------------
--
---@src/devices/video/mga2064w.h,VIDEOS["MGA2064W"] = true
---------------------------------------------------
-
-if (VIDEOS["MGA2064W"]~=null) then
- files {
- MAME_DIR .. "src/devices/video/mga2064w.cpp",
- MAME_DIR .. "src/devices/video/mga2064w.h",
- }
-end
-
---------------------------------------------------
---
--@src/devices/video/pc_vga_nvidia.h,VIDEOS["PC_VGA_NVIDIA"] = true
--------------------------------------------------
@@ -1065,19 +1017,6 @@ end
--------------------------------------------------
--
---@src/devices/video/virge_pci.h,VIDEOS["VIRGE_PCI"] = true
---------------------------------------------------
-
-if (VIDEOS["VIRGE_PCI"]~=null) then
- files {
- MAME_DIR .. "src/devices/video/virge_pci.cpp",
- MAME_DIR .. "src/devices/video/virge_pci.h",
- }
-end
-
-
---------------------------------------------------
---
--@src/devices/video/pcd8544.h,VIDEOS["PCD8544"] = true
--------------------------------------------------
diff --git a/src/devices/video/geforce.cpp b/src/devices/bus/pci/geforce.cpp
index d420d881547..d420d881547 100644
--- a/src/devices/video/geforce.cpp
+++ b/src/devices/bus/pci/geforce.cpp
diff --git a/src/devices/video/geforce.h b/src/devices/bus/pci/geforce.h
index d219516976a..d219516976a 100644
--- a/src/devices/video/geforce.h
+++ b/src/devices/bus/pci/geforce.h
diff --git a/src/devices/video/mga2064w.cpp b/src/devices/bus/pci/mga2064w.cpp
index 1afbbbb4a8f..ce64c216ba0 100644
--- a/src/devices/video/mga2064w.cpp
+++ b/src/devices/bus/pci/mga2064w.cpp
@@ -21,7 +21,7 @@
DEFINE_DEVICE_TYPE(MGA2064W, mga2064w_device, "mga2064w", "Matrox Millennium \"IS-STORM / MGA-2064W\"")
mga2064w_device::mga2064w_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
- : pci_device(mconfig, MGA2064W, tag, owner, clock)
+ : pci_card_device(mconfig, MGA2064W, tag, owner, clock)
, device_memory_interface(mconfig, *this)
, m_svga(*this, "svga")
, m_vga_rom(*this, "vga_rom")
diff --git a/src/devices/video/mga2064w.h b/src/devices/bus/pci/mga2064w.h
index 762af85d1eb..f86b8c65d92 100644
--- a/src/devices/video/mga2064w.h
+++ b/src/devices/bus/pci/mga2064w.h
@@ -5,10 +5,10 @@
#pragma once
-#include "machine/pci.h"
+#include "pci_slot.h"
#include "video/pc_vga_matrox.h"
-class mga2064w_device : public pci_device, public device_memory_interface {
+class mga2064w_device : public pci_card_device, public device_memory_interface {
public:
mga2064w_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
diff --git a/src/devices/bus/pci/pci_slot.cpp b/src/devices/bus/pci/pci_slot.cpp
new file mode 100644
index 00000000000..5496ee35b2e
--- /dev/null
+++ b/src/devices/bus/pci/pci_slot.cpp
@@ -0,0 +1,83 @@
+// license:BSD-3-Clause
+// copyright-holders:Olivier Galibert
+
+// Generic PCI card port
+
+#include "emu.h"
+#include "pci_slot.h"
+#include "virge_pci.h"
+#include "riva128.h"
+#include "rivatnt.h"
+#include "geforce.h"
+#include "mga2064w.h"
+#include "sw1000xg.h"
+
+DEFINE_DEVICE_TYPE(PCI_SLOT, pci_slot_device, "pci_slot", "PCI extension motherboard port")
+
+pci_slot_device::pci_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) :
+ device_t(mconfig, PCI_SLOT, tag, owner, clock),
+ device_single_card_slot_interface<pci_card_interface>(mconfig, *this),
+ m_irq_cb(*this)
+{
+}
+
+pci_slot_device::~pci_slot_device()
+{
+}
+
+void pci_slot_device::device_start()
+{
+}
+
+u8 pci_slot_device::get_slot() const
+{
+ return m_slot;
+}
+
+pci_card_device *pci_slot_device::get_card() const
+{
+ return dynamic_cast<pci_card_device *>(get_card_device());
+}
+
+pci_card_interface::pci_card_interface(const machine_config &mconfig, device_t &device) :
+ device_interface(device, "pci_card"),
+ m_pci_slot(nullptr)
+{
+}
+
+void pci_card_interface::interface_pre_start()
+{
+ m_pci_slot = downcast<pci_slot_device *>(device().owner());
+}
+
+void pci_card_interface::irq_w(offs_t line, u8 state)
+{
+}
+
+pci_card_device::pci_card_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock) :
+ pci_device(mconfig, type, tag, owner, clock),
+ pci_card_interface(mconfig, *this)
+{
+}
+
+pci_card_device::~pci_card_device()
+{
+}
+
+void pci_cards(device_slot_interface &device)
+{
+ device.option_add("virge", VIRGE_PCI);
+ device.option_add("virgedx", VIRGEDX_PCI);
+ device.option_add("riva128", RIVA128);
+ device.option_add("riva128zx", RIVA128ZX);
+ device.option_add("rivatnt", RIVATNT);
+ device.option_add("rivatnt2", RIVATNT2);
+ device.option_add("rivatnt2_ultra", RIVATNT2_ULTRA);
+ device.option_add("vanta", VANTA);
+ device.option_add("rivatnt2_m64", RIVATNT2_M64);
+ device.option_add("geforce256", GEFORCE256);
+ device.option_add("geforce256_ddr", GEFORCE256_DDR);
+ device.option_add("quadro", QUADRO);
+ device.option_add("mga2064w", MGA2064W);
+ device.option_add("sw1000xg", SW1000XG);
+}
diff --git a/src/devices/bus/pci/pci_slot.h b/src/devices/bus/pci/pci_slot.h
new file mode 100644
index 00000000000..4ac7943887c
--- /dev/null
+++ b/src/devices/bus/pci/pci_slot.h
@@ -0,0 +1,76 @@
+// license:BSD-3-Clause
+// copyright-holders:Olivier Galibert
+
+// Generic PCI card port
+
+#ifndef MAME_BUS_PCI_PCI_SLOT_H
+#define MAME_BUS_PCI_PCI_SLOT_H
+
+#include "machine/pci.h"
+
+class pci_card_interface;
+
+class pci_slot_device: public device_t, public device_single_card_slot_interface<pci_card_interface>
+{
+public:
+ friend class pci_card_interface;
+
+ template <typename T>
+ pci_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, T &&opts, u8 slot, u8 irqa, u8 irqb, u8 irqc, u8 irqd, const char *dflt)
+ : pci_slot_device(mconfig, tag, owner, (uint32_t)0)
+ {
+ option_reset();
+ opts(*this);
+ set_default_option(dflt);
+ set_fixed(false);
+ m_slot = slot;
+ m_irq[0] = irqa;
+ m_irq[1] = irqb;
+ m_irq[2] = irqc;
+ m_irq[3] = irqd;
+ }
+
+ pci_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock = 0);
+
+ virtual ~pci_slot_device();
+
+ auto irq_cb() { return m_irq_cb.bind(); }
+
+ u8 get_slot() const;
+ class pci_card_device *get_card() const;
+
+ void irq_w(offs_t line, u8 state);
+
+protected:
+ virtual void device_start() override;
+
+private:
+ devcb_write8 m_irq_cb;
+ std::array<u8, 4> m_irq;
+ u8 m_slot;
+};
+
+class pci_card_interface : public device_interface
+{
+public:
+ void irq_w(offs_t line, u8 state);
+
+protected:
+ pci_slot_device *m_pci_slot;
+
+ pci_card_interface(const machine_config &mconfig, device_t &device);
+ virtual void interface_pre_start() override;
+};
+
+class pci_card_device : public pci_device, public pci_card_interface
+{
+public:
+ pci_card_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock);
+ virtual ~pci_card_device();
+};
+
+DECLARE_DEVICE_TYPE(PCI_SLOT, pci_slot_device)
+
+void pci_cards(device_slot_interface &device);
+
+#endif
diff --git a/src/devices/video/riva128.cpp b/src/devices/bus/pci/riva128.cpp
index f36885fd76c..0fef064e4e8 100644
--- a/src/devices/video/riva128.cpp
+++ b/src/devices/bus/pci/riva128.cpp
@@ -7,7 +7,7 @@ nVidia NV3/NV3T Riva 128
TODO:
- Windows 98 punts device detection by attempting to modify the (supposedly) PMC ID.
-\- Maybe the card is supposed to send an INTA trap on the write attempt?
+- Maybe the card is supposed to send an INTA trap on the write attempt?
References:
- https://envytools.readthedocs.io/en/latest/hw/mmio.html?highlight=mmio#nv3-g80-mmio-map
@@ -32,7 +32,7 @@ DEFINE_DEVICE_TYPE(RIVA128, riva128_device, "riva128", "SGS-Thompson/nVidi
DEFINE_DEVICE_TYPE(RIVA128ZX, riva128zx_device, "riva128zx", "SGS-Thompson/nVidia Riva 128 ZX (NV3T)")
riva128_device::riva128_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock)
- : pci_device(mconfig, type, tag, owner, clock)
+ : pci_card_device(mconfig, type, tag, owner, clock)
, m_svga(*this, "svga")
, m_vga_rom(*this, "vga_rom")
{
diff --git a/src/devices/video/riva128.h b/src/devices/bus/pci/riva128.h
index ce03de39a68..b464cdbd464 100644
--- a/src/devices/video/riva128.h
+++ b/src/devices/bus/pci/riva128.h
@@ -6,10 +6,10 @@
#pragma once
-#include "machine/pci.h"
+#include "pci_slot.h"
#include "video/pc_vga_nvidia.h"
-class riva128_device : public pci_device
+class riva128_device : public pci_card_device
{
public:
riva128_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
diff --git a/src/devices/video/rivatnt.cpp b/src/devices/bus/pci/rivatnt.cpp
index 2b24f969d5a..2b24f969d5a 100644
--- a/src/devices/video/rivatnt.cpp
+++ b/src/devices/bus/pci/rivatnt.cpp
diff --git a/src/devices/video/rivatnt.h b/src/devices/bus/pci/rivatnt.h
index c7fb1bab99f..c7fb1bab99f 100644
--- a/src/devices/video/rivatnt.h
+++ b/src/devices/bus/pci/rivatnt.h
diff --git a/src/devices/bus/pci/sw1000xg.cpp b/src/devices/bus/pci/sw1000xg.cpp
new file mode 100644
index 00000000000..ea724d14aec
--- /dev/null
+++ b/src/devices/bus/pci/sw1000xg.cpp
@@ -0,0 +1,42 @@
+// license:BSD-3-Clause
+// copyright-holders:Olivier Galibert
+
+#include "emu.h"
+#include "sw1000xg.h"
+
+DEFINE_DEVICE_TYPE(SW1000XG, sw1000xg_device, "sw1000xg", "Yamaha SW1000XG")
+
+sw1000xg_device::sw1000xg_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
+ : pci_card_device(mconfig, SW1000XG, tag, owner, clock)
+{
+ set_ids(0x10731000, 0x00, 0x040100, 0x10731000);
+}
+
+void sw1000xg_device::device_start()
+{
+ pci_device::device_start();
+ add_map(0x40000, M_MEM, FUNC(sw1000xg_device::map));
+ intr_pin = 0x01;
+}
+
+void sw1000xg_device::device_reset()
+{
+}
+
+void sw1000xg_device::map(address_map &map)
+{
+ map(0x00000, 0x3ffff).rw(FUNC(sw1000xg_device::read), FUNC(sw1000xg_device::write));
+}
+
+u32 sw1000xg_device::read(offs_t offset, u32 mem_mask)
+{
+ logerror("ym read %05x %08x\n", offset*4, mem_mask);
+ return 0;
+}
+
+void sw1000xg_device::write(offs_t offset, u32 data, u32 mem_mask)
+{
+ logerror("ym write %05x, %08x %08x\n", offset*4, data, mem_mask);
+}
+
+
diff --git a/src/devices/bus/pci/sw1000xg.h b/src/devices/bus/pci/sw1000xg.h
new file mode 100644
index 00000000000..a09944ace0f
--- /dev/null
+++ b/src/devices/bus/pci/sw1000xg.h
@@ -0,0 +1,28 @@
+// license:BSD-3-Clause
+// copyright-holders:Olivier Galibert
+
+#ifndef MAME_SOUND_SW1000XG_H
+#define MAME_SOUND_SW1000XG_H
+
+#pragma once
+
+#include "pci_slot.h"
+
+class sw1000xg_device : public pci_card_device {
+public:
+ sw1000xg_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock = 0);
+
+protected:
+ virtual void device_start() override;
+ virtual void device_reset() override;
+
+private:
+ void map(address_map &map);
+
+ u32 read(offs_t offset, u32 mem_mask);
+ void write(offs_t offset, u32 data, u32 mem_mask);
+};
+
+DECLARE_DEVICE_TYPE(SW1000XG, sw1000xg_device)
+
+#endif
diff --git a/src/devices/video/virge_pci.cpp b/src/devices/bus/pci/virge_pci.cpp
index cd5ea859a85..b38090603f3 100644
--- a/src/devices/video/virge_pci.cpp
+++ b/src/devices/bus/pci/virge_pci.cpp
@@ -13,7 +13,7 @@ virge_pci_device::virge_pci_device(const machine_config &mconfig, const char *ta
}
virge_pci_device::virge_pci_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock)
- : pci_device(mconfig, type, tag, owner, clock),
+ : pci_card_device(mconfig, type, tag, owner, clock),
m_vga(*this, "vga"),
m_bios(*this, "bios"),
m_screen(*this, finder_base::DUMMY_TAG)
diff --git a/src/devices/video/virge_pci.h b/src/devices/bus/pci/virge_pci.h
index 51c902c871e..5533a2db14e 100644
--- a/src/devices/video/virge_pci.h
+++ b/src/devices/bus/pci/virge_pci.h
@@ -10,10 +10,10 @@
#pragma once
-#include "machine/pci.h"
+#include "pci_slot.h"
#include "video/s3virge.h"
-class virge_pci_device : public pci_device
+class virge_pci_device : public pci_card_device
{
public:
template <typename T>
diff --git a/src/devices/machine/i82371sb.cpp b/src/devices/machine/i82371sb.cpp
index 241a8ea8368..a1d1ed2c983 100644
--- a/src/devices/machine/i82371sb.cpp
+++ b/src/devices/machine/i82371sb.cpp
@@ -765,6 +765,10 @@ void i82371sb_isa_device::redirect_irq(int irq, int state)
}
}
+void i82371sb_isa_device::pci_irq_w(offs_t line, u8 state)
+{
+}
+
void i82371sb_isa_device::pc_pirqa_w(int state)
{
int irq = pirqrc[0] & 15;
diff --git a/src/devices/machine/i82371sb.h b/src/devices/machine/i82371sb.h
index e03dcf16ba8..c3b86ed7e5f 100644
--- a/src/devices/machine/i82371sb.h
+++ b/src/devices/machine/i82371sb.h
@@ -40,8 +40,9 @@ public:
auto stpclk() { return m_stpclk_callback.bind(); }
auto boot_state_hook() { return m_boot_state_hook.bind(); }
- template <typename T>
- void set_cpu_tag(T &&tag) { m_maincpu.set_tag(std::forward<T>(tag)); }
+ template <typename T> void set_cpu_tag(T &&tag) { m_maincpu.set_tag(std::forward<T>(tag)); }
+
+ void pci_irq_w(offs_t line, u8 state);
void pc_pirqa_w(int state);
void pc_pirqb_w(int state);
diff --git a/src/devices/machine/pci.cpp b/src/devices/machine/pci.cpp
index 10433028f2a..c9d723c7dab 100644
--- a/src/devices/machine/pci.cpp
+++ b/src/devices/machine/pci.cpp
@@ -7,6 +7,7 @@
*/
#include "emu.h"
#include "pci.h"
+#include "bus/pci/pci_slot.h"
DEFINE_DEVICE_TYPE(PCI_ROOT, pci_root_device, "pci_root", "PCI virtual root")
DEFINE_DEVICE_TYPE(PCI_BRIDGE, pci_bridge_device, "pci_bridge", "PCI-PCI Bridge")
@@ -108,7 +109,7 @@ void pci_device::set_ids(uint32_t _main_id, uint8_t _revision, uint32_t _pclass,
void pci_device::device_start()
{
- command = 0x0080;
+ command = 0x0000;
command_mask = 0x01bf;
status = 0x0000;
@@ -509,13 +510,25 @@ void pci_bridge_device::device_start()
for (device_t &d : bus_root()->subdevices())
{
- const char *t = d.tag();
- int l = strlen(t);
- if(l <= 4 || t[l-5] != ':' || t[l-2] != '.')
- continue;
- int id = strtol(t+l-4, nullptr, 16);
- int fct = t[l-1] - '0';
- sub_devices[(id << 3) | fct] = downcast<pci_device *>(&d);
+ if(d.type() == PCI_SLOT) {
+ pci_slot_device &slot = downcast<pci_slot_device &>(d);
+ pci_device *card = slot.get_card();
+ if(card) {
+ int id = slot.get_slot();
+ sub_devices[id << 3] = card;
+ }
+
+ } else {
+ const char *t = d.tag();
+ int l = strlen(t);
+ if(l <= 4 || t[l-5] != ':' || t[l-2] != '.') {
+ logerror("Device %s unhandled\n", t);
+ continue;
+ }
+ int id = strtol(t+l-4, nullptr, 16);
+ int fct = t[l-1] - '0';
+ sub_devices[(id << 3) | fct] = downcast<pci_device *>(&d);
+ }
}
mapper_cb cf_cb(&pci_bridge_device::regenerate_config_mapping, this);
diff --git a/src/devices/machine/pci.h b/src/devices/machine/pci.h
index 1bb75f52f67..0e0211411bf 100644
--- a/src/devices/machine/pci.h
+++ b/src/devices/machine/pci.h
@@ -5,7 +5,6 @@
#pragma once
-
class pci_device : public device_t {
public:
typedef delegate<void ()> mapper_cb;
diff --git a/src/emu/dislot.h b/src/emu/dislot.h
index 384bf9c3d3e..f6e1f86fcb3 100644
--- a/src/emu/dislot.h
+++ b/src/emu/dislot.h
@@ -83,7 +83,7 @@ public:
/// \param [in] fixed True to mark the slot as fixed, or false to
/// mark it user-configurable.
/// \sa fixed
- void set_fixed(bool fixed) { m_fixed = fixed; }
+ device_slot_interface &set_fixed(bool fixed) { m_fixed = fixed; return *this; }
/// \brief Set the default option
///
@@ -97,12 +97,12 @@ public:
/// valid for the lifetime of the device (or until another default
/// option is configured).
/// \sa default_option
- void set_default_option(const char *option) { m_default_option = option; }
+ device_slot_interface &set_default_option(const char *option) { m_default_option = option; return *this; }
/// \brief Clear options
///
/// This removes all previously added options.
- void option_reset() { m_options.clear(); }
+ device_slot_interface &option_reset() { m_options.clear(); return *this; }
/// \brief Add a user-selectable option
///
diff --git a/src/mame/jaleco/jaleco_vj_pc.cpp b/src/mame/jaleco/jaleco_vj_pc.cpp
index 38905000471..fcbe15d1bf3 100644
--- a/src/mame/jaleco/jaleco_vj_pc.cpp
+++ b/src/mame/jaleco/jaleco_vj_pc.cpp
@@ -34,6 +34,7 @@ when actually playing the games because otherwise you'll be sending inputs to th
#include "jaleco_vj_ups.h"
#include "bus/isa/isa_cards.h"
+#include "bus/pci/virge_pci.h"
#include "bus/rs232/rs232.h"
#include "machine/fdc37c93x.h"
#include "machine/i82371sb.h"
@@ -41,7 +42,6 @@ when actually playing the games because otherwise you'll be sending inputs to th
#include "machine/i82439tx.h"
#include "machine/pci-ide.h"
#include "machine/pci.h"
-#include "video/virge_pci.h"
jaleco_vj_pc_device::jaleco_vj_pc_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) :
@@ -125,7 +125,8 @@ void jaleco_vj_pc_device::device_add_mconfig(machine_config &config)
// TODO: pci:07.3 0x30401106 VIA VT83C572, VT86C586/A/B Power Management Controller
- VIRGEDX_PCI(config, "pci:10.0", 0); // TODO: Should actually be pci:0a.0 but it only shows a black screen
+ // TODO: Should actually be pci:0a.0 but it only shows a black screen
+ PCI_SLOT(config, "pci:2", pci_cards, 16, 1, 2, 3, 0, "virgedx").set_fixed(true);
ISA16_SLOT(config, "board4", 0, "pci:07.0:isabus", isa_internal_devices, "fdc37c93x", true).set_option_machine_config("fdc37c93x", [this] (device_t *device) { superio_config(*device); });
ISA16_SLOT(config, "isa1", 0, "pci:07.0:isabus", isa_cards, "vj_sound", true).set_option_machine_config("vj_sound", [this] (device_t *device) { sound_config(*device); });
diff --git a/src/mame/mame.lst b/src/mame/mame.lst
index 18ae8b9c980..55fe91c5fb3 100644
--- a/src/mame/mame.lst
+++ b/src/mame/mame.lst
@@ -35718,8 +35718,6 @@ streetgr3 // (c) 1993
@source:pc/pcipc.cpp
pciagp //
-pcimga //
-pcinv3 //
pcipc //
pcipctx //
diff --git a/src/mame/midway/midqslvr.cpp b/src/mame/midway/midqslvr.cpp
index eb6b69517e1..d8a3e60fb41 100644
--- a/src/mame/midway/midqslvr.cpp
+++ b/src/mame/midway/midqslvr.cpp
@@ -283,8 +283,8 @@ Notes:
#include "machine/i82371eb_ide.h"
#include "machine/i82371eb_acpi.h"
#include "machine/i82371eb_usb.h"
-#include "video/virge_pci.h"
#include "bus/isa/isa_cards.h"
+#include "bus/pci/virge_pci.h"
//#include "bus/rs232/hlemouse.h"
//#include "bus/rs232/null_modem.h"
//#include "bus/rs232/rs232.h"
@@ -419,7 +419,7 @@ void midway_quicksilver2_state::midqslvr(machine_config &config)
#endif
// "pci:0d.0" J4D2
// "pci:0e.0" J4D1
- VIRGE_PCI(config, "pci:0e.0", 0); // J4C1
+ PCI_SLOT(config, "pci:1", pci_cards, 14, 0, 1, 2, 3, "virge");
}
// Graphite runs on incompatible HW, consider splitting if things starts to get hairy ...
diff --git a/src/mame/misc/comebaby.cpp b/src/mame/misc/comebaby.cpp
index a8ab69e8de2..778c7f6f487 100644
--- a/src/mame/misc/comebaby.cpp
+++ b/src/mame/misc/comebaby.cpp
@@ -198,8 +198,8 @@ TODO:
#include "machine/i82371eb_ide.h"
#include "machine/i82371eb_acpi.h"
#include "machine/i82371eb_usb.h"
-#include "video/virge_pci.h"
#include "bus/isa/isa_cards.h"
+#include "bus/pci/virge_pci.h"
//#include "bus/rs232/hlemouse.h"
//#include "bus/rs232/null_modem.h"
//#include "bus/rs232/rs232.h"
@@ -316,7 +316,7 @@ void comebaby_state::comebaby(machine_config &config)
#else
// "pci:0d.0" J4D2
// "pci:0e.0" J4D1
- VIRGE_PCI(config, "pci:0e.0", 0); // J4C1
+ PCI_SLOT(config, "pci:1", pci_cards, 14, 0, 1, 2, 3, "virge").set_fixed(true);
#endif
}
diff --git a/src/mame/misc/ez2d.cpp b/src/mame/misc/ez2d.cpp
index 3cb59c2fffb..413969222f9 100644
--- a/src/mame/misc/ez2d.cpp
+++ b/src/mame/misc/ez2d.cpp
@@ -73,8 +73,8 @@ Ez2DJ series:
#include "machine/i82371eb_ide.h"
#include "machine/i82371eb_acpi.h"
#include "machine/i82371eb_usb.h"
-#include "video/rivatnt.h"
#include "bus/isa/isa_cards.h"
+#include "bus/pci/rivatnt.h"
//#include "bus/rs232/hlemouse.h"
//#include "bus/rs232/null_modem.h"
//#include "bus/rs232/rs232.h"
@@ -189,14 +189,14 @@ void ez2d_state::cubx(machine_config &config)
serport1.cts_handler().set("board4:w83977tf", FUNC(fdc37c93x_device::ncts2_w));
#endif
- RIVATNT(config, "pci:01.0:00.0", 0);
+ PCI_SLOT(config, "pci:01.0:1", pci_cards, 0, 0, 1, 2, 3, "rivatnt").set_fixed(true);
}
void ez2d_state::ez2d(machine_config &config)
{
ez2d_state::cubx(config);
- RIVATNT2_M64(config.replace(), "pci:01.0:00.0", 0);
+ PCI_SLOT(config.replace(), "pci:01.0:1", pci_cards, 0, 0, 1, 2, 3, "rivatnt2_m64").set_fixed(true);
// TODO: Sound Blaster Live CT4830
}
diff --git a/src/mame/misc/matrix.cpp b/src/mame/misc/matrix.cpp
index 10afa7dfa57..f16c7d061a7 100644
--- a/src/mame/misc/matrix.cpp
+++ b/src/mame/misc/matrix.cpp
@@ -30,6 +30,7 @@ Unpopulated spaces marked for: DS5002FP, PIC16C54, 93C56 EEPROM, a couple more u
#include "emu.h"
#include "bus/isa/isa_cards.h"
+#include "bus/pci/rivatnt.h"
#include "cpu/i386/i386.h"
#include "machine/8042kbdc.h"
#include "machine/mc146818.h"
@@ -38,7 +39,6 @@ Unpopulated spaces marked for: DS5002FP, PIC16C54, 93C56 EEPROM, a couple more u
#include "machine/mediagx_host.h"
#include "machine/pci.h"
#include "machine/zfmicro_usb.h"
-#include "video/rivatnt.h"
#include "screen.h"
@@ -108,7 +108,7 @@ void matrix_state::matrix(machine_config &config)
PCI_BRIDGE(config, "pci:01.0", 0, 0x10780000, 0);
#if ENABLE_VGA
// NOTE: most MediaGX boards don't even provide an AGP port, at best you get PCI slots.
- RIVATNT(config, "pci:01.0:00.0", 0);
+ PCI_SLOT(config, "pci:01.0:1", pci_cards, 0, 0, 1, 2, 3, "rivatnt").set_fixed(true);
#endif
// "pci:12.0" or "pci:10.0" depending on pin H26 (readable in bridge thru PCI index $44)
diff --git a/src/mame/misc/odyssey.cpp b/src/mame/misc/odyssey.cpp
index 239d42a2410..6f6de1c51d7 100644
--- a/src/mame/misc/odyssey.cpp
+++ b/src/mame/misc/odyssey.cpp
@@ -72,8 +72,8 @@
#include "machine/pci-ide.h"
#include "machine/i82371sb.h"
#include "machine/i82439hx.h"
-#include "video/virge_pci.h"
#include "bus/isa/isa_cards.h"
+#include "bus/pci/virge_pci.h"
//#include "bus/rs232/hlemouse.h"
//#include "bus/rs232/null_modem.h"
//#include "bus/rs232/rs232.h"
@@ -183,7 +183,7 @@ void odyssey_state::odyssey(machine_config &config)
// On-board Virge or Virge/DX
// TODO: actually a S3 Vision 968
- VIRGE_PCI(config, "pci:08.0", 0);
+ PCI_SLOT(config, "pci:1", pci_cards, 8, 0, 1, 2, 3, "virge");
// pci:0d.0 (J4E1) PCI expansion slot 1
// pci:0e.0 (J4D2) PCI expansion slot 2
diff --git a/src/mame/misc/silverball.cpp b/src/mame/misc/silverball.cpp
index 7ccf4cf100e..1ea5d20d450 100644
--- a/src/mame/misc/silverball.cpp
+++ b/src/mame/misc/silverball.cpp
@@ -41,9 +41,9 @@
#include "machine/i82371eb_ide.h"
#include "machine/i82371eb_acpi.h"
#include "machine/i82371eb_usb.h"
-#include "video/virge_pci.h"
#include "bus/isa/isa.h"
#include "bus/isa/isa_cards.h"
+#include "bus/pci/virge_pci.h"
#include "machine/w83977tf.h"
namespace {
@@ -146,7 +146,7 @@ void silverball_state::silverball_i440zx(machine_config &config)
ISA16_SLOT(config, "isa2", 0, "pci:07.0:isabus", pc_isa16_cards, nullptr, false);
// TODO: actually a Trio64V2
- VIRGE_PCI(config, "pci:0e.0", 0);
+ PCI_SLOT(config, "pci:1", pci_cards, 14, 0, 1, 2, 3, "virge");
}
diff --git a/src/mame/misc/xtom3d.cpp b/src/mame/misc/xtom3d.cpp
index 974c369f683..c3ce8fb374c 100644
--- a/src/mame/misc/xtom3d.cpp
+++ b/src/mame/misc/xtom3d.cpp
@@ -74,9 +74,9 @@ MX29F1610MC 16M FlashROM (x7)
#include "machine/i82371eb_ide.h"
#include "machine/i82371eb_acpi.h"
#include "machine/i82371eb_usb.h"
-#include "video/virge_pci.h"
#include "bus/isa/isa.h"
#include "bus/isa/isa_cards.h"
+#include "bus/pci/virge_pci.h"
//#include "bus/rs232/hlemouse.h"
//#include "bus/rs232/null_modem.h"
//#include "bus/rs232/rs232.h"
@@ -648,7 +648,7 @@ void xtom3d_state::xtom3d(machine_config &config)
screen.set_visarea(0, 640 - 1, 0, 480 - 1);
screen.set_screen_update(PCI_AGP_ID, FUNC(voodoo_banshee_pci_device::screen_update));
#else
- VIRGE_PCI(config, "pci:0e.0", 0); // J4C1
+ PCI_SLOT(config, "pci:1", pci_cards, 14, 0, 1, 2, 3, "virge").set_fixed(true);
#endif
// "pci:0d.0" J4D2
// "pci:0e.0" J4D1
diff --git a/src/mame/pc/nforcepc.cpp b/src/mame/pc/nforcepc.cpp
index 7e935ef383a..f2c431c10e9 100644
--- a/src/mame/pc/nforcepc.cpp
+++ b/src/mame/pc/nforcepc.cpp
@@ -35,7 +35,7 @@
#include "machine/pci-ide.h"
#include "machine/pckeybrd.h"
#include "bus/isa/isa.h"
-#include "video/virge_pci.h"
+#include "bus/pci/virge_pci.h"
#include "formats/naslite_dsk.h"
@@ -1239,7 +1239,7 @@ void nforcepc_state::nforcepc(machine_config &config)
ide.subdevice<ide_controller_32_device>("ide1")->options(ata_devices, "hdd", nullptr, true);
ide.subdevice<ide_controller_32_device>("ide2")->options(ata_devices, "cdrom", nullptr, true);
NV2A_AGP(config, "pci:1e.0", 0, 0x10de01b7, 0xb2); // 10de:01b7 NVIDIA Corporation nForce AGP to PCI Bridge
- VIRGEDX_PCI(config, "pci:0a.0", 0);
+ PCI_SLOT(config, "pci:1", pci_cards, 10, 0, 1, 2, 3, "virgedx");
SST_49LF020(config, "bios", 0);
FLOPPY_CONNECTOR(config, "pci:01.0:0:fdc:0", pc_hd_floppies, "35hd", floppy_formats);
diff --git a/src/mame/pc/pcipc.cpp b/src/mame/pc/pcipc.cpp
index 8f23fc0b8d5..50ccf222ee2 100644
--- a/src/mame/pc/pcipc.cpp
+++ b/src/mame/pc/pcipc.cpp
@@ -20,6 +20,7 @@
#include "emu.h"
#include "bus/isa/isa_cards.h"
+#include "bus/pci/pci_slot.h"
#include "bus/rs232/hlemouse.h"
#include "bus/rs232/null_modem.h"
#include "bus/rs232/rs232.h"
@@ -39,9 +40,6 @@
#include "machine/pci-ide.h"
#include "machine/w83977tf.h"
#include "video/clgd546x_laguna.h"
-#include "video/mga2064w.h"
-#include "video/riva128.h"
-#include "video/virge_pci.h"
namespace {
@@ -570,8 +568,11 @@ void pcipc_state::pcipc(machine_config &config)
i82371sb_ide_device &ide(I82371SB_IDE(config, "pci:07.1", 0, "maincpu"));
ide.irq_pri().set("pci:07.0", FUNC(i82371sb_isa_device::pc_irq14_w));
ide.irq_sec().set("pci:07.0", FUNC(i82371sb_isa_device::pc_mirq0_w));
-// MGA2064W(config, "pci:12.0", 0);
- VIRGE_PCI(config, "pci:12.0", 0); // use VIRGEDX_PCI for its VESA 2.0 BIOS
+
+ PCI_SLOT(config, "pci:1", pci_cards, 15, 0, 1, 2, 3, nullptr).irq_cb().set(isa, FUNC(i82371sb_isa_device::pci_irq_w));
+ PCI_SLOT(config, "pci:2", pci_cards, 16, 1, 2, 3, 0, nullptr).irq_cb().set(isa, FUNC(i82371sb_isa_device::pci_irq_w));
+ PCI_SLOT(config, "pci:3", pci_cards, 17, 2, 3, 0, 1, nullptr).irq_cb().set(isa, FUNC(i82371sb_isa_device::pci_irq_w));
+ PCI_SLOT(config, "pci:4", pci_cards, 18, 3, 0, 1, 2, "virge").irq_cb().set(isa, FUNC(i82371sb_isa_device::pci_irq_w));
ISA16_SLOT(config, "board4", 0, "pci:07.0:isabus", isa_internal_devices, "fdc37c93x", true).set_option_machine_config("fdc37c93x", smc_superio_config);
ISA16_SLOT(config, "isa1", 0, "pci:07.0:isabus", pc_isa16_cards, nullptr, false);
@@ -593,6 +594,8 @@ void pcipc_state::pcipc(machine_config &config)
serport1.dsr_handler().set("board4:fdc37c93x", FUNC(fdc37c93x_device::ndsr2_w));
serport1.ri_handler().set("board4:fdc37c93x", FUNC(fdc37c93x_device::nri2_w));
serport1.cts_handler().set("board4:fdc37c93x", FUNC(fdc37c93x_device::ncts2_w));
+
+ // SW1000XG(config, "pci:11.0");
}
void pcipc_state::pcipctx(machine_config &config)
@@ -606,20 +609,11 @@ void pcipc_state::pcipctx(machine_config &config)
i82371sb_isa_device &isa(I82371SB_ISA(config, "pci:07.0", 0, "maincpu"));
isa.boot_state_hook().set(FUNC(pcipc_state::boot_state_award_w));
// IDE_PCI(config, "pci:07.1", 0, 0x80867010, 0x03, 0x00000000);
- // TODO: eventually change this to something else
- MGA2064W(config, "pci:12.0", 0);
-}
-void pcipc_state::pcinv3(machine_config &config)
-{
- pcipc_state::pcipc(config);
- RIVA128(config.replace(), "pci:12.0", 0);
-}
-
-void pcipc_state::pcimga(machine_config &config)
-{
- pcipc_state::pcipc(config);
- MGA2064W(config.replace(), "pci:12.0", 0);
+ PCI_SLOT(config, "pci:1", pci_cards, 15, 0, 1, 2, 3, nullptr).irq_cb().set(isa, FUNC(i82371sb_isa_device::pci_irq_w));
+ PCI_SLOT(config, "pci:2", pci_cards, 16, 1, 2, 3, 0, nullptr).irq_cb().set(isa, FUNC(i82371sb_isa_device::pci_irq_w));
+ PCI_SLOT(config, "pci:3", pci_cards, 17, 2, 3, 0, 1, nullptr).irq_cb().set(isa, FUNC(i82371sb_isa_device::pci_irq_w));
+ PCI_SLOT(config, "pci:4", pci_cards, 18, 3, 0, 1, 2, "mga2064w").irq_cb().set(isa, FUNC(i82371sb_isa_device::pci_irq_w));
}
void pcipc_state::pciagp(machine_config &config)
@@ -697,18 +691,6 @@ ROM_START(pcipctx)
ROM_LOAD("ibm-vga.bin", 0x00000, 0x8000, BAD_DUMP CRC(74e3fadb) SHA1(dce6491424f1726203776dfae9a967a98a4ba7b5) )
ROM_END
-ROM_START(pcinv3)
- ROM_REGION32_LE(0x40000, "pci:07.0", 0) /* PC bios */
- ROM_SYSTEM_BIOS(0, "m55ns04", "m55ns04") // Micronics M55HI-Plus with no sound
- ROMX_LOAD("m55-04ns.rom", 0x20000, 0x20000, CRC(0116b2b0) SHA1(19b0203decfd4396695334517488d488aec3ccde), ROM_BIOS(0))
-ROM_END
-
-ROM_START(pcimga)
- ROM_REGION32_LE(0x40000, "pci:07.0", 0) /* PC bios */
- ROM_SYSTEM_BIOS(0, "m55ns04", "m55ns04") // Micronics M55HI-Plus with no sound
- ROMX_LOAD("m55-04ns.rom", 0x20000, 0x20000, CRC(0116b2b0) SHA1(19b0203decfd4396695334517488d488aec3ccde), ROM_BIOS(0))
-ROM_END
-
ROM_START(pciagp)
ROM_REGION32_LE(0x40000, "pci:07.0", 0) /* PC bios */
// a.k.a. the BIOS present in savquest.cpp
@@ -723,7 +705,5 @@ INPUT_PORTS_END
COMP(1998, pcipc, 0, 0, pcipc, pcipc, pcipc_state, empty_init, "Hack Inc.", "Sandbox PCI PC (430HX)", MACHINE_NO_SOUND )
-COMP(1998, pcinv3, pcipc, 0, pcinv3, pcipc, pcipc_state, empty_init, "Hack Inc.", "Sandbox PCI PC (430HX with nVidia Riva 128)", MACHINE_NO_SOUND | MACHINE_NOT_WORKING ) // Windows 98 doesn't recognize video card, may need AGP BIOS instead
-COMP(1998, pcimga, pcipc, 0, pcimga, pcipc, pcipc_state, empty_init, "Hack Inc.", "Sandbox PCI PC (430HX with Matrox Millennium)", MACHINE_NO_SOUND | MACHINE_NOT_WORKING ) // cfr. MGA2064W emulation
COMP(1998, pcipctx, 0, 0, pcipctx, pcipc, pcipc_state, empty_init, "Hack Inc.", "Sandbox PCI PC (430TX)", MACHINE_NO_SOUND | MACHINE_NOT_WORKING) // unemulated super I/O
COMP(1999, pciagp, 0, 0, pciagp, pcipc, pcipc_state, empty_init, "Hack Inc.", "Sandbox PCI/AGP PC (440BX)", MACHINE_NO_SOUND | MACHINE_NOT_WORKING) // errors out with ISA state 0x05 (keyboard), does stuff if bypassed but eventually PnP breaks OS booting