summaryrefslogtreecommitdiffstatshomepage
path: root/src/devices/bus/macpds/macpds.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/devices/bus/macpds/macpds.h')
-rw-r--r--src/devices/bus/macpds/macpds.h40
1 files changed, 20 insertions, 20 deletions
diff --git a/src/devices/bus/macpds/macpds.h b/src/devices/bus/macpds/macpds.h
index 1977447a87b..aeb860af7e7 100644
--- a/src/devices/bus/macpds/macpds.h
+++ b/src/devices/bus/macpds/macpds.h
@@ -13,6 +13,10 @@
#pragma once
+#include <functional>
+#include <utility>
+#include <vector>
+
//**************************************************************************
// TYPE DEFINITIONS
@@ -31,13 +35,14 @@ public:
option_reset();
opts(*this);
set_default_option(dflt);
- set_macpds_slot(nbtag, tag);
+ set_macpds_slot(nbtag);
}
macpds_slot_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
// inline configuration
- void set_macpds_slot(const char *tag, const char *slottag) { m_macpds_tag = tag; m_macpds_slottag = slottag; }
+ template <typename T>
+ void set_macpds_slot(T &&tag) { m_macpds.set_tag(std::forward<T>(tag));}
protected:
macpds_slot_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock);
@@ -46,7 +51,7 @@ protected:
virtual void device_start() override;
// configuration
- const char *m_macpds_tag, *m_macpds_slottag;
+ required_device<macpds_device> m_macpds;
};
// device type definition
@@ -67,14 +72,16 @@ public:
}
macpds_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
+ ~macpds_device();
- ~macpds_device() { m_device_list.detach_all(); }
// inline configuration
- void set_cputag(const char *tag) { m_cputag = tag; }
+ template <typename T>
+ void set_cputag(T &&tag) { m_maincpu.set_tag(std::forward<T>(tag)); }
- void add_macpds_card(device_macpds_card_interface *card);
+
+ void add_macpds_card(device_macpds_card_interface &card);
template<typename R, typename W> void install_device(offs_t start, offs_t end, R rhandler, W whandler, uint32_t mask=0xffffffff);
- void install_bank(offs_t start, offs_t end, const char *tag, uint8_t *data);
+ void install_bank(offs_t start, offs_t end, uint8_t *data);
void set_irq_line(int line, int state);
protected:
@@ -85,10 +92,9 @@ protected:
virtual void device_reset() override;
// internal state
- cpu_device *m_maincpu;
+ required_device<cpu_device> m_maincpu;
- simple_list<device_macpds_card_interface> m_device_list;
- const char *m_cputag;
+ std::vector<std::reference_wrapper<device_macpds_card_interface> > m_device_list;
};
@@ -101,30 +107,24 @@ DECLARE_DEVICE_TYPE(MACPDS, macpds_device)
class device_macpds_card_interface : public device_interface
{
friend class macpds_device;
- template <class ElememtType> friend class simple_list;
public:
// construction/destruction
virtual ~device_macpds_card_interface();
- device_macpds_card_interface *next() const { return m_next; }
-
void set_macpds_device();
// helper functions for card devices
- void install_bank(offs_t start, offs_t end, const char *tag, uint8_t *data);
+ void install_bank(offs_t start, offs_t end, uint8_t *data);
void install_rom(device_t *dev, const char *romregion, uint32_t addr);
// inline configuration
- void set_macpds_tag(const char *tag, const char *slottag) { m_macpds_tag = tag; m_macpds_slottag = slottag; }
+ void set_macpds_and_slot(macpds_device *macpds, macpds_slot_device *macpds_slot) { m_macpds = macpds; m_macpds_slot = macpds_slot; }
protected:
device_macpds_card_interface(const machine_config &mconfig, device_t &device);
- macpds_device *m_macpds;
- const char *m_macpds_tag, *m_macpds_slottag;
-
-private:
- device_macpds_card_interface *m_next;
+ macpds_device *m_macpds;
+ macpds_slot_device *m_macpds_slot;
};
#endif // MAME_BUS_MACPDS_MACPDS_H