private void InitializeJoyconPair( JoyConColor LeftColorBody, JoyConColor LeftColorButtons, JoyConColor RightColorBody, JoyConColor RightColorButtons) { long BaseControllerOffset = HidPosition + HidControllersOffset + 8 * HidControllerSize; HidControllerType Type = HidControllerType.ControllerType_Handheld; bool IsHalf = false; HidControllerColorDesc SingleColorDesc = HidControllerColorDesc.ColorDesc_ColorsNonexistent; JoyConColor SingleColorBody = JoyConColor.Black; JoyConColor SingleColorButtons = JoyConColor.Black; HidControllerColorDesc SplitColorDesc = 0; Device.Memory.WriteInt32(BaseControllerOffset + 0x0, (int)Type); Device.Memory.WriteInt32(BaseControllerOffset + 0x4, IsHalf ? 1 : 0); Device.Memory.WriteInt32(BaseControllerOffset + 0x8, (int)SingleColorDesc); Device.Memory.WriteInt32(BaseControllerOffset + 0xc, (int)SingleColorBody); Device.Memory.WriteInt32(BaseControllerOffset + 0x10, (int)SingleColorButtons); Device.Memory.WriteInt32(BaseControllerOffset + 0x14, (int)SplitColorDesc); Device.Memory.WriteInt32(BaseControllerOffset + 0x18, (int)LeftColorBody); Device.Memory.WriteInt32(BaseControllerOffset + 0x1c, (int)LeftColorButtons); Device.Memory.WriteInt32(BaseControllerOffset + 0x20, (int)RightColorBody); Device.Memory.WriteInt32(BaseControllerOffset + 0x24, (int)RightColorButtons); }
private static void ReadNNColorIntoJoyConColor(ref JoyConColor controllerColor, int mainColor, int subColor) { controllerColor.Main = ConvertNNColorToColor32(mainColor); controllerColor.Sub = ConvertNNColorToColor32(subColor); }