diff --git a/DS4Windows/DS4Library/DS4Device.cs b/DS4Windows/DS4Library/DS4Device.cs index 331fc8e..5eb684b 100644 --- a/DS4Windows/DS4Library/DS4Device.cs +++ b/DS4Windows/DS4Library/DS4Device.cs @@ -1089,7 +1089,7 @@ namespace DS4Windows hDevice.flush_Queue(); } - private void sendOutputReport(bool synchronous) + private unsafe void sendOutputReport(bool synchronous) { setTestRumble(); setHapticState(); @@ -1161,8 +1161,14 @@ namespace DS4Windows else { bool output = outputPendCount > 0, change = false; - for (int i = 0, arlen = outputReport.Length; !change && i < arlen; i++) - change = outputReport[i] != outReportBuffer[i]; + fixed (byte* byteR = outputReport, byteB = outReportBuffer) + { + for (int i = 0, arlen = outputReport.Length; !change && i < arlen; i++) + change = byteR[i] != byteB[i]; + } + + //for (int i = 0, arlen = outputReport.Length; !change && i < arlen; i++) + // change = outputReport[i] != outReportBuffer[i]; if (output || change) {