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