new version
[Chiptunes.git] / foo.c
1 #include <stdio.h>
2 #include "fakeasm.h"
3 typedef unsigned char u8;
4
5 int g(int i, u8 x, u8 t, u8 o) {
6 u8 xxx = (3 & i >> 16 ? "BY}6YB6%" : "Qj}6jQ6%")[t % 8];
7 SUBI (xxx, -51)
8 xxx = (i*xxx) >> o;
9 AND (xxx, x)
10 ANDI (xxx, 3)
11 return xxx;
12 };
13
14 int main(void) {
15 int i;
16 int n;
17 int s;
18 u8 acc;
19 for (i = 0;; i++) {
20 acc = 0;
21 n = i >> 14;
22 s = i >> 17;
23 acc += g(i, 1, n, 12);
24 acc += g(i, s, n ^ i >> 13, 10);
25 acc += g(i, s / 3, n + ((i >> 11) % 3), 10);
26 acc += g(i, s / 5, 8 + n - ((i >> 10) % 3), 9);
27 putchar(acc<<4);
28 }
29 }
Imprint / Impressum