diff options
author | 2016-04-14 21:20:49 -0400 | |
---|---|---|
committer | 2016-04-14 21:20:49 -0400 | |
commit | 34be7d416603f0601877f208e6250dae416a92b2 (patch) | |
tree | 5e15f2cc717eaff6dbb28c9b94c6377c88d5c566 /src/devices/cpu/z180 | |
parent | b5486236918e8565b27e79a99d7c3112f6cff00e (diff) |
Eliminate device_t::static_config, a type-unsafe legacy feature.
Rewrite or remove every last instance of MCFG_DEVICE_CONFIG and its two aliases, including within comments and dead code.
Make the Z80/Z180 daisy chain an interface that interfaces with the existing interface. Z8000 has been hooked up to this as well (p8000_16 already configures it), but currently does nothing with it.
Diffstat (limited to 'src/devices/cpu/z180')
-rw-r--r-- | src/devices/cpu/z180/z180.cpp | 11 | ||||
-rw-r--r-- | src/devices/cpu/z180/z180.h | 3 | ||||
-rw-r--r-- | src/devices/cpu/z180/z180op.inc | 4 | ||||
-rw-r--r-- | src/devices/cpu/z180/z180ops.h | 2 |
4 files changed, 7 insertions, 13 deletions
diff --git a/src/devices/cpu/z180/z180.cpp b/src/devices/cpu/z180/z180.cpp index 8e3e5e6fb5d..7b389baec26 100644 --- a/src/devices/cpu/z180/z180.cpp +++ b/src/devices/cpu/z180/z180.cpp @@ -83,6 +83,7 @@ const device_type Z180 = &device_creator<z180_device>; z180_device::z180_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : cpu_device(mconfig, Z180, "Z180", tag, owner, clock, "z180", __FILE__) + , z80_daisy_chain_interface(mconfig, *this) , m_program_config("program", ENDIANNESS_LITTLE, 8, 20, 0) , m_io_config("io", ENDIANNESS_LITTLE, 8, 16, 0) , m_decrypted_opcodes_config("program", ENDIANNESS_LITTLE, 8, 20, 0) @@ -1888,11 +1889,6 @@ void z180_device::device_start() int oldval, newval, val; UINT8 *padd, *padc, *psub, *psbc; - if (static_config() != nullptr) - { - m_daisy.init(this, (const z80_daisy_config *)static_config()); - } - /* allocate big flag arrays once */ SZHVC_add = std::make_unique<UINT8[]>(2*256*256); SZHVC_sub = std::make_unique<UINT8[]>(2*256*256); @@ -2241,7 +2237,6 @@ void z180_device::device_reset() IO_OMCR = Z180_OMCR_RESET; IO_IOCR = Z180_IOCR_RESET; - m_daisy.reset(); z180_mmu(); } @@ -2496,8 +2491,8 @@ void z180_device::execute_set_input(int irqline, int state) /* update the IRQ state */ m_irq_state[irqline] = state; - if (m_daisy.present()) - m_irq_state[0] = m_daisy.update_irq_state(); + if (daisy_chain_present()) + m_irq_state[0] = daisy_update_irq_state(); /* the main execute loop will take the interrupt */ } diff --git a/src/devices/cpu/z180/z180.h b/src/devices/cpu/z180/z180.h index e76c75501ba..87980e29f4e 100644 --- a/src/devices/cpu/z180/z180.h +++ b/src/devices/cpu/z180/z180.h @@ -125,7 +125,7 @@ enum #define Z180_IRQ2 2 /* Execute IRQ2 */ -class z180_device : public cpu_device +class z180_device : public cpu_device, public z80_daisy_chain_interface { public: // construction/destruction @@ -184,7 +184,6 @@ private: UINT8 m_timer_cnt; /* timer counter / divide by 20 */ UINT8 m_dma0_cnt; /* dma0 counter / divide by 20 */ UINT8 m_dma1_cnt; /* dma1 counter / divide by 20 */ - z80_daisy_chain m_daisy; address_space *m_program; direct_read_data *m_direct; address_space *m_oprogram; diff --git a/src/devices/cpu/z180/z180op.inc b/src/devices/cpu/z180/z180op.inc index b3005629a78..c00515ee9a5 100644 --- a/src/devices/cpu/z180/z180op.inc +++ b/src/devices/cpu/z180/z180op.inc @@ -310,8 +310,8 @@ int z180_device::take_interrupt(int irq) if( irq == Z180_INT_IRQ0 ) { /* Daisy chain mode? If so, call the requesting device */ - if (m_daisy.present()) - irq_vector = m_daisy.call_ack_device(); + if (daisy_chain_present()) + irq_vector = daisy_call_ack_device(); /* else call back the cpu interface to retrieve the vector */ else diff --git a/src/devices/cpu/z180/z180ops.h b/src/devices/cpu/z180/z180ops.h index 36f06a6847f..6fb50e18112 100644 --- a/src/devices/cpu/z180/z180ops.h +++ b/src/devices/cpu/z180/z180ops.h @@ -233,7 +233,7 @@ UINT32 z180_device::ARG16() POP(PC); \ /* according to http://www.msxnet.org/tech/Z80/z80undoc.txt */ \ /* m_IFF1 = m_IFF2; */ \ - m_daisy.call_reti_device(); \ + daisy_call_reti_device(); \ } /*************************************************************** |