summaryrefslogtreecommitdiffstatshomepage
path: root/src/devices/video/voodoo_pci.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/devices/video/voodoo_pci.h')
-rw-r--r--src/devices/video/voodoo_pci.h128
1 files changed, 100 insertions, 28 deletions
diff --git a/src/devices/video/voodoo_pci.h b/src/devices/video/voodoo_pci.h
index cf1fdbebb6d..3a67f241eeb 100644
--- a/src/devices/video/voodoo_pci.h
+++ b/src/devices/video/voodoo_pci.h
@@ -16,56 +16,128 @@
#define MCFG_VOODOO_PCI_TMUMEM(_value1, _value2) \
downcast<voodoo_pci_device &>(*device).set_tmumem(_value1, _value2);
-class voodoo_pci_device : public pci_device {
+class voodoo_pci_device : public pci_device
+{
public:
- template <typename T, typename U>
- voodoo_pci_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock, int type, T &&cpu_tag, U &&screen_tag)
- : voodoo_pci_device(mconfig, tag, owner, clock)
- {
- set_type(type);
- set_cpu_tag(std::forward<T>(cpu_tag));
- set_screen_tag(std::forward<U>(screen_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)); }
+ void set_fbmem(int fbmem) { m_fbmem = fbmem; }
+ void set_tmumem(int tmumem0, int tmumem1) { m_tmumem0 = tmumem0; m_tmumem1 = tmumem1; }
+ uint32_t screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect);
+
+ DECLARE_READ32_MEMBER(vga_r);
+ DECLARE_WRITE32_MEMBER(vga_w);
+
+ void voodoo_reg_map(address_map &map);
+ void banshee_reg_map(address_map &map);
+ void lfb_map(address_map &map);
+ void io_map(address_map &map);
+
+protected:
+ voodoo_pci_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock);
- voodoo_pci_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;
- uint32_t screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect);
virtual void config_map(address_map &map) override;
void postload(void);
- 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)); }
- void set_type(int type) {m_type = type;}
- void set_fbmem(int fbmem) {m_fbmem = fbmem;}
- void set_tmumem(int tmumem0, int tmumem1) {m_tmumem0 = tmumem0; m_tmumem1 = tmumem1;}
-
- DECLARE_READ32_MEMBER(vga_r);
- DECLARE_WRITE32_MEMBER(vga_w);
-protected:
virtual void device_start() override;
virtual void device_reset() override;
- virtual void device_add_mconfig(machine_config &config) override;
-private:
required_device<voodoo_device> m_voodoo;
optional_device<cpu_device> m_cpu;
optional_device<screen_device> m_screen;
- int m_type;
int m_fbmem, m_tmumem0, m_tmumem1;
uint32_t m_pcictrl_reg[0x20];
- void voodoo_reg_map(address_map &map);
- void banshee_reg_map(address_map &map);
- void lfb_map(address_map &map);
- void io_map(address_map &map);
DECLARE_READ32_MEMBER(pcictrl_r);
DECLARE_WRITE32_MEMBER(pcictrl_w);
};
-DECLARE_DEVICE_TYPE(VOODOO_PCI, voodoo_pci_device)
+class voodoo_1_pci_device : public voodoo_pci_device
+{
+public:
+ template <typename T, typename U>
+ voodoo_1_pci_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock, T &&cpu_tag, U &&screen_tag)
+ : voodoo_1_pci_device(mconfig, tag, owner, clock)
+ {
+ set_cpu_tag(std::forward<T>(cpu_tag));
+ set_screen_tag(std::forward<U>(screen_tag));
+ }
+
+ voodoo_1_pci_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
+
+protected:
+ virtual void device_start() override;
+ virtual void device_add_mconfig(machine_config &config) override;
+};
+
+class voodoo_2_pci_device : public voodoo_pci_device
+{
+public:
+ template <typename T, typename U>
+ voodoo_2_pci_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock, T &&cpu_tag, U &&screen_tag)
+ : voodoo_2_pci_device(mconfig, tag, owner, clock)
+ {
+ set_cpu_tag(std::forward<T>(cpu_tag));
+ set_screen_tag(std::forward<U>(screen_tag));
+ }
+
+ voodoo_2_pci_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
+
+protected:
+ virtual void device_start() override;
+ virtual void device_add_mconfig(machine_config &config) override;
+};
+
+class voodoo_banshee_pci_device : public voodoo_pci_device
+{
+public:
+ template <typename T, typename U>
+ voodoo_banshee_pci_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock, T &&cpu_tag, U &&screen_tag)
+ : voodoo_banshee_pci_device(mconfig, tag, owner, clock)
+ {
+ set_cpu_tag(std::forward<T>(cpu_tag));
+ set_screen_tag(std::forward<U>(screen_tag));
+ }
+
+ voodoo_banshee_pci_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
+
+protected:
+ virtual void device_start() override;
+ virtual void device_add_mconfig(machine_config &config) override;
+
+ 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;
+};
+
+class voodoo_3_pci_device : public voodoo_pci_device
+{
+public:
+ template <typename T, typename U>
+ voodoo_3_pci_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock, T &&cpu_tag, U &&screen_tag)
+ : voodoo_3_pci_device(mconfig, tag, owner, clock)
+ {
+ set_cpu_tag(std::forward<T>(cpu_tag));
+ set_screen_tag(std::forward<U>(screen_tag));
+ }
+
+ voodoo_3_pci_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
+
+protected:
+ virtual void device_start() override;
+ virtual void device_add_mconfig(machine_config &config) override;
+
+ 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;
+};
+
+DECLARE_DEVICE_TYPE(VOODOO_1_PCI, voodoo_1_pci_device)
+DECLARE_DEVICE_TYPE(VOODOO_2_PCI, voodoo_2_pci_device)
+DECLARE_DEVICE_TYPE(VOODOO_BANSHEE_PCI, voodoo_banshee_pci_device)
+DECLARE_DEVICE_TYPE(VOODOO_3_PCI, voodoo_3_pci_device)
#endif // MAME_VIDEO_VOODOO_PCI_H