From 4c95c177a8f9f7959fbaccab6aba6925587e9d34 Mon Sep 17 00:00:00 2001 From: Aaron Giles Date: Tue, 30 Dec 2008 00:42:19 +0000 Subject: [PATCH] 02785: a51site4: Interger Overflow with -debug --- src/emu/cpu/i386/i386ops.c | 3 ++- src/emu/cpuexec.c | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/src/emu/cpu/i386/i386ops.c b/src/emu/cpu/i386/i386ops.c index 8bc232d58d7..ab8f51f95ed 100644 --- a/src/emu/cpu/i386/i386ops.c +++ b/src/emu/cpu/i386/i386ops.c @@ -2169,8 +2169,9 @@ static void I386OP(hlt)(i386_state *cpustate) // Opcode 0xf4 // TODO: We need to raise an exception in protected mode and when // the current privilege level is not zero cpustate->halted = 1; - cpustate->cycles = 0; CYCLES(cpustate,CYCLES_HLT); + if (cpustate->cycles > 0) + cpustate->cycles = 0; } static void I386OP(decimal_adjust)(i386_state *cpustate, int direction) diff --git a/src/emu/cpuexec.c b/src/emu/cpuexec.c index 08cbc661a67..0c60411bd53 100644 --- a/src/emu/cpuexec.c +++ b/src/emu/cpuexec.c @@ -325,6 +325,7 @@ void cpuexec_timeslice(running_machine *machine) /* via the call to cpu_execute */ classdata->cycles_stolen = 0; global->executingcpu = classdata->device; + *classdata->icount = classdata->cycles_running; if (!call_debugger) ran = (*classdata->execute)(classdata->device, classdata->cycles_running); else