summaryrefslogtreecommitdiffstatshomepage
path: root/src/emu/cpu/hmcs40/hmcs40.c
diff options
context:
space:
mode:
author hap <happppp@users.noreply.github.com>2015-05-11 23:01:51 +0200
committer hap <happppp@users.noreply.github.com>2015-05-11 23:01:51 +0200
commit88c04136c83e43d6e441704f7ad1e78dc898738a (patch)
tree1db875bb35d0fff727cfb3cfe6bfc6678e12a670 /src/emu/cpu/hmcs40/hmcs40.c
parent3a298f294a8f93b97f3581ab7cb0c69515156c9e (diff)
exit execute loop if it ran out of icount after an interrupt
Diffstat (limited to 'src/emu/cpu/hmcs40/hmcs40.c')
-rw-r--r--src/emu/cpu/hmcs40/hmcs40.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/emu/cpu/hmcs40/hmcs40.c b/src/emu/cpu/hmcs40/hmcs40.c
index b40e1299e06..005a7c03b83 100644
--- a/src/emu/cpu/hmcs40/hmcs40.c
+++ b/src/emu/cpu/hmcs40/hmcs40.c
@@ -553,15 +553,17 @@ void hmcs40_cpu_device::execute_run()
{
while (m_icount > 0)
{
- m_icount--;
-
// LPU is handled 1 cycle later
if ((m_prev_op & 0x3e0) == 0x340)
m_pc = ((m_page << 6) | (m_pc & 0x3f)) & m_pcmask;
// check/handle interrupt, but not in the middle of a long jump
if (m_ie && (m_iri || m_irt) && (m_op & 0x3e0) != 0x340)
+ {
do_interrupt();
+ if (m_icount <= 0)
+ break;
+ }
// remember previous state
m_prev_op = m_op;
@@ -569,6 +571,7 @@ void hmcs40_cpu_device::execute_run()
// fetch next opcode
debugger_instruction_hook(this, m_pc);
+ m_icount--;
m_op = m_program->read_word(m_pc << 1) & 0x3ff;
m_i = BITSWAP8(m_op,7,6,5,4,0,1,2,3) & 0xf; // reversed bit-order for 4-bit immediate param (except for XAMR, REDD, SEDD)
increment_pc();