mirror of
https://github.com/RetroDECK/Duckstation.git
synced 2025-01-18 22:35:39 +00:00
GPU: Let GPU catch up before handling GP1 reset commands
Fixes trashed VRAM writes in some homebrew.
This commit is contained in:
parent
b0b3901722
commit
511c3133f1
|
@ -891,6 +891,7 @@ void GPU::WriteGP1(u32 value)
|
||||||
case 0x00: // Reset GPU
|
case 0x00: // Reset GPU
|
||||||
{
|
{
|
||||||
Log_DebugPrintf("GP1 reset GPU");
|
Log_DebugPrintf("GP1 reset GPU");
|
||||||
|
m_command_tick_event->InvokeEarly();
|
||||||
SynchronizeCRTC();
|
SynchronizeCRTC();
|
||||||
SoftReset();
|
SoftReset();
|
||||||
}
|
}
|
||||||
|
@ -899,6 +900,7 @@ void GPU::WriteGP1(u32 value)
|
||||||
case 0x01: // Clear FIFO
|
case 0x01: // Clear FIFO
|
||||||
{
|
{
|
||||||
Log_DebugPrintf("GP1 clear FIFO");
|
Log_DebugPrintf("GP1 clear FIFO");
|
||||||
|
m_command_tick_event->InvokeEarly();
|
||||||
SynchronizeCRTC();
|
SynchronizeCRTC();
|
||||||
m_blitter_state = BlitterState::Idle;
|
m_blitter_state = BlitterState::Idle;
|
||||||
m_command_total_words = 0;
|
m_command_total_words = 0;
|
||||||
|
@ -1007,6 +1009,7 @@ void GPU::WriteGP1(u32 value)
|
||||||
{
|
{
|
||||||
// Have to be careful when setting this because Synchronize() can modify GPUSTAT.
|
// Have to be careful when setting this because Synchronize() can modify GPUSTAT.
|
||||||
static constexpr u32 SET_MASK = UINT32_C(0b00000000011111110100000000000000);
|
static constexpr u32 SET_MASK = UINT32_C(0b00000000011111110100000000000000);
|
||||||
|
m_command_tick_event->InvokeEarly();
|
||||||
SynchronizeCRTC();
|
SynchronizeCRTC();
|
||||||
m_GPUSTAT.bits = (m_GPUSTAT.bits & ~SET_MASK) | (new_GPUSTAT.bits & SET_MASK);
|
m_GPUSTAT.bits = (m_GPUSTAT.bits & ~SET_MASK) | (new_GPUSTAT.bits & SET_MASK);
|
||||||
UpdateCRTCConfig();
|
UpdateCRTCConfig();
|
||||||
|
|
Loading…
Reference in a new issue