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 8 xxx = (i*xxx) >> o;
156da8fc 9 AND (xxx, x)
da675ce7 10 return ((3 & xxx));
61fab018
TG
11};
12
13int main(void) {
fe9a76e4
TG
14 int i;
15 int n;
16 int s;
ab6fe4c2 17 u8 acc;
fe9a76e4 18 for (i = 0;; i++) {
ab6fe4c2 19 acc = 0;
fe9a76e4
TG
20 n = i >> 14;
21 s = i >> 17;
ab6fe4c2
TG
22 acc += g(i, 1, n, 12);
23 acc += g(i, s, n ^ i >> 13, 10);
24 acc += g(i, s / 3, n + ((i >> 11) % 3), 10);
25 acc += g(i, s / 5, 8 + n - ((i >> 10) % 3), 9);
26 putchar(acc<<4);
fe9a76e4 27 }
61fab018 28}
Imprint / Impressum