From 49101037b8a8bccf89be1af57e312bd51dad0b4b Mon Sep 17 00:00:00 2001 From: SimoneN64 Date: Mon, 10 Jul 2023 23:04:07 +0200 Subject: [PATCH] Should reset this flag in the GSP (needs better name) --- include/services/gsp_gpu.hpp | 1 + src/core/services/gsp_gpu.cpp | 6 +++--- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/include/services/gsp_gpu.hpp b/include/services/gsp_gpu.hpp index f687532e..214a001e 100644 --- a/include/services/gsp_gpu.hpp +++ b/include/services/gsp_gpu.hpp @@ -22,6 +22,7 @@ enum class GPUInterrupt : u8 { class Kernel; class GPUService { + bool registerInterruptRelayQueueBeenHere = false; Handle handle = KernelHandles::GPU; Memory& mem; GPU& gpu; diff --git a/src/core/services/gsp_gpu.cpp b/src/core/services/gsp_gpu.cpp index f27688a2..e3dea8f6 100644 --- a/src/core/services/gsp_gpu.cpp +++ b/src/core/services/gsp_gpu.cpp @@ -34,6 +34,7 @@ void GPUService::reset() { privilegedProcess = 0xFFFFFFFF; // Set the privileged process to an invalid handle interruptEvent = std::nullopt; sharedMem = nullptr; + registerInterruptRelayQueueBeenHere = false; } void GPUService::handleSyncRequest(u32 messagePointer) { @@ -77,9 +78,8 @@ void GPUService::acquireRight(u32 messagePointer) { // How does the shared memory handle thing work? void GPUService::registerInterruptRelayQueue(u32 messagePointer) { // Detect if this function is called a 2nd time because we'll likely need to impl threads properly for the GSP - static bool beenHere = false; - if (beenHere) Helpers::panic("RegisterInterruptRelayQueue called a second time. Need to implement GSP threads properly"); - beenHere = true; + if (registerInterruptRelayQueueBeenHere) Helpers::panic("RegisterInterruptRelayQueue called a second time. Need to implement GSP threads properly"); + registerInterruptRelayQueueBeenHere = true; const u32 flags = mem.read32(messagePointer + 4); const u32 eventHandle = mem.read32(messagePointer + 12);