diff options
author | Aaron Giles <aaron@aarongiles.com> | 2009-08-02 21:37:45 +0000 |
---|---|---|
committer | Aaron Giles <aaron@aarongiles.com> | 2009-08-02 21:37:45 +0000 |
commit | 1fc576e72f5ce1856886b3b0132cf5f6dcc8f80d (patch) | |
tree | 52a0754448e5984dd452aa55a316847926e1aed5 | |
parent | 422c6c0d602f39b45b5e39fde95364a9853a9b59 (diff) |
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
-rw-r--r-- | src/emu/cpu/m68000/m68kcpu.c | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/src/emu/cpu/m68000/m68kcpu.c b/src/emu/cpu/m68000/m68kcpu.c index fbf4a52dcc7..4c4b6faee8b 100644 --- a/src/emu/cpu/m68000/m68kcpu.c +++ b/src/emu/cpu/m68000/m68kcpu.c @@ -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); |