aboutsummaryrefslogtreecommitdiffhomepage
path: root/src
diff options
context:
space:
mode:
authorGravatar bunnei <bunneidev@gmail.com>2014-07-22 23:10:02 -0400
committerGravatar bunnei <bunneidev@gmail.com>2014-08-05 23:57:59 -0400
commit99e404e2218e16925dda44bcae21bfb8cf2caf91 (patch)
tree61fd9164e37d256fddf8ba648fdd4df60acf97be /src
parentec14ffe1cda04cd098ce07f3d3ad96c253e91eed (diff)
GSP: Removed unnecessary GX_FinishCommand function.
Diffstat (limited to 'src')
-rw-r--r--src/core/hle/service/gsp.cpp18
1 files changed, 5 insertions, 13 deletions
diff --git a/src/core/hle/service/gsp.cpp b/src/core/hle/service/gsp.cpp
index f3d9fd26..bf85b1d8 100644
--- a/src/core/hle/service/gsp.cpp
+++ b/src/core/hle/service/gsp.cpp
@@ -80,17 +80,6 @@ static inline GX_InterruptQueue* GetInterruptQueue(u32 thread_id) {
return (GX_InterruptQueue*)Kernel::GetSharedMemoryPointer(g_shared_memory, sizeof(GX_InterruptQueue) * thread_id);
}
-/// Finishes execution of a GSP command
-void GX_FinishCommand(u32 thread_id) {
- GX_CmdBufferHeader* header = (GX_CmdBufferHeader*)GX_GetCmdBufferPointer(thread_id);
-
- g_debugger.GXCommandProcessed(GX_GetCmdBufferPointer(thread_id, 0x20 + (header->index * 0x20)));
-
- header->number_commands = 0;
-
- // TODO: Increment header->index?
-}
-
/// Write a GSP GPU hardware register
void WriteHWRegs(Service::Interface* self) {
u32* cmd_buff = Service::GetCommandBuffer();
@@ -211,6 +200,8 @@ void ExecuteCommand(int thread_id, int command_index) {
GX_CmdBufferHeader* header = (GX_CmdBufferHeader*)GX_GetCmdBufferPointer(thread_id);
auto& command = *(const GXCommand*)GX_GetCmdBufferPointer(thread_id, (command_index + 1) * 0x20);
+ g_debugger.GXCommandProcessed(GX_GetCmdBufferPointer(thread_id, 0x20 + (header->index * 0x20)));
+
NOTICE_LOG(GSP, "decoding command 0x%08X", (int)command.id.Value());
switch (command.id) {
@@ -295,10 +286,13 @@ void ExecuteCommand(int thread_id, int command_index) {
default:
ERROR_LOG(GSP, "unknown command 0x%08X", (int)command.id.Value());
}
+
+ header->number_commands = header->number_commands - 1; // Indicates that command has completed
}
/// This triggers handling of the GX command written to the command buffer in shared memory.
void TriggerCmdReqQueue(Service::Interface* self) {
+
// Iterate through each thread's command queue...
for (int thread_id = 0; thread_id < 0x4; ++thread_id) {
GX_CmdBufferHeader* header = (GX_CmdBufferHeader*)GX_GetCmdBufferPointer(thread_id);
@@ -307,8 +301,6 @@ void TriggerCmdReqQueue(Service::Interface* self) {
for (int command_index = 0; command_index < header->number_commands; ++command_index) {
ExecuteCommand(thread_id, command_index);
}
-
- GX_FinishCommand(thread_id);
}
}