mirror of
https://github.com/cemu-project/DS4Windows.git
synced 2024-12-01 21:44:19 +01:00
Minor tweak for CRC32 method
This commit is contained in:
parent
284acc128a
commit
a8b6213c0c
@ -327,39 +327,39 @@ namespace DS4Windows
|
|||||||
bufsize -= 16;
|
bufsize -= 16;
|
||||||
}
|
}
|
||||||
|
|
||||||
while (bufsize >= 8)
|
//while (bufsize >= 8)
|
||||||
//if (bufsize >= 8)
|
//if (bufsize >= 8)
|
||||||
{
|
|
||||||
uint one = (buffer[i++] |
|
|
||||||
(uint)(buffer[i++] << 8) |
|
|
||||||
(uint)(buffer[i++] << 16) |
|
|
||||||
(uint)(buffer[i++] << 24)) ^ crc;
|
|
||||||
uint two = buffer[i++] |
|
|
||||||
(uint)(buffer[i++] << 8) |
|
|
||||||
(uint)(buffer[i++] << 16) |
|
|
||||||
(uint)(buffer[i++] << 24);
|
|
||||||
crc = secondLook[7, one & 0xFF] ^
|
|
||||||
secondLook[6, (one >> 8) & 0xFF] ^
|
|
||||||
secondLook[5, (one >> 16) & 0xFF] ^
|
|
||||||
secondLook[4, one >> 24] ^
|
|
||||||
secondLook[3, two & 0xFF] ^
|
|
||||||
secondLook[2, (two >> 8) & 0xFF] ^
|
|
||||||
secondLook[1, (two >> 16) & 0xFF] ^
|
|
||||||
defaultTable[two >> 24];
|
|
||||||
|
|
||||||
bufsize -= 8;
|
uint one8 = (buffer[i++] |
|
||||||
/*crc ^= buffer[i++] |
|
(uint)(buffer[i++] << 8) |
|
||||||
(uint)(buffer[i++] << 8) |
|
(uint)(buffer[i++] << 16) |
|
||||||
(uint)(buffer[i++] << 16) |
|
(uint)(buffer[i++] << 24)) ^ crc;
|
||||||
(uint)(buffer[i++] << 24);// i = i + 4;
|
uint two8 = buffer[i++] |
|
||||||
//crc ^= buffer[i];
|
(uint)(buffer[i++] << 8) |
|
||||||
crc = secondLook[3, (crc & 0xFF)] ^
|
(uint)(buffer[i++] << 16) |
|
||||||
secondLook[2, ((crc >> 8) & 0xFF)] ^
|
(uint)(buffer[i++] << 24);
|
||||||
secondLook[1, ((crc >> 16) & 0xFF)] ^
|
crc = secondLook[7, one8 & 0xFF] ^
|
||||||
defaultTable[crc >> 24];
|
secondLook[6, (one8 >> 8) & 0xFF] ^
|
||||||
bufsize -= 4;
|
secondLook[5, (one8 >> 16) & 0xFF] ^
|
||||||
*/
|
secondLook[4, one8 >> 24] ^
|
||||||
}
|
secondLook[3, two8 & 0xFF] ^
|
||||||
|
secondLook[2, (two8 >> 8) & 0xFF] ^
|
||||||
|
secondLook[1, (two8 >> 16) & 0xFF] ^
|
||||||
|
defaultTable[two8 >> 24];
|
||||||
|
|
||||||
|
bufsize -= 8;
|
||||||
|
/*crc ^= buffer[i++] |
|
||||||
|
(uint)(buffer[i++] << 8) |
|
||||||
|
(uint)(buffer[i++] << 16) |
|
||||||
|
(uint)(buffer[i++] << 24);// i = i + 4;
|
||||||
|
//crc ^= buffer[i];
|
||||||
|
crc = secondLook[3, (crc & 0xFF)] ^
|
||||||
|
secondLook[2, ((crc >> 8) & 0xFF)] ^
|
||||||
|
secondLook[1, ((crc >> 16) & 0xFF)] ^
|
||||||
|
defaultTable[crc >> 24];
|
||||||
|
bufsize -= 4;
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
while (--bufsize >= 0)
|
while (--bufsize >= 0)
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user