diff options
author | mageven <62494521+mageven@users.noreply.github.com> | 2022-08-15 13:16:08 +0530 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-08-15 09:46:08 +0200 |
commit | 00e35d9bf61cda66430b7b4875d7b32e55e8f50f (patch) | |
tree | d0ef37cfcfff7393bee9cb3d65cdaddf78e0b24a | |
parent | 6dfb6ccf8cac7d50d08bec08198686032d7e6630 (diff) |
ControllerApplet: Override player counts when SingleMode is set (#3571)1.1.216
-rw-r--r-- | Ryujinx.HLE/HOS/Applets/Controller/ControllerApplet.cs | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/Ryujinx.HLE/HOS/Applets/Controller/ControllerApplet.cs b/Ryujinx.HLE/HOS/Applets/Controller/ControllerApplet.cs index 1e8e26df..e5af5fd9 100644 --- a/Ryujinx.HLE/HOS/Applets/Controller/ControllerApplet.cs +++ b/Ryujinx.HLE/HOS/Applets/Controller/ControllerApplet.cs @@ -72,9 +72,16 @@ namespace Ryujinx.HLE.HOS.Applets int playerMin = argHeader.PlayerCountMin; int playerMax = argHeader.PlayerCountMax; + bool singleMode = argHeader.EnableSingleMode != 0; Logger.Stub?.PrintStub(LogClass.ServiceHid, $"ControllerApplet Arg {playerMin} {playerMax} {argHeader.EnableTakeOverConnection} {argHeader.EnableSingleMode}"); + if (singleMode) + { + // Applications can set an arbitrary player range even with SingleMode, so clamp it + playerMin = playerMax = 1; + } + int configuredCount = 0; PlayerIndex primaryIndex = PlayerIndex.Unknown; while (!_system.Device.Hid.Npads.Validate(playerMin, playerMax, (ControllerType)privateArg.NpadStyleSet, out configuredCount, out primaryIndex)) |