diff options
author | 2020-01-07 00:23:47 -0500 | |
---|---|---|
committer | 2020-01-07 00:23:56 -0500 | |
commit | a708e8f80d160cf5f78ab77717edce4f8c1b4d27 (patch) | |
tree | 7701a157c697bc355a26758daa96a9b25f50f3ef /src/devices/cpu/rx01 | |
parent | 2645475b752919e2c6891ee35f0a4c4493336f36 (diff) |
rx01: Add CRC shifter (nw)
Diffstat (limited to 'src/devices/cpu/rx01')
-rw-r--r-- | src/devices/cpu/rx01/rx01.cpp | 18 | ||||
-rw-r--r-- | src/devices/cpu/rx01/rx01.h | 1 |
2 files changed, 19 insertions, 0 deletions
diff --git a/src/devices/cpu/rx01/rx01.cpp b/src/devices/cpu/rx01/rx01.cpp index db6fe74848c..250109df258 100644 --- a/src/devices/cpu/rx01/rx01.cpp +++ b/src/devices/cpu/rx01/rx01.cpp @@ -134,6 +134,15 @@ bool rx01_cpu_device::test_condition() } } +void rx01_cpu_device::shift_crc(bool data) +{ + // TODO: double-check algorithm + if (data == BIT(m_crc, 0)) + m_crc = (m_crc >> 1) ^ 0002010; + else + m_crc = (m_crc >> 1) | 0100000; +} + void rx01_cpu_device::execute_run() { while (m_icount > 0) @@ -189,6 +198,15 @@ void rx01_cpu_device::execute_run() m_bar = BIT(m_mb, 0) ? 0 : 06000; break; + case 054: + if ((m_mb & 3) == 3) + m_crc = 0177777; + else if (BIT(m_mb, 0)) + shift_crc(0 /*sep_data()*/); + else + shift_crc(BIT(m_mb, 1)); + break; + case 060: m_flag = (!BIT(m_mb, 0) && m_flag) || (BIT(m_mb, 1) && !m_flag); break; diff --git a/src/devices/cpu/rx01/rx01.h b/src/devices/cpu/rx01/rx01.h index ab1cbc123c8..303a1d10f8f 100644 --- a/src/devices/cpu/rx01/rx01.h +++ b/src/devices/cpu/rx01/rx01.h @@ -46,6 +46,7 @@ private: // internal helpers u8 mux_out(); bool test_condition(); + void shift_crc(bool data); // address spaces address_space_config m_inst_config; |