VideoInterface: Throttle prior to SI poll.

This commit is contained in:
Jordan Woyak 2025-03-02 03:19:28 -06:00
parent 81e842e2aa
commit 9675c90890

View File

@ -888,10 +888,13 @@ void VideoInterfaceManager::Update(u64 ticks)
if (is_at_field_boundary)
Core::Callback_NewField(m_system);
// If an SI poll is scheduled to happen on this half-line, do it!
auto& core_timing = m_system.GetCoreTiming();
// If an SI poll is scheduled to happen on this half-line, do it!
if (m_half_line_count == m_half_line_of_next_si_poll)
{
// Throttle before SI poll so user input is taken just before needed. (lower input latency)
core_timing.Throttle(ticks);
Core::UpdateInputGate(!Config::Get(Config::MAIN_INPUT_BACKGROUND_INPUT),
Config::Get(Config::MAIN_LOCK_CURSOR));
auto& si = m_system.GetSerialInterface();
@ -917,7 +920,6 @@ void VideoInterfaceManager::Update(u64 ticks)
m_half_line_count = 0;
}
auto& core_timing = m_system.GetCoreTiming();
if (!(m_half_line_count & 1))
{
m_ticks_last_line_start = core_timing.GetTicks();