feat: added working controller applet
This commit is contained in:
parent
7fe5035e88
commit
a9854ec30d
@ -126,6 +126,8 @@ namespace Ryujinx.HLE.HOS.Applets
|
|||||||
}
|
}
|
||||||
|
|
||||||
private MultiWaitHolder WaitSignaled()
|
private MultiWaitHolder WaitSignaled()
|
||||||
|
{
|
||||||
|
try
|
||||||
{
|
{
|
||||||
while (true)
|
while (true)
|
||||||
{
|
{
|
||||||
@ -146,6 +148,11 @@ namespace Ryujinx.HLE.HOS.Applets
|
|||||||
return selected;
|
return selected;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
catch (Exception)
|
||||||
|
{
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
private void Process(MultiWaitHolder holder)
|
private void Process(MultiWaitHolder holder)
|
||||||
{
|
{
|
||||||
|
@ -15,14 +15,20 @@ namespace Ryujinx.HLE.HOS.Services.BluetoothManager.BtmSystem
|
|||||||
|
|
||||||
public IBtmSystemCore() { }
|
public IBtmSystemCore() { }
|
||||||
|
|
||||||
|
[CommandCmif(0)]
|
||||||
|
// StartGamepadPairing()
|
||||||
|
public ResultCode StartGamepadPairing(ServiceCtx context)
|
||||||
|
{
|
||||||
|
Logger.Stub?.PrintStub(LogClass.ServiceBtm);
|
||||||
|
return ResultCode.Success;
|
||||||
|
}
|
||||||
|
|
||||||
[CommandCmif(6)]
|
[CommandCmif(6)]
|
||||||
// IsRadioEnabled() -> b8
|
// IsRadioEnabled() -> b8
|
||||||
public ResultCode IsRadioEnabled(ServiceCtx context)
|
public ResultCode IsRadioEnabled(ServiceCtx context)
|
||||||
{
|
{
|
||||||
context.ResponseData.Write(true);
|
context.ResponseData.Write(true);
|
||||||
|
|
||||||
Logger.Stub?.PrintStub(LogClass.ServiceBtm);
|
|
||||||
|
|
||||||
return ResultCode.Success;
|
return ResultCode.Success;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -150,6 +150,14 @@ namespace Ryujinx.HLE.HOS.Services.Hid
|
|||||||
return ResultCode.Success;
|
return ResultCode.Success;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
[CommandCmif(304)]
|
||||||
|
// EnableAssigningSingleOnSlSrPress()
|
||||||
|
public ResultCode EnableAssigningSingleOnSlSrPress(ServiceCtx context)
|
||||||
|
{
|
||||||
|
Logger.Stub?.PrintStub(LogClass.ServiceHid);
|
||||||
|
return ResultCode.Success;
|
||||||
|
}
|
||||||
|
|
||||||
[CommandCmif(306)]
|
[CommandCmif(306)]
|
||||||
// GetLastActiveNpad() -> nn::hid::NpadIdType
|
// GetLastActiveNpad() -> nn::hid::NpadIdType
|
||||||
public ResultCode GetLastActiveNpad(ServiceCtx context)
|
public ResultCode GetLastActiveNpad(ServiceCtx context)
|
||||||
@ -184,6 +192,28 @@ namespace Ryujinx.HLE.HOS.Services.Hid
|
|||||||
return ResultCode.Success;
|
return ResultCode.Success;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
[CommandCmif(310)]
|
||||||
|
// GetMaskedSupportedNpadStyleSet
|
||||||
|
public ResultCode GetMaskedSupportedNpadStyleSet(ServiceCtx context)
|
||||||
|
{
|
||||||
|
Logger.Stub?.PrintStub(LogClass.ServiceHid);
|
||||||
|
context.RequestData.ReadUInt32();
|
||||||
|
|
||||||
|
foreach (PlayerIndex playerIndex in context.Device.Hid.Npads.GetSupportedPlayers())
|
||||||
|
{
|
||||||
|
if (HidUtils.GetNpadIdTypeFromIndex(playerIndex) > NpadIdType.Handheld)
|
||||||
|
{
|
||||||
|
return ResultCode.InvalidNpadIdType;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// todo: wrong
|
||||||
|
// context.ResponseData.Write((ulong)context.Device.Hid.Npads.SupportedStyleSets);
|
||||||
|
context.ResponseData.Write((ulong)AppletFooterUiType.JoyDual);
|
||||||
|
context.ResponseData.Write((ulong)0);
|
||||||
|
return ResultCode.Success;
|
||||||
|
}
|
||||||
|
|
||||||
[CommandCmif(313)] // 9.0.0+
|
[CommandCmif(313)] // 9.0.0+
|
||||||
// GetNpadCaptureButtonAssignment()
|
// GetNpadCaptureButtonAssignment()
|
||||||
public ResultCode GetNpadCaptureButtonAssignment(ServiceCtx context)
|
public ResultCode GetNpadCaptureButtonAssignment(ServiceCtx context)
|
||||||
@ -203,6 +233,42 @@ namespace Ryujinx.HLE.HOS.Services.Hid
|
|||||||
return resultCode;
|
return resultCode;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
[CommandCmif(315)] // 9.0.0+
|
||||||
|
// GetAppletDetailedUiType(u32) -> u8
|
||||||
|
public ResultCode GetAppletDetailedUiType(ServiceCtx context)
|
||||||
|
{
|
||||||
|
ResultCode resultCode = GetAppletFooterUiTypeImpl(context, out AppletFooterUiType appletFooterUiType);
|
||||||
|
|
||||||
|
context.ResponseData.Write((byte)appletFooterUiType);
|
||||||
|
|
||||||
|
return resultCode;
|
||||||
|
}
|
||||||
|
|
||||||
|
[CommandCmif(316)]
|
||||||
|
// GetNpadInterfaceType() -> (u32, u8)
|
||||||
|
public ResultCode GetNpadInterfaceType(ServiceCtx context)
|
||||||
|
{
|
||||||
|
context.RequestData.ReadUInt32();
|
||||||
|
foreach (PlayerIndex playerIndex in context.Device.Hid.Npads.GetSupportedPlayers())
|
||||||
|
{
|
||||||
|
if (HidUtils.GetNpadIdTypeFromIndex(playerIndex) > NpadIdType.Handheld)
|
||||||
|
{
|
||||||
|
return ResultCode.InvalidNpadIdType;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
context.ResponseData.Write(1);
|
||||||
|
return ResultCode.Success;
|
||||||
|
}
|
||||||
|
|
||||||
|
[CommandCmif(318)]
|
||||||
|
// HasBattery(u32) -> bool
|
||||||
|
public ResultCode HasBattery(ServiceCtx context)
|
||||||
|
{
|
||||||
|
Logger.Stub?.PrintStub(LogClass.ServiceHid);
|
||||||
|
context.ResponseData.Write(true);
|
||||||
|
return ResultCode.Success;
|
||||||
|
}
|
||||||
|
|
||||||
[CommandCmif(321)]
|
[CommandCmif(321)]
|
||||||
// GetUniquePadsFromNpad(u32) -> (u64, buffer<nn::hid::system::UniquePadId[], 0xa>)
|
// GetUniquePadsFromNpad(u32) -> (u64, buffer<nn::hid::system::UniquePadId[], 0xa>)
|
||||||
public ResultCode GetUniquePadsFromNpad(ServiceCtx context)
|
public ResultCode GetUniquePadsFromNpad(ServiceCtx context)
|
||||||
@ -337,6 +403,16 @@ namespace Ryujinx.HLE.HOS.Services.Hid
|
|||||||
return ResultCode.Success;
|
return ResultCode.Success;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
[CommandCmif(548)]
|
||||||
|
// GetRegisteredDevices() -> (u64, buffer<nn::hid::system::RegisteredDevice, 0xa>)
|
||||||
|
public ResultCode GetRegisteredDevices(ServiceCtx context)
|
||||||
|
{
|
||||||
|
Logger.Stub?.PrintStub(LogClass.ServiceHid);
|
||||||
|
context.ResponseData.Write(0L);
|
||||||
|
return ResultCode.Success;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
[CommandCmif(703)]
|
[CommandCmif(703)]
|
||||||
// GetUniquePadIds() -> (u64, buffer<nn::hid::system::UniquePadId[], 0xa>)
|
// GetUniquePadIds() -> (u64, buffer<nn::hid::system::UniquePadId[], 0xa>)
|
||||||
public ResultCode GetUniquePadIds(ServiceCtx context)
|
public ResultCode GetUniquePadIds(ServiceCtx context)
|
||||||
@ -375,6 +451,13 @@ namespace Ryujinx.HLE.HOS.Services.Hid
|
|||||||
return ResultCode.Success;
|
return ResultCode.Success;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
[CommandCmif(870)]
|
||||||
|
// IsHandheldButtonPressedOnConsoleMode() -> bool
|
||||||
|
public ResultCode IsHandheldButtonPressedOnConsoleMode(ServiceCtx context)
|
||||||
|
{
|
||||||
|
context.ResponseData.Write(true);
|
||||||
|
return ResultCode.Success;
|
||||||
|
}
|
||||||
[CommandCmif(1120)]
|
[CommandCmif(1120)]
|
||||||
// Unknown1120()
|
// Unknown1120()
|
||||||
public ResultCode Unknown1120(ServiceCtx context)
|
public ResultCode Unknown1120(ServiceCtx context)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user