working dos vga writes!
This commit is contained in:
1 parent
5789cafd4e
commit
55ac075e4d
25 files changed
+454
-149
No files matched your search
@@ -0,0 +1,29 @@
|
||||
/*
|
||||
Simple fixed point bitcrash.
|
||||
https://github.com/schollz/fpfx
|
||||
*/
|
||||
|
||||
#ifndef COM_SND_BITCRSH_H
|
||||
#define COM_SND_BITCRSH_H
|
||||
|
||||
#include "../fix.h"
|
||||
#include <stdint.h>
|
||||
|
||||
struct com_snd_bitcrsh {
|
||||
uint8_t bits; /* How much to trim when triggered. */
|
||||
uint8_t reduce; /* Every Nth sample frame. */
|
||||
};
|
||||
|
||||
static void com_snd_bitcrsh_process(Bitcrush *bitcrush, int32_t *buf,
|
||||
unsigned int nr_samples) {
|
||||
for (int i = 0; i < nr_samples; i++) {
|
||||
if (i % bitcrush->reduce == 0) {
|
||||
// bitcrush fixedpoint
|
||||
buf[i] = buf[i] >> (16 - bitcrush->bits) << (16 - bitcrush->bits);
|
||||
} else {
|
||||
buf[i] = buf[i - 1];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
||||
Reference in new issue
Block a user