Merge pull request #9846 from jordan-woyak/report-dup-setting

Config: Add an ini setting to control real Wii Remote report duplication.
This commit is contained in:
Léo Lam 2021-07-13 03:32:49 +02:00 committed by GitHub
commit de54856fbb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 14 additions and 4 deletions

View File

@ -108,6 +108,8 @@ const Info<DiscIO::Region> MAIN_FALLBACK_REGION{{System::Main, "Core", "Fallback
const Info<bool> MAIN_AUTO_DISC_CHANGE{{System::Main, "Core", "AutoDiscChange"}, false}; const Info<bool> MAIN_AUTO_DISC_CHANGE{{System::Main, "Core", "AutoDiscChange"}, false};
const Info<bool> MAIN_ALLOW_SD_WRITES{{System::Main, "Core", "WiiSDCardAllowWrites"}, true}; const Info<bool> MAIN_ALLOW_SD_WRITES{{System::Main, "Core", "WiiSDCardAllowWrites"}, true};
const Info<bool> MAIN_ENABLE_SAVESTATES{{System::Main, "Core", "EnableSaveStates"}, false}; const Info<bool> MAIN_ENABLE_SAVESTATES{{System::Main, "Core", "EnableSaveStates"}, false};
const Info<bool> MAIN_REAL_WII_REMOTE_REPEAT_REPORTS{
{System::Main, "Core", "RealWiiRemoteRepeatReports"}, true};
// Main.Display // Main.Display

View File

@ -86,6 +86,7 @@ extern const Info<bool> MAIN_AUTO_DISC_CHANGE;
extern const Info<bool> MAIN_ALLOW_SD_WRITES; extern const Info<bool> MAIN_ALLOW_SD_WRITES;
extern const Info<bool> MAIN_ENABLE_SAVESTATES; extern const Info<bool> MAIN_ENABLE_SAVESTATES;
extern const Info<DiscIO::Region> MAIN_FALLBACK_REGION; extern const Info<DiscIO::Region> MAIN_FALLBACK_REGION;
extern const Info<bool> MAIN_REAL_WII_REMOTE_REPEAT_REPORTS;
// Main.DSP // Main.DSP

View File

@ -25,7 +25,7 @@ bool IsSettingSaveable(const Config::Location& config_location)
if (config_location.system == Config::System::Main) if (config_location.system == Config::System::Main)
{ {
for (const std::string& section : for (const std::string_view section :
{"NetPlay", "General", "Display", "Network", "Analytics", "AndroidOverlayButtons"}) {"NetPlay", "General", "Display", "Network", "Analytics", "AndroidOverlayButtons"})
{ {
if (config_location.section == section) if (config_location.section == section)
@ -46,7 +46,7 @@ bool IsSettingSaveable(const Config::Location& config_location)
} }
} }
static constexpr std::array<const Config::Location*, 17> s_setting_saveable = { static constexpr auto s_setting_saveable = {
// Main.Core // Main.Core
&Config::MAIN_DEFAULT_ISO.GetLocation(), &Config::MAIN_DEFAULT_ISO.GetLocation(),
@ -62,6 +62,7 @@ bool IsSettingSaveable(const Config::Location& config_location)
&Config::MAIN_GFX_BACKEND.GetLocation(), &Config::MAIN_GFX_BACKEND.GetLocation(),
&Config::MAIN_ENABLE_SAVESTATES.GetLocation(), &Config::MAIN_ENABLE_SAVESTATES.GetLocation(),
&Config::MAIN_FALLBACK_REGION.GetLocation(), &Config::MAIN_FALLBACK_REGION.GetLocation(),
&Config::MAIN_REAL_WII_REMOTE_REPEAT_REPORTS.GetLocation(),
// Main.Interface // Main.Interface
@ -77,7 +78,7 @@ bool IsSettingSaveable(const Config::Location& config_location)
&Config::MAIN_USE_DISCORD_PRESENCE.GetLocation(), &Config::MAIN_USE_DISCORD_PRESENCE.GetLocation(),
}; };
return std::any_of(s_setting_saveable.cbegin(), s_setting_saveable.cend(), return std::any_of(begin(s_setting_saveable), end(s_setting_saveable),
[&config_location](const Config::Location* location) { [&config_location](const Config::Location* location) {
return *location == config_location; return *location == config_location;
}); });

View File

@ -15,6 +15,7 @@
#include "Common/IniFile.h" #include "Common/IniFile.h"
#include "Common/Swap.h" #include "Common/Swap.h"
#include "Common/Thread.h" #include "Common/Thread.h"
#include "Core/Config/MainSettings.h"
#include "Core/ConfigManager.h" #include "Core/ConfigManager.h"
#include "Core/Core.h" #include "Core/Core.h"
#include "Core/HW/Wiimote.h" #include "Core/HW/Wiimote.h"
@ -436,12 +437,17 @@ void Wiimote::Update()
{ {
// Wii remotes send input at 200hz once a Wii enables "sniff mode" on the connection. // Wii remotes send input at 200hz once a Wii enables "sniff mode" on the connection.
// PC bluetooth stacks do not enable sniff mode causing remotes to send input at only 100hz. // PC bluetooth stacks do not enable sniff mode causing remotes to send input at only 100hz.
//
// Commercial games do not send speaker data unless input rates approach 200hz. // Commercial games do not send speaker data unless input rates approach 200hz.
// Some games will also present input issues.
// e.g. Super Mario Galaxy's star cursor drops in and out.
//
// If we want speaker data we must pretend input is at 200hz. // If we want speaker data we must pretend input is at 200hz.
// We duplicate data reports to accomplish this. // We duplicate data reports to accomplish this.
// Unfortunately this breaks detection of motion gestures in some games. // Unfortunately this breaks detection of motion gestures in some games.
// e.g. Sonic and the Secret Rings, Jett Rocket // e.g. Sonic and the Secret Rings, Jett Rocket
const bool repeat_reports_to_maintain_200hz = SConfig::GetInstance().m_WiimoteEnableSpeaker; const bool repeat_reports_to_maintain_200hz =
Config::Get(Config::MAIN_REAL_WII_REMOTE_REPEAT_REPORTS);
const Report& rpt = ProcessReadQueue(repeat_reports_to_maintain_200hz); const Report& rpt = ProcessReadQueue(repeat_reports_to_maintain_200hz);