From 00e35d9bf61cda66430b7b4875d7b32e55e8f50f Mon Sep 17 00:00:00 2001 From: mageven <62494521+mageven@users.noreply.github.com> Date: Mon, 15 Aug 2022 13:16:08 +0530 Subject: [PATCH] ControllerApplet: Override player counts when SingleMode is set (#3571) --- Ryujinx.HLE/HOS/Applets/Controller/ControllerApplet.cs | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/Ryujinx.HLE/HOS/Applets/Controller/ControllerApplet.cs b/Ryujinx.HLE/HOS/Applets/Controller/ControllerApplet.cs index 1e8e26dfc..e5af5fd98 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))