new version
authorTobias Girstmair <tobi@isticktoit.net>
Thu, 4 Mar 2021 16:34:37 +0000 (17:34 +0100)
committerTobias Girstmair <tobi@isticktoit.net>
Thu, 4 Mar 2021 16:34:37 +0000 (17:34 +0100)
bsv.c

diff --git a/bsv.c b/bsv.c
index a6863d4a8db3b6a4e47dbb80a61d6b55431d2039..a784857466fc21e0103fcb49c29154c7a0ce482a 100644 (file)
--- a/bsv.c
+++ b/bsv.c
@@ -46,10 +46,18 @@ void mod3(void) {
 }
 
 void g(void){
-       u8 notes_ix = acc & 0x7;
-       if(3&i2)
-               notes_ix += 8;
-       u8 result = ((i1<<8|i0)*notes[notes_ix])>>8;  // keep hi byte
+       // notes_ix_hi = always 0
+       u8 notes_ix;//lo
+       AND     (acc, 0x7)
+       MOV     (notes_ix, acc)
+       // test i2 & 3:
+       MOV     (acc, i2)
+       AND     (acc, 3)
+       if(3&i2) {// T0SN FLAG.Z (0x00.0) -- skip if !(3&i0)
+               notes_ix |= 8; // SET1 MEM.n
+       }
+       acc = notes[notes_ix]; // IDXM acc, notes_ix
+       u8 result = ((i1<<8|i0)*acc)>>8;  // keep hi byte
        acc = result;
 }
 void main(void){
Imprint / Impressum