From fdaccc16f1b606076b8d8e8cf33fe6b85ed2323b Mon Sep 17 00:00:00 2001 From: Vicki Pfau Date: Fri, 2 Jul 2021 03:29:45 -0700 Subject: [PATCH] DS: Lengthen CPU timeslices if the ARM7 is halted --- src/ds/ds.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/ds/ds.c b/src/ds/ds.c index ab38cd06b..98856d31e 100644 --- a/src/ds/ds.c +++ b/src/ds/ds.c @@ -73,6 +73,10 @@ static void _slice(struct mTiming* timing, void* context, uint32_t cyclesLate) { } else { ds->activeCpu = ds->ds9.cpu; ds->cycleDrift -= cycles << 1; + int32_t nextEvent = mTimingNextEvent(&ds->ds7.timing) << 1; + if (!ds->ds7.cpu->halted || nextEvent < SLICE_CYCLES) { + nextEvent = SLICE_CYCLES; + } cycles = ds->cycleDrift + SLICE_CYCLES; timing = &ds->ds9.timing; }