// device-level overrides protected override void device_start() { m_dimemory = GetClassInterface <device_memory_interface_m6800>(); m_diexec = GetClassInterface <device_execute_interface_m6800>(); m_distate = GetClassInterface <device_state_interface_m6800>(); m_program = m_dimemory.space(AS_PROGRAM); m_cache = m_program.cache(0, 0, (int)endianness_t.ENDIANNESS_BIG); m_opcodes = m_dimemory.has_space(AS_OPCODES) ? m_dimemory.space(AS_OPCODES) : m_program; m_opcodes_cache = m_opcodes.cache(0, 0, (int)endianness_t.ENDIANNESS_BIG); m_pc.d = 0; m_s.d = 0; m_x.d = 0; m_d.d = 0; m_cc = 0; m_wai_state = 0; m_irq_state[0] = 0; m_irq_state[1] = 0; m_irq_state[2] = 0; save_item(m_ppc.w.l, "m_ppc.w.l"); save_item(m_pc.w.l, "m_pc.w.l"); save_item(m_s.w.l, "m_s.w.l"); save_item(m_x.w.l, "m_x.w.l"); save_item(m_d.w.l, "m_d.w.l"); save_item(m_cc, "m_cc"); save_item(m_wai_state, "m_wai_state"); save_item(m_nmi_state, "m_nmi_state"); save_item(m_nmi_pending, "m_nmi_pending"); save_item(m_irq_state, "m_irq_state"); m_distate.state_add(M6800_A, "A", m_d.b.h).formatstr("%02X"); m_distate.state_add(M6800_B, "B", m_d.b.l).formatstr("%02X"); m_distate.state_add(M6800_PC, "PC", m_pc.w.l).formatstr("%04X"); m_distate.state_add(M6800_S, "S", m_s.w.l).formatstr("%04X"); m_distate.state_add(M6800_X, "X", m_x.w.l).formatstr("%04X"); m_distate.state_add(M6800_CC, "CC", m_cc).formatstr("%02X"); m_distate.state_add(M6800_WAI_STATE, "WAI", m_wai_state).formatstr("%01X"); m_distate.state_add(STATE_GENPC, "GENPC", m_pc.w.l).noshow(); m_distate.state_add(STATE_GENPCBASE, "CURPC", m_pc.w.l).noshow(); m_distate.state_add(STATE_GENFLAGS, "GENFLAGS", m_cc).formatstr("%8s").noshow(); set_icountptr(m_icountRef); }
} //template <std::size_t Port> auto write_r() { return m_write_r[Port].bind(); } // SI: serial input //auto read_si() { return m_read_si.bind(); } // SO: serial output //auto write_so() { return m_write_so.bind(); } //static void set_pla(device_t &device, UINT8 *pla) { downcast<mb88_cpu_device &>(device).m_PLA = pla; } //DECLARE_WRITE_LINE_MEMBER( clock_w ); //void data_4bit(address_map &map); //void data_5bit(address_map &map); //void data_6bit(address_map &map); //void data_7bit(address_map &map); //void program_10bit(address_map &map); //void program_11bit(address_map &map); //void program_9bit(address_map &map); // device-level overrides /*************************************************************************** * INITIALIZATION AND SHUTDOWN ***************************************************************************/ protected override void device_start() { m_dimemory = GetClassInterface <device_memory_interface_mb88>(); m_diexec = GetClassInterface <device_execute_interface_mb88>(); m_distate = GetClassInterface <device_state_interface_mb88>(); m_program = m_dimemory.space(AS_PROGRAM); m_cache = m_program.cache(0, 0, (int)endianness_t.ENDIANNESS_BIG); m_data = m_dimemory.space(AS_DATA); m_read_k.resolve_safe(0); m_write_o.resolve_safe(); m_write_p.resolve_safe(); foreach (var cb in m_read_r) { cb.resolve_safe(0); } foreach (var cb in m_write_r) { cb.resolve_safe(); } m_read_si.resolve_safe(0); m_write_so.resolve_safe(); m_serial = machine().scheduler().timer_alloc(serial_timer); //timer_expired_delegate(FUNC(mb88_cpu_device::serial_timer), this)); m_ctr = 0; save_item(m_PC, "m_PC"); save_item(m_PA, "m_PA"); save_item(m_SP[0], "m_SP[0]"); save_item(m_SP[1], "m_SP[1]"); save_item(m_SP[2], "m_SP[2]"); save_item(m_SP[3], "m_SP[3]"); save_item(m_SI, "m_SI"); save_item(m_A, "m_A"); save_item(m_X, "m_X"); save_item(m_Y, "m_Y"); save_item(m_st, "m_st"); save_item(m_zf, "m_zf"); save_item(m_cf, "m_cf"); save_item(m_vf, "m_vf"); save_item(m_sf, "m_sf"); save_item(m_nf, "m_nf"); save_item(m_pio, "m_pio"); save_item(m_TH, "m_TH"); save_item(m_TL, "m_TL"); save_item(m_TP, "m_TP"); save_item(m_ctr, "m_ctr"); save_item(m_SB, "m_SB"); save_item(m_SBcount, "m_SBcount"); save_item(m_pending_interrupt, "m_pending_interrupt"); m_distate.state_add(MB88_PC, "PC", m_PC).formatstr("%02X"); m_distate.state_add(MB88_PA, "PA", m_PA).formatstr("%02X"); m_distate.state_add(MB88_SI, "SI", m_SI).formatstr("%01X"); m_distate.state_add(MB88_A, "A", m_A).formatstr("%01X"); m_distate.state_add(MB88_X, "X", m_X).formatstr("%01X"); m_distate.state_add(MB88_Y, "Y", m_Y).formatstr("%01X"); m_distate.state_add(MB88_PIO, "PIO", m_pio).formatstr("%02X"); m_distate.state_add(MB88_TH, "TH", m_TH).formatstr("%01X"); m_distate.state_add(MB88_TL, "TL", m_TL).formatstr("%01X"); m_distate.state_add(MB88_SB, "SB", m_SB).formatstr("%01X"); m_distate.state_add(STATE_GENPC, "GENPC", m_debugger_pc).callimport().callexport().noshow(); m_distate.state_add(STATE_GENPCBASE, "CURPC", m_debugger_pc).callimport().callexport().noshow(); m_distate.state_add(STATE_GENFLAGS, "GENFLAGS", m_debugger_flags).callimport().callexport().formatstr("%6s").noshow(); set_icountptr(m_icountRef); }