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) {
65dfa14e 6 u8 xxx = (3 & i >> 16 ? "BY}6YB6%" : "Qj}6jQ6%")[t & 0x7];
da32ed67 7 SUBI (xxx, -51)
b312e447 8 xxx = (i*xxx) >> o;
156da8fc 9 AND (xxx, x)
cb4533d4
TG
10 ANDI (xxx, 3)
11 return xxx;
61fab018
TG
12};
13
14int main(void) {
fe9a76e4
TG
15 int i;
16 int n;
17 int s;
ab6fe4c2 18 u8 acc;
fe9a76e4 19 for (i = 0;; i++) {
ab6fe4c2 20 acc = 0;
fe9a76e4
TG
21 n = i >> 14;
22 s = i >> 17;
ab6fe4c2
TG
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);
fe9a76e4 28 }
61fab018 29}
Imprint / Impressum