]>
git.gir.st - Chiptunes-pms150c.git/blob - bsv.c
cc0348b4a6a52b6f5a51e40a2d12e7d271abf889
3 typedef unsigned char u8
;
12 0x84, 0x9d, 0xb0, 0x69, 0x9d, 0x84, 0x69, 0x58,
13 0x75, 0x8c, 0xb0, 0x69, 0x8c, 0x75, 0x69, 0x58
16 u8 mod3hi
, mod3lo
; //MEM
19 ADD(mod3lo
,acc
) // mod3lo = hi+lo
21 ADDC0(acc
) // mod3hi, 1bit
25 mod3lo
= mod3hi
+ (mod3lo
>>4) + (mod3lo
& 0xF);
26 mod3lo
= (mod3lo
>> 2) + (mod3lo
& 0x3);
27 mod3lo
= (mod3lo
>> 2) + (mod3lo
& 0x3);
28 if (mod3lo
> 2) mod3lo
= mod3lo
- 3;
33 u8 notes_ix
= acc
& 0x7;
36 u8 result
= ((i1
<<8|i0
)*notes
[notes_ix
])>>8; // keep hi byte
44 MOV (acc
, i2
)// "mov mem,mem"
45 MOV (n
, acc
)// does not exist
65 MOV (tmp_1
, acc
) // fresh tmp_1:
70 OR (acc
, tmp_1
) // tmp_1 done.
86 MOV (tmp_1
, acc
) // acc saved in tmp_1; fresh acc
88 // shift-divide by six
89 // note: i2 is max 0x78; so acc will <= 20. (breaks vor values >=128)
102 AND (acc
, tmp_1
) // acc restored from tmp_1
107 mod3lo
= i2
<<6|i1
>>2;
114 MOV (tmp_1
, acc
) // acc saved in tmp_1; fresh acc
116 // shift-divide by ten
117 // note: i2 is max 0x78; so acc will <= 12.
130 AND (acc
, tmp_1
) // acc restored from tmp_1
139 i1
+= !i0
; // ADDC i1
140 i2
+= !i1
&& !i0
; // ADDC i2