summaryrefslogtreecommitdiffstatshomepage
path: root/src/emu
diff options
context:
space:
mode:
author hap <happppp@users.noreply.github.com>2015-02-10 19:05:49 +0100
committer hap <happppp@users.noreply.github.com>2015-02-10 19:05:49 +0100
commit99516900ae378a262b02d8ea217e088fc0c20bfe (patch)
tree9252c33e99faed50aa00ae79e8ccd02854a1f04c /src/emu
parent18d3086febb0825d88cc3f60d55ce7bed1807519 (diff)
different implementation of prev bugfix
Diffstat (limited to 'src/emu')
-rw-r--r--src/emu/cpu/amis2000/amis2000.c9
-rw-r--r--src/emu/cpu/ucom4/ucom4.c13
2 files changed, 10 insertions, 12 deletions
diff --git a/src/emu/cpu/amis2000/amis2000.c b/src/emu/cpu/amis2000/amis2000.c
index 7a0ac5abe2b..0b0feef7110 100644
--- a/src/emu/cpu/amis2000/amis2000.c
+++ b/src/emu/cpu/amis2000/amis2000.c
@@ -208,7 +208,6 @@ void amis2000_device::device_reset()
{
m_pc = 0;
m_op = 0;
- m_prev_op = m_op;
m_skip = false;
// clear i/o
@@ -231,6 +230,9 @@ void amis2000_device::execute_run()
{
m_icount--;
+ // remember previous opcode
+ m_prev_op = m_op;
+
debugger_instruction_hook(this, m_pc);
m_op = m_program->read_byte(m_pc);
m_pc = (m_pc + 1) & 0x1fff;
@@ -239,7 +241,7 @@ void amis2000_device::execute_run()
{
// always skip over PP prefix
m_skip = ((m_op & 0xf0) == 0x60);
- continue;
+ m_op = 0; // nop
}
switch (m_op & 0xf0)
@@ -314,8 +316,5 @@ void amis2000_device::execute_run()
break; // 0xff
} // big switch
-
- // remember previous opcode
- m_prev_op = m_op;
}
}
diff --git a/src/emu/cpu/ucom4/ucom4.c b/src/emu/cpu/ucom4/ucom4.c
index 525b068e5a5..8c30de7de3f 100644
--- a/src/emu/cpu/ucom4/ucom4.c
+++ b/src/emu/cpu/ucom4/ucom4.c
@@ -190,7 +190,6 @@ void ucom4_cpu_device::device_reset()
m_inte_f = 1;
m_pc = 0;
m_op = 0;
- m_prev_op = m_op;
m_skip = false;
// clear i/o
@@ -204,13 +203,13 @@ void ucom4_cpu_device::device_reset()
// execute
//-------------------------------------------------
-void ucom4_cpu_device::increment_pc()
+inline void ucom4_cpu_device::increment_pc()
{
// upper bits (field register) don't auto-increment
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
if ((m_op & 0xfc) == 0x14 || (m_op & 0xf0) == 0xa0 || m_op == 0x1e)
@@ -227,6 +226,9 @@ void ucom4_cpu_device::execute_run()
{
m_icount--;
+ // remember previous opcode
+ m_prev_op = m_op;
+
debugger_instruction_hook(this, m_pc);
m_op = m_program->read_byte(m_pc);
m_bitmask = 1 << (m_op & 0x03);
@@ -236,7 +238,7 @@ void ucom4_cpu_device::execute_run()
if (m_skip)
{
m_skip = false;
- continue;
+ m_op = 0; // nop
}
switch (m_op & 0xf0)
@@ -337,8 +339,5 @@ void ucom4_cpu_device::execute_run()
break; // 0xff
} // big switch
-
- // remember previous opcode
- m_prev_op = m_op;
}
}