-
Notifications
You must be signed in to change notification settings - Fork 57
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Implement a high-level emulation of the MP2K audio mixer. (#170)
- Loading branch information
Showing
14 changed files
with
719 additions
and
282 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
/* | ||
* Copyright (C) 2021 fleroviux | ||
* | ||
* Licensed under GPLv3 or any later version. | ||
* Refer to the included LICENSE file. | ||
*/ | ||
|
||
#include <common/integer.hpp> | ||
|
||
inline u32 crc32(u8 const* data, int length) { | ||
u32 crc32 = 0xFFFFFFFF; | ||
|
||
while (length-- != 0) { | ||
u8 byte = *data++; | ||
|
||
// TODO: speed this up using a lookup table. | ||
for (int i = 0; i < 8; i++) { | ||
if ((crc32 ^ byte) & 1) { | ||
crc32 = (crc32 >> 1) ^ 0xEDB88320; | ||
} else { | ||
crc32 >>= 1; | ||
} | ||
byte >>= 1; | ||
} | ||
} | ||
|
||
return ~crc32; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.