From cfad1bef056109099d4bc69a1dd357aadc447c62 Mon Sep 17 00:00:00 2001 From: Aaron Giles Date: Thu, 6 Nov 2008 07:08:18 +0000 Subject: [PATCH] Re-added suspend/resume synchronization to fix a few games. --- src/emu/cpuexec.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/emu/cpuexec.c b/src/emu/cpuexec.c index 1cb4e63678f..dbef58ac73e 100644 --- a/src/emu/cpuexec.c +++ b/src/emu/cpuexec.c @@ -319,6 +319,10 @@ void cpuexec_timeslice(running_machine *machine) cpudata->localtime = attotime_add_attoseconds(cpudata->localtime, cycles_running * attoseconds_per_cycle[cpunum]); LOG((" %d skipped, %d total, time = %s\n", cycles_running, (INT32)cpudata->totalcycles, attotime_string(cpudata->localtime, 9))); } + + /* update the suspend state (breaks steeltal if we don't) */ + cpudata->suspend = cpudata->nextsuspend; + cpudata->eatcycles = cpudata->nexteatcycles; } /* update the global time */ @@ -377,6 +381,8 @@ void cpunum_suspend(int cpunum, int reason, int eatcycles) LOG(("cpunum_suspend (CPU=%d, r=%X, eat=%d)\n", cpunum, reason, eatcycles)); cpu[cpunum].nextsuspend |= reason; cpu[cpunum].nexteatcycles = eatcycles; + if (cpu_getexecutingcpu() >= 0) + activecpu_abort_timeslice(); } @@ -390,6 +396,8 @@ void cpunum_resume(int cpunum, int reason) VERIFY_CPUNUM(cpunum_resume); LOG(("cpunum_resume (CPU=%d, r=%X)\n", cpunum, reason)); cpu[cpunum].nextsuspend &= ~reason; + if (cpu_getexecutingcpu() >= 0) + activecpu_abort_timeslice(); }