signal hid events
This commit is contained in:
parent
452a3bcbc3
commit
a4277032c4
5 changed files with 37 additions and 18 deletions
|
@ -161,6 +161,9 @@ namespace Ryujinx.HLE.HOS.Services.Hid
|
|||
SensorFusionParams = new HidSensorFusionParameters();
|
||||
AccelerometerParams = new HidAccelerometerParameters();
|
||||
VibrationValue = new HidVibrationValue();
|
||||
|
||||
// TODO: signal event at right place
|
||||
XpadIdEvent.ReadableEvent.Signal();
|
||||
}
|
||||
|
||||
// CreateAppletResource(nn::applet::AppletResourceUserId) -> object<nn::hid::IAppletResource>
|
||||
|
@ -659,6 +662,8 @@ namespace Ryujinx.HLE.HOS.Services.Hid
|
|||
Logger.PrintStub(LogClass.ServiceHid, $"Stubbed. AppletResourceUserId: {AppletResourceUserId} - " +
|
||||
$"NpadStyleSet: {NpadStyleSet}");
|
||||
|
||||
NpadStyleSetUpdateEvent.ReadableEvent.Signal();
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
@ -1348,6 +1353,8 @@ namespace Ryujinx.HLE.HOS.Services.Hid
|
|||
|
||||
Logger.PrintStub(LogClass.ServiceHid, $"Stubbed. PalmaConnectionHandle: {PalmaConnectionHandle}");
|
||||
|
||||
PalmaOperationCompleteEvent.ReadableEvent.Signal();
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
@ -1392,6 +1399,8 @@ namespace Ryujinx.HLE.HOS.Services.Hid
|
|||
Logger.PrintStub(LogClass.ServiceHid, $"Stubbed. PalmaConnectionHandle: {PalmaConnectionHandle} - " +
|
||||
$"Unknown0: {Unknown0}");
|
||||
|
||||
PalmaOperationCompleteEvent.ReadableEvent.Signal();
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
@ -1404,6 +1413,8 @@ namespace Ryujinx.HLE.HOS.Services.Hid
|
|||
Logger.PrintStub(LogClass.ServiceHid, $"Stubbed. PalmaConnectionHandle: {PalmaConnectionHandle} - " +
|
||||
$"FrModeType: {FrModeType}");
|
||||
|
||||
PalmaOperationCompleteEvent.ReadableEvent.Signal();
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
@ -1426,6 +1437,8 @@ namespace Ryujinx.HLE.HOS.Services.Hid
|
|||
Logger.PrintStub(LogClass.ServiceHid, $"Stubbed. PalmaConnectionHandle: {PalmaConnectionHandle} - " +
|
||||
$"EnabledPalmaStep: {EnabledPalmaStep}");
|
||||
|
||||
PalmaOperationCompleteEvent.ReadableEvent.Signal();
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
@ -1436,6 +1449,8 @@ namespace Ryujinx.HLE.HOS.Services.Hid
|
|||
|
||||
Logger.PrintStub(LogClass.ServiceHid, $"Stubbed. PalmaConnectionHandle: {PalmaConnectionHandle}");
|
||||
|
||||
PalmaOperationCompleteEvent.ReadableEvent.Signal();
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
@ -1446,6 +1461,8 @@ namespace Ryujinx.HLE.HOS.Services.Hid
|
|||
|
||||
Logger.PrintStub(LogClass.ServiceHid, $"Stubbed. PalmaConnectionHandle: {PalmaConnectionHandle}");
|
||||
|
||||
PalmaOperationCompleteEvent.ReadableEvent.Signal();
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
@ -1475,6 +1492,8 @@ namespace Ryujinx.HLE.HOS.Services.Hid
|
|||
$"Unknown0: {Unknown0} - " +
|
||||
$"Unknown1: {Unknown1}");
|
||||
|
||||
PalmaOperationCompleteEvent.ReadableEvent.Signal();
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
|
@ -98,8 +98,8 @@ namespace Ryujinx.HLE.Input
|
|||
|
||||
long Timestamp = GetTimestamp();
|
||||
|
||||
Device.Memory.WriteInt64(TouchScreenOffset + 0x0, Timestamp);
|
||||
Device.Memory.WriteInt64(TouchScreenOffset + 0x8, HidEntryCount);
|
||||
Device.Memory.WriteInt64(TouchScreenOffset + 0x00, Timestamp);
|
||||
Device.Memory.WriteInt64(TouchScreenOffset + 0x08, HidEntryCount);
|
||||
Device.Memory.WriteInt64(TouchScreenOffset + 0x10, CurrEntry);
|
||||
Device.Memory.WriteInt64(TouchScreenOffset + 0x18, HidEntryCount - 1);
|
||||
Device.Memory.WriteInt64(TouchScreenOffset + 0x20, Timestamp);
|
||||
|
@ -112,8 +112,8 @@ namespace Ryujinx.HLE.Input
|
|||
|
||||
TouchEntryOffset += CurrEntry * HidTouchEntrySize;
|
||||
|
||||
Device.Memory.WriteInt64(TouchEntryOffset + 0x0, SampleCounter);
|
||||
Device.Memory.WriteInt64(TouchEntryOffset + 0x8, Points.Length);
|
||||
Device.Memory.WriteInt64(TouchEntryOffset + 0x00, SampleCounter);
|
||||
Device.Memory.WriteInt64(TouchEntryOffset + 0x08, Points.Length);
|
||||
|
||||
TouchEntryOffset += HidTouchEntryHeaderSize;
|
||||
|
||||
|
@ -123,9 +123,9 @@ namespace Ryujinx.HLE.Input
|
|||
|
||||
foreach (HidTouchPoint Point in Points)
|
||||
{
|
||||
Device.Memory.WriteInt64(TouchEntryOffset + 0x0, SampleCounter);
|
||||
Device.Memory.WriteInt32(TouchEntryOffset + 0x8, Padding);
|
||||
Device.Memory.WriteInt32(TouchEntryOffset + 0xc, Index++);
|
||||
Device.Memory.WriteInt64(TouchEntryOffset + 0x00, SampleCounter);
|
||||
Device.Memory.WriteInt32(TouchEntryOffset + 0x08, Padding);
|
||||
Device.Memory.WriteInt32(TouchEntryOffset + 0x0c, Index++);
|
||||
Device.Memory.WriteInt32(TouchEntryOffset + 0x10, Point.X);
|
||||
Device.Memory.WriteInt32(TouchEntryOffset + 0x14, Point.Y);
|
||||
Device.Memory.WriteInt32(TouchEntryOffset + 0x18, Point.DiameterX);
|
||||
|
|
|
@ -27,7 +27,7 @@ namespace Ryujinx.HLE.Input
|
|||
|
||||
Device.Memory.FillWithZeros(Offset, 0x5000);
|
||||
|
||||
Device.Memory.WriteInt32(Offset + 0x0, (int)HidControllerType);
|
||||
Device.Memory.WriteInt32(Offset + 0x00, (int)HidControllerType);
|
||||
}
|
||||
|
||||
public abstract void SendInput(
|
||||
|
@ -51,8 +51,8 @@ namespace Ryujinx.HLE.Input
|
|||
|
||||
long Timestamp = GetTimestamp();
|
||||
|
||||
Device.Memory.WriteInt64(ControllerOffset + 0x0, Timestamp);
|
||||
Device.Memory.WriteInt64(ControllerOffset + 0x8, HidEntryCount);
|
||||
Device.Memory.WriteInt64(ControllerOffset + 0x00, Timestamp);
|
||||
Device.Memory.WriteInt64(ControllerOffset + 0x08, HidEntryCount);
|
||||
Device.Memory.WriteInt64(ControllerOffset + 0x10, CurrEntry);
|
||||
Device.Memory.WriteInt64(ControllerOffset + 0x18, HidEntryCount - 1);
|
||||
|
||||
|
@ -64,8 +64,8 @@ namespace Ryujinx.HLE.Input
|
|||
|
||||
long SampleCounter = Device.Memory.ReadInt64(LastEntryOffset) + 1;
|
||||
|
||||
Device.Memory.WriteInt64(ControllerOffset + 0x0, SampleCounter);
|
||||
Device.Memory.WriteInt64(ControllerOffset + 0x8, SampleCounter);
|
||||
Device.Memory.WriteInt64(ControllerOffset + 0x00, SampleCounter);
|
||||
Device.Memory.WriteInt64(ControllerOffset + 0x08, SampleCounter);
|
||||
Device.Memory.WriteInt64(ControllerOffset + 0x10, (uint)Buttons);
|
||||
|
||||
Device.Memory.WriteInt32(ControllerOffset + 0x18, LeftStick.DX);
|
||||
|
|
|
@ -51,12 +51,12 @@
|
|||
NpadColor SingleColorBody = NpadColor.Black;
|
||||
NpadColor SingleColorButtons = NpadColor.Black;
|
||||
|
||||
Device.Memory.WriteInt32(Offset + 0x4, IsHalf ? 1 : 0);
|
||||
Device.Memory.WriteInt32(Offset + 0x04, IsHalf ? 1 : 0);
|
||||
|
||||
if (IsHalf)
|
||||
{
|
||||
Device.Memory.WriteInt32(Offset + 0x8, (int)SingleColorDesc);
|
||||
Device.Memory.WriteInt32(Offset + 0xc, (int)SingleColorBody);
|
||||
Device.Memory.WriteInt32(Offset + 0x08, (int)SingleColorDesc);
|
||||
Device.Memory.WriteInt32(Offset + 0x0c, (int)SingleColorBody);
|
||||
Device.Memory.WriteInt32(Offset + 0x10, (int)SingleColorButtons);
|
||||
Device.Memory.WriteInt32(Offset + 0x14, (int)SplitColorDesc);
|
||||
}
|
||||
|
|
|
@ -21,8 +21,8 @@
|
|||
NpadColor SingleColorBody = NpadColor.Black;
|
||||
NpadColor SingleColorButtons = NpadColor.Black;
|
||||
|
||||
Device.Memory.WriteInt32(Offset + 0x8, (int)SingleColorDesc);
|
||||
Device.Memory.WriteInt32(Offset + 0xc, (int)SingleColorBody);
|
||||
Device.Memory.WriteInt32(Offset + 0x08, (int)SingleColorDesc);
|
||||
Device.Memory.WriteInt32(Offset + 0x0c, (int)SingleColorBody);
|
||||
Device.Memory.WriteInt32(Offset + 0x10, (int)SingleColorButtons);
|
||||
Device.Memory.WriteInt32(Offset + 0x14, (int)SplitColorDesc);
|
||||
|
||||
|
@ -37,7 +37,7 @@
|
|||
long ControllerOffset = WriteInput(Buttons, LeftStick, RightStick, HidControllerLayouts.Pro_Controller);
|
||||
|
||||
Device.Memory.WriteInt64(ControllerOffset + 0x28,
|
||||
Connected ? (uint)HidControllerConnState.Controller_State_Connected : 0 |
|
||||
(Connected ? (uint)HidControllerConnState.Controller_State_Connected : 0) |
|
||||
(Wired ? (uint)HidControllerConnState.Controller_State_Wired : 0));
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue