GPU: Stub out more commands

This commit is contained in:
Connor McLaughlin 2019-10-05 22:22:49 +10:00
parent 751f348fd2
commit f59d35023c
2 changed files with 48 additions and 1 deletions

View File

@ -360,7 +360,7 @@ u32 GPU::ReadGPUREAD()
{ {
if (m_GPUREAD_buffer.empty()) 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); return UINT32_C(0xFFFFFFFF);
} }
@ -518,6 +518,13 @@ void GPU::WriteGP1(u32 value)
} }
break; break;
case 0x02: // Acknowledge Interrupt
{
Log_DebugPrintf("Acknowledge interrupt");
m_GPUSTAT.interrupt_request = false;
}
break;
case 0x04: // DMA Direction case 0x04: // DMA Direction
{ {
m_GPUSTAT.dma_direction = static_cast<DMADirection>(param); m_GPUSTAT.dma_direction = static_cast<DMADirection>(param);
@ -579,12 +586,51 @@ void GPU::WriteGP1(u32 value)
} }
break; 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: default:
Log_ErrorPrintf("Unimplemented GP1 command 0x%02X", command); Log_ErrorPrintf("Unimplemented GP1 command 0x%02X", command);
break; 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() bool GPU::HandleRenderCommand()
{ {
const u8 command = Truncate8(m_GP0_command[0] >> 24); const u8 command = Truncate8(m_GP0_command[0] >> 24);

View File

@ -181,6 +181,7 @@ protected:
u32 ReadGPUREAD(); u32 ReadGPUREAD();
void WriteGP0(u32 value); void WriteGP0(u32 value);
void WriteGP1(u32 value); void WriteGP1(u32 value);
void HandleGetGPUInfoCommand();
// Rendering commands, returns false if not enough data is provided // Rendering commands, returns false if not enough data is provided
bool HandleRenderCommand(); bool HandleRenderCommand();