diff --git a/Ryujinx.HLE/HOS/Services/Hid/IHidServer.cs b/Ryujinx.HLE/HOS/Services/Hid/IHidServer.cs index 1b8e5da817..1af734ffcb 100644 --- a/Ryujinx.HLE/HOS/Services/Hid/IHidServer.cs +++ b/Ryujinx.HLE/HOS/Services/Hid/IHidServer.cs @@ -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 @@ -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; } diff --git a/Ryujinx.HLE/Input/Hid.cs b/Ryujinx.HLE/Input/Hid.cs index cb63ef224f..6b198a7ffe 100644 --- a/Ryujinx.HLE/Input/Hid.cs +++ b/Ryujinx.HLE/Input/Hid.cs @@ -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); diff --git a/Ryujinx.HLE/Input/HidBaseController.cs b/Ryujinx.HLE/Input/HidBaseController.cs index a3fccd2d71..d5fcc4c7db 100644 --- a/Ryujinx.HLE/Input/HidBaseController.cs +++ b/Ryujinx.HLE/Input/HidBaseController.cs @@ -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); diff --git a/Ryujinx.HLE/Input/HidNpadController.cs b/Ryujinx.HLE/Input/HidNpadController.cs index 95be175bfe..707ded4f89 100644 --- a/Ryujinx.HLE/Input/HidNpadController.cs +++ b/Ryujinx.HLE/Input/HidNpadController.cs @@ -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); } diff --git a/Ryujinx.HLE/Input/HidProController.cs b/Ryujinx.HLE/Input/HidProController.cs index cc97b206a6..c2d02f64d8 100644 --- a/Ryujinx.HLE/Input/HidProController.cs +++ b/Ryujinx.HLE/Input/HidProController.cs @@ -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)); } }