From: hoge hoge

Date: Sat, 25 Jul 2009 11:57:29 -0700
To: submit@mamedev.org<submit@mamedev.org>
Subject: 68k cpu reset eat cycles fix
Hello,

Attached is a diff for 0133 that fixes a bug related to eating cycles 
during 68k cpu reset. Previously, initial_cycles had a wrong value 
after reset, and if cycles were < 0, it'd always return 0, .. check 
the diff to see what I mean.

This change also happens to fix a scrolling bug in Fantasy Zone, 
introduced when that cycle eating thing was added.

Greets,
hap
This commit is contained in:
Aaron Giles 2009-08-02 21:37:45 +00:00
parent 422c6c0d60
commit 1fc576e72f

View File

@ -540,15 +540,19 @@ static CPU_EXECUTE( m68k )
{
m68ki_cpu_core *m68k = get_safe_token(device);
m68k->initial_cycles = cycles;
/* eat up any reset cycles */
cycles -= m68k->reset_cycles;
m68k->reset_cycles = 0;
if (cycles <= 0)
return m68k->reset_cycles;
if (m68k->reset_cycles) {
int rc = m68k->reset_cycles;
m68k->reset_cycles = 0;
cycles -= rc;
if (cycles <= 0) return rc;
}
/* Set our pool of clock cycles available */
m68k->remaining_cycles = cycles;
m68k->initial_cycles = cycles;
/* See if interrupts came in */
m68ki_check_interrupts(m68k);