summaryrefslogtreecommitdiffstatshomepage
path: root/src/devices/machine/i82875p.h
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/devices/machine/i82875p.h
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/devices/machine/i82875p.h')
-rw-r--r--src/devices/machine/i82875p.h30
1 files changed, 16 insertions, 14 deletions
diff --git a/src/devices/machine/i82875p.h b/src/devices/machine/i82875p.h
index 667f5a8fb00..0ca29e66fc7 100644
--- a/src/devices/machine/i82875p.h
+++ b/src/devices/machine/i82875p.h
@@ -9,22 +9,20 @@
#include "pci.h"
-#define MCFG_I82875P_HOST_ADD(_tag, _subdevice_id, _cpu_tag, _ram_size) \
- MCFG_PCI_HOST_ADD(_tag, I82875P_HOST, 0x80862578, 0x02, _subdevice_id) \
- downcast<i82875p_host_device *>(device)->set_cpu_tag(_cpu_tag); \
- downcast<i82875p_host_device *>(device)->set_ram_size(_ram_size);
-
-#define MCFG_I82875P_AGP_ADD(_tag) \
- MCFG_AGP_BRIDGE_ADD(_tag, I82875P_AGP, 0x80862579, 0x02)
-
-#define MCFG_I82875P_OVERFLOW_ADD(_tag, _subdevice_id) \
- MCFG_PCI_DEVICE_ADD(_tag, I82875P_OVERFLOW, 0x8086257e, 0x02, 0x088000, _subdevice_id)
-
class i82875p_host_device : public pci_host_device {
public:
+ template <typename T>
+ i82875p_host_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock, uint32_t subdevice_id, T &&cpu_tag, int ram_size)
+ : i82875p_host_device(mconfig, tag, owner, clock)
+ {
+ set_ids_host(0x80862578, 0x02, subdevice_id);
+ set_cpu_tag(std::forward<T>(cpu_tag));
+ set_ram_size(ram_size);
+ }
+
i82875p_host_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
- void set_cpu_tag(const char *tag);
+ template <typename T> void set_cpu_tag(T &&tag) { cpu.set_tag(std::forward<T>(tag)); }
void set_ram_size(int ram_size);
virtual DECLARE_READ8_MEMBER(capptr_r) override;
@@ -43,9 +41,8 @@ protected:
private:
void agp_translation_map(address_map &map);
- const char *cpu_tag;
int ram_size;
- cpu_device *cpu;
+ required_device<device_memory_interface> cpu;
std::vector<uint32_t> ram;
uint8_t agpm, fpllcont, pam[8], smram, esmramc;
@@ -109,6 +106,11 @@ protected:
class i82875p_overflow_device : public pci_device {
public:
+ i82875p_overflow_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock, uint32_t subdevice_id)
+ : i82875p_overflow_device(mconfig, tag, owner, clock)
+ {
+ set_ids(0x8086257e, 0x02, 0x088000, subdevice_id);
+ }
i82875p_overflow_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
private: