From 3443023a0844822f4f320ea4f75d9522fb5bbc01 Mon Sep 17 00:00:00 2001 From: Mary Date: Sun, 2 May 2021 22:01:30 +0200 Subject: hid: Rewrite shared memory management (#2257) * hid: Rewrite shared memory management This entirely rewrite our ancient (and original) HID shared memory interface to be more usable and accurate. HID update logics were updated to reflect those changes but should work still the same way it previously did. This need heavy testing just in case to avoid possible regressions. * Silence warnings * Address gdkchan's comments * Address Ac_K's comments * Address one missing nit --- Ryujinx.Input/HLE/NpadController.cs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'Ryujinx.Input') diff --git a/Ryujinx.Input/HLE/NpadController.cs b/Ryujinx.Input/HLE/NpadController.cs index d3553d64..e1a8e2d7 100644 --- a/Ryujinx.Input/HLE/NpadController.cs +++ b/Ryujinx.Input/HLE/NpadController.cs @@ -456,14 +456,14 @@ namespace Ryujinx.Input.HLE KeyboardInput hidKeyboard = new KeyboardInput { Modifier = 0, - Keys = new int[0x8] + Keys = new ulong[0x4] }; foreach (HLEKeyboardMappingEntry entry in KeyMapping) { - int value = keyboardState.IsPressed(entry.TargetKey) ? 1 : 0; + ulong value = keyboardState.IsPressed(entry.TargetKey) ? 1UL : 0UL; - hidKeyboard.Keys[entry.Target / 0x20] |= (value << (entry.Target % 0x20)); + hidKeyboard.Keys[entry.Target / 0x40] |= (value << (entry.Target % 0x40)); } foreach (HLEKeyboardMappingEntry entry in KeyModifierMapping) -- cgit v1.2.3