From 5a91ae55daa30e8087dcadaaad1eff3bcd69ddda Mon Sep 17 00:00:00 2001 From: Phil Bennett Date: Sat, 23 Jun 2012 19:41:04 +0000 Subject: mcs51.c - Update the timers sequentially for each cycle. Fixes sound CPU serial communications in the eolith.c games. --- src/emu/cpu/mcs51/mcs51.c | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) (limited to 'src') diff --git a/src/emu/cpu/mcs51/mcs51.c b/src/emu/cpu/mcs51/mcs51.c index 2496afbff7d..518c92b560d 100644 --- a/src/emu/cpu/mcs51/mcs51.c +++ b/src/emu/cpu/mcs51/mcs51.c @@ -1203,13 +1203,15 @@ INLINE void update_timer_t2(mcs51_state_t *mcs51_state, int cycles) INLINE void update_timers(mcs51_state_t *mcs51_state, int cycles) { - /* Update Timer 0 */ - update_timer_t0(mcs51_state, cycles); - update_timer_t1(mcs51_state, cycles); - - if (mcs51_state->features & FEATURE_I8052) + while (cycles--) { - update_timer_t2(mcs51_state, cycles); + update_timer_t0(mcs51_state, 1); + update_timer_t1(mcs51_state, 1); + + if (mcs51_state->features & FEATURE_I8052) + { + update_timer_t2(mcs51_state, 1); + } } } -- cgit v1.2.3