different implementation of prev bugfix

This commit is contained in:
hap 2015-02-10 19:05:49 +01:00
parent 18d3086feb
commit 99516900ae
2 changed files with 10 additions and 12 deletions

View File

@ -208,7 +208,6 @@ void amis2000_device::device_reset()
{ {
m_pc = 0; m_pc = 0;
m_op = 0; m_op = 0;
m_prev_op = m_op;
m_skip = false; m_skip = false;
// clear i/o // clear i/o
@ -231,6 +230,9 @@ void amis2000_device::execute_run()
{ {
m_icount--; m_icount--;
// remember previous opcode
m_prev_op = m_op;
debugger_instruction_hook(this, m_pc); debugger_instruction_hook(this, m_pc);
m_op = m_program->read_byte(m_pc); m_op = m_program->read_byte(m_pc);
m_pc = (m_pc + 1) & 0x1fff; m_pc = (m_pc + 1) & 0x1fff;
@ -239,7 +241,7 @@ void amis2000_device::execute_run()
{ {
// always skip over PP prefix // always skip over PP prefix
m_skip = ((m_op & 0xf0) == 0x60); m_skip = ((m_op & 0xf0) == 0x60);
continue; m_op = 0; // nop
} }
switch (m_op & 0xf0) switch (m_op & 0xf0)
@ -314,8 +316,5 @@ void amis2000_device::execute_run()
break; // 0xff break; // 0xff
} // big switch } // big switch
// remember previous opcode
m_prev_op = m_op;
} }
} }

View File

@ -190,7 +190,6 @@ void ucom4_cpu_device::device_reset()
m_inte_f = 1; m_inte_f = 1;
m_pc = 0; m_pc = 0;
m_op = 0; m_op = 0;
m_prev_op = m_op;
m_skip = false; m_skip = false;
// clear i/o // clear i/o
@ -204,13 +203,13 @@ void ucom4_cpu_device::device_reset()
// execute // execute
//------------------------------------------------- //-------------------------------------------------
void ucom4_cpu_device::increment_pc() inline void ucom4_cpu_device::increment_pc()
{ {
// upper bits (field register) don't auto-increment // upper bits (field register) don't auto-increment
m_pc = (m_pc & ~0xff) | ((m_pc + 1) & 0xff); m_pc = (m_pc & ~0xff) | ((m_pc + 1) & 0xff);
} }
void ucom4_cpu_device::fetch_arg() inline void ucom4_cpu_device::fetch_arg()
{ {
// 2-byte opcodes: STM/LDI/CLI/CI, JMP/CAL, OCD // 2-byte opcodes: STM/LDI/CLI/CI, JMP/CAL, OCD
if ((m_op & 0xfc) == 0x14 || (m_op & 0xf0) == 0xa0 || m_op == 0x1e) if ((m_op & 0xfc) == 0x14 || (m_op & 0xf0) == 0xa0 || m_op == 0x1e)
@ -227,6 +226,9 @@ void ucom4_cpu_device::execute_run()
{ {
m_icount--; m_icount--;
// remember previous opcode
m_prev_op = m_op;
debugger_instruction_hook(this, m_pc); debugger_instruction_hook(this, m_pc);
m_op = m_program->read_byte(m_pc); m_op = m_program->read_byte(m_pc);
m_bitmask = 1 << (m_op & 0x03); m_bitmask = 1 << (m_op & 0x03);
@ -236,7 +238,7 @@ void ucom4_cpu_device::execute_run()
if (m_skip) if (m_skip)
{ {
m_skip = false; m_skip = false;
continue; m_op = 0; // nop
} }
switch (m_op & 0xf0) switch (m_op & 0xf0)
@ -337,8 +339,5 @@ void ucom4_cpu_device::execute_run()
break; // 0xff break; // 0xff
} // big switch } // big switch
// remember previous opcode
m_prev_op = m_op;
} }
} }