new version
[Chiptunes.git] / foo.c
diff --git a/foo.c b/foo.c
index b7a21e81de89e3a9eabc1543ac3c241ee6b5e420..4caddeafebf85fbbbaa77418b9b04b33dcd090bd 100644 (file)
--- a/foo.c
+++ b/foo.c
@@ -36,8 +36,16 @@ int main(void) {
        u8 acc;
        //TODO: clear all vars/registers
        for (;;) {
-               acc = 0;
-               n = (i2<<2 | i1>>6);
+               MOV     (n, i2)
+               LSL     (n)
+               LSL     (n)
+               #define tmp acc
+               MOV     (tmp, i1)
+               SWAP    (tmp)
+               ANDI    (tmp, 0x0f)
+               tmp >>= 2;
+               OR      (n, tmp)
+               #undef tmp
                s = (i3<<7 | i2>>1);
 
                //voice 1:
@@ -55,7 +63,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)
Imprint / Impressum