diff options
Diffstat (limited to 'src/devices/cpu/cop400/cop400.cpp')
-rw-r--r-- | src/devices/cpu/cop400/cop400.cpp | 47 |
1 files changed, 19 insertions, 28 deletions
diff --git a/src/devices/cpu/cop400/cop400.cpp b/src/devices/cpu/cop400/cop400.cpp index 30b1680150a..696e504835d 100644 --- a/src/devices/cpu/cop400/cop400.cpp +++ b/src/devices/cpu/cop400/cop400.cpp @@ -1117,9 +1117,10 @@ void cop400_cpu_device::device_start() // setup debugger state display offs_t pc_mask = m_program->addrmask(); + using namespace std::placeholders; state_add(STATE_GENPC, "GENPC", m_pc).mask(pc_mask).noshow(); state_add(STATE_GENPCBASE, "CURPC", m_prevpc).mask(pc_mask).noshow(); - state_add(STATE_GENFLAGS, "GENFLAGS", m_flags).mask(0x7).callimport().callexport().noshow().formatstr("%3s"); + state_add<uint8_t>(STATE_GENFLAGS, "GENFLAGS", std::bind(&cop400_cpu_device::get_flags, this), std::bind(&cop400_cpu_device::set_flags, this, _1)).mask(0x7).noshow().formatstr("%3s"); state_add(COP400_PC, "PC", m_pc).mask(pc_mask); state_add(COP400_SA, "SA", m_sa).mask(pc_mask); state_add(COP400_SB, "SB", m_sb).mask(pc_mask); @@ -1127,7 +1128,7 @@ void cop400_cpu_device::device_start() state_add(COP400_SC, "SC", m_sc).mask(pc_mask); state_add(COP400_B, "B", m_b); state_add(COP400_A, "A", m_a).mask(0xf); - state_add(COP400_M, "M", m_temp_m).mask(0xf).callimport().callexport(); + state_add<uint8_t>(COP400_M, "M", std::bind(&cop400_cpu_device::get_m, this), std::bind(&cop400_cpu_device::set_m, this, _1)).mask(0xf); state_add(COP400_G, "G", m_g).mask(0xf); state_add(COP400_Q, "Q", m_q); state_add(COP400_SIO, "SIO", m_sio).mask(0xf).formatstr("%4s"); @@ -1145,8 +1146,6 @@ void cop400_cpu_device::device_start() m_sb = 0; m_sc = 0; m_sio = 0; - m_flags = 0; - m_temp_m = 0; m_il = 0; m_in[0] = m_in[1] = m_in[2] = m_in[3] = 0; m_si = 0; @@ -1309,36 +1308,28 @@ void cop400_cpu_device::execute_run() GENERAL CONTEXT ACCESS ***************************************************************************/ -void cop400_cpu_device::state_import(const device_state_entry &entry) +uint8_t cop400_cpu_device::get_flags() const { - switch (entry.index()) - { - case STATE_GENFLAGS: - m_skt_latch = BIT(m_flags, 2); - m_c = BIT(m_flags, 1); - m_skl = BIT(m_flags, 0); - break; + return (m_skt_latch ? 0x04 : 0x00) | (m_c ? 0x02 : 0x00) | (m_skl ? 0x01 : 0x00); +} - case COP400_M: - auto dis = machine().disable_side_effect(); - RAM_W(B, m_temp_m); - break; - } +void cop400_cpu_device::set_flags(uint8_t flags) +{ + m_skt_latch = BIT(flags, 2); + m_c = BIT(flags, 1); + m_skl = BIT(flags, 0); } -void cop400_cpu_device::state_export(const device_state_entry &entry) +uint8_t cop400_cpu_device::get_m() const { - switch (entry.index()) - { - case STATE_GENFLAGS: - m_flags = (m_skt_latch ? 0x04 : 0x00) | (m_c ? 0x02 : 0x00) | (m_skl ? 0x01 : 0x00); - break; + auto dis = machine().disable_side_effect(); + return RAM_R(B); +} - case COP400_M: - auto dis = machine().disable_side_effect(); - m_temp_m = RAM_R(B); - break; - } +void cop400_cpu_device::set_m(uint8_t m) +{ + auto dis = machine().disable_side_effect(); + RAM_W(B, m); } void cop400_cpu_device::state_string_export(const device_state_entry &entry, std::string &str) const |