summaryrefslogtreecommitdiffstatshomepage
path: root/src/devices/machine/vrc4373.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/devices/machine/vrc4373.h')
-rw-r--r--src/devices/machine/vrc4373.h24
1 files changed, 13 insertions, 11 deletions
diff --git a/src/devices/machine/vrc4373.h b/src/devices/machine/vrc4373.h
index 12b04a86a53..0e4e205db11 100644
--- a/src/devices/machine/vrc4373.h
+++ b/src/devices/machine/vrc4373.h
@@ -10,15 +10,11 @@
#include "pci.h"
#include "cpu/mips/mips3.h"
-#define MCFG_VRC4373_ADD(_tag, _cpu_tag) \
- MCFG_PCI_HOST_ADD(_tag, VRC4373, 0x1033005B, 0x00, 0x00000000) \
- downcast<vrc4373_device *>(device)->set_cpu_tag(_cpu_tag);
-
#define MCFG_VRC4373_SET_RAM(_size) \
- downcast<vrc4373_device *>(device)->set_ram_size(_size);
+ downcast<vrc4373_device &>(*device).set_ram_size(_size);
#define MCFG_VRC4373_SET_SIMM0(_size) \
- downcast<vrc4373_device *>(device)->set_simm0_size(_size);
+ downcast<vrc4373_device &>(*device).set_simm0_size(_size);
#define MCFG_VRC4373_IRQ_CB(_devcb) \
devcb = &ide_pci_device::set_irq_cb(*device, DEVCB_##_devcb);
@@ -26,6 +22,13 @@
class vrc4373_device : public pci_host_device {
public:
+ template <typename T>
+ vrc4373_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock, T &&cpu_tag)
+ : vrc4373_device(mconfig, tag, owner, clock)
+ {
+ set_cpu_tag(std::forward<T>(cpu_tag));
+ }
+
vrc4373_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
virtual void reset_all_mappings() override;
@@ -34,9 +37,9 @@ public:
virtual void device_post_load() override;
template <class Object> devcb_base &set_irq_cb(Object &&cb) { return m_irq_cb.set_callback(std::forward<Object>(cb)); }
- void set_cpu_tag(const char *tag) { cpu_tag = tag; }
- void set_ram_size(const int size) { m_ram_size = size; };
- void set_simm0_size(const int size) { m_simm0_size = size; };
+ template <typename T> void set_cpu_tag(T &&tag) { m_cpu.set_tag(std::forward<T>(tag)); }
+ void set_ram_size(int size) { m_ram_size = size; };
+ void set_simm0_size(int size) { m_simm0_size = size; };
virtual void config_map(address_map &map) override;
@@ -86,8 +89,7 @@ private:
devcb_write_line m_irq_cb;
- mips3_device *m_cpu;
- const char *cpu_tag;
+ required_device<mips3_device> m_cpu;
int m_ram_size;
int m_simm0_size;