mirror of
https://github.com/RetroDECK/Duckstation.git
synced 2025-01-18 06:25:37 +00:00
Timers: Sync GPU on register write too
This commit is contained in:
parent
e2e2b573c0
commit
612b362ae9
|
@ -211,12 +211,15 @@ void Timers::WriteRegister(u32 offset, u32 value)
|
||||||
|
|
||||||
CounterState& cs = m_states[timer_index];
|
CounterState& cs = m_states[timer_index];
|
||||||
|
|
||||||
|
if (timer_index < 2)
|
||||||
|
m_gpu->Synchronize();
|
||||||
|
m_sysclk_event->InvokeEarly();
|
||||||
|
|
||||||
switch (port_offset)
|
switch (port_offset)
|
||||||
{
|
{
|
||||||
case 0x00:
|
case 0x00:
|
||||||
{
|
{
|
||||||
Log_DebugPrintf("Timer %u write counter %u", timer_index, value);
|
Log_DebugPrintf("Timer %u write counter %u", timer_index, value);
|
||||||
m_sysclk_event->InvokeEarly();
|
|
||||||
cs.counter = value & u32(0xFFFF);
|
cs.counter = value & u32(0xFFFF);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
@ -224,7 +227,6 @@ void Timers::WriteRegister(u32 offset, u32 value)
|
||||||
case 0x04:
|
case 0x04:
|
||||||
{
|
{
|
||||||
Log_DebugPrintf("Timer %u write mode register 0x%04X", timer_index, value);
|
Log_DebugPrintf("Timer %u write mode register 0x%04X", timer_index, value);
|
||||||
m_sysclk_event->InvokeEarly();
|
|
||||||
cs.mode.bits = value & u32(0x1FFF);
|
cs.mode.bits = value & u32(0x1FFF);
|
||||||
cs.use_external_clock = (cs.mode.clock_source & (timer_index == 2 ? 2 : 1)) != 0;
|
cs.use_external_clock = (cs.mode.clock_source & (timer_index == 2 ? 2 : 1)) != 0;
|
||||||
cs.counter = 0;
|
cs.counter = 0;
|
||||||
|
@ -241,7 +243,6 @@ void Timers::WriteRegister(u32 offset, u32 value)
|
||||||
case 0x08:
|
case 0x08:
|
||||||
{
|
{
|
||||||
Log_DebugPrintf("Timer %u write target 0x%04X", timer_index, ZeroExtend32(Truncate16(value)));
|
Log_DebugPrintf("Timer %u write target 0x%04X", timer_index, ZeroExtend32(Truncate16(value)));
|
||||||
m_sysclk_event->InvokeEarly();
|
|
||||||
cs.target = value & u32(0xFFFF);
|
cs.target = value & u32(0xFFFF);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
Loading…
Reference in a new issue