diff options
author | 2018-07-06 16:11:13 +0700 | |
---|---|---|
committer | 2018-07-06 11:11:13 +0200 | |
commit | 06700b3c52df0134dc1b159cfba5712d1d9568d4 (patch) | |
tree | ad692f1653671fb1198dc57dcf92561356dc4a12 | |
parent | f3ccd1f7f2fa8d8eef77a8ef1cfd69398e3a21fb (diff) |
clipper: minor bugfix (nw) (#3731)
This enables SoftPC to run.
-rw-r--r-- | src/devices/cpu/clipper/clipper.cpp | 10 | ||||
-rw-r--r-- | src/devices/cpu/clipper/clipperd.cpp | 4 |
2 files changed, 7 insertions, 7 deletions
diff --git a/src/devices/cpu/clipper/clipper.cpp b/src/devices/cpu/clipper/clipper.cpp index adddfff71e5..4a6217eadd3 100644 --- a/src/devices/cpu/clipper/clipper.cpp +++ b/src/devices/cpu/clipper/clipper.cpp @@ -1265,12 +1265,12 @@ void clipper_device::execute_instruction() // saved0..saved7: push registers fN:f7 // store fi at sp - 8 * (8 - i) - for (int i = R2; i < 8 && !m_exception; i++) + for (int i = m_info.subopcode & 0x7; i < 8 && !m_exception; i++) get_dcammu().store<float64>(m_ssw, m_r[15] - 8 * (8 - i), get_fp64(i)); // decrement sp after push to allow restart on exceptions if (!m_exception) - m_r[15] -= 8 * (8 - R2); + m_r[15] -= 8 * (8 - m_info.subopcode & 0x7); // TRAPS: A,P,W break; case 0x28: case 0x29: case 0x2a: case 0x2b: @@ -1278,12 +1278,12 @@ void clipper_device::execute_instruction() // restd0..restd7: pop registers fN:f7 // load fi from sp + 8 * (i - N) - for (int i = R2; i < 8 && !m_exception; i++) - get_dcammu().load<float64>(m_ssw, m_r[15] + 8 * (i - R2), [this, i](float64 v) { set_fp(i, v, F_NONE); }); + for (int i = m_info.subopcode & 0x7; i < 8 && !m_exception; i++) + get_dcammu().load<float64>(m_ssw, m_r[15] + 8 * (i - m_info.subopcode & 0x7), [this, i](float64 v) { set_fp(i, v, F_NONE); }); // increment sp after pop to allow restart on exceptions if (!m_exception) - m_r[15] += 8 * (8 - R2); + m_r[15] += 8 * (8 - m_info.subopcode & 0x7); // TRAPS: C,U,A,P,R break; case 0x30: diff --git a/src/devices/cpu/clipper/clipperd.cpp b/src/devices/cpu/clipper/clipperd.cpp index c11cf0a5ee8..5af39805227 100644 --- a/src/devices/cpu/clipper/clipperd.cpp +++ b/src/devices/cpu/clipper/clipperd.cpp @@ -273,12 +273,12 @@ offs_t clipper_disassembler::disassemble(std::ostream &stream, offs_t pc, const case 0x20: case 0x21: case 0x22: case 0x23: case 0x24: case 0x25: case 0x26: case 0x27: - util::stream_format(stream, "saved%d", R2); + util::stream_format(stream, "saved%d", opcodes.r16(pc) & 0x7); break; case 0x28: case 0x29: case 0x2a: case 0x2b: case 0x2c: case 0x2d: case 0x2e: case 0x2f: - util::stream_format(stream, "restd%d", R2); + util::stream_format(stream, "restd%d", opcodes.r16(pc) & 0x7); break; case 0x30: util::stream_format(stream, "cnvsw f%d,r%d", (opcodes.r16(pc+2) & 0xf0) >> 4, opcodes.r16(pc+2) & 0xf); break; |