X-Git-Url: https://git.gir.st/Chiptunes.git/blobdiff_plain/238720910767fee2ed2b0433432f660384f74966..e389879f63ee13e638364da4a624a1b3d137f8a5:/foo.c diff --git a/foo.c b/foo.c index b7a21e8..6c1e738 100644 --- a/foo.c +++ b/foo.c @@ -36,9 +36,26 @@ int main(void) { u8 acc; //TODO: clear all vars/registers for (;;) { - acc = 0; - n = (i2<<2 | i1>>6); - s = (i3<<7 | i2>>1); + MOV (n, i2) + LSL (n) + LSL (n) + #define tmp acc + MOV (tmp, i1) + SWAP (tmp) + ANDI (tmp, 0x0f) + LSR (tmp) + LSR (tmp) + OR (n, tmp) + #undef tmp + MOV (s, i3) + ROR (s) + ROR (s) + ANDI (s, 0x80) + #define tmp acc + MOV (tmp, i2) + LSR (tmp) + OR (s, tmp) + #undef tmp //voice 1: LDI (x, 1) @@ -55,7 +72,9 @@ int main(void) { LSL (tmp) LSL (tmp) MOV (t, i1) - t >>= 5; + SWAP (t) + ANDI (t, 0xf) + LSR (t) OR (t, tmp) #undef tmp EOR (t, n)