diff options
author | MooglyGuy <therealmogminer@gmail.com> | 2020-03-12 14:32:11 +0100 |
---|---|---|
committer | MooglyGuy <therealmogminer@gmail.com> | 2020-03-12 14:32:25 +0100 |
commit | b68968ebee0009e9b82caa3019a29d8832c9238e (patch) | |
tree | 30a1ebdeb73b84d22c325230519c4f108dac7f80 | |
parent | 891f0790280e78f741c44e9a863fbcf22d105c9c (diff) |
-unsp: Fixed a silly bug with lsror, nw
-rw-r--r-- | src/devices/cpu/unsp/unsp_exxx.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/devices/cpu/unsp/unsp_exxx.cpp b/src/devices/cpu/unsp/unsp_exxx.cpp index 82593669770..66f16ca9099 100644 --- a/src/devices/cpu/unsp/unsp_exxx.cpp +++ b/src/devices/cpu/unsp/unsp_exxx.cpp @@ -12,7 +12,7 @@ #define LOG_UNSP_MULS (1U << 1) #define LOG_UNSP_SHIFTS (1U << 2) -#define VERBOSE (0) +#define VERBOSE (LOG_UNSP_SHIFTS) #include "logmacro.h" @@ -269,11 +269,11 @@ void unsp_12_device::execute_exxx_group(uint16_t op) case 0x05: { LOGMASKED(LOG_UNSP_SHIFTS, "pc:%06x: %s = %s lsror %s (%04x %04x)\n", UNSP_LPC, regs[rd], regs[rd], regs[rs], m_core->m_r[rd], m_core->m_r[rs]); - const uint32_t rdval = m_core->m_r[rd]; + const uint32_t rdval = m_core->m_r[rd] << 16; const int shift = (m_core->m_r[rs] & 0x01f); - const uint32_t res = rdval << shift; + const uint32_t res = rdval >> shift; m_core->m_r[REG_R3] |= (uint16_t)res; - m_core->m_r[REG_R4] |= (uint16_t)(res >> 16); + m_core->m_r[REG_R4] = (uint16_t)(res >> 16); LOGMASKED(LOG_UNSP_SHIFTS, "result: %04x%04x\n", m_core->m_r[REG_R4], m_core->m_r[REG_R3]); return; } |