summaryrefslogtreecommitdiffstatshomepage
path: root/src/mame
diff options
context:
space:
mode:
author Vas Crabb <vas@vastheman.com>2018-05-25 22:28:49 +1000
committer Vas Crabb <vas@vastheman.com>2018-05-25 22:28:49 +1000
commit106e27478414a80e0959be52e55b23742855646c (patch)
treebaff6778e3449f8f9f7fb33a6935eaeb0bc5f255 /src/mame
parentfada3dfc8b58b1209c6dcd4cf7837b4d23c88d82 (diff)
remove many mainly PCI-related MCFG macros in favour of constructor
overloads, remove some absolute device lookups, remove some absolute device tags, and generally clean up stuff fix incorrect device class for PCI APIC (nw) xbox machine config looks ugly now - the devices should expose proper constructor overloads that accept the parts of the PCI ID that are in system PROM or customisable by the OEM and hard-code the parts inherent to the device
Diffstat (limited to 'src/mame')
-rw-r--r--src/mame/drivers/atlantis.cpp46
-rw-r--r--src/mame/drivers/atpci.cpp2
-rw-r--r--src/mame/drivers/iteagle.cpp24
-rw-r--r--src/mame/drivers/lindbergh.cpp48
-rw-r--r--src/mame/drivers/pcipc.cpp20
-rw-r--r--src/mame/drivers/seattle.cpp6
-rw-r--r--src/mame/drivers/vegas.cpp6
-rw-r--r--src/mame/includes/xbox_pci.h40
-rw-r--r--src/mame/machine/iteagle_fpga.cpp21
-rw-r--r--src/mame/machine/iteagle_fpga.h47
-rw-r--r--src/mame/machine/segabb.cpp1
-rw-r--r--src/mame/machine/segabb.h3
-rw-r--r--src/mame/machine/xbox.cpp34
-rw-r--r--src/mame/machine/xbox_pci.cpp40
14 files changed, 162 insertions, 176 deletions
diff --git a/src/mame/drivers/atlantis.cpp b/src/mame/drivers/atlantis.cpp
index 0fb54abbdfa..1ccea3e97a4 100644
--- a/src/mame/drivers/atlantis.cpp
+++ b/src/mame/drivers/atlantis.cpp
@@ -806,15 +806,15 @@ DEVICE_INPUT_DEFAULTS_END
MACHINE_CONFIG_START(atlantis_state::mwskins)
/* basic machine hardware */
- MCFG_DEVICE_ADD("maincpu", VR4310LE, 166666666) // clock is TRUSTED
+ MCFG_DEVICE_ADD(m_maincpu, VR4310LE, 166666666) // clock is TRUSTED
MCFG_MIPS3_ICACHE_SIZE(16384)
MCFG_MIPS3_DCACHE_SIZE(16384)
MCFG_MIPS3_SYSTEM_CLOCK(66666666)
- MCFG_PCI_ROOT_ADD( ":pci")
- MCFG_VRC4373_ADD( PCI_ID_NILE, ":maincpu")
+ MCFG_DEVICE_ADD(":pci", PCI_ROOT, 0)
+ MCFG_DEVICE_ADD(PCI_ID_NILE, VRC4373, 0, m_maincpu)
MCFG_VRC4373_SET_RAM(0x00800000)
- MCFG_PCI9050_ADD( PCI_ID_9050)
+ MCFG_DEVICE_ADD(PCI_ID_9050, PCI9050, 0)
MCFG_PCI9050_SET_MAP(0, atlantis_state::map0)
MCFG_PCI9050_SET_MAP(1, atlantis_state::map1)
MCFG_PCI9050_SET_MAP(2, atlantis_state::map2)
@@ -822,11 +822,11 @@ MACHINE_CONFIG_START(atlantis_state::mwskins)
MCFG_PCI9050_USER_OUTPUT_CALLBACK(WRITE32(*this, atlantis_state, user_io_output))
MCFG_PCI9050_USER_INPUT_CALLBACK(READ32(*this, atlantis_state, user_io_input))
- MCFG_M48T37_ADD("rtc")
+ MCFG_M48T37_ADD(m_rtc)
MCFG_M48T37_RESET_HANDLER(WRITELINE(*this, atlantis_state, watchdog_reset))
MCFG_M48T37_IRQ_HANDLER(WRITELINE(*this, atlantis_state, watchdog_irq))
- MCFG_IDE_PCI_ADD(PCI_ID_IDE, 0x10950646, 0x07, 0x0)
+ MCFG_DEVICE_ADD(m_ide, IDE_PCI, 0, 0x10950646, 0x07, 0x0)
MCFG_IDE_PCI_IRQ_HANDLER(WRITELINE(*this, atlantis_state, ide_irq))
// The pci-ide by default expects the system controller to be pci:00.0 so need to fix here
MCFG_DEVICE_MODIFY(PCI_ID_IDE":ide")
@@ -835,7 +835,7 @@ MACHINE_CONFIG_START(atlantis_state::mwskins)
MCFG_BUS_MASTER_IDE_CONTROLLER_SPACE(PCI_ID_NILE, AS_DATA)
/* video hardware */
- MCFG_DEVICE_ADD("zeus2", ZEUS2, ZEUS2_VIDEO_CLOCK)
+ MCFG_DEVICE_ADD(m_zeus, ZEUS2, ZEUS2_VIDEO_CLOCK)
MCFG_ZEUS2_FLOAT_MODE(1)
MCFG_ZEUS2_IRQ_CB(WRITELINE(*this, atlantis_state, zeus_irq))
MCFG_ZEUS2_VBLANK_CB(WRITELINE(*this, atlantis_state, vblank_irq))
@@ -846,49 +846,49 @@ MACHINE_CONFIG_START(atlantis_state::mwskins)
MCFG_SCREEN_UPDATE_DEVICE("zeus2", zeus2_device, screen_update)
/* sound hardware */
- MCFG_DEVICE_ADD("dcs", DCS2_AUDIO_DENVER, 0)
+ MCFG_DEVICE_ADD(m_dcs, DCS2_AUDIO_DENVER, 0)
MCFG_DCS2_AUDIO_DRAM_IN_MB(4)
MCFG_DCS2_AUDIO_POLLING_OFFSET(0xe33)
- MCFG_DEVICE_ADD("ioasic", MIDWAY_IOASIC, 0)
+ MCFG_DEVICE_ADD(m_ioasic, MIDWAY_IOASIC, 0)
MCFG_MIDWAY_IOASIC_SHUFFLE(MIDWAY_IOASIC_STANDARD)
MCFG_MIDWAY_SERIAL_PIC2_YEAR_OFFS(80)
MCFG_MIDWAY_IOASIC_UPPER(342) // 325
MCFG_MIDWAY_IOASIC_IRQ_CALLBACK(WRITELINE(*this, atlantis_state, ioasic_irq))
MCFG_MIDWAY_IOASIC_AUTO_ACK(1)
if DEBUG_CONSOLE {
- MCFG_MIDWAY_IOASIC_OUT_TX_CB(WRITE8("uart0", generic_terminal_device, write))
- MCFG_DEVICE_ADD("uart0", GENERIC_TERMINAL, 0)
+ MCFG_MIDWAY_IOASIC_OUT_TX_CB(WRITE8(m_uart0, generic_terminal_device, write))
+ MCFG_DEVICE_ADD(m_uart0, GENERIC_TERMINAL, 0)
MCFG_GENERIC_TERMINAL_KEYBOARD_CB(DEVPUT("ioasic", midway_ioasic_device, serial_rx_w))
}
// TL16C552 UART
- MCFG_DEVICE_ADD("uart1", NS16550, XTAL(24'000'000))
+ MCFG_DEVICE_ADD(m_uart1, NS16550, XTAL(24'000'000))
MCFG_INS8250_OUT_TX_CB(WRITELINE("com1", rs232_port_device, write_txd))
MCFG_INS8250_OUT_DTR_CB(WRITELINE("com1", rs232_port_device, write_dtr))
MCFG_INS8250_OUT_RTS_CB(WRITELINE("com1", rs232_port_device, write_rts))
MCFG_INS8250_OUT_INT_CB(WRITELINE(*this, atlantis_state, duart_irq_callback))
- MCFG_DEVICE_ADD("uart2", NS16550, XTAL(24'000'000))
+ MCFG_DEVICE_ADD(m_uart2, NS16550, XTAL(24'000'000))
MCFG_INS8250_OUT_TX_CB(WRITELINE("com2", rs232_port_device, write_txd))
MCFG_INS8250_OUT_DTR_CB(WRITELINE("com2", rs232_port_device, write_dtr))
MCFG_INS8250_OUT_RTS_CB(WRITELINE("com2", rs232_port_device, write_rts))
MCFG_INS8250_OUT_INT_CB(WRITELINE(*this, atlantis_state, duart_irq_callback))
MCFG_DEVICE_ADD("com1", RS232_PORT, default_rs232_devices, nullptr)
- MCFG_RS232_RXD_HANDLER(WRITELINE("uart1", ins8250_uart_device, rx_w))
- MCFG_RS232_DCD_HANDLER(WRITELINE("uart1", ins8250_uart_device, dcd_w))
- MCFG_RS232_DSR_HANDLER(WRITELINE("uart1", ins8250_uart_device, dsr_w))
- MCFG_RS232_RI_HANDLER(WRITELINE("uart1", ins8250_uart_device, ri_w))
- MCFG_RS232_CTS_HANDLER(WRITELINE("uart1", ins8250_uart_device, cts_w))
+ MCFG_RS232_RXD_HANDLER(WRITELINE(m_uart1, ins8250_uart_device, rx_w))
+ MCFG_RS232_DCD_HANDLER(WRITELINE(m_uart1, ins8250_uart_device, dcd_w))
+ MCFG_RS232_DSR_HANDLER(WRITELINE(m_uart1, ins8250_uart_device, dsr_w))
+ MCFG_RS232_RI_HANDLER(WRITELINE(m_uart1, ins8250_uart_device, ri_w))
+ MCFG_RS232_CTS_HANDLER(WRITELINE(m_uart1, ins8250_uart_device, cts_w))
//MCFG_SLOT_OPTION_DEVICE_INPUT_DEFAULTS("com1", mwskins_comm)
MCFG_DEVICE_ADD("com2", RS232_PORT, default_rs232_devices, nullptr)
- MCFG_RS232_RXD_HANDLER(WRITELINE("uart2", ins8250_uart_device, rx_w))
- MCFG_RS232_DCD_HANDLER(WRITELINE("uart2", ins8250_uart_device, dcd_w))
- MCFG_RS232_DSR_HANDLER(WRITELINE("uart2", ins8250_uart_device, dsr_w))
- MCFG_RS232_RI_HANDLER(WRITELINE("uart2", ins8250_uart_device, ri_w))
- MCFG_RS232_CTS_HANDLER(WRITELINE("uart2", ins8250_uart_device, cts_w))
+ MCFG_RS232_RXD_HANDLER(WRITELINE(m_uart2, ins8250_uart_device, rx_w))
+ MCFG_RS232_DCD_HANDLER(WRITELINE(m_uart2, ins8250_uart_device, dcd_w))
+ MCFG_RS232_DSR_HANDLER(WRITELINE(m_uart2, ins8250_uart_device, dsr_w))
+ MCFG_RS232_RI_HANDLER(WRITELINE(m_uart2, ins8250_uart_device, ri_w))
+ MCFG_RS232_CTS_HANDLER(WRITELINE(m_uart2, ins8250_uart_device, cts_w))
MACHINE_CONFIG_END
diff --git a/src/mame/drivers/atpci.cpp b/src/mame/drivers/atpci.cpp
index 4f6ee155674..393ca07ab06 100644
--- a/src/mame/drivers/atpci.cpp
+++ b/src/mame/drivers/atpci.cpp
@@ -79,7 +79,7 @@ static void isa_internal_devices(device_slot_interface &device)
static void pci_devices(device_slot_interface &device)
{
- device.option_add_internal("i82439tx", I82439TX);
+ device.option_add_internal("i82439tx", I82439TX_LEGACY);
device.option_add_internal("i82371ab", I82371AB);
device.option_add_internal("i82371sb", I82371SB);
}
diff --git a/src/mame/drivers/iteagle.cpp b/src/mame/drivers/iteagle.cpp
index 60b3729b5ec..d2c7b1df9ad 100644
--- a/src/mame/drivers/iteagle.cpp
+++ b/src/mame/drivers/iteagle.cpp
@@ -119,8 +119,8 @@ class iteagle_state : public driver_device
{
public:
iteagle_state(const machine_config &mconfig, device_type type, const char *tag)
- : driver_device(mconfig, type, tag),
- m_maincpu(*this, "maincpu")
+ : driver_device(mconfig, type, tag)
+ , m_maincpu(*this, "maincpu")
{}
required_device<mips3_device> m_maincpu;
@@ -164,31 +164,31 @@ void iteagle_state::machine_reset()
MACHINE_CONFIG_START(iteagle_state::iteagle)
/* basic machine hardware */
- MCFG_DEVICE_ADD("maincpu", VR4310LE, 166666666)
+ MCFG_DEVICE_ADD(m_maincpu, VR4310LE, 166666666)
MCFG_MIPS3_ICACHE_SIZE(16384)
MCFG_MIPS3_DCACHE_SIZE(8192)
MCFG_MIPS3_SYSTEM_CLOCK(66666667)
- MCFG_PCI_ROOT_ADD( ":pci")
- MCFG_VRC4373_ADD( PCI_ID_NILE, ":maincpu")
+ MCFG_DEVICE_ADD(":pci", PCI_ROOT, 0)
+ MCFG_DEVICE_ADD(PCI_ID_NILE, VRC4373, 0, m_maincpu)
MCFG_VRC4373_SET_RAM(0x00800000)
MCFG_VRC4373_SET_SIMM0(0x02000000)
- MCFG_ITEAGLE_PERIPH_ADD( PCI_ID_PERIPH)
- MCFG_IDE_PCI_ADD( PCI_ID_IDE, 0x1080C693, 0x00, 0x0)
- MCFG_IDE_PCI_IRQ_ADD( ":maincpu", MIPS3_IRQ2)
+ MCFG_DEVICE_ADD( PCI_ID_PERIPH, ITEAGLE_PERIPH, 0)
+ MCFG_DEVICE_ADD( PCI_ID_IDE, IDE_PCI, 0, 0x1080C693, 0x00, 0x0)
+ MCFG_IDE_PCI_IRQ_HANDLER( INPUTLINE(m_maincpu, MIPS3_IRQ2))
- MCFG_ITEAGLE_FPGA_ADD( PCI_ID_FPGA, ":maincpu", MIPS3_IRQ1, MIPS3_IRQ4)
- MCFG_ES1373_ADD( PCI_ID_SOUND)
+ MCFG_DEVICE_ADD( PCI_ID_FPGA, ITEAGLE_FPGA, 0, "screen", m_maincpu, MIPS3_IRQ1, MIPS3_IRQ4)
+ MCFG_DEVICE_ADD( PCI_ID_SOUND, ES1373, 0)
MCFG_SOUND_ROUTE(0, PCI_ID_SOUND":lspeaker", 1.0)
MCFG_SOUND_ROUTE(1, PCI_ID_SOUND":rspeaker", 1.0)
- MCFG_ES1373_IRQ_ADD( ":maincpu", MIPS3_IRQ3)
+ MCFG_ES1373_IRQ_HANDLER( INPUTLINE(m_maincpu, MIPS3_IRQ3))
MCFG_DEVICE_ADD(PCI_ID_VIDEO, VOODOO_3_PCI, 0, m_maincpu, "screen")
MCFG_VOODOO_PCI_FBMEM(16)
MCFG_DEVICE_MODIFY(PCI_ID_VIDEO":voodoo")
MCFG_VOODOO_VBLANK_CB(WRITELINE(PCI_ID_FPGA, iteagle_fpga_device, vblank_update))
- MCFG_ITEAGLE_EEPROM_ADD( PCI_ID_EEPROM)
+ MCFG_DEVICE_ADD( PCI_ID_EEPROM, ITEAGLE_EEPROM, 0)
MCFG_SCREEN_ADD("screen", RASTER)
MCFG_SCREEN_REFRESH_RATE(60)
diff --git a/src/mame/drivers/lindbergh.cpp b/src/mame/drivers/lindbergh.cpp
index e7caf8a5592..20c39a07638 100644
--- a/src/mame/drivers/lindbergh.cpp
+++ b/src/mame/drivers/lindbergh.cpp
@@ -393,28 +393,28 @@ void lindbergh_state::machine_reset()
MACHINE_CONFIG_START(lindbergh_state::lindbergh)
MCFG_DEVICE_ADD("maincpu", PENTIUM4, 28000000U*5) /* Actually Celeron D at 2,8 GHz */
- MCFG_PCI_ROOT_ADD( ":pci")
- MCFG_I82875P_HOST_ADD( ":pci:00.0", 0x103382c0, ":maincpu", 512*1024*1024)
- MCFG_I82875P_AGP_ADD( ":pci:01.0")
- MCFG_GEFORCE_7600GS_ADD( ":pci:01.0:00.0", 0x10de02e1)
- MCFG_I82875P_OVERFLOW_ADD( ":pci:06.0", 0x103382c0)
- MCFG_PCI_BRIDGE_ADD( ":pci:1c.0", 0x808625ae, 0x02)
- MCFG_I82541PI_ADD( ":pci:1c.0:00.0", 0x103382c0)
- MCFG_USB_UHCI_ADD( ":pci:1d.0", 0x808625a9, 0x02, 0x103382c0)
- MCFG_USB_UHCI_ADD( ":pci:1d.1", 0x808625aa, 0x02, 0x103382c0)
- MCFG_I6300ESB_WATCHDOG_ADD( ":pci:1d.4", 0x103382c0)
- MCFG_APIC_ADD( ":pci:1d.5", 0x808625ac, 0x02, 0x103382c0)
- MCFG_USB_EHCI_ADD( ":pci:1d.7", 0x808625ad, 0x02, 0x103382c0)
- MCFG_PCI_BRIDGE_ADD( ":pci:1e.0", 0x8086244e, 0x0a)
- MCFG_SB0400_ADD( ":pci:1e.0:02.0", 0x11021101)
- MCFG_SEGA_LINDBERGH_BASEBOARD_ADD(":pci:1e.0:03.0")
- MCFG_I6300ESB_LPC_ADD( ":pci:1f.0")
- MCFG_LPC_ACPI_ADD( ":pci:1f.0:acpi")
- MCFG_LPC_RTC_ADD( ":pci:1f.0:rtc")
- MCFG_LPC_PIT_ADD( ":pci:1f.0:pit")
- MCFG_SATA_ADD( ":pci:1f.2", 0x808625a3, 0x02, 0x103382c0)
- MCFG_SMBUS_ADD( ":pci:1f.3", 0x808625a4, 0x02, 0x103382c0)
- MCFG_AC97_ADD( ":pci:1f.5", 0x808625a6, 0x02, 0x103382c0)
+ PCI_ROOT (config, ":pci", 0);
+ I82875P_HOST (config, ":pci:00.0", 0, 0x103382c0, "maincpu", 512*1024*1024);
+ I82875P_AGP (config, ":pci:01.0", 0);
+ GEFORCE_7600GS (config, ":pci:01.0:00.0", 0, 0x10de02e1);
+ I82875P_OVERFLOW (config, ":pci:06.0", 0, 0x103382c0);
+ PCI_BRIDGE (config, ":pci:1c.0", 0, 0x808625ae, 0x02);
+ I82541 (config, ":pci:1c.0:00.0", 0, 0x103382c0);
+ USB_UHCI (config, ":pci:1d.0", 0, 0x808625a9, 0x02, 0x103382c0);
+ USB_UHCI (config, ":pci:1d.1", 0, 0x808625aa, 0x02, 0x103382c0);
+ I6300ESB_WATCHDOG (config, ":pci:1d.4", 0, 0x103382c0);
+ APIC (config, ":pci:1d.5", 0, 0x808625ac, 0x02, 0x103382c0);
+ USB_EHCI (config, ":pci:1d.7", 0, 0x808625ad, 0x02, 0x103382c0);
+ PCI_BRIDGE (config, ":pci:1e.0", 0, 0x8086244e, 0x0a);
+ SB0400 (config, ":pci:1e.0:02.0", 0, 0x11021101);
+ SEGA_LINDBERGH_BASEBOARD(config, ":pci:1e.0:03.0", 0);
+ I6300ESB_LPC (config, ":pci:1f.0", 0);
+ LPC_ACPI (config, ":pci:1f.0:acpi", 0);
+ LPC_RTC (config, ":pci:1f.0:rtc", 0);
+ LPC_PIT (config, ":pci:1f.0:pit", 0);
+ SATA (config, ":pci:1f.2", 0, 0x808625a3, 0x02, 0x103382c0);
+ SMBUS (config, ":pci:1f.3", 0, 0x808625a4, 0x02, 0x103382c0);
+ AC97 (config, ":pci:1f.5", 0, 0x808625a6, 0x02, 0x103382c0);
MACHINE_CONFIG_END
#define LINDBERGH_BIOS \
@@ -425,10 +425,10 @@ MACHINE_CONFIG_END
ROMX_LOAD("6.0.0009.bin", 0x00000, 0x100000, CRC(5ffdfbf8) SHA1(605bc4967b749b4e6d13fc2ebb845ba956a259a7), ROM_BIOS(2) ) \
ROM_SYSTEM_BIOS(2, "bios2", "6.0.0010") \
ROMX_LOAD("6.0.0010.bin", 0x00000, 0x100000, CRC(ea2bf888) SHA1(c9c5b6f0d4f4f36620939b15dd2f128a74347e37), ROM_BIOS(3) ) \
-\
+ \
ROM_REGION(0x400000, ":pci:1e.0:03.0", 0) /* Baseboard MPC firmware */ \
ROM_LOAD("fpr-24370b.ic6", 0x000000, 0x400000, CRC(c3b021a4) SHA1(1b6938a50fe0e4ae813864649eb103838c399ac0)) \
-\
+ \
ROM_REGION32_LE(0x10000, ":pci:01.0:00.0", 0) /* Geforce bios extension (custom for the card) */ \
ROM_LOAD("vid_bios.u504", 0x00000, 0x10000, CRC(f78d14d7) SHA1(f129787e487984edd23bf344f2e9500c85052275)) \
DISK_REGION("cf") \
diff --git a/src/mame/drivers/pcipc.cpp b/src/mame/drivers/pcipc.cpp
index cd606f02b4c..a3d6314f588 100644
--- a/src/mame/drivers/pcipc.cpp
+++ b/src/mame/drivers/pcipc.cpp
@@ -488,13 +488,13 @@ MACHINE_CONFIG_START(pcipc_state::pcipc)
MCFG_DEVICE_IRQ_ACKNOWLEDGE_DEVICE("pci:07.0:pic8259_master", pic8259_device, inta_cb)
MCFG_I386_SMIACT(WRITELINE("pci:00.0", i82439hx_host_device, smi_act_w))
- MCFG_PCI_ROOT_ADD( ":pci")
- MCFG_I82439HX_ADD( ":pci:00.0", ":maincpu", 256*1024*1024)
- MCFG_I82371SB_ISA_ADD(":pci:07.0")
+ MCFG_DEVICE_ADD( ":pci", PCI_ROOT, 0)
+ MCFG_DEVICE_ADD( ":pci:00.0", I82439HX, 0, "maincpu", 256*1024*1024)
+ MCFG_DEVICE_ADD( ":pci:07.0", I82371SB_ISA, 0)
MCFG_I82371SB_BOOT_STATE_HOOK(WRITE8(*this, pcipc_state, boot_state_phoenix_ver40_rev6_w))
MCFG_I82371SB_SMI_CB(INPUTLINE(":maincpu", INPUT_LINE_SMI))
-// MCFG_IDE_PCI_ADD( ":pci:07.1", 0x80867010, 0x03, 0x00000000)
-// MCFG_MGA2064W_ADD( ":pci:12.0")
+// MCFG_DEVICE_ADD( ":pci:07.1", IDE_PCI, 0, 0x80867010, 0x03, 0x00000000)
+// MCFG_DEVICE_ADD( ":pci:12.0", MGA2064W, 0)
MCFG_DEVICE_ADD("board4", ISA16_SLOT, 0, "pci:07.0:isabus", isa_internal_devices, "fdc37c93x", true)
MCFG_SLOT_OPTION_MACHINE_CONFIG("fdc37c93x", superio_config)
@@ -509,12 +509,12 @@ MACHINE_CONFIG_START(pcipc_state::pcipctx)
MCFG_DEVICE_ADD("maincpu", PENTIUM, 60000000)
MCFG_DEVICE_IRQ_ACKNOWLEDGE_DEVICE("pci:07.0:pic8259_master", pic8259_device, inta_cb)
- MCFG_PCI_ROOT_ADD( ":pci")
- MCFG_I82439TX_ADD( ":pci:00.0", ":maincpu", 256*1024*1024)
- MCFG_I82371SB_ISA_ADD(":pci:07.0")
+ MCFG_DEVICE_ADD( ":pci", PCI_ROOT, 0)
+ MCFG_DEVICE_ADD( ":pci:00.0", I82439TX, 0, ":maincpu", 256*1024*1024)
+ MCFG_DEVICE_ADD( ":pci:07.0", I82371SB_ISA, 0)
MCFG_I82371SB_BOOT_STATE_HOOK(WRITE8(*this, pcipc_state, boot_state_award_w))
-// MCFG_IDE_PCI_ADD( ":pci:07.1", 0x80867010, 0x03, 0x00000000)
- MCFG_MGA2064W_ADD( ":pci:12.0")
+// MCFG_DEVICE_ADD( ":pci:07.1", IDE_PCI, 0, 0x80867010, 0x03, 0x00000000)
+ MCFG_DEVICE_ADD( ":pci:12.0", MGA2064W, 0)
MACHINE_CONFIG_END
ROM_START(pcipc)
diff --git a/src/mame/drivers/seattle.cpp b/src/mame/drivers/seattle.cpp
index 9b0d2be10bd..13d86545940 100644
--- a/src/mame/drivers/seattle.cpp
+++ b/src/mame/drivers/seattle.cpp
@@ -1879,7 +1879,7 @@ MACHINE_CONFIG_START(seattle_state::seattle_common)
MCFG_MIPS3_SYSTEM_CLOCK(SYSTEM_CLOCK)
// PCI Bus Devices
- MCFG_PCI_ROOT_ADD(":pci")
+ MCFG_DEVICE_ADD(":pci", PCI_ROOT, 0)
MCFG_GT64010_ADD(PCI_ID_GALILEO, ":maincpu", SYSTEM_CLOCK, GALILEO_IRQ_NUM)
MCFG_GT64XXX_SET_CS(0, seattle_state::seattle_cs0_map)
@@ -1888,8 +1888,8 @@ MACHINE_CONFIG_START(seattle_state::seattle_common)
MCFG_GT64XXX_SET_CS(3, seattle_state::seattle_cs3_map)
MCFG_GT64XX_SET_SIMM0(0x00800000)
- MCFG_IDE_PCI_ADD(PCI_ID_IDE, 0x100b0002, 0x01, 0x0)
- MCFG_IDE_PCI_IRQ_ADD(":maincpu", IDE_IRQ_NUM)
+ MCFG_DEVICE_ADD(PCI_ID_IDE, IDE_PCI, 0, 0x100b0002, 0x01, 0x0)
+ MCFG_IDE_PCI_IRQ_HANDLER(INPUTLINE(m_maincpu, IDE_IRQ_NUM))
MCFG_IDE_PCI_SET_LEGACY_TOP(0x0a0)
MCFG_DEVICE_ADD(PCI_ID_VIDEO, VOODOO_1_PCI, 0, m_maincpu, m_screen)
diff --git a/src/mame/drivers/vegas.cpp b/src/mame/drivers/vegas.cpp
index f7422d2d2fb..2363b4360ab 100644
--- a/src/mame/drivers/vegas.cpp
+++ b/src/mame/drivers/vegas.cpp
@@ -1723,9 +1723,9 @@ MACHINE_CONFIG_START(vegas_state::vegascore)
MCFG_MIPS3_SYSTEM_CLOCK(vegas_state::SYSTEM_CLOCK)
// PCI Bus Devices
- MCFG_PCI_ROOT_ADD(":pci")
+ MCFG_DEVICE_ADD(":pci", PCI_ROOT, 0)
- MCFG_VRC5074_ADD(PCI_ID_NILE, ":maincpu")
+ MCFG_DEVICE_ADD(PCI_ID_NILE, VRC5074, 0, m_maincpu)
MCFG_VRC5074_SET_SDRAM(0, 0x00800000)
MCFG_VRC5074_SET_CS(2, vegas_state::vegas_cs2_map)
MCFG_VRC5074_SET_CS(3, vegas_state::vegas_cs3_map)
@@ -1734,7 +1734,7 @@ MACHINE_CONFIG_START(vegas_state::vegascore)
MCFG_VRC5074_SET_CS(6, vegas_state::vegas_cs6_map)
MCFG_VRC5074_SET_CS(7, vegas_state::vegas_cs7_map)
- MCFG_IDE_PCI_ADD(PCI_ID_IDE, 0x10950646, 0x05, 0x0)
+ MCFG_DEVICE_ADD(PCI_ID_IDE, IDE_PCI, 0, 0x10950646, 0x05, 0x0)
MCFG_IDE_PCI_IRQ_HANDLER(WRITELINE(PCI_ID_NILE, vrc5074_device, pci_intr_d))
//MCFG_IDE_PCI_SET_PIF(0x8f)
diff --git a/src/mame/includes/xbox_pci.h b/src/mame/includes/xbox_pci.h
index 9fade952cae..14800e22fc2 100644
--- a/src/mame/includes/xbox_pci.h
+++ b/src/mame/includes/xbox_pci.h
@@ -14,25 +14,28 @@
class nv2a_host_device : public pci_host_device {
public:
+ template <typename T>
+ nv2a_host_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock, T &&cpu_tag)
+ : nv2a_host_device(mconfig, tag, owner, clock)
+ {
+ set_ids_host(0x10de02a5, 0, 0);
+ set_cpu_tag(std::forward<T>(cpu_tag));
+ }
nv2a_host_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
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;
- void set_cpu_tag(const char *cpu_tag);
+ uint64_t io_window_start, uint64_t io_window_end, uint64_t io_offset, address_space *io_space) override;
+ template <typename T> void set_cpu_tag(T &&cpu_tag) { cpu.set_tag(std::forward<T>(cpu_tag)); }
protected:
virtual void device_start() override;
virtual void device_reset() override;
private:
- const char *cpu_tag;
- cpu_device *cpu;
+ required_device<device_memory_interface> cpu;
};
DECLARE_DEVICE_TYPE(NV2A_HOST, nv2a_host_device)
-#define MCFG_NV2A_HOST_ADD(_tag, _cpu_tag) MCFG_PCI_HOST_ADD(_tag, NV2A_HOST, 0x10de02a5, 0, 0) \
- downcast<nv2a_host_device *>(device)->set_cpu_tag(_cpu_tag);
-
/*
* Ram
*/
@@ -180,8 +183,14 @@ DECLARE_DEVICE_TYPE(MCPX_ETH, mcpx_eth_device)
class mcpx_apu_device : public pci_device {
public:
+ template <typename T>
+ mcpx_apu_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock, T &&cpu_tag)
+ : mcpx_apu_device(mconfig, tag, owner, clock)
+ {
+ set_cpu_tag(std::forward<T>(cpu_tag));
+ }
mcpx_apu_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
- void set_cpu_tag(const char *cpu_tag);
+ template <typename T> void set_cpu_tag(T &&cpu_tag) { cpu.set_tag(std::forward<T>(cpu_tag)); }
DECLARE_READ32_MEMBER(apu_r);
DECLARE_WRITE32_MEMBER(apu_w);
@@ -192,8 +201,7 @@ protected:
virtual void device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr) override;
private:
- const char *cpu_tag;
- cpu_device *cpu;
+ required_device<device_memory_interface> cpu;
// APU contains 3 dsps: voice processor (VP) global processor (GP) encode processor (EP)
struct apu_state {
uint32_t memory[0x60000 / 4];
@@ -221,9 +229,6 @@ private:
DECLARE_DEVICE_TYPE(MCPX_APU, mcpx_apu_device)
-#define MCFG_MCPX_APU_ADD(_tag, _cpu_tag) MCFG_PCI_DEVICE_ADD(_tag, MCPX_APU, 0x10de01b0, 0, 0, 0) \
- downcast<mcpx_apu_device *>(device)->set_cpu_tag(_cpu_tag);
-
/*
* AC97 Audio Controller
*/
@@ -298,6 +303,11 @@ DECLARE_DEVICE_TYPE(MCPX_IDE, mcpx_ide_device)
class nv2a_agp_device : public agp_bridge_device {
public:
+ nv2a_agp_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock, uint32_t main_id, uint32_t revision)
+ : nv2a_agp_device(mconfig, tag, owner, clock)
+ {
+ set_ids_bridge(main_id, revision);
+ }
nv2a_agp_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
protected:
@@ -314,7 +324,7 @@ DECLARE_DEVICE_TYPE(NV2A_AGP, nv2a_agp_device)
class nv2a_gpu_device : public pci_device {
public:
nv2a_gpu_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
- void set_cpu_tag(const char *cpu_tag);
+ template <typename T> void set_cpu_tag(T &&cpu_tag) { cpu.set_tag(std::forward<T>(cpu_tag)); }
nv2a_renderer *debug_get_renderer() { return nvidia_nv2a; }
template<class Object> devcb_base &set_interrupt_handler(Object &&cb) { return m_interrupt_handler.set_callback(std::forward<Object>(cb)); }
@@ -330,7 +340,7 @@ protected:
private:
nv2a_renderer *nvidia_nv2a;
- const char *cpu_tag;
+ required_device<device_memory_interface> cpu;
devcb_write_line m_interrupt_handler;
address_space *m_program;
void nv2a_mmio(address_map &map);
diff --git a/src/mame/machine/iteagle_fpga.cpp b/src/mame/machine/iteagle_fpga.cpp
index 8986ad245ce..9d54367121c 100644
--- a/src/mame/machine/iteagle_fpga.cpp
+++ b/src/mame/machine/iteagle_fpga.cpp
@@ -34,9 +34,10 @@ void iteagle_fpga_device::ram_map(address_map &map)
}
iteagle_fpga_device::iteagle_fpga_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
- : pci_device(mconfig, ITEAGLE_FPGA, tag, owner, clock),
- m_rtc(*this, "eagle2_rtc"), m_e1_nvram(*this, "eagle1_bram"), m_scc1(*this, AM85C30_TAG), m_version(0), m_seq_init(0)
+ : pci_device(mconfig, ITEAGLE_FPGA, tag, owner, clock)
+ , m_rtc(*this, "eagle2_rtc"), m_e1_nvram(*this, "eagle1_bram"), m_scc1(*this, AM85C30_TAG), m_screen(*this, finder_base::DUMMY_TAG), m_cpu(*this, finder_base::DUMMY_TAG), m_version(0), m_seq_init(0)
{
+ set_ids(0x55cc33aa, 0xaa, 0xaaaaaa, 0x00);
}
MACHINE_CONFIG_START(iteagle_fpga_device::device_add_mconfig)
@@ -63,8 +64,6 @@ MACHINE_CONFIG_END
void iteagle_fpga_device::device_start()
{
- m_screen = downcast<screen_device *>(machine().device("screen"));
-
// RTC M48T02
m_rtc->set_base(m_rtc_regs, sizeof(m_rtc_regs));
@@ -104,7 +103,6 @@ void iteagle_fpga_device::device_start()
void iteagle_fpga_device::device_reset()
{
remap_cb();
- m_cpu = machine().device<cpu_device>(m_cpu_tag);
memset(m_fpga_regs, 0, sizeof(m_fpga_regs));
m_seq = m_seq_init;
m_seq_rem1 = 0;
@@ -471,7 +469,7 @@ WRITE32_MEMBER( iteagle_fpga_device::fpga_w )
//*************************************
//* AM85c30 serial controller
//*************************************
-void iteagle_am85c30::reset(void)
+void iteagle_am85c30::reset()
{
memset(m_rr_regs, 0, 0x10 * 2);
memset(m_wr_regs, 0, 0x10 * 2);
@@ -656,9 +654,11 @@ MACHINE_CONFIG_START(iteagle_eeprom_device::device_add_mconfig)
MACHINE_CONFIG_END
iteagle_eeprom_device::iteagle_eeprom_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
- : pci_device(mconfig, ITEAGLE_EEPROM, tag, owner, clock),
- m_sw_version(0), m_hw_version(0), m_eeprom(*this, "eeprom")
+ : pci_device(mconfig, ITEAGLE_EEPROM, tag, owner, clock)
+ , m_sw_version(0), m_hw_version(0), m_eeprom(*this, "eeprom")
{
+ set_ids(0x80861229, 0x02, 0x020000, 0x00);
+
// When corrupt writes 0x3=2, 0x3e=2, 0xa=0, 0x30=0
// 0x4 = HW Version - 6-8 is GREEN board PCB, 9 is RED board PCB
// 0x5 = Serial Num + top byte of 0x4
@@ -777,9 +777,10 @@ void iteagle_periph_device::ctrl_map(address_map &map)
}
iteagle_periph_device::iteagle_periph_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
- : pci_device(mconfig, ITEAGLE_PERIPH, tag, owner, clock),
- m_rtc(*this, "eagle1_rtc")
+ : pci_device(mconfig, ITEAGLE_PERIPH, tag, owner, clock)
+ , m_rtc(*this, "eagle1_rtc")
{
+ set_ids(0x1080c693, 0x00, 0x060100, 0x00);
}
void iteagle_periph_device::device_start()
diff --git a/src/mame/machine/iteagle_fpga.h b/src/mame/machine/iteagle_fpga.h
index 102931147dc..3f2a33d44bf 100644
--- a/src/mame/machine/iteagle_fpga.h
+++ b/src/mame/machine/iteagle_fpga.h
@@ -13,31 +13,18 @@
#include "bus/rs232/rs232.h"
#include "screen.h"
-//MCFG_PCI_DEVICE_ADD(_tag, _type, _main_id, _revision, _pclass, _subsystem_id)
-
-#define MCFG_ITEAGLE_FPGA_ADD(_tag, _cpu_tag, _irq_num, _serial_irq_num) \
- MCFG_PCI_DEVICE_ADD(_tag, ITEAGLE_FPGA, 0x55CC33AA, 0xAA, 0xAAAAAA, 0x00) \
- downcast<iteagle_fpga_device *>(device)->set_irq_info(_cpu_tag, _irq_num, _serial_irq_num);
-
#define MCFG_ITEAGLE_FPGA_INIT(_version, _seq_init) \
- downcast<iteagle_fpga_device *>(device)->set_init_info(_version, _seq_init);
-
-#define MCFG_ITEAGLE_EEPROM_ADD(_tag) \
- MCFG_PCI_DEVICE_ADD(_tag, ITEAGLE_EEPROM, 0x80861229, 0x02, 0x020000, 0x00)
+ downcast<iteagle_fpga_device &>(*device).set_init_info(_version, _seq_init);
#define MCFG_ITEAGLE_EEPROM_INIT(_sw_version, _hw_version) \
- downcast<iteagle_eeprom_device *>(device)->set_info(_sw_version, _hw_version);
-
-// Mimic Cypress CY82C693 Peripheral Controller
-#define MCFG_ITEAGLE_PERIPH_ADD(_tag) \
- MCFG_PCI_DEVICE_ADD(_tag, ITEAGLE_PERIPH, 0x1080C693, 0x00, 0x060100, 0x00)
+ downcast<iteagle_eeprom_device &>(*device).set_info(_sw_version, _hw_version);
// Functional emulation of AMD AM85C30 serial controller
// Two channels, A & B
class iteagle_am85c30
{
public:
- void reset(void);
+ void reset();
void write_control(uint8_t data, int channel);
uint8_t read_control(int channel);
void write_data(uint8_t data, int channel);
@@ -45,7 +32,7 @@ public:
void write_rx_str(int channel, std::string resp);
std::string get_tx_str(int channel) { return m_serial_tx[channel]; };
void clear_tx_str(int channel) { m_serial_tx[channel].clear(); };
- bool check_interrupt(void) { return (m_rr_regs[0][3] != 0); };
+ bool check_interrupt() { return (m_rr_regs[0][3] != 0); };
private:
uint8_t m_rr_regs[2][16];
uint8_t m_wr_regs[2][16];
@@ -56,16 +43,19 @@ private:
class iteagle_fpga_device : public pci_device
{
public:
+ template <typename T, typename U>
+ iteagle_fpga_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock, T &&screen_tag, U &&cpu_tag, int irq_num, int serial_num)
+ : iteagle_fpga_device(mconfig, tag, owner, clock)
+ {
+ set_screen_tag(std::forward<T>(screen_tag));
+ set_irq_info(std::forward<U>(cpu_tag), irq_num, serial_num);
+ }
iteagle_fpga_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
- required_device<nvram_device> m_rtc;
- optional_device<nvram_device> m_e1_nvram;
- required_device<scc85c30_device> m_scc1;
- screen_device *m_screen;
-
void set_init_info(int version, int seq_init) {m_version=version; m_seq_init=seq_init;}
- void set_irq_info(const char *tag, const int irq_num, const int serial_num) {
- m_cpu_tag = tag; m_irq_num = irq_num; m_serial_irq_num = serial_num;}
+ template <typename T> void set_screen_tag(T &&tag) { m_screen.set_tag(std::forward<T>(tag)); }
+ template <typename T> void set_irq_info(T &&tag, const int irq_num, int serial_num) {
+ m_cpu.set_tag(std::forward<T>(tag)); m_irq_num = irq_num; m_serial_irq_num = serial_num; }
DECLARE_WRITE_LINE_MEMBER(vblank_update);
DECLARE_WRITE8_MEMBER(serial_rx_w);
@@ -77,9 +67,13 @@ protected:
virtual void device_add_mconfig(machine_config &config) override;
private:
+ required_device<nvram_device> m_rtc;
+ optional_device<nvram_device> m_e1_nvram;
+ required_device<scc85c30_device> m_scc1;
+ required_device<screen_device> m_screen;
+
emu_timer * m_timer;
- const char *m_cpu_tag;
- cpu_device *m_cpu;
+ required_device<device_execute_interface> m_cpu;
int m_irq_num;
int m_serial_irq_num;
@@ -148,6 +142,7 @@ private:
required_device<eeprom_serial_93cxx_device> m_eeprom;
};
+// Mimic Cypress CY82C693 Peripheral Controller
class iteagle_periph_device : public pci_device {
public:
iteagle_periph_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
diff --git a/src/mame/machine/segabb.cpp b/src/mame/machine/segabb.cpp
index b297d1916e3..679896abb75 100644
--- a/src/mame/machine/segabb.cpp
+++ b/src/mame/machine/segabb.cpp
@@ -20,6 +20,7 @@ void sega_lindbergh_baseboard_device::map3(address_map &map)
sega_lindbergh_baseboard_device::sega_lindbergh_baseboard_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
: pci_device(mconfig, SEGA_LINDBERGH_BASEBOARD, tag, owner, clock)
{
+ set_ids(0x105718c1, 0x10, 0x068000, 0x11db067b);
}
void sega_lindbergh_baseboard_device::device_start()
diff --git a/src/mame/machine/segabb.h b/src/mame/machine/segabb.h
index 96bc685857e..5c42c21d084 100644
--- a/src/mame/machine/segabb.h
+++ b/src/mame/machine/segabb.h
@@ -9,9 +9,6 @@
#include "machine/pci.h"
-#define MCFG_SEGA_LINDBERGH_BASEBOARD_ADD(_tag) \
- MCFG_PCI_DEVICE_ADD(_tag, SEGA_LINDBERGH_BASEBOARD, 0x105718c1, 0x10, 0x068000, 0x11db067b)
-
class sega_lindbergh_baseboard_device : public pci_device {
public:
sega_lindbergh_baseboard_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
diff --git a/src/mame/machine/xbox.cpp b/src/mame/machine/xbox.cpp
index c7ee6233543..e4a35dfa27d 100644
--- a/src/mame/machine/xbox.cpp
+++ b/src/mame/machine/xbox.cpp
@@ -862,32 +862,32 @@ void xbox_base_state::xbox_base_map_io(address_map &map)
MACHINE_CONFIG_START(xbox_base_state::xbox_base)
/* basic machine hardware */
- MCFG_DEVICE_ADD("maincpu", PENTIUM3, 733333333) /* Wrong! family 6 model 8 stepping 10 */
+ MCFG_DEVICE_ADD(m_maincpu, PENTIUM3, 733333333) /* Wrong! family 6 model 8 stepping 10 */
MCFG_DEVICE_PROGRAM_MAP(xbox_base_map)
MCFG_DEVICE_IO_MAP(xbox_base_map_io)
MCFG_DEVICE_IRQ_ACKNOWLEDGE_DRIVER(xbox_base_state, irq_callback)
MCFG_QUANTUM_TIME(attotime::from_hz(6000))
- MCFG_PCI_ROOT_ADD( ":pci")
- MCFG_NV2A_HOST_ADD( ":pci:00.0", "maincpu")
- MCFG_PCI_DEVICE_ADD(":pci:00.3", NV2A_RAM, 0x10de02a6, 0, 0, 0)
- MCFG_PCI_DEVICE_ADD(":pci:01.0", MCPX_LPC, 0x10de01b2, 0xb4, 0, 0) // revision id must be at least 0xb4, otherwise usb will require a hub
- MCFG_PCI_DEVICE_ADD(":pci:01.1", MCPX_SMBUS, 0x10de01b4, 0, 0, 0)
+ MCFG_DEVICE_ADD(":pci", PCI_ROOT, 0)
+ MCFG_DEVICE_ADD(":pci:00.0", NV2A_HOST, 0, m_maincpu)
+ MCFG_DEVICE_ADD(":pci:00.3", NV2A_RAM, 0) downcast<pci_device &>(*device).set_ids(0x10de02a6, 0, 0, 0);
+ MCFG_DEVICE_ADD(":pci:01.0", MCPX_LPC, 0) downcast<pci_device &>(*device).set_ids(0x10de01b2, 0xb4, 0, 0); // revision id must be at least 0xb4, otherwise usb will require a hub
+ MCFG_DEVICE_ADD(":pci:01.1", MCPX_SMBUS, 0) downcast<pci_device &>(*device).set_ids(0x10de01b4, 0, 0, 0);
MCFG_MCPX_SMBUS_INTERRUPT_HANDLER(WRITELINE(*this, xbox_base_state, xbox_smbus_interrupt_changed))
- MCFG_PCI_DEVICE_ADD(":pci:02.0", MCPX_OHCI, 0x10de01c2, 0, 0, 0)
+ MCFG_DEVICE_ADD(":pci:02.0", MCPX_OHCI, 0) downcast<pci_device &>(*device).set_ids(0x10de01c2, 0, 0, 0);
MCFG_MCPX_OHCI_INTERRUPT_HANDLER(WRITELINE(*this, xbox_base_state, xbox_ohci_usb_interrupt_changed))
- MCFG_PCI_DEVICE_ADD(":pci:03.0", MCPX_OHCI, 0x10de01c2, 0, 0, 0)
- MCFG_PCI_DEVICE_ADD(":pci:04.0", MCPX_ETH, 0x10de01c3, 0, 0, 0)
- MCFG_MCPX_APU_ADD( ":pci:05.0", "maincpu")
- MCFG_PCI_DEVICE_ADD(":pci:06.0", MCPX_AC97_AUDIO, 0x10de01b1, 0, 0, 0)
- MCFG_PCI_DEVICE_ADD(":pci:06.1", MCPX_AC97_MODEM, 0x10de01c1, 0, 0, 0)
- MCFG_PCI_BRIDGE_ADD(":pci:08.0", 0x10de01b8, 0)
- MCFG_PCI_DEVICE_ADD(":pci:09.0", MCPX_IDE, 0x10de01bc, 0, 0, 0)
+ MCFG_DEVICE_ADD(":pci:03.0", MCPX_OHCI, 0) downcast<pci_device &>(*device).set_ids(0x10de01c2, 0, 0, 0);
+ MCFG_DEVICE_ADD(":pci:04.0", MCPX_ETH, 0) downcast<pci_device &>(*device).set_ids(0x10de01c3, 0, 0, 0);
+ MCFG_DEVICE_ADD(":pci:05.0", MCPX_APU, 0, m_maincpu)
+ MCFG_DEVICE_ADD(":pci:06.0", MCPX_AC97_AUDIO, 0) downcast<pci_device &>(*device).set_ids(0x10de01b1, 0, 0, 0);
+ MCFG_DEVICE_ADD(":pci:06.1", MCPX_AC97_MODEM, 0) downcast<pci_device &>(*device).set_ids(0x10de01c1, 0, 0, 0);
+ MCFG_DEVICE_ADD(":pci:08.0", PCI_BRIDGE, 0, 0x10de01b8, 0)
+ MCFG_DEVICE_ADD(":pci:09.0", MCPX_IDE, 0) downcast<pci_device &>(*device).set_ids(0x10de01bc, 0, 0, 0);
MCFG_MCPX_IDE_INTERRUPT_HANDLER(WRITELINE("pic8259_2", pic8259_device, ir6_w))
- MCFG_AGP_BRIDGE_ADD(":pci:1e.0", NV2A_AGP, 0x10de01b7, 0)
- MCFG_PCI_DEVICE_ADD(":pci:1e.0:00.0", NV2A_GPU, 0x10de02a0, 0, 0, 0)
- MCFG_MCPX_NV2A_GPU_CPU("maincpu")
+ MCFG_DEVICE_ADD(":pci:1e.0", NV2A_AGP, 0, 0x10de01b7, 0)
+ MCFG_DEVICE_ADD(":pci:1e.0:00.0", NV2A_GPU, 0) downcast<pci_device &>(*device).set_ids(0x10de02a0, 0, 0, 0);
+ MCFG_MCPX_NV2A_GPU_CPU(m_maincpu)
MCFG_MCPX_NV2A_GPU_INTERRUPT_HANDLER(WRITELINE(*this, xbox_base_state, xbox_nv2a_interrupt_changed))
MCFG_DEVICE_ADD("pic8259_1", PIC8259, 0)
diff --git a/src/mame/machine/xbox_pci.cpp b/src/mame/machine/xbox_pci.cpp
index 42fdd2c68fb..c2d53ec277f 100644
--- a/src/mame/machine/xbox_pci.cpp
+++ b/src/mame/machine/xbox_pci.cpp
@@ -15,11 +15,11 @@
DEFINE_DEVICE_TYPE(NV2A_HOST, nv2a_host_device, "nv2a_host", "NV2A PCI Bridge Device - Host Bridge")
-nv2a_host_device::nv2a_host_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
- : pci_host_device(mconfig, NV2A_HOST, tag, owner, clock),
- cpu_tag(nullptr),
- cpu(nullptr)
+nv2a_host_device::nv2a_host_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) :
+ pci_host_device(mconfig, NV2A_HOST, tag, owner, clock),
+ cpu(*this, finder_base::DUMMY_TAG)
{
+ set_ids(0x10de01b0, 0, 0, 0);
}
void nv2a_host_device::map_extra(uint64_t memory_window_start, uint64_t memory_window_end, uint64_t memory_offset, address_space *memory_space,
@@ -28,15 +28,9 @@ void nv2a_host_device::map_extra(uint64_t memory_window_start, uint64_t memory_w
io_space->install_device(0, 0xffff, *static_cast<pci_host_device *>(this), &pci_host_device::io_configuration_access_map);
}
-void nv2a_host_device::set_cpu_tag(const char *_cpu_tag)
-{
- cpu_tag = _cpu_tag;
-}
-
void nv2a_host_device::device_start()
{
pci_host_device::device_start();
- cpu = machine().device<cpu_device>(cpu_tag);
memory_space = &cpu->space(AS_PROGRAM);
io_space = &cpu->space(AS_IO);
@@ -382,18 +376,12 @@ void mcpx_apu_device::apu_mmio(address_map &map)
map(0x00000000, 0x00007ffff).rw(this, FUNC(mcpx_apu_device::apu_r), FUNC(mcpx_apu_device::apu_w));
}
-mcpx_apu_device::mcpx_apu_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
- : pci_device(mconfig, MCPX_APU, tag, owner, clock),
- cpu_tag(nullptr),
- cpu(nullptr)
+mcpx_apu_device::mcpx_apu_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) :
+ pci_device(mconfig, MCPX_APU, tag, owner, clock),
+ cpu(*this, finder_base::DUMMY_TAG)
{
}
-void mcpx_apu_device::set_cpu_tag(const char *_cpu_tag)
-{
- cpu_tag = _cpu_tag;
-}
-
void mcpx_apu_device::device_start()
{
pci_device::device_start();
@@ -406,7 +394,6 @@ void mcpx_apu_device::device_start()
memset(apust.voices_position_start, 0, sizeof(apust.voices_position_start));
memset(apust.voices_position_end, 0, sizeof(apust.voices_position_end));
memset(apust.voices_position_increment, 0, sizeof(apust.voices_position_increment));
- cpu = machine().device<cpu_device>(cpu_tag);
apust.space = &cpu->space();
apust.timer = timer_alloc(0);
apust.timer->enable(false);
@@ -762,20 +749,15 @@ void nv2a_gpu_device::nv2a_mirror(address_map &map)
map(0x00000000, 0x07ffffff).ram().rw(this, FUNC(nv2a_gpu_device::nv2a_mirror_r), FUNC(nv2a_gpu_device::nv2a_mirror_w));
}
-nv2a_gpu_device::nv2a_gpu_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
- : pci_device(mconfig, NV2A_GPU, tag, owner, clock),
+nv2a_gpu_device::nv2a_gpu_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) :
+ pci_device(mconfig, NV2A_GPU, tag, owner, clock),
nvidia_nv2a(nullptr),
- cpu_tag(nullptr),
+ cpu(*this, finder_base::DUMMY_TAG),
m_interrupt_handler(*this),
m_program(nullptr)
{
}
-void nv2a_gpu_device::set_cpu_tag(const char *_cpu_tag)
-{
- cpu_tag = _cpu_tag;
-}
-
void nv2a_gpu_device::device_start()
{
pci_device::device_start();
@@ -784,7 +766,7 @@ void nv2a_gpu_device::device_start()
bank_infos[0].adr = 0xfd000000;
add_map(0x08000000, M_MEM, FUNC(nv2a_gpu_device::nv2a_mirror));
bank_infos[1].adr = 0xf0000000;
- m_program = &machine().device<cpu_device>(cpu_tag)->space();
+ m_program = &cpu->space(AS_PROGRAM); // FIXME: isn't there a proper way to map stuff or do DMA via the PCI device interface?
nvidia_nv2a = new nv2a_renderer(machine());
nvidia_nv2a->set_irq_callbaclk(
[&](int state)