summaryrefslogtreecommitdiffstatshomepage
path: root/src/devices/video
diff options
context:
space:
mode:
author Olivier Galibert <galibert@pobox.com>2018-05-22 22:45:03 +0200
committer Olivier Galibert <galibert@pobox.com>2018-05-22 22:48:16 +0200
commitfdf0c866e21da85ed6760ad34aabce8b41ba6e65 (patch)
treea61cfed5e97cc9c8e6ae6b9b4f5ea35b4b2742fe /src/devices/video
parentd07b223f149a27c91cae437352b5df86456be29f (diff)
Uncrappify voodoo pci devices transfert. Fix some paths on midwayic. (nw)
Diffstat (limited to 'src/devices/video')
-rw-r--r--src/devices/video/voodoo.h4
-rw-r--r--src/devices/video/voodoo_pci.cpp14
-rw-r--r--src/devices/video/voodoo_pci.h11
3 files changed, 12 insertions, 17 deletions
diff --git a/src/devices/video/voodoo.h b/src/devices/video/voodoo.h
index 0d874a61bb4..23ae8b99ae1 100644
--- a/src/devices/video/voodoo.h
+++ b/src/devices/video/voodoo.h
@@ -1468,8 +1468,8 @@ public:
void set_fbmem(int value) { m_fbmem = value; }
void set_tmumem(int value1, int value2) { m_tmumem0 = value1; m_tmumem1 = value2; }
- void set_screen_tag(const char *tag) { m_screen.set_tag(tag); }
- void set_cpu_tag(const char *tag) { m_cpu.set_tag(tag); }
+ template <typename T> void set_screen_tag(T &&tag) { m_screen.set_tag(std::forward<T>(tag)); }
+ template <typename T> void set_cpu_tag(T &&tag) { m_cpu.set_tag(std::forward<T>(tag)); }
template <class Object> devcb_base &set_vblank_callback(Object &&cb) { return m_vblank.set_callback(std::forward<Object>(cb)); }
template <class Object> devcb_base &set_stall_callback(Object &&cb) { return m_stall.set_callback(std::forward<Object>(cb)); }
template <class Object> devcb_base &set_pciint_callback(Object &&cb) { return m_pciint.set_callback(std::forward<Object>(cb)); }
diff --git a/src/devices/video/voodoo_pci.cpp b/src/devices/video/voodoo_pci.cpp
index 5a1fccdc655..c2ce4109dbe 100644
--- a/src/devices/video/voodoo_pci.cpp
+++ b/src/devices/video/voodoo_pci.cpp
@@ -14,24 +14,20 @@ MACHINE_CONFIG_START(voodoo_pci_device::device_add_mconfig)
MCFG_DEVICE_ADD("voodoo", VOODOO_1, STD_VOODOO_1_CLOCK)
MCFG_VOODOO_FBMEM(4)
MCFG_VOODOO_TMUMEM(1, 0)
- MCFG_VOODOO_SCREEN_TAG("screen")
break;
case TYPE_VOODOO_2:
MCFG_DEVICE_ADD("voodoo", VOODOO_2, STD_VOODOO_2_CLOCK)
MCFG_VOODOO_FBMEM(4)
MCFG_VOODOO_TMUMEM(1, 0)
- MCFG_VOODOO_SCREEN_TAG("screen")
break;
case TYPE_VOODOO_BANSHEE:
MCFG_DEVICE_ADD("voodoo", VOODOO_BANSHEE, STD_VOODOO_BANSHEE_CLOCK)
MCFG_VOODOO_FBMEM(16)
- MCFG_VOODOO_SCREEN_TAG("screen")
break;
//case TYPE_VOODOO_3
default:
MCFG_DEVICE_ADD("voodoo", VOODOO_3, STD_VOODOO_3_CLOCK)
MCFG_VOODOO_FBMEM(16)
- MCFG_VOODOO_SCREEN_TAG("screen")
break;}
MACHINE_CONFIG_END
@@ -67,18 +63,14 @@ void voodoo_pci_device::io_map(address_map &map)
voodoo_pci_device::voodoo_pci_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
: pci_device(mconfig, VOODOO_PCI, tag, owner, clock),
- m_voodoo(*this, "voodoo"), m_fbmem(2), m_tmumem0(0), m_tmumem1(0)
+ m_voodoo(*this, "voodoo"), m_cpu(*this, finder_base::DUMMY_TAG), m_screen(*this, finder_base::DUMMY_TAG), m_fbmem(2), m_tmumem0(0), m_tmumem1(0)
{
}
-void voodoo_pci_device::set_cpu_tag(const char *_cpu_tag)
-{
- m_cpu_tag = _cpu_tag;
-}
-
void voodoo_pci_device::device_start()
{
- m_voodoo->set_cpu_tag(m_cpu_tag);
+ m_voodoo->set_cpu_tag(m_cpu);
+ m_voodoo->set_screen_tag(m_screen);
m_voodoo->set_fbmem(m_fbmem);
m_voodoo->set_tmumem(m_tmumem0, m_tmumem1);
switch (m_type) {
diff --git a/src/devices/video/voodoo_pci.h b/src/devices/video/voodoo_pci.h
index 01356e5da0f..6682be79cd5 100644
--- a/src/devices/video/voodoo_pci.h
+++ b/src/devices/video/voodoo_pci.h
@@ -10,10 +10,11 @@
#include "machine/pci.h"
#include "voodoo.h"
-#define MCFG_VOODOO_PCI_ADD(_tag, _type, _cpu_tag) \
+#define MCFG_VOODOO_PCI_ADD(_tag, _type, _cpu_tag, _screen_tag) \
voodoo_pci_device::set_type(_type); \
MCFG_PCI_DEVICE_ADD(_tag, VOODOO_PCI, 0, 0, 0, 0) \
- downcast<voodoo_pci_device *>(device)->set_cpu_tag(_cpu_tag);
+ downcast<voodoo_pci_device *>(device)->set_cpu_tag(_cpu_tag); \
+ downcast<voodoo_pci_device *>(device)->set_screen_tag(_screen_tag);
#define MCFG_VOODOO_PCI_FBMEM(_value) \
downcast<voodoo_pci_device *>(device)->set_fbmem(_value);
@@ -31,7 +32,8 @@ public:
virtual void config_map(address_map &map) override;
void postload(void);
- void set_cpu_tag(const char *tag);
+ template <typename T> void set_cpu_tag(T &&tag) { m_cpu.set_tag(std::forward<T>(tag)); }
+ template <typename T> void set_screen_tag(T &&tag) { m_screen.set_tag(std::forward<T>(tag)); }
static void set_type(const int type) {m_type = type;}
void set_fbmem(const int fbmem) {m_fbmem = fbmem;}
void set_tmumem(const int tmumem0, const int tmumem1) {m_tmumem0 = tmumem0; m_tmumem1 = tmumem1;}
@@ -46,9 +48,10 @@ protected:
private:
required_device<voodoo_device> m_voodoo;
+ optional_device<cpu_device> m_cpu;
+ optional_device<screen_device> m_screen;
static int m_type; // FIXME: all voodoo have to be the same? really?
int m_fbmem, m_tmumem0, m_tmumem1;
- const char *m_cpu_tag;
uint32_t m_pcictrl_reg[0x20];
void voodoo_reg_map(address_map &map);