From 0994529652e623acd4410b3952723fe8a043e867 Mon Sep 17 00:00:00 2001 From: AJR Date: Fri, 13 Mar 2020 16:21:28 -0400 Subject: m6801: Add preliminary HD6301X internal register map (nw) --- src/devices/cpu/m6800/m6801.cpp | 38 ++++++++++++++++++++++++++++++++++++-- src/devices/cpu/m6800/m6801.h | 20 +++++++++++--------- src/mame/drivers/psion.cpp | 6 +----- 3 files changed, 48 insertions(+), 16 deletions(-) diff --git a/src/devices/cpu/m6800/m6801.cpp b/src/devices/cpu/m6800/m6801.cpp index 9f44ad65d1a..ffe0f287a56 100644 --- a/src/devices/cpu/m6800/m6801.cpp +++ b/src/devices/cpu/m6800/m6801.cpp @@ -230,8 +230,8 @@ void m6801_cpu_device::m6801_io(address_map &map) map(0x0003, 0x0003).rw(FUNC(m6801_cpu_device::p2_data_r), FUNC(m6801_cpu_device::p2_data_w)); map(0x0004, 0x0004).rw(FUNC(m6801_cpu_device::ff_r), FUNC(m6801_cpu_device::p3_ddr_w)); // TODO: external in 6801 modes 0–3 & 6 map(0x0005, 0x0005).rw(FUNC(m6801_cpu_device::ff_r), FUNC(m6801_cpu_device::p4_ddr_w)); // TODO: external in 6801 modes 0–3 - map(0x0006, 0x0006).rw(FUNC(m6801_cpu_device::p3_data_r), FUNC(m6801_cpu_device::p3_data_w)); - map(0x0007, 0x0007).rw(FUNC(m6801_cpu_device::p4_data_r), FUNC(m6801_cpu_device::p4_data_w)); + map(0x0006, 0x0006).rw(FUNC(m6801_cpu_device::p3_data_r), FUNC(m6801_cpu_device::p3_data_w)); // TODO: external in 6801 modes 0–3 & 6 + map(0x0007, 0x0007).rw(FUNC(m6801_cpu_device::p4_data_r), FUNC(m6801_cpu_device::p4_data_w)); // TODO: external in 6801 modes 0–3 map(0x0008, 0x0008).rw(FUNC(m6801_cpu_device::tcsr_r), FUNC(m6801_cpu_device::tcsr_w)); map(0x0009, 0x0009).rw(FUNC(m6801_cpu_device::ch_r), FUNC(m6801_cpu_device::ch_w)); map(0x000a, 0x000a).rw(FUNC(m6801_cpu_device::cl_r), FUNC(m6801_cpu_device::cl_w)); @@ -253,6 +253,40 @@ void m6801_cpu_device::m6803_mem(address_map &map) map(0x0080, 0x00ff).ram(); /* 6803 internal RAM */ } +void hd6301x_cpu_device::hd6301x_io(address_map &map) +{ + map(0x0001, 0x0001).rw(FUNC(hd6301x_cpu_device::ff_r), FUNC(hd6301x_cpu_device::p2_ddr_2bit_w)); + map(0x0002, 0x0002).rw(FUNC(hd6301x_cpu_device::p1_data_r), FUNC(hd6301x_cpu_device::p1_data_w)); + map(0x0003, 0x0003).rw(FUNC(hd6301x_cpu_device::p2_data_r), FUNC(hd6301x_cpu_device::p2_data_w)); + map(0x0004, 0x0004).rw(FUNC(hd6301x_cpu_device::ff_r), FUNC(hd6301x_cpu_device::p3_ddr_w)); // TODO: external except in single-chip mode + map(0x0005, 0x0005).rw(FUNC(hd6301x_cpu_device::ff_r), FUNC(hd6301x_cpu_device::p4_ddr_w)); // TODO: external except in single-chip mode + map(0x0006, 0x0006).rw(FUNC(hd6301x_cpu_device::p3_data_r), FUNC(hd6301x_cpu_device::p3_data_w)); + map(0x0007, 0x0007).rw(FUNC(hd6301x_cpu_device::p4_data_r), FUNC(hd6301x_cpu_device::p4_data_w)); + map(0x0008, 0x0008).rw(FUNC(hd6301x_cpu_device::tcsr_r), FUNC(hd6301x_cpu_device::tcsr_w)); + map(0x0009, 0x0009).rw(FUNC(hd6301x_cpu_device::ch_r), FUNC(hd6301x_cpu_device::ch_w)); + map(0x000a, 0x000a).rw(FUNC(hd6301x_cpu_device::cl_r), FUNC(hd6301x_cpu_device::cl_w)); + map(0x000b, 0x000b).rw(FUNC(hd6301x_cpu_device::ocrh_r), FUNC(hd6301x_cpu_device::ocrh_w)); + map(0x000c, 0x000c).rw(FUNC(hd6301x_cpu_device::ocrl_r), FUNC(hd6301x_cpu_device::ocrl_w)); + map(0x000d, 0x000d).r(FUNC(hd6301x_cpu_device::icrh_r)); + map(0x000e, 0x000e).r(FUNC(hd6301x_cpu_device::icrl_r)); + //map(0x000f, 0x000f).rw(FUNC(hd6301x_cpu_device::tcsr2_r), FUNC(hd6301x_cpu_device::tcsr2_w)); + map(0x0010, 0x0010).rw(FUNC(hd6301x_cpu_device::sci_rmcr_r), FUNC(hd6301x_cpu_device::sci_rmcr_w)); + map(0x0011, 0x0011).rw(FUNC(hd6301x_cpu_device::sci_trcsr_r), FUNC(hd6301x_cpu_device::sci_trcsr_w)); + map(0x0012, 0x0012).r(FUNC(hd6301x_cpu_device::sci_rdr_r)); + map(0x0013, 0x0013).w(FUNC(hd6301x_cpu_device::sci_tdr_w)); + map(0x0014, 0x0014).rw(FUNC(hd6301x_cpu_device::rcr_r), FUNC(hd6301x_cpu_device::rcr_w)); + map(0x0015, 0x0015).r(FUNC(hd6301x_cpu_device::p5_data_r)); + map(0x0016, 0x0016).rw(FUNC(hd6301x_cpu_device::ff_r), FUNC(hd6301x_cpu_device::p6_ddr_w)); + map(0x0017, 0x0017).rw(FUNC(hd6301x_cpu_device::p6_data_r), FUNC(hd6301x_cpu_device::p6_data_w)); + map(0x0018, 0x0018).rw(FUNC(hd6301x_cpu_device::p7_data_r), FUNC(hd6301x_cpu_device::p7_data_w)); // TODO: external except in single-chip mode + //map(0x0019, 0x0019).rw(FUNC(hd6301x_cpu_device::ocr2h_r), FUNC(hd6301x_cpu_device::ocr2h_w)); + //map(0x001a, 0x001a).rw(FUNC(hd6301x_cpu_device::ocr2l_r), FUNC(hd6301x_cpu_device::ocr2l_w)); + //map(0x001b, 0x001b).rw(FUNC(hd6301x_cpu_device::tcsr3_r), FUNC(hd6301x_cpu_device::tcsr3_w)); + //map(0x001c, 0x001c).rw(FUNC(hd6301x_cpu_device::ff_r), FUNC(hd6301x_cpu_device::tconr_w)); + //map(0x001d, 0x001d).rw(FUNC(hd6301x_cpu_device::t2cnt_r), FUNC(hd6301x_cpu_device::t2cnt_w)); + //map(0x001f, 0x001f).rw(FUNC(hd6301x_cpu_device::tstreg_r), FUNC(hd6301x_cpu_device::tstreg_w)); +} + DEFINE_DEVICE_TYPE(M6801, m6801_cpu_device, "m6801", "Motorola MC6801") DEFINE_DEVICE_TYPE(M6803, m6803_cpu_device, "m6803", "Motorola MC6803") diff --git a/src/devices/cpu/m6800/m6801.h b/src/devices/cpu/m6800/m6801.h index 0161334dd20..f708cf38e18 100644 --- a/src/devices/cpu/m6800/m6801.h +++ b/src/devices/cpu/m6800/m6801.h @@ -254,15 +254,7 @@ public: auto out_p7_cb() { return m_out_portx_func[2].bind(); } // TODO: privatize eventually - void p2_ddr_2bit_w(uint8_t data); - void p5_ddr_w(uint8_t data); - uint8_t p5_data_r(); - void p5_data_w(uint8_t data); - void p6_ddr_w(uint8_t data); - uint8_t p6_data_r(); - void p6_data_w(uint8_t data); - uint8_t p7_data_r(); - void p7_data_w(uint8_t data); + void hd6301x_io(address_map &map); protected: hd6301x_cpu_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock); @@ -274,6 +266,16 @@ protected: virtual void write_port2() override; + void p2_ddr_2bit_w(uint8_t data); + void p5_ddr_w(uint8_t data); + uint8_t p5_data_r(); + void p5_data_w(uint8_t data); + void p6_ddr_w(uint8_t data); + uint8_t p6_data_r(); + void p6_data_w(uint8_t data); + uint8_t p7_data_r(); + void p7_data_w(uint8_t data); + devcb_read8::array<2> m_in_portx_func; devcb_write8::array<3> m_out_portx_func; diff --git a/src/mame/drivers/psion.cpp b/src/mame/drivers/psion.cpp index 0f0611423cd..0f67945d5ff 100644 --- a/src/mame/drivers/psion.cpp +++ b/src/mame/drivers/psion.cpp @@ -246,13 +246,9 @@ READ8_MEMBER( psion1_state::switchoff_r ) void psion_state::psion_int_reg(address_map &map) { // FIXME: this should all be made internal to the CPU device - map(0x0000, 0x001f).m(m_maincpu, FUNC(hd6301x_cpu_device::m6801_io)); - map(0x0001, 0x0001).w(m_maincpu, FUNC(hd6301x_cpu_device::p2_ddr_2bit_w)); + map(0x0000, 0x001f).m(m_maincpu, FUNC(hd6301x_cpu_device::hd6301x_io)); map(0x0008, 0x0008).rw(FUNC(psion_state::tcsr_r), FUNC(psion_state::tcsr_w)); map(0x0014, 0x0014).r(FUNC(psion_state::rcp5c_r)); - map(0x0015, 0x0015).r(m_maincpu, FUNC(hd6301x_cpu_device::p5_data_r)).nopw(); - map(0x0016, 0x0016).w(m_maincpu, FUNC(hd6301x_cpu_device::p6_ddr_w)); - map(0x0017, 0x0017).rw(m_maincpu, FUNC(hd6301x_cpu_device::p6_data_r), FUNC(hd6301x_cpu_device::p6_data_w)); } void psion1_state::psion1_mem(address_map &map) -- cgit v1.2.3