summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorGravatar bunnei2014-07-22 23:10:02 -0400
committerGravatar bunnei2014-08-05 23:57:59 -0400
commit99e404e2218e16925dda44bcae21bfb8cf2caf91 (patch)
tree61fd9164e37d256fddf8ba648fdd4df60acf97be /src
parentGSP: Implements preliminary command synchronization via GPU interrupts. (diff)
downloadyuzu-99e404e2218e16925dda44bcae21bfb8cf2caf91.tar.gz
yuzu-99e404e2218e16925dda44bcae21bfb8cf2caf91.tar.xz
yuzu-99e404e2218e16925dda44bcae21bfb8cf2caf91.zip
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 f3d9fd26d..bf85b1d86 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) {
80 return (GX_InterruptQueue*)Kernel::GetSharedMemoryPointer(g_shared_memory, sizeof(GX_InterruptQueue) * thread_id); 80 return (GX_InterruptQueue*)Kernel::GetSharedMemoryPointer(g_shared_memory, sizeof(GX_InterruptQueue) * thread_id);
81} 81}
82 82
83/// Finishes execution of a GSP command
84void GX_FinishCommand(u32 thread_id) {
85 GX_CmdBufferHeader* header = (GX_CmdBufferHeader*)GX_GetCmdBufferPointer(thread_id);
86
87 g_debugger.GXCommandProcessed(GX_GetCmdBufferPointer(thread_id, 0x20 + (header->index * 0x20)));
88
89 header->number_commands = 0;
90
91 // TODO: Increment header->index?
92}
93
94/// Write a GSP GPU hardware register 83/// Write a GSP GPU hardware register
95void WriteHWRegs(Service::Interface* self) { 84void WriteHWRegs(Service::Interface* self) {
96 u32* cmd_buff = Service::GetCommandBuffer(); 85 u32* cmd_buff = Service::GetCommandBuffer();
@@ -211,6 +200,8 @@ void ExecuteCommand(int thread_id, int command_index) {
211 GX_CmdBufferHeader* header = (GX_CmdBufferHeader*)GX_GetCmdBufferPointer(thread_id); 200 GX_CmdBufferHeader* header = (GX_CmdBufferHeader*)GX_GetCmdBufferPointer(thread_id);
212 auto& command = *(const GXCommand*)GX_GetCmdBufferPointer(thread_id, (command_index + 1) * 0x20); 201 auto& command = *(const GXCommand*)GX_GetCmdBufferPointer(thread_id, (command_index + 1) * 0x20);
213 202
203 g_debugger.GXCommandProcessed(GX_GetCmdBufferPointer(thread_id, 0x20 + (header->index * 0x20)));
204
214 NOTICE_LOG(GSP, "decoding command 0x%08X", (int)command.id.Value()); 205 NOTICE_LOG(GSP, "decoding command 0x%08X", (int)command.id.Value());
215 206
216 switch (command.id) { 207 switch (command.id) {
@@ -295,10 +286,13 @@ void ExecuteCommand(int thread_id, int command_index) {
295 default: 286 default:
296 ERROR_LOG(GSP, "unknown command 0x%08X", (int)command.id.Value()); 287 ERROR_LOG(GSP, "unknown command 0x%08X", (int)command.id.Value());
297 } 288 }
289
290 header->number_commands = header->number_commands - 1; // Indicates that command has completed
298} 291}
299 292
300/// This triggers handling of the GX command written to the command buffer in shared memory. 293/// This triggers handling of the GX command written to the command buffer in shared memory.
301void TriggerCmdReqQueue(Service::Interface* self) { 294void TriggerCmdReqQueue(Service::Interface* self) {
295
302 // Iterate through each thread's command queue... 296 // Iterate through each thread's command queue...
303 for (int thread_id = 0; thread_id < 0x4; ++thread_id) { 297 for (int thread_id = 0; thread_id < 0x4; ++thread_id) {
304 GX_CmdBufferHeader* header = (GX_CmdBufferHeader*)GX_GetCmdBufferPointer(thread_id); 298 GX_CmdBufferHeader* header = (GX_CmdBufferHeader*)GX_GetCmdBufferPointer(thread_id);
@@ -307,8 +301,6 @@ void TriggerCmdReqQueue(Service::Interface* self) {
307 for (int command_index = 0; command_index < header->number_commands; ++command_index) { 301 for (int command_index = 0; command_index < header->number_commands; ++command_index) {
308 ExecuteCommand(thread_id, command_index); 302 ExecuteCommand(thread_id, command_index);
309 } 303 }
310
311 GX_FinishCommand(thread_id);
312 } 304 }
313} 305}
314 306