summaryrefslogtreecommitdiffstatshomepage
path: root/src/mame/machine/6883sam.h
diff options
context:
space:
mode:
author mooglyguy <therealmogminer@gmail.com>2018-06-05 11:52:23 +0200
committer mooglyguy <therealmogminer@gmail.com>2018-06-05 11:52:45 +0200
commitabef4f38dd796837c0ec949c387cdb707af3629c (patch)
tree8afcef0b9305cc8c40be7e76676f37895b49b680 /src/mame/machine/6883sam.h
parent34b3107c925c74f8ca996f1a5e9e14b099f43fea (diff)
Fix recent coco3 regressions, nw
Diffstat (limited to 'src/mame/machine/6883sam.h')
-rw-r--r--src/mame/machine/6883sam.h26
1 files changed, 10 insertions, 16 deletions
diff --git a/src/mame/machine/6883sam.h b/src/mame/machine/6883sam.h
index 0817ab37503..7675588498e 100644
--- a/src/mame/machine/6883sam.h
+++ b/src/mame/machine/6883sam.h
@@ -14,10 +14,6 @@
#pragma once
-#define MCFG_SAM6883_ADD(_tag, _clock, _cputag, _cpuspace) \
- MCFG_DEVICE_ADD(_tag, SAM6883, _clock) \
- downcast<sam6883_device &>(*device).configure_cpu(_cputag, _cpuspace);
-
#define MCFG_SAM6883_RES_CALLBACK(_read) \
devcb = &downcast<sam6883_device &>(*device).set_res_rd_callback(DEVCB_##_read);
@@ -52,10 +48,10 @@ protected:
static const uint16_t SAM_STATE_V0 = 0x0001;
// incidentals
- cpu_device * m_cpu;
+ required_device<cpu_device> m_cpu;
// device state
- uint16_t m_sam_state;
+ uint16_t m_sam_state;
// base clock divider (/4 for MC6883, /8 for GIME)
int m_divider;
@@ -89,16 +85,17 @@ protected:
class sam6883_device : public device_t, public sam6883_friend_device_interface
{
public:
- sam6883_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
+ template <typename T>
+ sam6883_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock, T &&cpu_tag)
+ : sam6883_device(mconfig, tag, owner, clock)
+ {
+ m_cpu.set_tag(std::forward<T>(cpu_tag));
+ }
+
+ sam6883_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
template <class Object> devcb_base &set_res_rd_callback(Object &&cb) { return m_read_res.set_callback(std::forward<Object>(cb)); }
- void configure_cpu(const char *tag, int space)
- {
- m_cpu_tag = tag;
- m_cpu_space_ref = space;
- }
-
// called to configure banks
void configure_bank(int bank, uint8_t *memory, uint32_t memory_size, bool is_read_only);
void configure_bank(int bank, read8_delegate rhandler, write8_delegate whandler);
@@ -170,9 +167,6 @@ private:
void point_specific_bank(const sam_bank &bank, uint32_t offset, uint32_t mask, memory_bank *&memory_bank, uint32_t addrstart, uint32_t addrend, bool is_write);
};
- const char * m_cpu_tag;
- int m_cpu_space_ref;
-
// incidentals
address_space * m_cpu_space;
devcb_read8 m_read_res;