2018-10-17 13:15:50 -04:00
|
|
|
using Ryujinx.Common.Logging;
|
2018-08-16 19:47:36 -04:00
|
|
|
using Ryujinx.HLE.HOS.Ipc;
|
2018-12-18 00:33:36 -05:00
|
|
|
using Ryujinx.HLE.HOS.Kernel.Common;
|
|
|
|
using Ryujinx.HLE.HOS.Kernel.Threading;
|
2018-06-10 20:46:42 -04:00
|
|
|
using Ryujinx.HLE.Input;
|
2018-09-20 20:08:35 -04:00
|
|
|
using System;
|
2018-02-24 23:34:16 -05:00
|
|
|
using System.Collections.Generic;
|
|
|
|
|
2018-08-16 19:47:36 -04:00
|
|
|
namespace Ryujinx.HLE.HOS.Services.Hid
|
2018-02-24 23:34:16 -05:00
|
|
|
{
|
2018-09-18 19:36:43 -04:00
|
|
|
class IHidServer : IpcService
|
2018-02-24 23:34:16 -05:00
|
|
|
{
|
2018-12-06 06:16:24 -05:00
|
|
|
private Dictionary<int, ServiceProcessRequest> _commands;
|
2018-02-24 23:34:16 -05:00
|
|
|
|
2018-12-06 06:16:24 -05:00
|
|
|
private KEvent _npadStyleSetUpdateEvent;
|
|
|
|
private KEvent _xpadIdEvent;
|
|
|
|
private KEvent _palmaOperationCompleteEvent;
|
2018-09-20 20:08:35 -04:00
|
|
|
|
2018-12-06 06:16:24 -05:00
|
|
|
private int _xpadIdEventHandle;
|
2018-09-20 20:08:35 -04:00
|
|
|
|
2018-12-06 06:16:24 -05:00
|
|
|
private bool _sixAxisSensorFusionEnabled;
|
|
|
|
private bool _unintendedHomeButtonInputProtectionEnabled;
|
|
|
|
private bool _vibrationPermitted;
|
|
|
|
private bool _usbFullKeyControllerEnabled;
|
2018-09-20 20:08:35 -04:00
|
|
|
|
2018-12-06 06:16:24 -05:00
|
|
|
private HidNpadJoyHoldType _npadJoyHoldType;
|
|
|
|
private HidNpadStyle _npadStyleSet;
|
|
|
|
private HidNpadJoyAssignmentMode _npadJoyAssignmentMode;
|
|
|
|
private HidNpadHandheldActivationMode _npadHandheldActivationMode;
|
|
|
|
private HidGyroscopeZeroDriftMode _gyroscopeZeroDriftMode;
|
2018-09-20 20:08:35 -04:00
|
|
|
|
2018-12-06 06:16:24 -05:00
|
|
|
private long _npadCommunicationMode;
|
|
|
|
private uint _accelerometerPlayMode;
|
|
|
|
private long _vibrationGcErmCommand;
|
|
|
|
private float _sevenSixAxisSensorFusionStrength;
|
2018-09-20 20:08:35 -04:00
|
|
|
|
2018-12-06 06:16:24 -05:00
|
|
|
private HidSensorFusionParameters _sensorFusionParams;
|
|
|
|
private HidAccelerometerParameters _accelerometerParams;
|
|
|
|
private HidVibrationValue _vibrationValue;
|
2018-08-13 17:31:09 -04:00
|
|
|
|
2018-12-06 06:16:24 -05:00
|
|
|
public override IReadOnlyDictionary<int, ServiceProcessRequest> Commands => _commands;
|
2018-02-24 23:34:16 -05:00
|
|
|
|
2018-12-06 06:16:24 -05:00
|
|
|
public IHidServer(Horizon system)
|
2018-02-24 23:34:16 -05:00
|
|
|
{
|
2018-12-06 06:16:24 -05:00
|
|
|
_commands = new Dictionary<int, ServiceProcessRequest>
|
2018-02-24 23:34:16 -05:00
|
|
|
{
|
2018-09-20 20:08:35 -04:00
|
|
|
{ 0, CreateAppletResource },
|
|
|
|
{ 1, ActivateDebugPad },
|
|
|
|
{ 11, ActivateTouchScreen },
|
|
|
|
{ 21, ActivateMouse },
|
|
|
|
{ 31, ActivateKeyboard },
|
|
|
|
{ 40, AcquireXpadIdEventHandle },
|
|
|
|
{ 41, ReleaseXpadIdEventHandle },
|
|
|
|
{ 51, ActivateXpad },
|
|
|
|
{ 55, GetXpadIds },
|
|
|
|
{ 56, ActivateJoyXpad },
|
|
|
|
{ 58, GetJoyXpadLifoHandle },
|
|
|
|
{ 59, GetJoyXpadIds },
|
|
|
|
{ 60, ActivateSixAxisSensor },
|
|
|
|
{ 61, DeactivateSixAxisSensor },
|
|
|
|
{ 62, GetSixAxisSensorLifoHandle },
|
|
|
|
{ 63, ActivateJoySixAxisSensor },
|
|
|
|
{ 64, DeactivateJoySixAxisSensor },
|
|
|
|
{ 65, GetJoySixAxisSensorLifoHandle },
|
|
|
|
{ 66, StartSixAxisSensor },
|
|
|
|
{ 67, StopSixAxisSensor },
|
|
|
|
{ 68, IsSixAxisSensorFusionEnabled },
|
|
|
|
{ 69, EnableSixAxisSensorFusion },
|
|
|
|
{ 70, SetSixAxisSensorFusionParameters },
|
|
|
|
{ 71, GetSixAxisSensorFusionParameters },
|
|
|
|
{ 72, ResetSixAxisSensorFusionParameters },
|
|
|
|
{ 73, SetAccelerometerParameters },
|
|
|
|
{ 74, GetAccelerometerParameters },
|
|
|
|
{ 75, ResetAccelerometerParameters },
|
|
|
|
{ 76, SetAccelerometerPlayMode },
|
|
|
|
{ 77, GetAccelerometerPlayMode },
|
|
|
|
{ 78, ResetAccelerometerPlayMode },
|
|
|
|
{ 79, SetGyroscopeZeroDriftMode },
|
|
|
|
{ 80, GetGyroscopeZeroDriftMode },
|
|
|
|
{ 81, ResetGyroscopeZeroDriftMode },
|
|
|
|
{ 82, IsSixAxisSensorAtRest },
|
|
|
|
{ 91, ActivateGesture },
|
|
|
|
{ 100, SetSupportedNpadStyleSet },
|
|
|
|
{ 101, GetSupportedNpadStyleSet },
|
|
|
|
{ 102, SetSupportedNpadIdType },
|
|
|
|
{ 103, ActivateNpad },
|
|
|
|
{ 104, DeactivateNpad },
|
|
|
|
{ 106, AcquireNpadStyleSetUpdateEventHandle },
|
|
|
|
{ 107, DisconnectNpad },
|
|
|
|
{ 108, GetPlayerLedPattern },
|
|
|
|
{ 109, ActivateNpadWithRevision },
|
|
|
|
{ 120, SetNpadJoyHoldType },
|
|
|
|
{ 121, GetNpadJoyHoldType },
|
|
|
|
{ 122, SetNpadJoyAssignmentModeSingleByDefault },
|
|
|
|
{ 123, SetNpadJoyAssignmentModeSingle },
|
|
|
|
{ 124, SetNpadJoyAssignmentModeDual },
|
|
|
|
{ 125, MergeSingleJoyAsDualJoy },
|
|
|
|
{ 126, StartLrAssignmentMode },
|
|
|
|
{ 127, StopLrAssignmentMode },
|
|
|
|
{ 128, SetNpadHandheldActivationMode },
|
|
|
|
{ 129, GetNpadHandheldActivationMode },
|
|
|
|
{ 130, SwapNpadAssignment },
|
|
|
|
{ 131, IsUnintendedHomeButtonInputProtectionEnabled },
|
|
|
|
{ 132, EnableUnintendedHomeButtonInputProtection },
|
|
|
|
{ 133, SetNpadJoyAssignmentModeSingleWithDestination },
|
|
|
|
{ 200, GetVibrationDeviceInfo },
|
|
|
|
{ 201, SendVibrationValue },
|
|
|
|
{ 202, GetActualVibrationValue },
|
|
|
|
{ 203, CreateActiveVibrationDeviceList },
|
|
|
|
{ 204, PermitVibration },
|
|
|
|
{ 205, IsVibrationPermitted },
|
|
|
|
{ 206, SendVibrationValues },
|
|
|
|
{ 207, SendVibrationGcErmCommand },
|
|
|
|
{ 208, GetActualVibrationGcErmCommand },
|
|
|
|
{ 209, BeginPermitVibrationSession },
|
|
|
|
{ 210, EndPermitVibrationSession },
|
|
|
|
{ 300, ActivateConsoleSixAxisSensor },
|
|
|
|
{ 301, StartConsoleSixAxisSensor },
|
|
|
|
{ 302, StopConsoleSixAxisSensor },
|
|
|
|
{ 303, ActivateSevenSixAxisSensor },
|
|
|
|
{ 304, StartSevenSixAxisSensor },
|
|
|
|
{ 305, StopSevenSixAxisSensor },
|
|
|
|
{ 306, InitializeSevenSixAxisSensor },
|
|
|
|
{ 307, FinalizeSevenSixAxisSensor },
|
|
|
|
{ 308, SetSevenSixAxisSensorFusionStrength },
|
|
|
|
{ 309, GetSevenSixAxisSensorFusionStrength },
|
|
|
|
{ 400, IsUsbFullKeyControllerEnabled },
|
|
|
|
{ 401, EnableUsbFullKeyController },
|
|
|
|
{ 402, IsUsbFullKeyControllerConnected },
|
|
|
|
{ 403, HasBattery },
|
|
|
|
{ 404, HasLeftRightBattery },
|
|
|
|
{ 405, GetNpadInterfaceType },
|
|
|
|
{ 406, GetNpadLeftRightInterfaceType },
|
|
|
|
{ 500, GetPalmaConnectionHandle },
|
|
|
|
{ 501, InitializePalma },
|
|
|
|
{ 502, AcquirePalmaOperationCompleteEvent },
|
|
|
|
{ 503, GetPalmaOperationInfo },
|
|
|
|
{ 504, PlayPalmaActivity },
|
|
|
|
{ 505, SetPalmaFrModeType },
|
|
|
|
{ 506, ReadPalmaStep },
|
|
|
|
{ 507, EnablePalmaStep },
|
|
|
|
{ 508, SuspendPalmaStep },
|
|
|
|
{ 509, ResetPalmaStep },
|
|
|
|
{ 510, ReadPalmaApplicationSection },
|
|
|
|
{ 511, WritePalmaApplicationSection },
|
|
|
|
{ 512, ReadPalmaUniqueCode },
|
|
|
|
{ 513, SetPalmaUniqueCodeInvalid },
|
|
|
|
{ 1000, SetNpadCommunicationMode },
|
2018-12-06 06:16:24 -05:00
|
|
|
{ 1001, GetNpadCommunicationMode }
|
2018-02-24 23:34:16 -05:00
|
|
|
};
|
2018-08-13 17:31:09 -04:00
|
|
|
|
2018-12-06 06:16:24 -05:00
|
|
|
_npadStyleSetUpdateEvent = new KEvent(system);
|
|
|
|
_xpadIdEvent = new KEvent(system);
|
|
|
|
_palmaOperationCompleteEvent = new KEvent(system);
|
2018-09-20 20:08:35 -04:00
|
|
|
|
2018-12-06 06:16:24 -05:00
|
|
|
_npadJoyHoldType = HidNpadJoyHoldType.Vertical;
|
|
|
|
_npadStyleSet = HidNpadStyle.FullKey | HidNpadStyle.Dual | HidNpadStyle.Left | HidNpadStyle.Right | HidNpadStyle.Handheld;
|
|
|
|
_npadJoyAssignmentMode = HidNpadJoyAssignmentMode.Dual;
|
|
|
|
_npadHandheldActivationMode = HidNpadHandheldActivationMode.Dual;
|
|
|
|
_gyroscopeZeroDriftMode = HidGyroscopeZeroDriftMode.Standard;
|
2018-09-20 20:08:35 -04:00
|
|
|
|
2018-12-06 06:16:24 -05:00
|
|
|
_sensorFusionParams = new HidSensorFusionParameters();
|
|
|
|
_accelerometerParams = new HidAccelerometerParameters();
|
|
|
|
_vibrationValue = new HidVibrationValue();
|
2018-11-19 19:01:36 -05:00
|
|
|
|
|
|
|
// TODO: signal event at right place
|
2018-12-06 06:16:24 -05:00
|
|
|
_xpadIdEvent.ReadableEvent.Signal();
|
2018-02-24 23:34:16 -05:00
|
|
|
}
|
|
|
|
|
2018-09-20 20:08:35 -04:00
|
|
|
// CreateAppletResource(nn::applet::AppletResourceUserId) -> object<nn::hid::IAppletResource>
|
2018-12-06 06:16:24 -05:00
|
|
|
public long CreateAppletResource(ServiceCtx context)
|
2018-02-24 23:34:16 -05:00
|
|
|
{
|
2018-12-06 06:16:24 -05:00
|
|
|
long appletResourceUserId = context.RequestData.ReadInt64();
|
2018-09-20 20:08:35 -04:00
|
|
|
|
2018-12-06 06:16:24 -05:00
|
|
|
MakeObject(context, new IAppletResource(context.Device.System.HidSharedMem));
|
2018-02-24 23:34:16 -05:00
|
|
|
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
2018-09-20 20:08:35 -04:00
|
|
|
// ActivateDebugPad(nn::applet::AppletResourceUserId)
|
2018-12-06 06:16:24 -05:00
|
|
|
public long ActivateDebugPad(ServiceCtx context)
|
2018-04-04 18:16:59 -04:00
|
|
|
{
|
2018-12-06 06:16:24 -05:00
|
|
|
long appletResourceUserId = context.RequestData.ReadInt64();
|
2018-09-20 20:08:35 -04:00
|
|
|
|
2018-12-06 06:16:24 -05:00
|
|
|
Logger.PrintStub(LogClass.ServiceHid, $"Stubbed. AppletResourceUserId: {appletResourceUserId}");
|
2018-04-16 20:24:42 -04:00
|
|
|
|
2018-04-04 18:16:59 -04:00
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
2018-09-20 20:08:35 -04:00
|
|
|
// ActivateTouchScreen(nn::applet::AppletResourceUserId)
|
2018-12-06 06:16:24 -05:00
|
|
|
public long ActivateTouchScreen(ServiceCtx context)
|
2018-02-24 23:34:16 -05:00
|
|
|
{
|
2018-12-06 06:16:24 -05:00
|
|
|
long appletResourceUserId = context.RequestData.ReadInt64();
|
2018-04-04 18:39:47 -04:00
|
|
|
|
2018-12-06 06:16:24 -05:00
|
|
|
Logger.PrintStub(LogClass.ServiceHid, $"Stubbed. AppletResourceUserId: {appletResourceUserId}");
|
2018-04-16 20:24:42 -04:00
|
|
|
|
2018-04-04 18:39:47 -04:00
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
2018-09-20 20:08:35 -04:00
|
|
|
// ActivateMouse(nn::applet::AppletResourceUserId)
|
2018-12-06 06:16:24 -05:00
|
|
|
public long ActivateMouse(ServiceCtx context)
|
2018-04-04 18:39:47 -04:00
|
|
|
{
|
2018-12-06 06:16:24 -05:00
|
|
|
long appletResourceUserId = context.RequestData.ReadInt64();
|
2018-02-24 23:34:16 -05:00
|
|
|
|
2018-12-06 06:16:24 -05:00
|
|
|
Logger.PrintStub(LogClass.ServiceHid, $"Stubbed. AppletResourceUserId: {appletResourceUserId}");
|
2018-04-16 20:24:42 -04:00
|
|
|
|
2018-02-24 23:34:16 -05:00
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
2018-09-20 20:08:35 -04:00
|
|
|
// ActivateKeyboard(nn::applet::AppletResourceUserId)
|
2018-12-06 06:16:24 -05:00
|
|
|
public long ActivateKeyboard(ServiceCtx context)
|
2018-04-04 18:44:02 -04:00
|
|
|
{
|
2018-12-06 06:16:24 -05:00
|
|
|
long appletResourceUserId = context.RequestData.ReadInt64();
|
2018-04-04 18:44:02 -04:00
|
|
|
|
2018-12-06 06:16:24 -05:00
|
|
|
Logger.PrintStub(LogClass.ServiceHid, $"Stubbed. AppletResourceUserId: {appletResourceUserId}");
|
2018-09-20 20:08:35 -04:00
|
|
|
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
// AcquireXpadIdEventHandle(ulong XpadId) -> nn::sf::NativeHandle
|
2018-12-06 06:16:24 -05:00
|
|
|
public long AcquireXpadIdEventHandle(ServiceCtx context)
|
2018-09-20 20:08:35 -04:00
|
|
|
{
|
2018-12-06 06:16:24 -05:00
|
|
|
long xpadId = context.RequestData.ReadInt64();
|
2018-09-20 20:08:35 -04:00
|
|
|
|
2018-12-06 06:16:24 -05:00
|
|
|
if (context.Process.HandleTable.GenerateHandle(_xpadIdEvent.ReadableEvent, out _xpadIdEventHandle) != KernelResult.Success)
|
2018-09-23 14:11:46 -04:00
|
|
|
{
|
|
|
|
throw new InvalidOperationException("Out of handles!");
|
|
|
|
}
|
2018-09-20 20:08:35 -04:00
|
|
|
|
2018-12-06 06:16:24 -05:00
|
|
|
context.Response.HandleDesc = IpcHandleDesc.MakeCopy(_xpadIdEventHandle);
|
2018-09-20 20:08:35 -04:00
|
|
|
|
2018-12-06 06:16:24 -05:00
|
|
|
Logger.PrintStub(LogClass.ServiceHid, $"Stubbed. XpadId: {xpadId}");
|
2018-09-20 20:08:35 -04:00
|
|
|
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
// ReleaseXpadIdEventHandle(ulong XpadId)
|
2018-12-06 06:16:24 -05:00
|
|
|
public long ReleaseXpadIdEventHandle(ServiceCtx context)
|
2018-09-20 20:08:35 -04:00
|
|
|
{
|
2018-12-06 06:16:24 -05:00
|
|
|
long xpadId = context.RequestData.ReadInt64();
|
2018-09-20 20:08:35 -04:00
|
|
|
|
2018-12-06 06:16:24 -05:00
|
|
|
context.Process.HandleTable.CloseHandle(_xpadIdEventHandle);
|
2018-09-20 20:08:35 -04:00
|
|
|
|
2018-12-06 06:16:24 -05:00
|
|
|
Logger.PrintStub(LogClass.ServiceHid, $"Stubbed. XpadId: {xpadId}");
|
2018-09-20 20:08:35 -04:00
|
|
|
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
// ActivateXpad(nn::hid::BasicXpadId, nn::applet::AppletResourceUserId)
|
2018-12-06 06:16:24 -05:00
|
|
|
public long ActivateXpad(ServiceCtx context)
|
2018-09-20 20:08:35 -04:00
|
|
|
{
|
2018-12-06 06:16:24 -05:00
|
|
|
int basicXpadId = context.RequestData.ReadInt32();
|
|
|
|
long appletResourceUserId = context.RequestData.ReadInt64();
|
2018-09-20 20:08:35 -04:00
|
|
|
|
2018-12-06 06:16:24 -05:00
|
|
|
Logger.PrintStub(LogClass.ServiceHid, $"Stubbed. AppletResourceUserId: {appletResourceUserId} - " +
|
|
|
|
$"BasicXpadId: {basicXpadId}");
|
2018-09-20 20:08:35 -04:00
|
|
|
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
// GetXpadIds() -> long IdsCount, buffer<array<nn::hid::BasicXpadId>, type: 0xa>
|
2018-12-06 06:16:24 -05:00
|
|
|
public long GetXpadIds(ServiceCtx context)
|
2018-09-20 20:08:35 -04:00
|
|
|
{
|
|
|
|
// There is any Xpad, so we return 0 and write nothing inside the type-0xa buffer.
|
2018-12-06 06:16:24 -05:00
|
|
|
context.ResponseData.Write(0L);
|
2018-09-20 20:08:35 -04:00
|
|
|
|
2018-10-17 13:15:50 -04:00
|
|
|
Logger.PrintStub(LogClass.ServiceHid, $"Stubbed.");
|
2018-09-20 20:08:35 -04:00
|
|
|
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
// ActivateJoyXpad(nn::hid::JoyXpadId)
|
2018-12-06 06:16:24 -05:00
|
|
|
public long ActivateJoyXpad(ServiceCtx context)
|
2018-09-20 20:08:35 -04:00
|
|
|
{
|
2018-12-06 06:16:24 -05:00
|
|
|
int joyXpadId = context.RequestData.ReadInt32();
|
2018-09-20 20:08:35 -04:00
|
|
|
|
2018-12-06 06:16:24 -05:00
|
|
|
Logger.PrintStub(LogClass.ServiceHid, $"Stubbed. JoyXpadId: {joyXpadId}");
|
2018-09-20 20:08:35 -04:00
|
|
|
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
// GetJoyXpadLifoHandle(nn::hid::JoyXpadId) -> nn::sf::NativeHandle
|
2018-12-06 06:16:24 -05:00
|
|
|
public long GetJoyXpadLifoHandle(ServiceCtx context)
|
2018-09-20 20:08:35 -04:00
|
|
|
{
|
2018-12-06 06:16:24 -05:00
|
|
|
int joyXpadId = context.RequestData.ReadInt32();
|
2018-09-20 20:08:35 -04:00
|
|
|
|
2018-12-06 06:16:24 -05:00
|
|
|
int handle = 0;
|
2018-09-20 20:08:35 -04:00
|
|
|
|
2018-12-06 06:16:24 -05:00
|
|
|
context.Response.HandleDesc = IpcHandleDesc.MakeCopy(handle);
|
2018-09-20 20:08:35 -04:00
|
|
|
|
2018-12-06 06:16:24 -05:00
|
|
|
Logger.PrintStub(LogClass.ServiceHid, $"Stubbed. JoyXpadId: {joyXpadId}");
|
2018-09-20 20:08:35 -04:00
|
|
|
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
// GetJoyXpadIds() -> long IdsCount, buffer<array<nn::hid::JoyXpadId>, type: 0xa>
|
2018-12-06 06:16:24 -05:00
|
|
|
public long GetJoyXpadIds(ServiceCtx context)
|
2018-09-20 20:08:35 -04:00
|
|
|
{
|
|
|
|
// There is any JoyXpad, so we return 0 and write nothing inside the type-0xa buffer.
|
2018-12-06 06:16:24 -05:00
|
|
|
context.ResponseData.Write(0L);
|
2018-09-20 20:08:35 -04:00
|
|
|
|
2018-10-17 13:15:50 -04:00
|
|
|
Logger.PrintStub(LogClass.ServiceHid, $"Stubbed.");
|
2018-09-20 20:08:35 -04:00
|
|
|
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
// ActivateSixAxisSensor(nn::hid::BasicXpadId)
|
2018-12-06 06:16:24 -05:00
|
|
|
public long ActivateSixAxisSensor(ServiceCtx context)
|
2018-09-20 20:08:35 -04:00
|
|
|
{
|
2018-12-06 06:16:24 -05:00
|
|
|
int basicXpadId = context.RequestData.ReadInt32();
|
2018-09-20 20:08:35 -04:00
|
|
|
|
2018-12-06 06:16:24 -05:00
|
|
|
Logger.PrintStub(LogClass.ServiceHid, $"Stubbed. BasicXpadId: {basicXpadId}");
|
2018-09-20 20:08:35 -04:00
|
|
|
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
// DeactivateSixAxisSensor(nn::hid::BasicXpadId)
|
2018-12-06 06:16:24 -05:00
|
|
|
public long DeactivateSixAxisSensor(ServiceCtx context)
|
2018-09-20 20:08:35 -04:00
|
|
|
{
|
2018-12-06 06:16:24 -05:00
|
|
|
int basicXpadId = context.RequestData.ReadInt32();
|
2018-09-20 20:08:35 -04:00
|
|
|
|
2018-12-06 06:16:24 -05:00
|
|
|
Logger.PrintStub(LogClass.ServiceHid, $"Stubbed. BasicXpadId: {basicXpadId}");
|
2018-09-20 20:08:35 -04:00
|
|
|
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
// GetSixAxisSensorLifoHandle(nn::hid::BasicXpadId) -> nn::sf::NativeHandle
|
2018-12-06 06:16:24 -05:00
|
|
|
public long GetSixAxisSensorLifoHandle(ServiceCtx context)
|
2018-09-20 20:08:35 -04:00
|
|
|
{
|
2018-12-06 06:16:24 -05:00
|
|
|
int basicXpadId = context.RequestData.ReadInt32();
|
2018-09-20 20:08:35 -04:00
|
|
|
|
2018-12-06 06:16:24 -05:00
|
|
|
int handle = 0;
|
2018-09-20 20:08:35 -04:00
|
|
|
|
2018-12-06 06:16:24 -05:00
|
|
|
context.Response.HandleDesc = IpcHandleDesc.MakeCopy(handle);
|
2018-09-20 20:08:35 -04:00
|
|
|
|
2018-12-06 06:16:24 -05:00
|
|
|
Logger.PrintStub(LogClass.ServiceHid, $"Stubbed. BasicXpadId: {basicXpadId}");
|
2018-09-20 20:08:35 -04:00
|
|
|
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
// ActivateJoySixAxisSensor(nn::hid::JoyXpadId)
|
2018-12-06 06:16:24 -05:00
|
|
|
public long ActivateJoySixAxisSensor(ServiceCtx context)
|
2018-09-20 20:08:35 -04:00
|
|
|
{
|
2018-12-06 06:16:24 -05:00
|
|
|
int joyXpadId = context.RequestData.ReadInt32();
|
2018-09-20 20:08:35 -04:00
|
|
|
|
2018-12-06 06:16:24 -05:00
|
|
|
Logger.PrintStub(LogClass.ServiceHid, $"Stubbed. JoyXpadId: {joyXpadId}");
|
2018-09-20 20:08:35 -04:00
|
|
|
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
// DeactivateJoySixAxisSensor(nn::hid::JoyXpadId)
|
2018-12-06 06:16:24 -05:00
|
|
|
public long DeactivateJoySixAxisSensor(ServiceCtx context)
|
2018-09-20 20:08:35 -04:00
|
|
|
{
|
2018-12-06 06:16:24 -05:00
|
|
|
int joyXpadId = context.RequestData.ReadInt32();
|
2018-09-20 20:08:35 -04:00
|
|
|
|
2018-12-06 06:16:24 -05:00
|
|
|
Logger.PrintStub(LogClass.ServiceHid, $"Stubbed. JoyXpadId: {joyXpadId}");
|
2018-09-20 20:08:35 -04:00
|
|
|
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
// GetJoySixAxisSensorLifoHandle(nn::hid::JoyXpadId) -> nn::sf::NativeHandle
|
2018-12-06 06:16:24 -05:00
|
|
|
public long GetJoySixAxisSensorLifoHandle(ServiceCtx context)
|
2018-09-20 20:08:35 -04:00
|
|
|
{
|
2018-12-06 06:16:24 -05:00
|
|
|
int joyXpadId = context.RequestData.ReadInt32();
|
2018-09-20 20:08:35 -04:00
|
|
|
|
2018-12-06 06:16:24 -05:00
|
|
|
int handle = 0;
|
2018-09-20 20:08:35 -04:00
|
|
|
|
2018-12-06 06:16:24 -05:00
|
|
|
context.Response.HandleDesc = IpcHandleDesc.MakeCopy(handle);
|
2018-09-20 20:08:35 -04:00
|
|
|
|
2018-12-06 06:16:24 -05:00
|
|
|
Logger.PrintStub(LogClass.ServiceHid, $"Stubbed. JoyXpadId: {joyXpadId}");
|
2018-04-16 20:24:42 -04:00
|
|
|
|
2018-04-04 18:44:02 -04:00
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
2018-09-20 20:08:35 -04:00
|
|
|
// StartSixAxisSensor(nn::hid::SixAxisSensorHandle, nn::applet::AppletResourceUserId)
|
2018-12-06 06:16:24 -05:00
|
|
|
public long StartSixAxisSensor(ServiceCtx context)
|
2018-03-13 20:26:14 -04:00
|
|
|
{
|
2018-12-06 06:16:24 -05:00
|
|
|
int sixAxisSensorHandle = context.RequestData.ReadInt32();
|
|
|
|
long appletResourceUserId = context.RequestData.ReadInt64();
|
2018-09-20 20:08:35 -04:00
|
|
|
|
2018-12-06 06:16:24 -05:00
|
|
|
Logger.PrintStub(LogClass.ServiceHid, $"Stubbed. AppletResourceUserId: {appletResourceUserId} - " +
|
|
|
|
$"SixAxisSensorHandle: {sixAxisSensorHandle}");
|
2018-09-20 20:08:35 -04:00
|
|
|
|
|
|
|
return 0;
|
|
|
|
}
|
2018-03-13 20:26:14 -04:00
|
|
|
|
2018-09-20 20:08:35 -04:00
|
|
|
// StopSixAxisSensor(nn::hid::SixAxisSensorHandle, nn::applet::AppletResourceUserId)
|
2018-12-06 06:16:24 -05:00
|
|
|
public long StopSixAxisSensor(ServiceCtx context)
|
2018-09-20 20:08:35 -04:00
|
|
|
{
|
2018-12-06 06:16:24 -05:00
|
|
|
int sixAxisSensorHandle = context.RequestData.ReadInt32();
|
|
|
|
long appletResourceUserId = context.RequestData.ReadInt64();
|
2018-03-13 20:26:14 -04:00
|
|
|
|
2018-12-06 06:16:24 -05:00
|
|
|
Logger.PrintStub(LogClass.ServiceHid, $"Stubbed. AppletResourceUserId: {appletResourceUserId} - " +
|
|
|
|
$"SixAxisSensorHandle: {sixAxisSensorHandle}");
|
2018-04-16 20:24:42 -04:00
|
|
|
|
2018-03-13 20:26:14 -04:00
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
2018-09-20 20:08:35 -04:00
|
|
|
// IsSixAxisSensorFusionEnabled(nn::hid::SixAxisSensorHandle, nn::applet::AppletResourceUserId) -> bool IsEnabled
|
2018-12-06 06:16:24 -05:00
|
|
|
public long IsSixAxisSensorFusionEnabled(ServiceCtx context)
|
2018-04-17 12:40:22 -04:00
|
|
|
{
|
2018-12-06 06:16:24 -05:00
|
|
|
int sixAxisSensorHandle = context.RequestData.ReadInt32();
|
|
|
|
long appletResourceUserId = context.RequestData.ReadInt64();
|
2018-04-17 12:40:22 -04:00
|
|
|
|
2018-12-06 06:16:24 -05:00
|
|
|
context.ResponseData.Write(_sixAxisSensorFusionEnabled);
|
2018-09-20 20:08:35 -04:00
|
|
|
|
2018-12-06 06:16:24 -05:00
|
|
|
Logger.PrintStub(LogClass.ServiceHid, $"Stubbed. AppletResourceUserId: {appletResourceUserId} - " +
|
|
|
|
$"SixAxisSensorHandle: {sixAxisSensorHandle} - " +
|
|
|
|
$"SixAxisSensorFusionEnabled: {_sixAxisSensorFusionEnabled}");
|
2018-04-17 12:40:22 -04:00
|
|
|
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
2018-09-20 20:08:35 -04:00
|
|
|
// EnableSixAxisSensorFusion(bool Enabled, nn::hid::SixAxisSensorHandle, nn::applet::AppletResourceUserId)
|
2018-12-06 06:16:24 -05:00
|
|
|
public long EnableSixAxisSensorFusion(ServiceCtx context)
|
2018-08-13 17:31:09 -04:00
|
|
|
{
|
2018-12-06 06:16:24 -05:00
|
|
|
_sixAxisSensorFusionEnabled = context.RequestData.ReadBoolean();
|
|
|
|
int sixAxisSensorHandle = context.RequestData.ReadInt32();
|
|
|
|
long appletResourceUserId = context.RequestData.ReadInt64();
|
2018-09-23 14:11:46 -04:00
|
|
|
|
2018-12-06 06:16:24 -05:00
|
|
|
Logger.PrintStub(LogClass.ServiceHid, $"Stubbed. AppletResourceUserId: {appletResourceUserId} - " +
|
|
|
|
$"SixAxisSensorHandle: {sixAxisSensorHandle} - " +
|
|
|
|
$"SixAxisSensorFusionEnabled: {_sixAxisSensorFusionEnabled}");
|
2018-08-13 17:31:09 -04:00
|
|
|
|
2018-09-20 20:08:35 -04:00
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
// SetSixAxisSensorFusionParameters(nn::hid::SixAxisSensorHandle, float RevisePower, float ReviseRange, nn::applet::AppletResourceUserId)
|
2018-12-06 06:16:24 -05:00
|
|
|
public long SetSixAxisSensorFusionParameters(ServiceCtx context)
|
2018-09-20 20:08:35 -04:00
|
|
|
{
|
2018-12-06 06:16:24 -05:00
|
|
|
int sixAxisSensorHandle = context.RequestData.ReadInt32();
|
2018-09-20 20:08:35 -04:00
|
|
|
|
2018-12-06 06:16:24 -05:00
|
|
|
_sensorFusionParams = new HidSensorFusionParameters
|
2018-09-20 20:08:35 -04:00
|
|
|
{
|
2018-12-06 06:16:24 -05:00
|
|
|
RevisePower = context.RequestData.ReadInt32(),
|
|
|
|
ReviseRange = context.RequestData.ReadInt32()
|
2018-09-20 20:08:35 -04:00
|
|
|
};
|
|
|
|
|
2018-12-06 06:16:24 -05:00
|
|
|
long appletResourceUserId = context.RequestData.ReadInt64();
|
2018-09-20 20:08:35 -04:00
|
|
|
|
2018-12-06 06:16:24 -05:00
|
|
|
Logger.PrintStub(LogClass.ServiceHid, $"Stubbed. AppletResourceUserId: {appletResourceUserId} - " +
|
|
|
|
$"SixAxisSensorHandle: {sixAxisSensorHandle} - " +
|
|
|
|
$"RevisePower: {_sensorFusionParams.RevisePower} - " +
|
|
|
|
$"ReviseRange: {_sensorFusionParams.ReviseRange}");
|
2018-08-13 17:31:09 -04:00
|
|
|
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
2018-09-20 20:08:35 -04:00
|
|
|
// GetSixAxisSensorFusionParameters(nn::hid::SixAxisSensorHandle, nn::applet::AppletResourceUserId) -> float RevisePower, float ReviseRange)
|
2018-12-06 06:16:24 -05:00
|
|
|
public long GetSixAxisSensorFusionParameters(ServiceCtx context)
|
2018-09-20 20:08:35 -04:00
|
|
|
{
|
2018-12-06 06:16:24 -05:00
|
|
|
int sixAxisSensorHandle = context.RequestData.ReadInt32();
|
|
|
|
long appletResourceUserId = context.RequestData.ReadInt64();
|
2018-09-20 20:08:35 -04:00
|
|
|
|
2018-12-06 06:16:24 -05:00
|
|
|
context.ResponseData.Write(_sensorFusionParams.RevisePower);
|
|
|
|
context.ResponseData.Write(_sensorFusionParams.ReviseRange);
|
2018-09-20 20:08:35 -04:00
|
|
|
|
2018-12-06 06:16:24 -05:00
|
|
|
Logger.PrintStub(LogClass.ServiceHid, $"Stubbed. AppletResourceUserId: {appletResourceUserId} - " +
|
|
|
|
$"SixAxisSensorHandle: {sixAxisSensorHandle} - " +
|
|
|
|
$"RevisePower: {_sensorFusionParams.RevisePower} - " +
|
|
|
|
$"ReviseRange: {_sensorFusionParams.ReviseRange}");
|
2018-09-20 20:08:35 -04:00
|
|
|
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
// ResetSixAxisSensorFusionParameters(nn::hid::SixAxisSensorHandle, nn::applet::AppletResourceUserId)
|
2018-12-06 06:16:24 -05:00
|
|
|
public long ResetSixAxisSensorFusionParameters(ServiceCtx context)
|
2018-02-24 23:34:16 -05:00
|
|
|
{
|
2018-12-06 06:16:24 -05:00
|
|
|
int sixAxisSensorHandle = context.RequestData.ReadInt32();
|
|
|
|
long appletResourceUserId = context.RequestData.ReadInt64();
|
2018-02-24 23:34:16 -05:00
|
|
|
|
2018-12-06 06:16:24 -05:00
|
|
|
_sensorFusionParams.RevisePower = 0;
|
|
|
|
_sensorFusionParams.ReviseRange = 0;
|
2018-09-20 20:08:35 -04:00
|
|
|
|
2018-12-06 06:16:24 -05:00
|
|
|
Logger.PrintStub(LogClass.ServiceHid, $"Stubbed. AppletResourceUserId: {appletResourceUserId} - " +
|
|
|
|
$"SixAxisSensorHandle: {sixAxisSensorHandle} - " +
|
|
|
|
$"RevisePower: {_sensorFusionParams.RevisePower} - " +
|
|
|
|
$"ReviseRange: {_sensorFusionParams.ReviseRange}");
|
2018-04-16 20:24:42 -04:00
|
|
|
|
2018-02-24 23:34:16 -05:00
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
2018-09-20 20:08:35 -04:00
|
|
|
// SetAccelerometerParameters(nn::hid::SixAxisSensorHandle, float X, float Y, nn::applet::AppletResourceUserId)
|
2018-12-06 06:16:24 -05:00
|
|
|
public long SetAccelerometerParameters(ServiceCtx context)
|
2018-02-24 23:34:16 -05:00
|
|
|
{
|
2018-12-06 06:16:24 -05:00
|
|
|
int sixAxisSensorHandle = context.RequestData.ReadInt32();
|
2018-09-20 20:08:35 -04:00
|
|
|
|
2018-12-06 06:16:24 -05:00
|
|
|
_accelerometerParams = new HidAccelerometerParameters
|
2018-09-20 20:08:35 -04:00
|
|
|
{
|
2018-12-06 06:16:24 -05:00
|
|
|
X = context.RequestData.ReadInt32(),
|
|
|
|
Y = context.RequestData.ReadInt32()
|
2018-09-20 20:08:35 -04:00
|
|
|
};
|
|
|
|
|
2018-12-06 06:16:24 -05:00
|
|
|
long appletResourceUserId = context.RequestData.ReadInt64();
|
2018-02-24 23:34:16 -05:00
|
|
|
|
2018-12-06 06:16:24 -05:00
|
|
|
Logger.PrintStub(LogClass.ServiceHid, $"Stubbed. AppletResourceUserId: {appletResourceUserId} - " +
|
|
|
|
$"SixAxisSensorHandle: {sixAxisSensorHandle} - " +
|
|
|
|
$"X: {_accelerometerParams.X} - " +
|
|
|
|
$"Y: {_accelerometerParams.Y}");
|
2018-04-16 20:24:42 -04:00
|
|
|
|
2018-02-24 23:34:16 -05:00
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
2018-09-20 20:08:35 -04:00
|
|
|
// GetAccelerometerParameters(nn::hid::SixAxisSensorHandle, nn::applet::AppletResourceUserId) -> float X, float Y
|
2018-12-06 06:16:24 -05:00
|
|
|
public long GetAccelerometerParameters(ServiceCtx context)
|
2018-02-24 23:34:16 -05:00
|
|
|
{
|
2018-12-06 06:16:24 -05:00
|
|
|
int sixAxisSensorHandle = context.RequestData.ReadInt32();
|
|
|
|
long appletResourceUserId = context.RequestData.ReadInt64();
|
2018-09-20 20:08:35 -04:00
|
|
|
|
2018-12-06 06:16:24 -05:00
|
|
|
context.ResponseData.Write(_accelerometerParams.X);
|
|
|
|
context.ResponseData.Write(_accelerometerParams.Y);
|
2018-02-24 23:34:16 -05:00
|
|
|
|
2018-12-06 06:16:24 -05:00
|
|
|
Logger.PrintStub(LogClass.ServiceHid, $"Stubbed. AppletResourceUserId: {appletResourceUserId} - " +
|
|
|
|
$"SixAxisSensorHandle: {sixAxisSensorHandle} - " +
|
|
|
|
$"X: {_accelerometerParams.X} - " +
|
|
|
|
$"Y: {_accelerometerParams.Y}");
|
2018-04-16 20:24:42 -04:00
|
|
|
|
2018-02-24 23:34:16 -05:00
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
2018-09-20 20:08:35 -04:00
|
|
|
// ResetAccelerometerParameters(nn::hid::SixAxisSensorHandle, nn::applet::AppletResourceUserId)
|
2018-12-06 06:16:24 -05:00
|
|
|
public long ResetAccelerometerParameters(ServiceCtx context)
|
2018-02-24 23:34:16 -05:00
|
|
|
{
|
2018-12-06 06:16:24 -05:00
|
|
|
int sixAxisSensorHandle = context.RequestData.ReadInt32();
|
|
|
|
long appletResourceUserId = context.RequestData.ReadInt64();
|
2018-02-24 23:34:16 -05:00
|
|
|
|
2018-12-06 06:16:24 -05:00
|
|
|
_accelerometerParams.X = 0;
|
|
|
|
_accelerometerParams.Y = 0;
|
2018-09-20 20:08:35 -04:00
|
|
|
|
2018-12-06 06:16:24 -05:00
|
|
|
Logger.PrintStub(LogClass.ServiceHid, $"Stubbed. AppletResourceUserId: {appletResourceUserId} - " +
|
|
|
|
$"SixAxisSensorHandle: {sixAxisSensorHandle} - " +
|
|
|
|
$"X: {_accelerometerParams.X} - " +
|
|
|
|
$"Y: {_accelerometerParams.Y}");
|
2018-04-16 20:24:42 -04:00
|
|
|
|
2018-02-24 23:34:16 -05:00
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
2018-09-20 20:08:35 -04:00
|
|
|
// SetAccelerometerPlayMode(nn::hid::SixAxisSensorHandle, uint PlayMode, nn::applet::AppletResourceUserId)
|
2018-12-06 06:16:24 -05:00
|
|
|
public long SetAccelerometerPlayMode(ServiceCtx context)
|
2018-04-17 12:40:22 -04:00
|
|
|
{
|
2018-12-06 06:16:24 -05:00
|
|
|
int sixAxisSensorHandle = context.RequestData.ReadInt32();
|
|
|
|
_accelerometerPlayMode = context.RequestData.ReadUInt32();
|
|
|
|
long appletResourceUserId = context.RequestData.ReadInt64();
|
2018-04-17 12:40:22 -04:00
|
|
|
|
2018-12-06 06:16:24 -05:00
|
|
|
Logger.PrintStub(LogClass.ServiceHid, $"Stubbed. AppletResourceUserId: {appletResourceUserId} - " +
|
|
|
|
$"SixAxisSensorHandle: {sixAxisSensorHandle} - " +
|
|
|
|
$"PlayMode: {_accelerometerPlayMode}");
|
2018-09-20 20:08:35 -04:00
|
|
|
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
// GetAccelerometerPlayMode(nn::hid::SixAxisSensorHandle, nn::applet::AppletResourceUserId) -> uint PlayMode
|
2018-12-06 06:16:24 -05:00
|
|
|
public long GetAccelerometerPlayMode(ServiceCtx context)
|
2018-09-20 20:08:35 -04:00
|
|
|
{
|
2018-12-06 06:16:24 -05:00
|
|
|
int sixAxisSensorHandle = context.RequestData.ReadInt32();
|
|
|
|
long appletResourceUserId = context.RequestData.ReadInt64();
|
2018-09-20 20:08:35 -04:00
|
|
|
|
2018-12-06 06:16:24 -05:00
|
|
|
context.ResponseData.Write(_accelerometerPlayMode);
|
2018-04-17 12:40:22 -04:00
|
|
|
|
2018-12-06 06:16:24 -05:00
|
|
|
Logger.PrintStub(LogClass.ServiceHid, $"Stubbed. AppletResourceUserId: {appletResourceUserId} - " +
|
|
|
|
$"SixAxisSensorHandle: {sixAxisSensorHandle} - " +
|
|
|
|
$"PlayMode: {_accelerometerPlayMode}");
|
2018-04-17 12:40:22 -04:00
|
|
|
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
2018-09-20 20:08:35 -04:00
|
|
|
// ResetAccelerometerPlayMode(nn::hid::SixAxisSensorHandle, nn::applet::AppletResourceUserId)
|
2018-12-06 06:16:24 -05:00
|
|
|
public long ResetAccelerometerPlayMode(ServiceCtx context)
|
2018-02-24 23:34:16 -05:00
|
|
|
{
|
2018-12-06 06:16:24 -05:00
|
|
|
int sixAxisSensorHandle = context.RequestData.ReadInt32();
|
|
|
|
long appletResourceUserId = context.RequestData.ReadInt64();
|
2018-02-24 23:34:16 -05:00
|
|
|
|
2018-12-06 06:16:24 -05:00
|
|
|
_accelerometerPlayMode = 0;
|
2018-09-20 20:08:35 -04:00
|
|
|
|
2018-12-06 06:16:24 -05:00
|
|
|
Logger.PrintStub(LogClass.ServiceHid, $"Stubbed. AppletResourceUserId: {appletResourceUserId} - " +
|
|
|
|
$"SixAxisSensorHandle: {sixAxisSensorHandle} - " +
|
|
|
|
$"PlayMode: {_accelerometerPlayMode}");
|
2018-04-16 20:24:42 -04:00
|
|
|
|
2018-02-24 23:34:16 -05:00
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
2018-09-20 20:08:35 -04:00
|
|
|
// SetGyroscopeZeroDriftMode(nn::hid::SixAxisSensorHandle, uint GyroscopeZeroDriftMode, nn::applet::AppletResourceUserId)
|
2018-12-06 06:16:24 -05:00
|
|
|
public long SetGyroscopeZeroDriftMode(ServiceCtx context)
|
2018-02-24 23:34:16 -05:00
|
|
|
{
|
2018-12-06 06:16:24 -05:00
|
|
|
int sixAxisSensorHandle = context.RequestData.ReadInt32();
|
|
|
|
_gyroscopeZeroDriftMode = (HidGyroscopeZeroDriftMode)context.RequestData.ReadInt32();
|
|
|
|
long appletResourceUserId = context.RequestData.ReadInt64();
|
2018-02-24 23:34:16 -05:00
|
|
|
|
2018-12-06 06:16:24 -05:00
|
|
|
Logger.PrintStub(LogClass.ServiceHid, $"Stubbed. AppletResourceUserId: {appletResourceUserId} - " +
|
|
|
|
$"SixAxisSensorHandle: {sixAxisSensorHandle} - " +
|
|
|
|
$"GyroscopeZeroDriftMode: {_gyroscopeZeroDriftMode}");
|
2018-04-16 20:24:42 -04:00
|
|
|
|
2018-02-24 23:34:16 -05:00
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
2018-09-20 20:08:35 -04:00
|
|
|
// GetGyroscopeZeroDriftMode(nn::applet::AppletResourceUserId, nn::hid::SixAxisSensorHandle) -> int GyroscopeZeroDriftMode
|
2018-12-06 06:16:24 -05:00
|
|
|
public long GetGyroscopeZeroDriftMode(ServiceCtx context)
|
2018-03-13 17:59:17 -04:00
|
|
|
{
|
2018-12-06 06:16:24 -05:00
|
|
|
int sixAxisSensorHandle = context.RequestData.ReadInt32();
|
|
|
|
long appletResourceUserId = context.RequestData.ReadInt64();
|
2018-04-24 14:57:39 -04:00
|
|
|
|
2018-12-06 06:16:24 -05:00
|
|
|
context.ResponseData.Write((int)_gyroscopeZeroDriftMode);
|
2018-03-13 17:59:17 -04:00
|
|
|
|
2018-12-06 06:16:24 -05:00
|
|
|
Logger.PrintStub(LogClass.ServiceHid, $"Stubbed. AppletResourceUserId: {appletResourceUserId} - " +
|
|
|
|
$"SixAxisSensorHandle: {sixAxisSensorHandle} - " +
|
|
|
|
$"GyroscopeZeroDriftMode: {_gyroscopeZeroDriftMode}");
|
2018-04-16 20:24:42 -04:00
|
|
|
|
2018-03-13 17:59:17 -04:00
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
2018-09-20 20:08:35 -04:00
|
|
|
// ResetGyroscopeZeroDriftMode(nn::hid::SixAxisSensorHandle, nn::applet::AppletResourceUserId)
|
2018-12-06 06:16:24 -05:00
|
|
|
public long ResetGyroscopeZeroDriftMode(ServiceCtx context)
|
2018-03-13 17:59:17 -04:00
|
|
|
{
|
2018-12-06 06:16:24 -05:00
|
|
|
int sixAxisSensorHandle = context.RequestData.ReadInt32();
|
|
|
|
long appletResourceUserId = context.RequestData.ReadInt64();
|
2018-04-24 14:57:39 -04:00
|
|
|
|
2018-12-06 06:16:24 -05:00
|
|
|
_gyroscopeZeroDriftMode = HidGyroscopeZeroDriftMode.Standard;
|
2018-04-04 18:39:47 -04:00
|
|
|
|
2018-12-06 06:16:24 -05:00
|
|
|
Logger.PrintStub(LogClass.ServiceHid, $"Stubbed. AppletResourceUserId: {appletResourceUserId} - " +
|
|
|
|
$"SixAxisSensorHandle: {sixAxisSensorHandle} - " +
|
|
|
|
$"GyroscopeZeroDriftMode: {_gyroscopeZeroDriftMode}");
|
2018-04-16 20:24:42 -04:00
|
|
|
|
2018-03-13 17:59:17 -04:00
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
2018-09-20 20:08:35 -04:00
|
|
|
// IsSixAxisSensorAtRest(nn::hid::SixAxisSensorHandle, nn::applet::AppletResourceUserId) -> bool IsAsRest
|
2018-12-06 06:16:24 -05:00
|
|
|
public long IsSixAxisSensorAtRest(ServiceCtx context)
|
2018-09-23 14:11:46 -04:00
|
|
|
{
|
2018-12-06 06:16:24 -05:00
|
|
|
int sixAxisSensorHandle = context.RequestData.ReadInt32();
|
|
|
|
long appletResourceUserId = context.RequestData.ReadInt64();
|
2018-09-20 20:08:35 -04:00
|
|
|
|
2018-12-06 06:16:24 -05:00
|
|
|
bool isAtRest = true;
|
2018-09-20 20:08:35 -04:00
|
|
|
|
2018-12-06 06:16:24 -05:00
|
|
|
context.ResponseData.Write(isAtRest);
|
2018-09-20 20:08:35 -04:00
|
|
|
|
2018-12-06 06:16:24 -05:00
|
|
|
Logger.PrintStub(LogClass.ServiceHid, $"Stubbed. AppletResourceUserId: {appletResourceUserId} - " +
|
|
|
|
$"SixAxisSensorHandle: {sixAxisSensorHandle} - " +
|
|
|
|
$"IsAtRest: {isAtRest}");
|
2018-09-20 20:08:35 -04:00
|
|
|
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
// ActivateGesture(nn::applet::AppletResourceUserId, int Unknown0)
|
2018-12-06 06:16:24 -05:00
|
|
|
public long ActivateGesture(ServiceCtx context)
|
2018-09-20 20:08:35 -04:00
|
|
|
{
|
2018-12-06 06:16:24 -05:00
|
|
|
long appletResourceUserId = context.RequestData.ReadInt64();
|
|
|
|
int unknown0 = context.RequestData.ReadInt32();
|
2018-09-20 20:08:35 -04:00
|
|
|
|
2018-12-06 06:16:24 -05:00
|
|
|
Logger.PrintStub(LogClass.ServiceHid, $"Stubbed. AppletResourceUserId: {appletResourceUserId} - " +
|
|
|
|
$"Unknown0: {unknown0}");
|
2018-09-20 20:08:35 -04:00
|
|
|
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// SetSupportedNpadStyleSet(nn::applet::AppletResourceUserId, nn::hid::NpadStyleTag)
|
2018-12-06 06:16:24 -05:00
|
|
|
public long SetSupportedNpadStyleSet(ServiceCtx context)
|
2018-03-13 17:59:17 -04:00
|
|
|
{
|
2018-12-06 06:16:24 -05:00
|
|
|
_npadStyleSet = (HidNpadStyle)context.RequestData.ReadInt32();
|
2018-04-24 14:57:39 -04:00
|
|
|
|
2018-12-06 06:16:24 -05:00
|
|
|
long appletResourceUserId = context.RequestData.ReadInt64();
|
2018-03-13 17:59:17 -04:00
|
|
|
|
2018-12-06 06:16:24 -05:00
|
|
|
Logger.PrintStub(LogClass.ServiceHid, $"Stubbed. AppletResourceUserId: {appletResourceUserId} - " +
|
|
|
|
$"NpadStyleSet: {_npadStyleSet}");
|
2018-11-19 19:01:36 -05:00
|
|
|
|
2018-12-06 06:16:24 -05:00
|
|
|
_npadStyleSetUpdateEvent.ReadableEvent.Signal();
|
2018-04-16 20:24:42 -04:00
|
|
|
|
2018-03-13 17:59:17 -04:00
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
2018-09-20 20:08:35 -04:00
|
|
|
// GetSupportedNpadStyleSet(nn::applet::AppletResourceUserId) -> uint nn::hid::NpadStyleTag
|
2018-12-06 06:16:24 -05:00
|
|
|
public long GetSupportedNpadStyleSet(ServiceCtx context)
|
2018-03-13 17:59:17 -04:00
|
|
|
{
|
2018-12-06 06:16:24 -05:00
|
|
|
long appletResourceUserId = context.RequestData.ReadInt64();
|
2018-04-17 12:40:22 -04:00
|
|
|
|
2018-12-06 06:16:24 -05:00
|
|
|
context.ResponseData.Write((int)_npadStyleSet);
|
2018-09-20 20:08:35 -04:00
|
|
|
|
2018-12-06 06:16:24 -05:00
|
|
|
Logger.PrintStub(LogClass.ServiceHid, $"Stubbed. AppletResourceUserId: {appletResourceUserId} - " +
|
|
|
|
$"NpadStyleSet: {_npadStyleSet}");
|
2018-04-17 12:40:22 -04:00
|
|
|
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
2018-09-20 20:08:35 -04:00
|
|
|
// SetSupportedNpadIdType(nn::applet::AppletResourceUserId, array<NpadIdType, 9>)
|
2018-12-06 06:16:24 -05:00
|
|
|
public long SetSupportedNpadIdType(ServiceCtx context)
|
2018-04-17 12:40:22 -04:00
|
|
|
{
|
2018-12-06 06:16:24 -05:00
|
|
|
long appletResourceUserId = context.RequestData.ReadInt64();
|
|
|
|
HidControllerId npadIdType = (HidControllerId)context.RequestData.ReadInt64();
|
2018-03-13 17:59:17 -04:00
|
|
|
|
2018-12-06 06:16:24 -05:00
|
|
|
Logger.PrintStub(LogClass.ServiceHid, $"Stubbed. AppletResourceUserId: {appletResourceUserId} - " +
|
|
|
|
$"NpadIdType: {npadIdType}");
|
2018-04-16 20:24:42 -04:00
|
|
|
|
2018-03-13 17:59:17 -04:00
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
2018-09-20 20:08:35 -04:00
|
|
|
// ActivateNpad(nn::applet::AppletResourceUserId)
|
2018-12-06 06:16:24 -05:00
|
|
|
public long ActivateNpad(ServiceCtx context)
|
2018-02-25 13:58:16 -05:00
|
|
|
{
|
2018-12-06 06:16:24 -05:00
|
|
|
long appletResourceUserId = context.RequestData.ReadInt64();
|
2018-09-20 20:08:35 -04:00
|
|
|
|
2018-12-06 06:16:24 -05:00
|
|
|
Logger.PrintStub(LogClass.ServiceHid, $"Stubbed. AppletResourceUserId: {appletResourceUserId}");
|
2018-09-20 20:08:35 -04:00
|
|
|
|
|
|
|
return 0;
|
|
|
|
}
|
2018-02-25 13:58:16 -05:00
|
|
|
|
2018-09-20 20:08:35 -04:00
|
|
|
// DeactivateNpad(nn::applet::AppletResourceUserId)
|
2018-12-06 06:16:24 -05:00
|
|
|
public long DeactivateNpad(ServiceCtx context)
|
2018-09-20 20:08:35 -04:00
|
|
|
{
|
2018-12-06 06:16:24 -05:00
|
|
|
long appletResourceUserId = context.RequestData.ReadInt64();
|
2018-04-16 20:24:42 -04:00
|
|
|
|
2018-12-06 06:16:24 -05:00
|
|
|
Logger.PrintStub(LogClass.ServiceHid, $"Stubbed. AppletResourceUserId: {appletResourceUserId}");
|
2018-02-25 13:58:16 -05:00
|
|
|
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
2018-09-20 20:08:35 -04:00
|
|
|
// AcquireNpadStyleSetUpdateEventHandle(nn::applet::AppletResourceUserId, uint, ulong) -> nn::sf::NativeHandle
|
2018-12-06 06:16:24 -05:00
|
|
|
public long AcquireNpadStyleSetUpdateEventHandle(ServiceCtx context)
|
2018-04-17 12:40:22 -04:00
|
|
|
{
|
2018-12-06 06:16:24 -05:00
|
|
|
long appletResourceUserId = context.RequestData.ReadInt64();
|
|
|
|
int npadId = context.RequestData.ReadInt32();
|
|
|
|
long npadStyleSet = context.RequestData.ReadInt64();
|
2018-09-20 20:08:35 -04:00
|
|
|
|
2018-12-06 06:16:24 -05:00
|
|
|
if (context.Process.HandleTable.GenerateHandle(_npadStyleSetUpdateEvent.ReadableEvent, out int handle) != KernelResult.Success)
|
2018-09-23 14:11:46 -04:00
|
|
|
{
|
|
|
|
throw new InvalidOperationException("Out of handles!");
|
|
|
|
}
|
2018-09-20 20:08:35 -04:00
|
|
|
|
2018-12-06 06:16:24 -05:00
|
|
|
context.Response.HandleDesc = IpcHandleDesc.MakeCopy(handle);
|
2018-09-20 20:08:35 -04:00
|
|
|
|
2018-12-06 06:16:24 -05:00
|
|
|
Logger.PrintStub(LogClass.ServiceHid, $"Stubbed. AppletResourceUserId: {appletResourceUserId} - " +
|
|
|
|
$"NpadId: {npadId} - " +
|
|
|
|
$"NpadStyleSet: {npadStyleSet}");
|
2018-04-17 12:40:22 -04:00
|
|
|
|
2018-09-20 20:08:35 -04:00
|
|
|
return 0;
|
|
|
|
}
|
2018-04-17 12:40:22 -04:00
|
|
|
|
2018-09-20 20:08:35 -04:00
|
|
|
// DisconnectNpad(nn::applet::AppletResourceUserId, uint NpadIdType)
|
2018-12-06 06:16:24 -05:00
|
|
|
public long DisconnectNpad(ServiceCtx context)
|
2018-09-20 20:08:35 -04:00
|
|
|
{
|
2018-12-06 06:16:24 -05:00
|
|
|
long appletResourceUserId = context.RequestData.ReadInt64();
|
|
|
|
int npadIdType = context.RequestData.ReadInt32();
|
2018-04-17 12:40:22 -04:00
|
|
|
|
2018-12-06 06:16:24 -05:00
|
|
|
Logger.PrintStub(LogClass.ServiceHid, $"Stubbed. AppletResourceUserId: {appletResourceUserId} - " +
|
|
|
|
$"NpadIdType: {npadIdType}");
|
2018-04-17 12:40:22 -04:00
|
|
|
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
2018-09-20 20:08:35 -04:00
|
|
|
// GetPlayerLedPattern(uint NpadId) -> ulong LedPattern
|
2018-12-06 06:16:24 -05:00
|
|
|
public long GetPlayerLedPattern(ServiceCtx context)
|
2018-02-24 23:34:16 -05:00
|
|
|
{
|
2018-12-06 06:16:24 -05:00
|
|
|
int npadId = context.RequestData.ReadInt32();
|
2018-09-20 20:08:35 -04:00
|
|
|
|
2018-12-06 06:16:24 -05:00
|
|
|
long ledPattern = 0;
|
2018-09-20 20:08:35 -04:00
|
|
|
|
2018-12-06 06:16:24 -05:00
|
|
|
context.ResponseData.Write(ledPattern);
|
2018-09-20 20:08:35 -04:00
|
|
|
|
2018-12-06 06:16:24 -05:00
|
|
|
Logger.PrintStub(LogClass.ServiceHid, $"Stubbed. NpadId: {npadId} - Pattern: {ledPattern}");
|
2018-02-24 23:34:16 -05:00
|
|
|
|
|
|
|
return 0;
|
|
|
|
}
|
2018-03-03 22:06:44 -05:00
|
|
|
|
2018-09-20 20:08:35 -04:00
|
|
|
// ActivateNpadWithRevision(nn::applet::AppletResourceUserId, int Unknown)
|
2018-12-06 06:16:24 -05:00
|
|
|
public long ActivateNpadWithRevision(ServiceCtx context)
|
2018-09-20 20:08:35 -04:00
|
|
|
{
|
2018-12-06 06:16:24 -05:00
|
|
|
long appletResourceUserId = context.RequestData.ReadInt64();
|
|
|
|
int unknown = context.RequestData.ReadInt32();
|
2018-09-20 20:08:35 -04:00
|
|
|
|
2018-12-06 06:16:24 -05:00
|
|
|
Logger.PrintStub(LogClass.ServiceHid, $"Stubbed. AppletResourceUserId: {appletResourceUserId} - Unknown: {unknown}");
|
2018-09-20 20:08:35 -04:00
|
|
|
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
// SetNpadJoyHoldType(nn::applet::AppletResourceUserId, long NpadJoyHoldType)
|
2018-12-06 06:16:24 -05:00
|
|
|
public long SetNpadJoyHoldType(ServiceCtx context)
|
2018-09-20 20:08:35 -04:00
|
|
|
{
|
2018-12-06 06:16:24 -05:00
|
|
|
long appletResourceUserId = context.RequestData.ReadInt64();
|
|
|
|
_npadJoyHoldType = (HidNpadJoyHoldType)context.RequestData.ReadInt64();
|
2018-09-20 20:08:35 -04:00
|
|
|
|
2018-12-06 06:16:24 -05:00
|
|
|
Logger.PrintStub(LogClass.ServiceHid, $"Stubbed. AppletResourceUserId: {appletResourceUserId} - " +
|
|
|
|
$"NpadJoyHoldType: {_npadJoyHoldType}");
|
2018-09-20 20:08:35 -04:00
|
|
|
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
// GetNpadJoyHoldType(nn::applet::AppletResourceUserId) -> long NpadJoyHoldType
|
2018-12-06 06:16:24 -05:00
|
|
|
public long GetNpadJoyHoldType(ServiceCtx context)
|
2018-03-03 22:06:44 -05:00
|
|
|
{
|
2018-12-06 06:16:24 -05:00
|
|
|
long appletResourceUserId = context.RequestData.ReadInt64();
|
2018-09-20 20:08:35 -04:00
|
|
|
|
2018-12-06 06:16:24 -05:00
|
|
|
context.ResponseData.Write((long)_npadJoyHoldType);
|
2018-09-20 20:08:35 -04:00
|
|
|
|
2018-12-06 06:16:24 -05:00
|
|
|
Logger.PrintStub(LogClass.ServiceHid, $"Stubbed. AppletResourceUserId: {appletResourceUserId} - " +
|
|
|
|
$"NpadJoyHoldTypeValue: {_npadJoyHoldType}");
|
2018-09-20 20:08:35 -04:00
|
|
|
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
// SetNpadJoyAssignmentModeSingleByDefault(uint HidControllerId, nn::applet::AppletResourceUserId)
|
2018-12-06 06:16:24 -05:00
|
|
|
public long SetNpadJoyAssignmentModeSingleByDefault(ServiceCtx context)
|
2018-09-20 20:08:35 -04:00
|
|
|
{
|
2018-12-06 06:16:24 -05:00
|
|
|
HidControllerId hidControllerId = (HidControllerId)context.RequestData.ReadInt32();
|
|
|
|
long appletResourceUserId = context.RequestData.ReadInt64();
|
2018-09-20 20:08:35 -04:00
|
|
|
|
2018-12-06 06:16:24 -05:00
|
|
|
_npadJoyAssignmentMode = HidNpadJoyAssignmentMode.Single;
|
2018-09-20 20:08:35 -04:00
|
|
|
|
2018-12-06 06:16:24 -05:00
|
|
|
Logger.PrintStub(LogClass.ServiceHid, $"Stubbed. AppletResourceUserId: {appletResourceUserId} - " +
|
|
|
|
$"HidControllerId: {hidControllerId} - " +
|
|
|
|
$"NpadJoyAssignmentModeValue: {_npadJoyAssignmentMode}");
|
2018-09-20 20:08:35 -04:00
|
|
|
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
// SetNpadJoyAssignmentModeSingle(uint HidControllerId, nn::applet::AppletResourceUserId, long HidNpadJoyDeviceType)
|
2018-12-06 06:16:24 -05:00
|
|
|
public long SetNpadJoyAssignmentModeSingle(ServiceCtx context)
|
2018-09-20 20:08:35 -04:00
|
|
|
{
|
2018-12-06 06:16:24 -05:00
|
|
|
HidControllerId hidControllerId = (HidControllerId)context.RequestData.ReadInt32();
|
|
|
|
long appletResourceUserId = context.RequestData.ReadInt64();
|
|
|
|
HidNpadJoyDeviceType hidNpadJoyDeviceType = (HidNpadJoyDeviceType)context.RequestData.ReadInt64();
|
2018-09-20 20:08:35 -04:00
|
|
|
|
2018-12-06 06:16:24 -05:00
|
|
|
_npadJoyAssignmentMode = HidNpadJoyAssignmentMode.Single;
|
2018-09-20 20:08:35 -04:00
|
|
|
|
2018-12-06 06:16:24 -05:00
|
|
|
Logger.PrintStub(LogClass.ServiceHid, $"Stubbed. AppletResourceUserId: {appletResourceUserId} - " +
|
|
|
|
$"HidControllerId: {hidControllerId} - " +
|
|
|
|
$"HidNpadJoyDeviceType: {hidNpadJoyDeviceType} - " +
|
|
|
|
$"NpadJoyAssignmentModeValue: {_npadJoyAssignmentMode}");
|
2018-09-20 20:08:35 -04:00
|
|
|
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
// SetNpadJoyAssignmentModeDual(uint HidControllerId, nn::applet::AppletResourceUserId)
|
2018-12-06 06:16:24 -05:00
|
|
|
public long SetNpadJoyAssignmentModeDual(ServiceCtx context)
|
2018-09-20 20:08:35 -04:00
|
|
|
{
|
2018-12-06 06:16:24 -05:00
|
|
|
HidControllerId hidControllerId = (HidControllerId)context.RequestData.ReadInt32();
|
|
|
|
long appletResourceUserId = context.RequestData.ReadInt64();
|
2018-09-20 20:08:35 -04:00
|
|
|
|
2018-12-06 06:16:24 -05:00
|
|
|
_npadJoyAssignmentMode = HidNpadJoyAssignmentMode.Dual;
|
2018-09-20 20:08:35 -04:00
|
|
|
|
2018-12-06 06:16:24 -05:00
|
|
|
Logger.PrintStub(LogClass.ServiceHid, $"Stubbed. AppletResourceUserId: {appletResourceUserId} - " +
|
|
|
|
$"HidControllerId: {hidControllerId} - " +
|
|
|
|
$"NpadJoyAssignmentModeValue: {_npadJoyAssignmentMode}");
|
2018-09-20 20:08:35 -04:00
|
|
|
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
// MergeSingleJoyAsDualJoy(uint SingleJoyId0, uint SingleJoyId1, nn::applet::AppletResourceUserId)
|
2018-12-06 06:16:24 -05:00
|
|
|
public long MergeSingleJoyAsDualJoy(ServiceCtx context)
|
2018-09-20 20:08:35 -04:00
|
|
|
{
|
2018-12-06 06:16:24 -05:00
|
|
|
long singleJoyId0 = context.RequestData.ReadInt32();
|
|
|
|
long singleJoyId1 = context.RequestData.ReadInt32();
|
|
|
|
long appletResourceUserId = context.RequestData.ReadInt64();
|
2018-09-20 20:08:35 -04:00
|
|
|
|
2018-12-06 06:16:24 -05:00
|
|
|
Logger.PrintStub(LogClass.ServiceHid, $"Stubbed. AppletResourceUserId: {appletResourceUserId} - " +
|
|
|
|
$"SingleJoyId0: {singleJoyId0} - " +
|
|
|
|
$"SingleJoyId1: {singleJoyId1}");
|
2018-09-20 20:08:35 -04:00
|
|
|
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
// StartLrAssignmentMode(nn::applet::AppletResourceUserId)
|
2018-12-06 06:16:24 -05:00
|
|
|
public long StartLrAssignmentMode(ServiceCtx context)
|
2018-09-20 20:08:35 -04:00
|
|
|
{
|
2018-12-06 06:16:24 -05:00
|
|
|
long appletResourceUserId = context.RequestData.ReadInt64();
|
2018-09-20 20:08:35 -04:00
|
|
|
|
2018-12-06 06:16:24 -05:00
|
|
|
Logger.PrintStub(LogClass.ServiceHid, $"Stubbed. AppletResourceUserId: {appletResourceUserId}");
|
2018-09-20 20:08:35 -04:00
|
|
|
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
// StopLrAssignmentMode(nn::applet::AppletResourceUserId)
|
2018-12-06 06:16:24 -05:00
|
|
|
public long StopLrAssignmentMode(ServiceCtx context)
|
2018-09-20 20:08:35 -04:00
|
|
|
{
|
2018-12-06 06:16:24 -05:00
|
|
|
long appletResourceUserId = context.RequestData.ReadInt64();
|
2018-09-20 20:08:35 -04:00
|
|
|
|
2018-12-06 06:16:24 -05:00
|
|
|
Logger.PrintStub(LogClass.ServiceHid, $"Stubbed. AppletResourceUserId: {appletResourceUserId}");
|
2018-09-20 20:08:35 -04:00
|
|
|
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
// SetNpadHandheldActivationMode(nn::applet::AppletResourceUserId, long HidNpadHandheldActivationMode)
|
2018-12-06 06:16:24 -05:00
|
|
|
public long SetNpadHandheldActivationMode(ServiceCtx context)
|
2018-09-20 20:08:35 -04:00
|
|
|
{
|
2018-12-06 06:16:24 -05:00
|
|
|
long appletResourceUserId = context.RequestData.ReadInt64();
|
|
|
|
_npadHandheldActivationMode = (HidNpadHandheldActivationMode)context.RequestData.ReadInt64();
|
2018-09-20 20:08:35 -04:00
|
|
|
|
2018-12-06 06:16:24 -05:00
|
|
|
Logger.PrintStub(LogClass.ServiceHid, $"Stubbed. AppletResourceUserId: {appletResourceUserId} - " +
|
|
|
|
$"NpadHandheldActivationMode: {_npadHandheldActivationMode}");
|
2018-09-20 20:08:35 -04:00
|
|
|
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
// GetNpadHandheldActivationMode(nn::applet::AppletResourceUserId) -> long HidNpadHandheldActivationMode
|
2018-12-06 06:16:24 -05:00
|
|
|
public long GetNpadHandheldActivationMode(ServiceCtx context)
|
2018-09-20 20:08:35 -04:00
|
|
|
{
|
2018-12-06 06:16:24 -05:00
|
|
|
long appletResourceUserId = context.RequestData.ReadInt64();
|
2018-09-20 20:08:35 -04:00
|
|
|
|
2018-12-06 06:16:24 -05:00
|
|
|
context.ResponseData.Write((long)_npadHandheldActivationMode);
|
2018-09-20 20:08:35 -04:00
|
|
|
|
2018-12-06 06:16:24 -05:00
|
|
|
Logger.PrintStub(LogClass.ServiceHid, $"Stubbed. AppletResourceUserId: {appletResourceUserId} - " +
|
|
|
|
$"NpadHandheldActivationMode: {_npadHandheldActivationMode}");
|
2018-09-20 20:08:35 -04:00
|
|
|
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
// SwapNpadAssignment(uint OldNpadAssignment, uint NewNpadAssignment, nn::applet::AppletResourceUserId)
|
2018-12-06 06:16:24 -05:00
|
|
|
public long SwapNpadAssignment(ServiceCtx context)
|
2018-09-20 20:08:35 -04:00
|
|
|
{
|
2018-12-06 06:16:24 -05:00
|
|
|
int oldNpadAssignment = context.RequestData.ReadInt32();
|
|
|
|
int newNpadAssignment = context.RequestData.ReadInt32();
|
|
|
|
long appletResourceUserId = context.RequestData.ReadInt64();
|
2018-09-20 20:08:35 -04:00
|
|
|
|
2018-12-06 06:16:24 -05:00
|
|
|
Logger.PrintStub(LogClass.ServiceHid, $"Stubbed. AppletResourceUserId: {appletResourceUserId} - " +
|
|
|
|
$"OldNpadAssignment: {oldNpadAssignment} - " +
|
|
|
|
$"NewNpadAssignment: {newNpadAssignment}");
|
2018-09-20 20:08:35 -04:00
|
|
|
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
// IsUnintendedHomeButtonInputProtectionEnabled(uint Unknown0, nn::applet::AppletResourceUserId) -> bool IsEnabled
|
2018-12-06 06:16:24 -05:00
|
|
|
public long IsUnintendedHomeButtonInputProtectionEnabled(ServiceCtx context)
|
2018-09-20 20:08:35 -04:00
|
|
|
{
|
2018-12-06 06:16:24 -05:00
|
|
|
uint unknown0 = context.RequestData.ReadUInt32();
|
|
|
|
long appletResourceUserId = context.RequestData.ReadInt64();
|
2018-09-20 20:08:35 -04:00
|
|
|
|
2018-12-06 06:16:24 -05:00
|
|
|
context.ResponseData.Write(_unintendedHomeButtonInputProtectionEnabled);
|
2018-09-20 20:08:35 -04:00
|
|
|
|
2018-12-06 06:16:24 -05:00
|
|
|
Logger.PrintStub(LogClass.ServiceHid, $"Stubbed. AppletResourceUserId: {appletResourceUserId} - " +
|
|
|
|
$"Unknown0: {unknown0} - " +
|
|
|
|
$"UnintendedHomeButtonInputProtectionEnabled: {_unintendedHomeButtonInputProtectionEnabled}");
|
2018-09-20 20:08:35 -04:00
|
|
|
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
// EnableUnintendedHomeButtonInputProtection(bool Enable, uint Unknown0, nn::applet::AppletResourceUserId)
|
2018-12-06 06:16:24 -05:00
|
|
|
public long EnableUnintendedHomeButtonInputProtection(ServiceCtx context)
|
2018-09-20 20:08:35 -04:00
|
|
|
{
|
2018-12-06 06:16:24 -05:00
|
|
|
_unintendedHomeButtonInputProtectionEnabled = context.RequestData.ReadBoolean();
|
|
|
|
uint unknown0 = context.RequestData.ReadUInt32();
|
|
|
|
long appletResourceUserId = context.RequestData.ReadInt64();
|
2018-09-20 20:08:35 -04:00
|
|
|
|
2018-12-06 06:16:24 -05:00
|
|
|
Logger.PrintStub(LogClass.ServiceHid, $"Stubbed. AppletResourceUserId: {appletResourceUserId} - " +
|
|
|
|
$"Unknown0: {unknown0} - " +
|
|
|
|
$"UnintendedHomeButtonInputProtectionEnable: {_unintendedHomeButtonInputProtectionEnabled}");
|
2018-09-20 20:08:35 -04:00
|
|
|
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
// SetNpadJoyAssignmentModeSingleWithDestination(uint HidControllerId, long HidNpadJoyDeviceType, nn::applet::AppletResourceUserId) -> bool Unknown0, uint Unknown1
|
2018-12-06 06:16:24 -05:00
|
|
|
public long SetNpadJoyAssignmentModeSingleWithDestination(ServiceCtx context)
|
2018-09-20 20:08:35 -04:00
|
|
|
{
|
2018-12-06 06:16:24 -05:00
|
|
|
HidControllerId hidControllerId = (HidControllerId)context.RequestData.ReadInt32();
|
|
|
|
HidNpadJoyDeviceType hidNpadJoyDeviceType = (HidNpadJoyDeviceType)context.RequestData.ReadInt64();
|
|
|
|
long appletResourceUserId = context.RequestData.ReadInt64();
|
2018-09-20 20:08:35 -04:00
|
|
|
|
2018-12-06 06:16:24 -05:00
|
|
|
_npadJoyAssignmentMode = HidNpadJoyAssignmentMode.Single;
|
2018-09-20 20:08:35 -04:00
|
|
|
|
2018-12-06 06:16:24 -05:00
|
|
|
context.ResponseData.Write(0); //Unknown0
|
|
|
|
context.ResponseData.Write(0); //Unknown1
|
2018-09-20 20:08:35 -04:00
|
|
|
|
2018-12-06 06:16:24 -05:00
|
|
|
Logger.PrintStub(LogClass.ServiceHid, $"Stubbed. AppletResourceUserId: {appletResourceUserId} - " +
|
|
|
|
$"HidControllerId: {hidControllerId} - " +
|
|
|
|
$"HidNpadJoyDeviceType: {hidNpadJoyDeviceType} - " +
|
|
|
|
$"NpadJoyAssignmentModeValue: {_npadJoyAssignmentMode} - " +
|
2018-10-17 13:15:50 -04:00
|
|
|
$"Unknown0: 0 - " +
|
|
|
|
$"Unknown1: 0");
|
2018-09-20 20:08:35 -04:00
|
|
|
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
// GetVibrationDeviceInfo(nn::hid::VibrationDeviceHandle) -> nn::hid::VibrationDeviceInfo
|
2018-12-06 06:16:24 -05:00
|
|
|
public long GetVibrationDeviceInfo(ServiceCtx context)
|
2018-09-20 20:08:35 -04:00
|
|
|
{
|
2018-12-06 06:16:24 -05:00
|
|
|
int vibrationDeviceHandle = context.RequestData.ReadInt32();
|
2018-09-20 20:08:35 -04:00
|
|
|
|
2018-12-06 06:16:24 -05:00
|
|
|
HidVibrationDeviceValue deviceInfo = new HidVibrationDeviceValue
|
2018-09-20 20:08:35 -04:00
|
|
|
{
|
|
|
|
DeviceType = HidVibrationDeviceType.None,
|
|
|
|
Position = HidVibrationDevicePosition.None
|
|
|
|
};
|
|
|
|
|
2018-12-06 06:16:24 -05:00
|
|
|
context.ResponseData.Write((int)deviceInfo.DeviceType);
|
|
|
|
context.ResponseData.Write((int)deviceInfo.Position);
|
2018-09-20 20:08:35 -04:00
|
|
|
|
2018-12-06 06:16:24 -05:00
|
|
|
Logger.PrintStub(LogClass.ServiceHid, $"Stubbed. VibrationDeviceHandle: {vibrationDeviceHandle} - " +
|
|
|
|
$"DeviceType: {deviceInfo.DeviceType} - " +
|
|
|
|
$"Position: {deviceInfo.Position}");
|
2018-09-20 20:08:35 -04:00
|
|
|
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
// SendVibrationValue(nn::hid::VibrationDeviceHandle, nn::hid::VibrationValue, nn::applet::AppletResourceUserId)
|
2018-12-06 06:16:24 -05:00
|
|
|
public long SendVibrationValue(ServiceCtx context)
|
2018-09-20 20:08:35 -04:00
|
|
|
{
|
2018-12-06 06:16:24 -05:00
|
|
|
int vibrationDeviceHandle = context.RequestData.ReadInt32();
|
2018-09-20 20:08:35 -04:00
|
|
|
|
2018-12-06 06:16:24 -05:00
|
|
|
_vibrationValue = new HidVibrationValue
|
2018-09-20 20:08:35 -04:00
|
|
|
{
|
2018-12-06 06:16:24 -05:00
|
|
|
AmplitudeLow = context.RequestData.ReadSingle(),
|
|
|
|
FrequencyLow = context.RequestData.ReadSingle(),
|
|
|
|
AmplitudeHigh = context.RequestData.ReadSingle(),
|
|
|
|
FrequencyHigh = context.RequestData.ReadSingle()
|
2018-09-20 20:08:35 -04:00
|
|
|
};
|
|
|
|
|
2018-12-06 06:16:24 -05:00
|
|
|
long appletResourceUserId = context.RequestData.ReadInt64();
|
2018-09-20 20:08:35 -04:00
|
|
|
|
2018-12-06 06:16:24 -05:00
|
|
|
Logger.PrintStub(LogClass.ServiceHid, $"Stubbed. AppletResourceUserId: {appletResourceUserId} - " +
|
|
|
|
$"VibrationDeviceHandle: {vibrationDeviceHandle} - " +
|
|
|
|
$"AmplitudeLow: {_vibrationValue.AmplitudeLow} - " +
|
|
|
|
$"FrequencyLow: {_vibrationValue.FrequencyLow} - " +
|
|
|
|
$"AmplitudeHigh: {_vibrationValue.AmplitudeHigh} - " +
|
|
|
|
$"FrequencyHigh: {_vibrationValue.FrequencyHigh}");
|
2018-09-20 20:08:35 -04:00
|
|
|
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
// GetActualVibrationValue(nn::hid::VibrationDeviceHandle, nn::applet::AppletResourceUserId) -> nn::hid::VibrationValue
|
2018-12-06 06:16:24 -05:00
|
|
|
public long GetActualVibrationValue(ServiceCtx context)
|
2018-09-20 20:08:35 -04:00
|
|
|
{
|
2018-12-06 06:16:24 -05:00
|
|
|
int vibrationDeviceHandle = context.RequestData.ReadInt32();
|
|
|
|
long appletResourceUserId = context.RequestData.ReadInt64();
|
2018-09-20 20:08:35 -04:00
|
|
|
|
2018-12-06 06:16:24 -05:00
|
|
|
context.ResponseData.Write(_vibrationValue.AmplitudeLow);
|
|
|
|
context.ResponseData.Write(_vibrationValue.FrequencyLow);
|
|
|
|
context.ResponseData.Write(_vibrationValue.AmplitudeHigh);
|
|
|
|
context.ResponseData.Write(_vibrationValue.FrequencyHigh);
|
2018-09-20 20:08:35 -04:00
|
|
|
|
2018-12-06 06:16:24 -05:00
|
|
|
Logger.PrintStub(LogClass.ServiceHid, $"Stubbed. AppletResourceUserId: {appletResourceUserId} - " +
|
|
|
|
$"VibrationDeviceHandle: {vibrationDeviceHandle} - " +
|
|
|
|
$"AmplitudeLow: {_vibrationValue.AmplitudeLow} - " +
|
|
|
|
$"FrequencyLow: {_vibrationValue.FrequencyLow} - " +
|
|
|
|
$"AmplitudeHigh: {_vibrationValue.AmplitudeHigh} - " +
|
|
|
|
$"FrequencyHigh: {_vibrationValue.FrequencyHigh}");
|
2018-09-20 20:08:35 -04:00
|
|
|
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
// CreateActiveVibrationDeviceList() -> object<nn::hid::IActiveVibrationDeviceList>
|
2018-12-06 06:16:24 -05:00
|
|
|
public long CreateActiveVibrationDeviceList(ServiceCtx context)
|
2018-09-20 20:08:35 -04:00
|
|
|
{
|
2018-12-06 06:16:24 -05:00
|
|
|
MakeObject(context, new IActiveApplicationDeviceList());
|
2018-09-20 20:08:35 -04:00
|
|
|
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
// PermitVibration(bool Enable)
|
2018-12-06 06:16:24 -05:00
|
|
|
public long PermitVibration(ServiceCtx context)
|
2018-09-20 20:08:35 -04:00
|
|
|
{
|
2018-12-06 06:16:24 -05:00
|
|
|
_vibrationPermitted = context.RequestData.ReadBoolean();
|
2018-09-20 20:08:35 -04:00
|
|
|
|
2018-12-06 06:16:24 -05:00
|
|
|
Logger.PrintStub(LogClass.ServiceHid, $"Stubbed. VibrationPermitted: {_vibrationPermitted}");
|
2018-09-20 20:08:35 -04:00
|
|
|
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
// IsVibrationPermitted() -> bool IsEnabled
|
2018-12-06 06:16:24 -05:00
|
|
|
public long IsVibrationPermitted(ServiceCtx context)
|
2018-09-20 20:08:35 -04:00
|
|
|
{
|
2018-12-06 06:16:24 -05:00
|
|
|
context.ResponseData.Write(_vibrationPermitted);
|
2018-09-20 20:08:35 -04:00
|
|
|
|
2018-12-06 06:16:24 -05:00
|
|
|
Logger.PrintStub(LogClass.ServiceHid, $"Stubbed. VibrationPermitted: {_vibrationPermitted}");
|
2018-09-20 20:08:35 -04:00
|
|
|
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
// SendVibrationValues(nn::applet::AppletResourceUserId, buffer<array<nn::hid::VibrationDeviceHandle>, type: 9>, buffer<array<nn::hid::VibrationValue>, type: 9>)
|
2018-12-06 06:16:24 -05:00
|
|
|
public long SendVibrationValues(ServiceCtx context)
|
2018-09-20 20:08:35 -04:00
|
|
|
{
|
2018-12-06 06:16:24 -05:00
|
|
|
long appletResourceUserId = context.RequestData.ReadInt64();
|
2018-09-20 20:08:35 -04:00
|
|
|
|
2018-12-06 06:16:24 -05:00
|
|
|
byte[] vibrationDeviceHandleBuffer = context.Memory.ReadBytes(
|
|
|
|
context.Request.PtrBuff[0].Position,
|
|
|
|
context.Request.PtrBuff[0].Size);
|
2018-09-20 20:08:35 -04:00
|
|
|
|
2018-12-06 06:16:24 -05:00
|
|
|
byte[] vibrationValueBuffer = context.Memory.ReadBytes(
|
|
|
|
context.Request.PtrBuff[1].Position,
|
|
|
|
context.Request.PtrBuff[1].Size);
|
2018-09-20 20:08:35 -04:00
|
|
|
|
|
|
|
//Todo: Read all handles and values from buffer.
|
|
|
|
|
2018-12-06 06:16:24 -05:00
|
|
|
Logger.PrintStub(LogClass.ServiceHid, $"Stubbed. AppletResourceUserId: {appletResourceUserId} - " +
|
|
|
|
$"VibrationDeviceHandleBufferLength: {vibrationDeviceHandleBuffer.Length} - " +
|
|
|
|
$"VibrationValueBufferLength: {vibrationValueBuffer.Length}");
|
2018-09-20 20:08:35 -04:00
|
|
|
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
// SendVibrationGcErmCommand(nn::hid::VibrationDeviceHandle, nn::hid::VibrationGcErmCommand, nn::applet::AppletResourceUserId)
|
2018-12-06 06:16:24 -05:00
|
|
|
public long SendVibrationGcErmCommand(ServiceCtx context)
|
2018-09-20 20:08:35 -04:00
|
|
|
{
|
2018-12-06 06:16:24 -05:00
|
|
|
int vibrationDeviceHandle = context.RequestData.ReadInt32();
|
|
|
|
long vibrationGcErmCommand = context.RequestData.ReadInt64();
|
|
|
|
long appletResourceUserId = context.RequestData.ReadInt64();
|
2018-09-20 20:08:35 -04:00
|
|
|
|
2018-12-06 06:16:24 -05:00
|
|
|
Logger.PrintStub(LogClass.ServiceHid, $"Stubbed. AppletResourceUserId: {appletResourceUserId} - " +
|
|
|
|
$"VibrationDeviceHandle: {vibrationDeviceHandle} - " +
|
|
|
|
$"VibrationGcErmCommand: {vibrationGcErmCommand}");
|
2018-09-20 20:08:35 -04:00
|
|
|
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
// GetActualVibrationGcErmCommand(nn::hid::VibrationDeviceHandle, nn::applet::AppletResourceUserId) -> nn::hid::VibrationGcErmCommand
|
2018-12-06 06:16:24 -05:00
|
|
|
public long GetActualVibrationGcErmCommand(ServiceCtx context)
|
2018-09-20 20:08:35 -04:00
|
|
|
{
|
2018-12-06 06:16:24 -05:00
|
|
|
int vibrationDeviceHandle = context.RequestData.ReadInt32();
|
|
|
|
long appletResourceUserId = context.RequestData.ReadInt64();
|
2018-09-20 20:08:35 -04:00
|
|
|
|
2018-12-06 06:16:24 -05:00
|
|
|
context.ResponseData.Write(_vibrationGcErmCommand);
|
2018-09-20 20:08:35 -04:00
|
|
|
|
2018-12-06 06:16:24 -05:00
|
|
|
Logger.PrintStub(LogClass.ServiceHid, $"Stubbed. AppletResourceUserId: {appletResourceUserId} - " +
|
|
|
|
$"VibrationDeviceHandle: {vibrationDeviceHandle} - " +
|
|
|
|
$"VibrationGcErmCommand: {_vibrationGcErmCommand}");
|
2018-09-20 20:08:35 -04:00
|
|
|
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
// BeginPermitVibrationSession(nn::applet::AppletResourceUserId)
|
2018-12-06 06:16:24 -05:00
|
|
|
public long BeginPermitVibrationSession(ServiceCtx context)
|
2018-09-20 20:08:35 -04:00
|
|
|
{
|
2018-12-06 06:16:24 -05:00
|
|
|
long appletResourceUserId = context.RequestData.ReadInt64();
|
2018-09-20 20:08:35 -04:00
|
|
|
|
2018-12-06 06:16:24 -05:00
|
|
|
Logger.PrintStub(LogClass.ServiceHid, $"Stubbed. AppletResourceUserId: {appletResourceUserId}");
|
2018-09-20 20:08:35 -04:00
|
|
|
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
// EndPermitVibrationSession()
|
2018-12-06 06:16:24 -05:00
|
|
|
public long EndPermitVibrationSession(ServiceCtx context)
|
2018-09-20 20:08:35 -04:00
|
|
|
{
|
2018-10-17 13:15:50 -04:00
|
|
|
Logger.PrintStub(LogClass.ServiceHid, $"Stubbed.");
|
2018-09-20 20:08:35 -04:00
|
|
|
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
// ActivateConsoleSixAxisSensor(nn::applet::AppletResourceUserId)
|
2018-12-06 06:16:24 -05:00
|
|
|
public long ActivateConsoleSixAxisSensor(ServiceCtx context)
|
2018-09-20 20:08:35 -04:00
|
|
|
{
|
2018-12-06 06:16:24 -05:00
|
|
|
long appletResourceUserId = context.RequestData.ReadInt64();
|
2018-09-20 20:08:35 -04:00
|
|
|
|
2018-12-06 06:16:24 -05:00
|
|
|
Logger.PrintStub(LogClass.ServiceHid, $"Stubbed. AppletResourceUserId: {appletResourceUserId}");
|
2018-09-20 20:08:35 -04:00
|
|
|
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
// StartConsoleSixAxisSensor(nn::hid::ConsoleSixAxisSensorHandle, nn::applet::AppletResourceUserId)
|
2018-12-06 06:16:24 -05:00
|
|
|
public long StartConsoleSixAxisSensor(ServiceCtx context)
|
2018-09-20 20:08:35 -04:00
|
|
|
{
|
2018-12-06 06:16:24 -05:00
|
|
|
int consoleSixAxisSensorHandle = context.RequestData.ReadInt32();
|
|
|
|
long appletResourceUserId = context.RequestData.ReadInt64();
|
2018-09-23 14:11:46 -04:00
|
|
|
|
2018-12-06 06:16:24 -05:00
|
|
|
Logger.PrintStub(LogClass.ServiceHid, $"Stubbed. AppletResourceUserId: {appletResourceUserId} - " +
|
|
|
|
$"ConsoleSixAxisSensorHandle: {consoleSixAxisSensorHandle}");
|
2018-09-20 20:08:35 -04:00
|
|
|
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
// StopConsoleSixAxisSensor(nn::hid::ConsoleSixAxisSensorHandle, nn::applet::AppletResourceUserId)
|
2018-12-06 06:16:24 -05:00
|
|
|
public long StopConsoleSixAxisSensor(ServiceCtx context)
|
2018-09-20 20:08:35 -04:00
|
|
|
{
|
2018-12-06 06:16:24 -05:00
|
|
|
int consoleSixAxisSensorHandle = context.RequestData.ReadInt32();
|
|
|
|
long appletResourceUserId = context.RequestData.ReadInt64();
|
2018-09-20 20:08:35 -04:00
|
|
|
|
2018-12-06 06:16:24 -05:00
|
|
|
Logger.PrintStub(LogClass.ServiceHid, $"Stubbed. AppletResourceUserId: {appletResourceUserId} - " +
|
|
|
|
$"ConsoleSixAxisSensorHandle: {consoleSixAxisSensorHandle}");
|
2018-09-20 20:08:35 -04:00
|
|
|
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
// ActivateSevenSixAxisSensor(nn::applet::AppletResourceUserId)
|
2018-12-06 06:16:24 -05:00
|
|
|
public long ActivateSevenSixAxisSensor(ServiceCtx context)
|
2018-09-20 20:08:35 -04:00
|
|
|
{
|
2018-12-06 06:16:24 -05:00
|
|
|
long appletResourceUserId = context.RequestData.ReadInt64();
|
2018-09-20 20:08:35 -04:00
|
|
|
|
2018-12-06 06:16:24 -05:00
|
|
|
Logger.PrintStub(LogClass.ServiceHid, $"Stubbed. AppletResourceUserId: {appletResourceUserId}");
|
2018-09-20 20:08:35 -04:00
|
|
|
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
// StartSevenSixAxisSensor(nn::applet::AppletResourceUserId)
|
2018-12-06 06:16:24 -05:00
|
|
|
public long StartSevenSixAxisSensor(ServiceCtx context)
|
2018-09-20 20:08:35 -04:00
|
|
|
{
|
2018-12-06 06:16:24 -05:00
|
|
|
long appletResourceUserId = context.RequestData.ReadInt64();
|
2018-09-20 20:08:35 -04:00
|
|
|
|
2018-12-06 06:16:24 -05:00
|
|
|
Logger.PrintStub(LogClass.ServiceHid, $"Stubbed. AppletResourceUserId: {appletResourceUserId}");
|
2018-09-20 20:08:35 -04:00
|
|
|
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
// StopSevenSixAxisSensor(nn::applet::AppletResourceUserId)
|
2018-12-06 06:16:24 -05:00
|
|
|
public long StopSevenSixAxisSensor(ServiceCtx context)
|
2018-09-20 20:08:35 -04:00
|
|
|
{
|
2018-12-06 06:16:24 -05:00
|
|
|
long appletResourceUserId = context.RequestData.ReadInt64();
|
2018-09-20 20:08:35 -04:00
|
|
|
|
2018-12-06 06:16:24 -05:00
|
|
|
Logger.PrintStub(LogClass.ServiceHid, $"Stubbed. AppletResourceUserId: {appletResourceUserId}");
|
2018-09-20 20:08:35 -04:00
|
|
|
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
// InitializeSevenSixAxisSensor(array<nn::sf::NativeHandle>, ulong Counter0, array<nn::sf::NativeHandle>, ulong Counter1, nn::applet::AppletResourceUserId)
|
2018-12-06 06:16:24 -05:00
|
|
|
public long InitializeSevenSixAxisSensor(ServiceCtx context)
|
2018-09-20 20:08:35 -04:00
|
|
|
{
|
2018-12-06 06:16:24 -05:00
|
|
|
long appletResourceUserId = context.RequestData.ReadInt64();
|
|
|
|
long counter0 = context.RequestData.ReadInt64();
|
|
|
|
long counter1 = context.RequestData.ReadInt64();
|
2018-09-20 20:08:35 -04:00
|
|
|
|
|
|
|
// Todo: Determine if array<nn::sf::NativeHandle> is a buffer or not...
|
|
|
|
|
2018-12-06 06:16:24 -05:00
|
|
|
Logger.PrintStub(LogClass.ServiceHid, $"Stubbed. AppletResourceUserId: {appletResourceUserId} - " +
|
|
|
|
$"Counter0: {counter0} - " +
|
|
|
|
$"Counter1: {counter1}");
|
2018-09-20 20:08:35 -04:00
|
|
|
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
// FinalizeSevenSixAxisSensor(nn::applet::AppletResourceUserId)
|
2018-12-06 06:16:24 -05:00
|
|
|
public long FinalizeSevenSixAxisSensor(ServiceCtx context)
|
2018-09-20 20:08:35 -04:00
|
|
|
{
|
2018-12-06 06:16:24 -05:00
|
|
|
long appletResourceUserId = context.RequestData.ReadInt64();
|
2018-09-20 20:08:35 -04:00
|
|
|
|
2018-12-06 06:16:24 -05:00
|
|
|
Logger.PrintStub(LogClass.ServiceHid, $"Stubbed. AppletResourceUserId: {appletResourceUserId}");
|
2018-12-18 00:33:36 -05:00
|
|
|
|
2018-09-20 20:08:35 -04:00
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
// SetSevenSixAxisSensorFusionStrength(float Strength, nn::applet::AppletResourceUserId)
|
2018-12-06 06:16:24 -05:00
|
|
|
public long SetSevenSixAxisSensorFusionStrength(ServiceCtx context)
|
2018-09-20 20:08:35 -04:00
|
|
|
{
|
2018-12-06 06:16:24 -05:00
|
|
|
_sevenSixAxisSensorFusionStrength = context.RequestData.ReadSingle();
|
|
|
|
long appletResourceUserId = context.RequestData.ReadInt64();
|
2018-09-20 20:08:35 -04:00
|
|
|
|
2018-12-06 06:16:24 -05:00
|
|
|
Logger.PrintStub(LogClass.ServiceHid, $"Stubbed. AppletResourceUserId: {appletResourceUserId} - " +
|
|
|
|
$"SevenSixAxisSensorFusionStrength: {_sevenSixAxisSensorFusionStrength}");
|
2018-09-20 20:08:35 -04:00
|
|
|
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
// GetSevenSixAxisSensorFusionStrength(nn::applet::AppletResourceUserId) -> float Strength
|
2018-12-06 06:16:24 -05:00
|
|
|
public long GetSevenSixAxisSensorFusionStrength(ServiceCtx context)
|
2018-09-20 20:08:35 -04:00
|
|
|
{
|
2018-12-06 06:16:24 -05:00
|
|
|
long appletResourceUserId = context.RequestData.ReadInt64();
|
2018-09-20 20:08:35 -04:00
|
|
|
|
2018-12-06 06:16:24 -05:00
|
|
|
context.ResponseData.Write(_sevenSixAxisSensorFusionStrength);
|
2018-09-20 20:08:35 -04:00
|
|
|
|
2018-12-06 06:16:24 -05:00
|
|
|
Logger.PrintStub(LogClass.ServiceHid, $"Stubbed. AppletResourceUserId: {appletResourceUserId} - " +
|
|
|
|
$"SevenSixAxisSensorFusionStrength: {_sevenSixAxisSensorFusionStrength}");
|
2018-09-20 20:08:35 -04:00
|
|
|
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
// IsUsbFullKeyControllerEnabled() -> bool IsEnabled
|
2018-12-06 06:16:24 -05:00
|
|
|
public long IsUsbFullKeyControllerEnabled(ServiceCtx context)
|
2018-09-20 20:08:35 -04:00
|
|
|
{
|
2018-12-06 06:16:24 -05:00
|
|
|
context.ResponseData.Write(_usbFullKeyControllerEnabled);
|
2018-09-20 20:08:35 -04:00
|
|
|
|
2018-12-06 06:16:24 -05:00
|
|
|
Logger.PrintStub(LogClass.ServiceHid, $"Stubbed. UsbFullKeyControllerEnabled: {_usbFullKeyControllerEnabled}");
|
2018-09-20 20:08:35 -04:00
|
|
|
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
// EnableUsbFullKeyController(bool Enable)
|
2018-12-06 06:16:24 -05:00
|
|
|
public long EnableUsbFullKeyController(ServiceCtx context)
|
2018-09-20 20:08:35 -04:00
|
|
|
{
|
2018-12-06 06:16:24 -05:00
|
|
|
_usbFullKeyControllerEnabled = context.RequestData.ReadBoolean();
|
2018-09-20 20:08:35 -04:00
|
|
|
|
2018-12-06 06:16:24 -05:00
|
|
|
Logger.PrintStub(LogClass.ServiceHid, $"Stubbed. UsbFullKeyControllerEnabled: {_usbFullKeyControllerEnabled}");
|
2018-09-20 20:08:35 -04:00
|
|
|
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
// IsUsbFullKeyControllerConnected(uint Unknown0) -> bool Connected
|
2018-12-06 06:16:24 -05:00
|
|
|
public long IsUsbFullKeyControllerConnected(ServiceCtx context)
|
2018-09-20 20:08:35 -04:00
|
|
|
{
|
2018-12-06 06:16:24 -05:00
|
|
|
int unknown0 = context.RequestData.ReadInt32();
|
2018-09-20 20:08:35 -04:00
|
|
|
|
2018-12-06 06:16:24 -05:00
|
|
|
context.ResponseData.Write(true); //FullKeyController is always connected ?
|
2018-09-20 20:08:35 -04:00
|
|
|
|
2018-12-06 06:16:24 -05:00
|
|
|
Logger.PrintStub(LogClass.ServiceHid, $"Stubbed. Unknown0: {unknown0} - Connected: true");
|
2018-09-20 20:08:35 -04:00
|
|
|
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
// HasBattery(uint NpadId) -> bool HasBattery
|
2018-12-06 06:16:24 -05:00
|
|
|
public long HasBattery(ServiceCtx context)
|
2018-09-20 20:08:35 -04:00
|
|
|
{
|
2018-12-06 06:16:24 -05:00
|
|
|
int npadId = context.RequestData.ReadInt32();
|
2018-09-20 20:08:35 -04:00
|
|
|
|
2018-12-06 06:16:24 -05:00
|
|
|
context.ResponseData.Write(true); //Npad always got a battery ?
|
2018-09-20 20:08:35 -04:00
|
|
|
|
2018-12-06 06:16:24 -05:00
|
|
|
Logger.PrintStub(LogClass.ServiceHid, $"Stubbed. NpadId: {npadId} - HasBattery: true");
|
2018-09-20 20:08:35 -04:00
|
|
|
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
// HasLeftRightBattery(uint NpadId) -> bool HasLeftBattery, bool HasRightBattery
|
2018-12-06 06:16:24 -05:00
|
|
|
public long HasLeftRightBattery(ServiceCtx context)
|
2018-09-20 20:08:35 -04:00
|
|
|
{
|
2018-12-06 06:16:24 -05:00
|
|
|
int npadId = context.RequestData.ReadInt32();
|
2018-09-20 20:08:35 -04:00
|
|
|
|
2018-12-06 06:16:24 -05:00
|
|
|
context.ResponseData.Write(true); //Npad always got a left battery ?
|
|
|
|
context.ResponseData.Write(true); //Npad always got a right battery ?
|
2018-09-20 20:08:35 -04:00
|
|
|
|
2018-12-06 06:16:24 -05:00
|
|
|
Logger.PrintStub(LogClass.ServiceHid, $"Stubbed. NpadId: {npadId} - HasLeftBattery: true - HasRightBattery: true");
|
2018-09-20 20:08:35 -04:00
|
|
|
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
// GetNpadInterfaceType(uint NpadId) -> uchar InterfaceType
|
2018-12-06 06:16:24 -05:00
|
|
|
public long GetNpadInterfaceType(ServiceCtx context)
|
2018-09-20 20:08:35 -04:00
|
|
|
{
|
2018-12-06 06:16:24 -05:00
|
|
|
int npadId = context.RequestData.ReadInt32();
|
2018-09-20 20:08:35 -04:00
|
|
|
|
2018-12-06 06:16:24 -05:00
|
|
|
context.ResponseData.Write((byte)0);
|
2018-09-20 20:08:35 -04:00
|
|
|
|
2018-12-06 06:16:24 -05:00
|
|
|
Logger.PrintStub(LogClass.ServiceHid, $"Stubbed. NpadId: {npadId} - NpadInterfaceType: 0");
|
2018-09-20 20:08:35 -04:00
|
|
|
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
// GetNpadLeftRightInterfaceType(uint NpadId) -> uchar LeftInterfaceType, uchar RightInterfaceType
|
2018-12-06 06:16:24 -05:00
|
|
|
public long GetNpadLeftRightInterfaceType(ServiceCtx context)
|
2018-09-20 20:08:35 -04:00
|
|
|
{
|
2018-12-06 06:16:24 -05:00
|
|
|
int npadId = context.RequestData.ReadInt32();
|
2018-09-20 20:08:35 -04:00
|
|
|
|
2018-12-06 06:16:24 -05:00
|
|
|
context.ResponseData.Write((byte)0);
|
|
|
|
context.ResponseData.Write((byte)0);
|
2018-09-20 20:08:35 -04:00
|
|
|
|
2018-12-06 06:16:24 -05:00
|
|
|
Logger.PrintStub(LogClass.ServiceHid, $"Stubbed. NpadId: {npadId} - " +
|
2018-10-17 13:15:50 -04:00
|
|
|
$"LeftInterfaceType: 0 - " +
|
|
|
|
$"RightInterfaceType: 0");
|
2018-09-20 20:08:35 -04:00
|
|
|
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
// GetPalmaConnectionHandle(uint Unknown0, nn::applet::AppletResourceUserId) -> nn::hid::PalmaConnectionHandle
|
2018-12-06 06:16:24 -05:00
|
|
|
public long GetPalmaConnectionHandle(ServiceCtx context)
|
2018-09-20 20:08:35 -04:00
|
|
|
{
|
2018-12-06 06:16:24 -05:00
|
|
|
int unknown0 = context.RequestData.ReadInt32();
|
|
|
|
long appletResourceUserId = context.RequestData.ReadInt64();
|
2018-09-20 20:08:35 -04:00
|
|
|
|
2018-12-06 06:16:24 -05:00
|
|
|
int palmaConnectionHandle = 0;
|
2018-09-20 20:08:35 -04:00
|
|
|
|
2018-12-06 06:16:24 -05:00
|
|
|
context.ResponseData.Write(palmaConnectionHandle);
|
2018-09-20 20:08:35 -04:00
|
|
|
|
2018-12-06 06:16:24 -05:00
|
|
|
Logger.PrintStub(LogClass.ServiceHid, $"Stubbed. AppletResourceUserId: {appletResourceUserId} - " +
|
|
|
|
$"Unknown0: {unknown0} - " +
|
|
|
|
$"PalmaConnectionHandle: {palmaConnectionHandle}");
|
2018-09-20 20:08:35 -04:00
|
|
|
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
// InitializePalma(nn::hid::PalmaConnectionHandle)
|
2018-12-06 06:16:24 -05:00
|
|
|
public long InitializePalma(ServiceCtx context)
|
2018-09-20 20:08:35 -04:00
|
|
|
{
|
2018-12-06 06:16:24 -05:00
|
|
|
int palmaConnectionHandle = context.RequestData.ReadInt32();
|
2018-09-20 20:08:35 -04:00
|
|
|
|
2018-12-06 06:16:24 -05:00
|
|
|
Logger.PrintStub(LogClass.ServiceHid, $"Stubbed. PalmaConnectionHandle: {palmaConnectionHandle}");
|
2018-09-20 20:08:35 -04:00
|
|
|
|
2018-12-06 06:16:24 -05:00
|
|
|
_palmaOperationCompleteEvent.ReadableEvent.Signal();
|
2018-11-19 19:01:36 -05:00
|
|
|
|
2018-09-20 20:08:35 -04:00
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
// AcquirePalmaOperationCompleteEvent(nn::hid::PalmaConnectionHandle) -> nn::sf::NativeHandle
|
2018-12-06 06:16:24 -05:00
|
|
|
public long AcquirePalmaOperationCompleteEvent(ServiceCtx context)
|
2018-09-20 20:08:35 -04:00
|
|
|
{
|
2018-12-06 06:16:24 -05:00
|
|
|
int palmaConnectionHandle = context.RequestData.ReadInt32();
|
2018-09-20 20:08:35 -04:00
|
|
|
|
2018-12-06 06:16:24 -05:00
|
|
|
if (context.Process.HandleTable.GenerateHandle(_palmaOperationCompleteEvent.ReadableEvent, out int handle) != KernelResult.Success)
|
2018-09-23 14:11:46 -04:00
|
|
|
{
|
|
|
|
throw new InvalidOperationException("Out of handles!");
|
|
|
|
}
|
2018-09-20 20:08:35 -04:00
|
|
|
|
2018-12-06 06:16:24 -05:00
|
|
|
context.Response.HandleDesc = IpcHandleDesc.MakeCopy(handle);
|
2018-09-20 20:08:35 -04:00
|
|
|
|
2018-12-06 06:16:24 -05:00
|
|
|
Logger.PrintStub(LogClass.ServiceHid, $"Stubbed. PalmaConnectionHandle: {palmaConnectionHandle}");
|
2018-09-20 20:08:35 -04:00
|
|
|
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
// GetPalmaOperationInfo(nn::hid::PalmaConnectionHandle) -> long Unknown0, buffer<Unknown>
|
2018-12-06 06:16:24 -05:00
|
|
|
public long GetPalmaOperationInfo(ServiceCtx context)
|
2018-09-20 20:08:35 -04:00
|
|
|
{
|
2018-12-06 06:16:24 -05:00
|
|
|
int palmaConnectionHandle = context.RequestData.ReadInt32();
|
2018-09-20 20:08:35 -04:00
|
|
|
|
2018-12-06 06:16:24 -05:00
|
|
|
long unknown0 = 0; //Counter?
|
2018-09-20 20:08:35 -04:00
|
|
|
|
2018-12-06 06:16:24 -05:00
|
|
|
context.ResponseData.Write(unknown0);
|
2018-09-20 20:08:35 -04:00
|
|
|
|
2018-12-06 06:16:24 -05:00
|
|
|
Logger.PrintStub(LogClass.ServiceHid, $"Stubbed. PalmaConnectionHandle: {palmaConnectionHandle} - " +
|
|
|
|
$"Unknown0: {unknown0}");
|
2018-09-20 20:08:35 -04:00
|
|
|
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
// PlayPalmaActivity(nn::hid::PalmaConnectionHandle, ulong Unknown0)
|
2018-12-06 06:16:24 -05:00
|
|
|
public long PlayPalmaActivity(ServiceCtx context)
|
2018-09-20 20:08:35 -04:00
|
|
|
{
|
2018-12-06 06:16:24 -05:00
|
|
|
int palmaConnectionHandle = context.RequestData.ReadInt32();
|
|
|
|
long unknown0 = context.RequestData.ReadInt64();
|
2018-09-20 20:08:35 -04:00
|
|
|
|
2018-12-06 06:16:24 -05:00
|
|
|
Logger.PrintStub(LogClass.ServiceHid, $"Stubbed. PalmaConnectionHandle: {palmaConnectionHandle} - " +
|
|
|
|
$"Unknown0: {unknown0}");
|
2018-09-20 20:08:35 -04:00
|
|
|
|
2018-12-06 06:16:24 -05:00
|
|
|
_palmaOperationCompleteEvent.ReadableEvent.Signal();
|
2018-11-19 19:01:36 -05:00
|
|
|
|
2018-09-20 20:08:35 -04:00
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
// SetPalmaFrModeType(nn::hid::PalmaConnectionHandle, ulong FrModeType)
|
2018-12-06 06:16:24 -05:00
|
|
|
public long SetPalmaFrModeType(ServiceCtx context)
|
2018-09-20 20:08:35 -04:00
|
|
|
{
|
2018-12-06 06:16:24 -05:00
|
|
|
int palmaConnectionHandle = context.RequestData.ReadInt32();
|
|
|
|
long frModeType = context.RequestData.ReadInt64();
|
2018-09-20 20:08:35 -04:00
|
|
|
|
2018-12-06 06:16:24 -05:00
|
|
|
Logger.PrintStub(LogClass.ServiceHid, $"Stubbed. PalmaConnectionHandle: {palmaConnectionHandle} - " +
|
|
|
|
$"FrModeType: {frModeType}");
|
2018-09-20 20:08:35 -04:00
|
|
|
|
2018-12-06 06:16:24 -05:00
|
|
|
_palmaOperationCompleteEvent.ReadableEvent.Signal();
|
2018-11-19 19:01:36 -05:00
|
|
|
|
2018-09-20 20:08:35 -04:00
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
// ReadPalmaStep(nn::hid::PalmaConnectionHandle)
|
2018-12-06 06:16:24 -05:00
|
|
|
public long ReadPalmaStep(ServiceCtx context)
|
2018-09-20 20:08:35 -04:00
|
|
|
{
|
2018-12-06 06:16:24 -05:00
|
|
|
int palmaConnectionHandle = context.RequestData.ReadInt32();
|
2018-09-20 20:08:35 -04:00
|
|
|
|
2018-12-06 06:16:24 -05:00
|
|
|
Logger.PrintStub(LogClass.ServiceHid, $"Stubbed. PalmaConnectionHandle: {palmaConnectionHandle}");
|
2018-09-20 20:08:35 -04:00
|
|
|
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
// EnablePalmaStep(nn::hid::PalmaConnectionHandle, bool Enable)
|
2018-12-06 06:16:24 -05:00
|
|
|
public long EnablePalmaStep(ServiceCtx context)
|
2018-09-20 20:08:35 -04:00
|
|
|
{
|
2018-12-06 06:16:24 -05:00
|
|
|
int palmaConnectionHandle = context.RequestData.ReadInt32();
|
|
|
|
bool enabledPalmaStep = context.RequestData.ReadBoolean();
|
2018-09-20 20:08:35 -04:00
|
|
|
|
2018-12-06 06:16:24 -05:00
|
|
|
Logger.PrintStub(LogClass.ServiceHid, $"Stubbed. PalmaConnectionHandle: {palmaConnectionHandle} - " +
|
|
|
|
$"EnabledPalmaStep: {enabledPalmaStep}");
|
2018-09-20 20:08:35 -04:00
|
|
|
|
2018-12-06 06:16:24 -05:00
|
|
|
_palmaOperationCompleteEvent.ReadableEvent.Signal();
|
2018-11-19 19:01:36 -05:00
|
|
|
|
2018-09-20 20:08:35 -04:00
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
// SuspendPalmaStep(nn::hid::PalmaConnectionHandle)
|
2018-12-06 06:16:24 -05:00
|
|
|
public long SuspendPalmaStep(ServiceCtx context)
|
2018-09-20 20:08:35 -04:00
|
|
|
{
|
2018-12-06 06:16:24 -05:00
|
|
|
int palmaConnectionHandle = context.RequestData.ReadInt32();
|
2018-09-20 20:08:35 -04:00
|
|
|
|
2018-12-06 06:16:24 -05:00
|
|
|
Logger.PrintStub(LogClass.ServiceHid, $"Stubbed. PalmaConnectionHandle: {palmaConnectionHandle}");
|
2018-09-20 20:08:35 -04:00
|
|
|
|
2018-12-06 06:16:24 -05:00
|
|
|
_palmaOperationCompleteEvent.ReadableEvent.Signal();
|
2018-11-19 19:01:36 -05:00
|
|
|
|
2018-09-20 20:08:35 -04:00
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
// ResetPalmaStep(nn::hid::PalmaConnectionHandle)
|
2018-12-06 06:16:24 -05:00
|
|
|
public long ResetPalmaStep(ServiceCtx context)
|
2018-09-20 20:08:35 -04:00
|
|
|
{
|
2018-12-06 06:16:24 -05:00
|
|
|
int palmaConnectionHandle = context.RequestData.ReadInt32();
|
2018-09-20 20:08:35 -04:00
|
|
|
|
2018-12-06 06:16:24 -05:00
|
|
|
Logger.PrintStub(LogClass.ServiceHid, $"Stubbed. PalmaConnectionHandle: {palmaConnectionHandle}");
|
2018-09-20 20:08:35 -04:00
|
|
|
|
2018-12-06 06:16:24 -05:00
|
|
|
_palmaOperationCompleteEvent.ReadableEvent.Signal();
|
2018-11-19 19:01:36 -05:00
|
|
|
|
2018-09-20 20:08:35 -04:00
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
// ReadPalmaApplicationSection(nn::hid::PalmaConnectionHandle, ulong Unknown0, ulong Unknown1)
|
2018-12-06 06:16:24 -05:00
|
|
|
public long ReadPalmaApplicationSection(ServiceCtx context)
|
2018-09-20 20:08:35 -04:00
|
|
|
{
|
2018-12-06 06:16:24 -05:00
|
|
|
int palmaConnectionHandle = context.RequestData.ReadInt32();
|
|
|
|
long unknown0 = context.RequestData.ReadInt64();
|
|
|
|
long unknown1 = context.RequestData.ReadInt64();
|
2018-09-20 20:08:35 -04:00
|
|
|
|
2018-12-06 06:16:24 -05:00
|
|
|
Logger.PrintStub(LogClass.ServiceHid, $"Stubbed. PalmaConnectionHandle: {palmaConnectionHandle} - " +
|
|
|
|
$"Unknown0: {unknown0} - " +
|
|
|
|
$"Unknown1: {unknown1}");
|
2018-09-20 20:08:35 -04:00
|
|
|
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
// WritePalmaApplicationSection(nn::hid::PalmaConnectionHandle, ulong Unknown0, ulong Unknown1, nn::hid::PalmaApplicationSectionAccessBuffer)
|
2018-12-06 06:16:24 -05:00
|
|
|
public long WritePalmaApplicationSection(ServiceCtx context)
|
2018-09-20 20:08:35 -04:00
|
|
|
{
|
2018-12-06 06:16:24 -05:00
|
|
|
int palmaConnectionHandle = context.RequestData.ReadInt32();
|
|
|
|
long unknown0 = context.RequestData.ReadInt64();
|
|
|
|
long unknown1 = context.RequestData.ReadInt64();
|
2018-09-20 20:08:35 -04:00
|
|
|
// nn::hid::PalmaApplicationSectionAccessBuffer cast is unknown
|
|
|
|
|
2018-12-06 06:16:24 -05:00
|
|
|
Logger.PrintStub(LogClass.ServiceHid, $"Stubbed. PalmaConnectionHandle: {palmaConnectionHandle} - " +
|
|
|
|
$"Unknown0: {unknown0} - " +
|
|
|
|
$"Unknown1: {unknown1}");
|
2018-09-20 20:08:35 -04:00
|
|
|
|
2018-12-06 06:16:24 -05:00
|
|
|
_palmaOperationCompleteEvent.ReadableEvent.Signal();
|
2018-11-19 19:01:36 -05:00
|
|
|
|
2018-09-20 20:08:35 -04:00
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
// ReadPalmaUniqueCode(nn::hid::PalmaConnectionHandle)
|
2018-12-06 06:16:24 -05:00
|
|
|
public long ReadPalmaUniqueCode(ServiceCtx context)
|
2018-09-20 20:08:35 -04:00
|
|
|
{
|
2018-12-06 06:16:24 -05:00
|
|
|
int palmaConnectionHandle = context.RequestData.ReadInt32();
|
2018-09-20 20:08:35 -04:00
|
|
|
|
2018-12-06 06:16:24 -05:00
|
|
|
Logger.PrintStub(LogClass.ServiceHid, $"Stubbed. PalmaConnectionHandle: {palmaConnectionHandle}");
|
2018-09-20 20:08:35 -04:00
|
|
|
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
// SetPalmaUniqueCodeInvalid(nn::hid::PalmaConnectionHandle)
|
2018-12-06 06:16:24 -05:00
|
|
|
public long SetPalmaUniqueCodeInvalid(ServiceCtx context)
|
2018-09-20 20:08:35 -04:00
|
|
|
{
|
2018-12-06 06:16:24 -05:00
|
|
|
int palmaConnectionHandle = context.RequestData.ReadInt32();
|
2018-09-20 20:08:35 -04:00
|
|
|
|
2018-12-06 06:16:24 -05:00
|
|
|
Logger.PrintStub(LogClass.ServiceHid, $"Stubbed. PalmaConnectionHandle: {palmaConnectionHandle}");
|
2018-09-20 20:08:35 -04:00
|
|
|
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
// SetNpadCommunicationMode(long CommunicationMode, nn::applet::AppletResourceUserId)
|
2018-12-06 06:16:24 -05:00
|
|
|
public long SetNpadCommunicationMode(ServiceCtx context)
|
2018-09-20 20:08:35 -04:00
|
|
|
{
|
2018-12-06 06:16:24 -05:00
|
|
|
_npadCommunicationMode = context.RequestData.ReadInt64();
|
|
|
|
long appletResourceUserId = context.RequestData.ReadInt64();
|
2018-09-20 20:08:35 -04:00
|
|
|
|
2018-12-06 06:16:24 -05:00
|
|
|
Logger.PrintStub(LogClass.ServiceHid, $"Stubbed. AppletResourceUserId: {appletResourceUserId} - " +
|
|
|
|
$"NpadCommunicationMode: {_npadCommunicationMode}");
|
2018-09-20 20:08:35 -04:00
|
|
|
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
// GetNpadCommunicationMode() -> long CommunicationMode
|
2018-12-06 06:16:24 -05:00
|
|
|
public long GetNpadCommunicationMode(ServiceCtx context)
|
2018-09-20 20:08:35 -04:00
|
|
|
{
|
2018-12-06 06:16:24 -05:00
|
|
|
context.ResponseData.Write(_npadCommunicationMode);
|
2018-09-20 20:08:35 -04:00
|
|
|
|
2018-12-06 06:16:24 -05:00
|
|
|
Logger.PrintStub(LogClass.ServiceHid, $"Stubbed. CommunicationMode: {_npadCommunicationMode}");
|
2018-04-16 20:24:42 -04:00
|
|
|
|
2018-03-03 22:06:44 -05:00
|
|
|
return 0;
|
|
|
|
}
|
2018-02-24 23:34:16 -05:00
|
|
|
}
|
2018-04-17 12:40:22 -04:00
|
|
|
}
|