git://git.gir.st
/
Chiptunes-pms150c.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
63fc42a
)
new version
author
Tobias Girstmair
<tobi@isticktoit.net>
Thu, 4 Mar 2021 00:09:10 +0000
(
01:09
+0100)
committer
Tobias Girstmair
<tobi@isticktoit.net>
Thu, 4 Mar 2021 00:09:31 +0000
(
01:09
+0100)
bsv.c
patch
|
blob
|
blame
|
history
diff --git
a/bsv.c
b/bsv.c
index 086dc12eeb96885b1498e998160fb9463415bafa..ed30e94626a3cb0d47f7a92f143c2e20a093a4da 100644
(file)
--- a/
bsv.c
+++ b/
bsv.c
@@
-1,6
+1,5
@@
typedef unsigned char u8;
-int i;
u8 i0, i1, i2;
u8 notes[] = {
@@
-12,13
+11,12
@@
u8 g(u8 x, u8 t, u8 o){
u8 notes_ix = t & 0x7;
if(3&i2)
notes_ix += 8;
- u8 result = (
i
*notes[notes_ix])>>o;
+ u8 result = (
(i1<<8|i0)
*notes[notes_ix])>>o;
result &= x;
result &= 3;
return result;
}
void main(void){
- i = 0;
i0 = i1 = i2 = 0;
for(;;) {
u8 sample;
@@
-51,7
+49,6
@@
void main(void){
putchar(sample<<4);
- i++;
i0++;
i1 += !i0;
i2 += !i1 && !i0;