From f59d35023c2d5bb32aae57fe3eb694babdd3d27a Mon Sep 17 00:00:00 2001 From: Connor McLaughlin Date: Sat, 5 Oct 2019 22:22:49 +1000 Subject: [PATCH] GPU: Stub out more commands --- src/core/gpu.cpp | 48 +++++++++++++++++++++++++++++++++++++++++++++++- src/core/gpu.h | 1 + 2 files changed, 48 insertions(+), 1 deletion(-) diff --git a/src/core/gpu.cpp b/src/core/gpu.cpp index e28614bb8..ce475773d 100644 --- a/src/core/gpu.cpp +++ b/src/core/gpu.cpp @@ -360,7 +360,7 @@ u32 GPU::ReadGPUREAD() { if (m_GPUREAD_buffer.empty()) { - Log_ErrorPrintf("GPUREAD read while buffer is empty"); + Log_DevPrintf("GPUREAD read while buffer is empty"); return UINT32_C(0xFFFFFFFF); } @@ -518,6 +518,13 @@ void GPU::WriteGP1(u32 value) } break; + case 0x02: // Acknowledge Interrupt + { + Log_DebugPrintf("Acknowledge interrupt"); + m_GPUSTAT.interrupt_request = false; + } + break; + case 0x04: // DMA Direction { m_GPUSTAT.dma_direction = static_cast(param); @@ -579,12 +586,51 @@ void GPU::WriteGP1(u32 value) } break; + case 0x10: + case 0x11: + case 0x12: + case 0x13: + case 0x14: + case 0x15: + case 0x16: + case 0x17: + case 0x18: + case 0x19: + case 0x1A: + case 0x1B: + case 0x1C: + case 0x1D: + case 0x1E: + case 0x1F: + { + HandleGetGPUInfoCommand(); + } + break; + default: Log_ErrorPrintf("Unimplemented GP1 command 0x%02X", command); break; } } +void GPU::HandleGetGPUInfoCommand() +{ + const u8 subcommand = Truncate8(m_GP0_command[0] & 0x07); + switch (subcommand) + { + case 0x00: + case 0x01: + case 0x06: + case 0x07: + // leave GPUREAD intact + break; + + default: + Log_WarningPrintf("Unhandled GetGPUInfo(0x%02X)", ZeroExtend32(subcommand)); + break; + } +} + bool GPU::HandleRenderCommand() { const u8 command = Truncate8(m_GP0_command[0] >> 24); diff --git a/src/core/gpu.h b/src/core/gpu.h index e63af87dc..137f5bb8e 100644 --- a/src/core/gpu.h +++ b/src/core/gpu.h @@ -181,6 +181,7 @@ protected: u32 ReadGPUREAD(); void WriteGP0(u32 value); void WriteGP1(u32 value); + void HandleGetGPUInfoCommand(); // Rendering commands, returns false if not enough data is provided bool HandleRenderCommand();