From d4ecdfc2ac29913867c9e2b91c8a946ffa312f50 Mon Sep 17 00:00:00 2001 From: Jeffrey Pfau Date: Wed, 1 Jul 2015 19:24:15 -0700 Subject: [PATCH] GBA Memory: Fix prefetch invalidation delay --- src/gba/memory.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/gba/memory.c b/src/gba/memory.c index af97a869a..78f85739b 100644 --- a/src/gba/memory.c +++ b/src/gba/memory.c @@ -1566,8 +1566,8 @@ void GBAMemoryInvalidatePrefetch(struct GBA* gba) { int32_t toRemove = (s - 1) * loads + n2s * nWaits + diff; if (toRemove > gba->cpu->cycles) { // We have to delay invalidating... - gba->memory.prefetchCycles = gba->memory.prefetchCycles; - gba->memory.prefetchStalls = gba->memory.prefetchStalls; + gba->memory.prefetchCycles = waited; + gba->memory.prefetchStalls = nWaits; return; } gba->cpu->cycles -= toRemove;