fix homebrew input

This commit is contained in:
emmaus 2018-12-05 22:26:07 +00:00
commit 99b43679c1
4 changed files with 16 additions and 2 deletions

View file

@ -39,7 +39,7 @@ namespace Ryujinx.HLE.Input
PrimaryController.Connect(controllerId); PrimaryController.Connect(controllerId);
} }
private HidControllerButtons UpdateStickButtons( public HidControllerButtons UpdateStickButtons(
HidJoystickPosition leftStick, HidJoystickPosition leftStick,
HidJoystickPosition rightStick) HidJoystickPosition rightStick)
{ {

View file

@ -81,6 +81,12 @@
Device.Memory.WriteInt64(controllerOffset + 0x28, Device.Memory.WriteInt64(controllerOffset + 0x28,
(Connected ? (uint)HidControllerConnState.ControllerStateConnected : 0) | (Connected ? (uint)HidControllerConnState.ControllerStateConnected : 0) |
(_currentLayout == HidControllerLayouts.HandheldJoined ? (uint)HidControllerConnState.ControllerStateWired : 0)); (_currentLayout == HidControllerLayouts.HandheldJoined ? (uint)HidControllerConnState.ControllerStateWired : 0));
controllerOffset = WriteInput(buttons, leftStick, rightStick, HidControllerLayouts.Main);
Device.Memory.WriteInt64(controllerOffset + 0x28,
(Connected ? (uint)HidControllerConnState.ControllerStateWired : 0) |
(uint)HidControllerConnState.ControllerStateWired);
} }
} }
} }

View file

@ -35,10 +35,16 @@
HidJoystickPosition rightStick) HidJoystickPosition rightStick)
{ {
long controllerOffset = WriteInput(buttons, leftStick, rightStick, HidControllerLayouts.ProController); long controllerOffset = WriteInput(buttons, leftStick, rightStick, HidControllerLayouts.ProController);
Device.Memory.WriteInt64(controllerOffset + 0x28, Device.Memory.WriteInt64(controllerOffset + 0x28,
(Connected ? (uint)HidControllerConnState.ControllerStateConnected : 0) | (Connected ? (uint)HidControllerConnState.ControllerStateConnected : 0) |
(_wired ? (uint)HidControllerConnState.ControllerStateWired : 0)); (_wired ? (uint)HidControllerConnState.ControllerStateWired : 0));
controllerOffset = WriteInput(buttons, leftStick, rightStick, HidControllerLayouts.Main);
Device.Memory.WriteInt64(controllerOffset + 0x28,
(Connected ? (uint)HidControllerConnState.ControllerStateWired : 0) |
(uint)HidControllerConnState.ControllerStateWired);
} }
} }
} }

View file

@ -174,6 +174,8 @@ namespace Ryujinx
Dy = rightJoystickDy Dy = rightJoystickDy
}; };
currentButton |= _device.Hid.UpdateStickButtons(leftJoystick, rightJoystick);
bool hasTouch = false; bool hasTouch = false;
//Get screen touch position from left mouse click //Get screen touch position from left mouse click