From caec927a984e3531f787dcc815a262a794bf4b24 Mon Sep 17 00:00:00 2001 From: Connor McLaughlin Date: Sun, 6 Oct 2019 23:12:17 +1000 Subject: [PATCH] GPU: Implement GetGPUInfo subcommands 02-05h --- src/core/gpu.cpp | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) diff --git a/src/core/gpu.cpp b/src/core/gpu.cpp index 2f3d70781..a5d7d3c9f 100644 --- a/src/core/gpu.cpp +++ b/src/core/gpu.cpp @@ -637,6 +637,37 @@ void GPU::HandleGetGPUInfoCommand(u32 value) // leave GPUREAD intact break; + case 0x02: // Get Texture Window + { + Log_DebugPrintf("Get texture window"); + m_GPUREAD_buffer.push_back(m_render_state.texture_window_value); + } + break; + + case 0x03: // Get Draw Area Top Left + { + Log_DebugPrintf("Get drawing area top left"); + m_GPUREAD_buffer.push_back((m_drawing_area.left & UINT32_C(0b1111111111)) | + ((m_drawing_area.top & UINT32_C(0b1111111111)) << 10)); + } + break; + + case 0x04: // Get Draw Area Bottom Right + { + Log_DebugPrintf("Get drawing area bottom right"); + m_GPUREAD_buffer.push_back((m_drawing_area.right & UINT32_C(0b1111111111)) | + ((m_drawing_area.bottom & UINT32_C(0b1111111111)) << 10)); + } + break; + + case 0x05: // Get Drawing Offset + { + Log_DebugPrintf("Get drawing offset"); + m_GPUREAD_buffer.push_back((m_drawing_offset.x & INT32_C(0b11111111111)) | + ((m_drawing_offset.y & INT32_C(0b11111111111)) << 11)); + } + break; + default: Log_WarningPrintf("Unhandled GetGPUInfo(0x%02X)", ZeroExtend32(subcommand)); break;