From dd175b10fd8a0f98f95225d166e360d235d0f638 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Henrik=20Rydg=C3=A5rd?= Date: Wed, 4 Dec 2024 12:42:10 +0100 Subject: [PATCH] Warning fix --- GPU/Debugger/Playback.cpp | 1 - GPU/GPUCommon.cpp | 8 ++++++-- GPU/Software/SoftGpu.cpp | 5 +++-- headless/HeadlessHost.h | 2 ++ 4 files changed, 11 insertions(+), 5 deletions(-) diff --git a/GPU/Debugger/Playback.cpp b/GPU/Debugger/Playback.cpp index 1edc63a7bc..81288e6b77 100644 --- a/GPU/Debugger/Playback.cpp +++ b/GPU/Debugger/Playback.cpp @@ -432,7 +432,6 @@ bool DumpExecute::SubmitCmds(const void *p, u32 sz) { } execListQueue.clear(); - return true; } diff --git a/GPU/GPUCommon.cpp b/GPU/GPUCommon.cpp index c79b053124..bac8d0c3a7 100644 --- a/GPU/GPUCommon.cpp +++ b/GPU/GPUCommon.cpp @@ -561,6 +561,8 @@ void GPUCommon::RunGe(DeferredAction action, bool forceRunDirect) { RunDeferredAction(); #else // No sense in switching core mode if there's nothing to do, just maybe some bookkeeping. + // Also, in some situations like dump playback, we run DLs directly too (yes, this means that + // we can't step through display lists in a dump, which should be fixed later). if (dlQueue.empty() || forceRunDirect) { ProcessDLQueue(false); RunDeferredAction(); @@ -580,7 +582,9 @@ void GPUCommon::RunDeferredAction() { CoreTiming::ForceCheck(); } if (deferredAction_.reschedule) { - hleReSchedule("ge deferred action"); + // NOTE: hleReSchedule doesn't work if we're not in a syscall. We just reschedule, implementing the parts of hleFinishSyscall that are relevant. + __KernelForceCallbacks(); + __KernelReSchedule(true, "ge deferred action"); } } @@ -879,7 +883,7 @@ DLResult GPUCommon::ProcessDLQueue(bool fromCore) { for (int listIndex = GetNextListIndex(); listIndex != -1; listIndex = GetNextListIndex()) { DisplayList &l = dls[listIndex]; - DEBUG_LOG(Log::G3D, "Starting DL execution at %08x - stall = %08x (startingTicks=%d)", l.pc, l.stall, startingTicks); + DEBUG_LOG(Log::G3D, "Starting DL execution at %08x - stall = %08x (startingTicks=%lld)", l.pc, l.stall, startingTicks); if (!InterpretList(l)) { return DLResult::Error; } diff --git a/GPU/Software/SoftGpu.cpp b/GPU/Software/SoftGpu.cpp index d0b0b8d035..f64c81d633 100644 --- a/GPU/Software/SoftGpu.cpp +++ b/GPU/Software/SoftGpu.cpp @@ -1168,8 +1168,9 @@ void SoftGPU::Execute_TgenMtxData(u32 op, u32 diff) { } // Doesn't wrap to any other matrix. - if ((num & 0xF) < 12) { - matrixVisible.tgen[num & 0xF] = op & 0x00FFFFFF; + int wrappedNum = num & 0xF; + if (wrappedNum < 12) { + matrixVisible.tgen[wrappedNum] = op & 0x00FFFFFF; } num++; diff --git a/headless/HeadlessHost.h b/headless/HeadlessHost.h index 9f61bf08b3..5ef80d8c98 100644 --- a/headless/HeadlessHost.h +++ b/headless/HeadlessHost.h @@ -17,6 +17,7 @@ #pragma once +#include "Common/Log.h" #include "Common/CommonTypes.h" #include "Common/File/Path.h" @@ -31,6 +32,7 @@ public: virtual void SendDebugOutput(const std::string &output) { if (!writeDebugOutput_) return; + OutputDebugStringUTF8(output.c_str()); if (output.find('\n') != output.npos) { FlushDebugOutput(); fwrite(output.data(), sizeof(char), output.length(), stdout);