mirror of
https://github.com/RetroDECK/Duckstation.git
synced 2024-11-26 23:55:40 +00:00
Small optimization to GPU::SystemTicksToCRTCTicks
This commit is contained in:
parent
3ed429772d
commit
f5f12fd76d
|
@ -408,20 +408,13 @@ TickCount GPU::CRTCTicksToSystemTicks(TickCount gpu_ticks, TickCount fractional_
|
||||||
|
|
||||||
TickCount GPU::SystemTicksToCRTCTicks(TickCount sysclk_ticks, TickCount* fractional_ticks) const
|
TickCount GPU::SystemTicksToCRTCTicks(TickCount sysclk_ticks, TickCount* fractional_ticks) const
|
||||||
{
|
{
|
||||||
if (!m_console_is_pal)
|
u64 mul = u64(sysclk_ticks);
|
||||||
{
|
mul *= !m_console_is_pal ? u64(715909) : u64(709379);
|
||||||
const u64 mul = u64(sysclk_ticks) * u64(715909) + u64(*fractional_ticks);
|
mul += u64(*fractional_ticks);
|
||||||
const TickCount ticks = static_cast<TickCount>(mul / u64(451584));
|
|
||||||
*fractional_ticks = static_cast<TickCount>(mul % u64(451584));
|
const TickCount ticks = static_cast<TickCount>(mul / u64(451584));
|
||||||
return ticks;
|
*fractional_ticks = static_cast<TickCount>(mul % u64(451584));
|
||||||
}
|
return ticks;
|
||||||
else
|
|
||||||
{
|
|
||||||
const u64 mul = u64(sysclk_ticks) * u64(709379) + u64(*fractional_ticks);
|
|
||||||
const TickCount ticks = static_cast<TickCount>(mul / u64(451584));
|
|
||||||
*fractional_ticks = static_cast<TickCount>(mul % u64(451584));
|
|
||||||
return ticks;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void GPU::AddCommandTicks(TickCount ticks)
|
void GPU::AddCommandTicks(TickCount ticks)
|
||||||
|
|
Loading…
Reference in a new issue