From d305d1faa2493fec0d384af3a1e35f85ab65bbb7 Mon Sep 17 00:00:00 2001 From: "Unknown W. Brackets" Date: Sat, 21 Sep 2013 16:17:46 -0700 Subject: [PATCH] Check enqueue as well, should be safer. Also, make sure not to eat a bunch more cycles when forcing a check. --- Core/CoreTiming.cpp | 3 +++ Core/HLE/sceGe.cpp | 7 +++++-- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/Core/CoreTiming.cpp b/Core/CoreTiming.cpp index b03b43efa9..6e5f6e32a4 100644 --- a/Core/CoreTiming.cpp +++ b/Core/CoreTiming.cpp @@ -525,6 +525,8 @@ void ForceCheck() globalTimer += cyclesExecuted; // This will cause us to check for new events immediately. currentMIPS->downcount = 0; + // But let's not eat a bunnch more time in Advance() because of this. + slicelength = 0; } void Advance() @@ -541,6 +543,7 @@ void Advance() { // WARN_LOG(TIMER, "WARNING - no events in queue. Setting currentMIPS->downcount to 10000"); currentMIPS->downcount += 10000; + slicelength = 10000; } else { diff --git a/Core/HLE/sceGe.cpp b/Core/HLE/sceGe.cpp index 8db50327de..b7310ac11f 100644 --- a/Core/HLE/sceGe.cpp +++ b/Core/HLE/sceGe.cpp @@ -338,10 +338,11 @@ u32 sceGeListEnQueue(u32 listAddress, u32 stallAddress, int callbackId, u32 listID = gpu->EnqueueList(listAddress, stallAddress, __GeSubIntrBase(callbackId), optParam, false); if ((int)listID >= 0) - listID = 0x35000000 | listID; + listID = 0x35000000 ^ listID; DEBUG_LOG(SCEGE, "List %i enqueued.", listID); - hleEatCycles(520); + hleEatCycles(490); + CoreTiming::ForceCheck(); return listID; } @@ -359,6 +360,8 @@ u32 sceGeListEnQueueHead(u32 listAddress, u32 stallAddress, int callbackId, listID = 0x35000000 ^ listID; DEBUG_LOG(SCEGE, "List %i enqueued.", listID); + hleEatCycles(480); + CoreTiming::ForceCheck(); return listID; }