From 63c03053017bcc5cbdbd05de4586f6fe0d4824e8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Henrik=20Rydg=C3=A5rd?= Date: Tue, 3 Dec 2024 21:34:55 +0100 Subject: [PATCH] Delete unused enum, add a new parameter bool --- Core/HLE/sceGe.cpp | 12 ++++++------ Core/System.cpp | 2 +- GPU/GPUCommon.cpp | 13 ++++++++----- GPU/GPUCommon.h | 19 +++---------------- 4 files changed, 18 insertions(+), 28 deletions(-) diff --git a/Core/HLE/sceGe.cpp b/Core/HLE/sceGe.cpp index 087e19e60d..83f54fc3c5 100644 --- a/Core/HLE/sceGe.cpp +++ b/Core/HLE/sceGe.cpp @@ -340,11 +340,11 @@ u32 sceGeListEnQueue(u32 listAddress, u32 stallAddress, int callbackId, u32 optP auto optParam = PSPPointer::Create(optParamAddr); u32 listID = gpu->EnqueueList(listAddress, stallAddress, __GeSubIntrBase(callbackId), optParam, false); - if ((int)listID >= 0) - listID = LIST_ID_MAGIC ^ listID; - hleEatCycles(490); CoreTiming::ForceCheck(); + + if ((int)listID >= 0) + listID = LIST_ID_MAGIC ^ listID; return hleLogSuccessX(Log::sceGe, listID); } @@ -355,11 +355,11 @@ u32 sceGeListEnQueueHead(u32 listAddress, u32 stallAddress, int callbackId, u32 auto optParam = PSPPointer::Create(optParamAddr); u32 listID = gpu->EnqueueList(listAddress, stallAddress, __GeSubIntrBase(callbackId), optParam, true); - if ((int)listID >= 0) - listID = LIST_ID_MAGIC ^ listID; - hleEatCycles(480); CoreTiming::ForceCheck(); + + if ((int)listID >= 0) + listID = LIST_ID_MAGIC ^ listID; return hleLogSuccessX(Log::sceGe, listID); } diff --git a/Core/System.cpp b/Core/System.cpp index d8b956e3fd..fceecc9206 100644 --- a/Core/System.cpp +++ b/Core/System.cpp @@ -642,7 +642,7 @@ void PSP_RunLoopUntil(u64 globalticks) { _dbg_assert_(false); break; case CORE_RUNNING_GE: - gpu->ProcessDLQueue(DLRunType::Run, DLStepType::None); + gpu->ProcessDLQueue(true); coreState = CORE_RUNNING_CPU; break; } diff --git a/GPU/GPUCommon.cpp b/GPU/GPUCommon.cpp index fdd9c59973..90cb365bef 100644 --- a/GPU/GPUCommon.cpp +++ b/GPU/GPUCommon.cpp @@ -552,7 +552,7 @@ void GPUCommon::SwitchToGe() { // Old method, although may make sense for performance if the ImDebugger isn't active. #if 1 // Call ProcessDLQueue directly. - ProcessDLQueue(DLRunType::Run, DLStepType::None); + ProcessDLQueue(false); #else // New method, will allow ImDebugger to step the GPU. // ARGH, what makes this different appears to be what happens AFTER the call to @@ -844,10 +844,7 @@ int GPUCommon::GetNextListIndex() { // This is now called when coreState == CORE_RUNNING_GE. // TODO: It should return the next action.. (break into debugger or continue running) -DLResult GPUCommon::ProcessDLQueue(DLRunType run, DLStepType step) { - _dbg_assert_(run == DLRunType::Run); - _dbg_assert_(step == DLStepType::None); - +DLResult GPUCommon::ProcessDLQueue(bool fromCore) { startingTicks = CoreTiming::GetTicks(); cyclesExecuted = 0; @@ -883,6 +880,12 @@ DLResult GPUCommon::ProcessDLQueue(DLRunType run, DLStepType step) { __GeTriggerSync(GPU_SYNC_DRAW, 1, drawCompleteTicks); // Since the event is in CoreTiming, we're in sync. Just set 0 now. + + if (fromCore) { + // Now update the core timing like we would have previously... + // TODO + } + return DLResult::Done; } diff --git a/GPU/GPUCommon.h b/GPU/GPUCommon.h index b23fb2f569..521e9bbd8f 100644 --- a/GPU/GPUCommon.h +++ b/GPU/GPUCommon.h @@ -140,21 +140,6 @@ namespace Draw { class DrawContext; } -enum class DLRunType { - Run, - RunDebug, - Step, -}; - -enum class DLStepType { - None, - Single, - Prim, - Draw, - Texture, - Rendertarget, -}; - enum class DLResult { Done, Error, @@ -257,7 +242,9 @@ public: virtual void PreExecuteOp(u32 op, u32 diff) {} bool InterpretList(DisplayList &list); - DLResult ProcessDLQueue(DLRunType run, DLStepType step); + + DLResult ProcessDLQueue(bool fromCore); + u32 UpdateStall(int listid, u32 newstall); u32 EnqueueList(u32 listpc, u32 stall, int subIntrBase, PSPPointer args, bool head); u32 DequeueList(int listid);