Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: standard controller 40fps, increases input lag for all #35

Open
wants to merge 5 commits into
base: slippi
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Source/Core/Core/HW/SI/SI.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -295,7 +295,7 @@ void SerialInterfaceManager::Init()
}

m_poll.hex = 0;
m_poll.X = 492;
m_poll.X = 123;

m_com_csr.hex = 0;

Expand Down
1 change: 1 addition & 0 deletions Source/Core/Core/HW/SI/SI_DeviceGCController.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,7 @@ void CSIDevice_GCController::HandleMoviePadStatus(Movie::MovieManager& movie, in
GCPadStatus CSIDevice_GCController::GetPadStatus()
{
GCPadStatus pad_status = {};
m_system.GetSerialInterface().UpdateDevices();

// For netplay, the local controllers are polled in GetNetPads(), and
// the remote controllers receive their status there as well
Expand Down
55 changes: 28 additions & 27 deletions Source/Core/Core/HW/VideoInterface.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -848,10 +848,11 @@ void VideoInterfaceManager::EndField(FieldType field, u64 ticks)
// Run when: When a frame is scanned (progressive/interlace)
void VideoInterfaceManager::Update(u64 ticks)
{
// Try calling SI Poll every time update is called
m_system.GetSerialInterface().UpdateDevices();
Core::UpdateInputGate(!Config::Get(Config::MAIN_INPUT_BACKGROUND_INPUT),
Config::Get(Config::MAIN_LOCK_CURSOR));
// SLIPPITODO: figure out a better way to increase poll frequency without impacting perf
// // SLIPPINOTES: Try calling SI Poll every time update is called
// m_system.GetSerialInterface().UpdateDevices();
// Core::UpdateInputGate(!Config::Get(Config::MAIN_INPUT_BACKGROUND_INPUT),
// Config::Get(Config::MAIN_LOCK_CURSOR));

// Movie's frame counter should be updated before actually rendering the frame,
// in case frame counter display is enabled
Expand Down Expand Up @@ -886,29 +887,29 @@ void VideoInterfaceManager::Update(u64 ticks)
if (m_half_line_count == 0 || m_half_line_count == GetHalfLinesPerEvenField())
Core::Callback_NewField(m_system);

// SLIPPINOTES: this section is disabled because we would rather poll every chance we get to reduce
// lag
// // If an SI poll is scheduled to happen on this half-line, do it!
// if (m_half_line_of_next_si_poll == m_half_line_count)
// {
// Core::UpdateInputGate(!Config::Get(Config::MAIN_INPUT_BACKGROUND_INPUT),
// Config::Get(Config::MAIN_LOCK_CURSOR));
// auto& si = m_system.GetSerialInterface();
// si.UpdateDevices();
// m_half_line_of_next_si_poll += 2 * si.GetPollXLines();
// }

// // If this half-line is at the actual boundary of either field, schedule an SI poll to happen
// // some number of half-lines in the future

// if (m_half_line_count == 0)
// {
// m_half_line_of_next_si_poll = NUM_HALF_LINES_FOR_SI_POLL; // first results start at vsync
// }
// if (m_half_line_count == GetHalfLinesPerEvenField())
// {
// m_half_line_of_next_si_poll = GetHalfLinesPerEvenField() + NUM_HALF_LINES_FOR_SI_POLL;
// }
// SLIPPINOTES: this section can be disabled in favor of calling UpdateDevices every
// time this function runs, but doing so will cause a perf hit on some systems
// If an SI poll is scheduled to happen on this half-line, do it!
if (m_half_line_of_next_si_poll == m_half_line_count)
{
Core::UpdateInputGate(!Config::Get(Config::MAIN_INPUT_BACKGROUND_INPUT),
Config::Get(Config::MAIN_LOCK_CURSOR));
auto& si = m_system.GetSerialInterface();
si.UpdateDevices();
m_half_line_of_next_si_poll += 2 * si.GetPollXLines();
}

// If this half-line is at the actual boundary of either field, schedule an SI poll to happen
// some number of half-lines in the future

if (m_half_line_count == 0)
{
m_half_line_of_next_si_poll = NUM_HALF_LINES_FOR_SI_POLL; // first results start at vsync
}
if (m_half_line_count == GetHalfLinesPerEvenField())
{
m_half_line_of_next_si_poll = GetHalfLinesPerEvenField() + NUM_HALF_LINES_FOR_SI_POLL;
}

// Move to the next half-line and potentially roll-over the count to zero. If we've reached
// the beginning of a new full-line, update the timer
Expand Down
Loading