Changeset 8cc57e6 in buchla-68k
- Timestamp:
- 11/11/2017 10:03:09 PM (7 years ago)
- Branches:
- master
- Children:
- 572daa7
- Parents:
- 3ac8e1b
- Location:
- ram
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
ram/etiosc.c
r3ac8e1b r8cc57e6 11 11 12 12 /* C C# D D# E F F# G G# A A# B */ 13 int 16_t notes[] = {2, 2, 3, 3, 4, 5, 5, 6, 6, 0, 0, 1};13 int8_t notes[] = {2, 2, 3, 3, 4, 5, 5, 6, 6, 0, 0, 1}; 14 14 15 15 /* A B C D E F G */ … … 19 19 20 20 /* C C# D D# E F F# G G# A A# B */ 21 int 16_t sharps[] = {7, 9, 7, 9, 7, 7, 9, 7, 9, 7, 9, 7};21 int8_t sharps[] = {7, 9, 7, 9, 7, 7, 9, 7, 9, 7, 9, 7}; 22 22 23 23 int16_t shrpflt[] = { 0, -100, 100}; … … 55 55 if (rat EQ ratio[inum + den]) { 56 56 57 ebuf[0] = num + '0';58 ebuf[2] = den + '0';57 ebuf[0] = (int8_t)(num + '0'); 58 ebuf[2] = (int8_t)(den + '0'); 59 59 return; 60 60 } … … 74 74 75 75 cv -= 160; 76 buf[0] = cv / 1200;77 rem = cv - (buf[0] * 1200);76 buf[0] = (int8_t)(cv / 1200); 77 rem = (int8_t)(cv - (buf[0] * 1200)); 78 78 tmp = rem / 100; 79 79 rem -= (tmp * 100); 80 80 buf[1] = notes[tmp]; 81 81 buf[2] = sharps[tmp]; 82 buf[3] = rem / 10;83 buf[4] = rem - (buf[3] * 10);82 buf[3] = (int8_t)(rem / 10); 83 buf[4] = (int8_t)(rem - (buf[3] * 10)); 84 84 } 85 85 … … 208 208 209 209 ip->idhos1v = val << 1; 210 ip->idhos1c = (i p->idhos1c & ~OC_MOD) | bform;210 ip->idhos1c = (int8_t)((ip->idhos1c & ~OC_MOD) | bform); 211 211 break; 212 212 … … 214 214 215 215 ip->idhos2v = val << 1; 216 ip->idhos2c = (i p->idhos2c & ~OC_MOD) | bform;216 ip->idhos2c = (int8_t)((ip->idhos2c & ~OC_MOD) | bform); 217 217 break; 218 218 … … 220 220 221 221 ip->idhos3v = val << 1; 222 ip->idhos3c = (i p->idhos3c & ~OC_MOD) | bform;222 ip->idhos3c = (int8_t)((ip->idhos3c & ~OC_MOD) | bform); 223 223 break; 224 224 … … 226 226 227 227 ip->idhos4v = val << 1; 228 ip->idhos4c = (i p->idhos4c & ~OC_MOD) | bform;229 break; 230 } 231 232 ip->idhfnc[v].idftmd = (i p->idhfnc[v].idftmd & ~I_NRATIO)233 | ((bform & 2) ? I_NRATIO : 0) ;228 ip->idhos4c = (int8_t)((ip->idhos4c & ~OC_MOD) | bform); 229 break; 230 } 231 232 ip->idhfnc[v].idftmd = (int8_t)((ip->idhfnc[v].idftmd & ~I_NRATIO) 233 | ((bform & 2) ? I_NRATIO : 0)); 234 234 } 235 235 … … 377 377 strcpy(dspbuf, "Pch "); 378 378 cnvc2p(&dspbuf[4], (val >> 1)); 379 dspbuf[4] += '0';380 dspbuf[5] += 'A';379 dspbuf[4] = (int8_t)(dspbuf[4] + '0'); 380 dspbuf[5] = (int8_t)(dspbuf[5] + 'A'); 381 381 dspbuf[6] = sfdsp[dspbuf[6] - 7]; 382 dspbuf[7] += '0';383 dspbuf[8] += '0';382 dspbuf[7] = (int8_t)(dspbuf[7] + '0'); 383 dspbuf[8] = (int8_t)(dspbuf[8] + '0'); 384 384 dspbuf[9] = ' '; 385 385 dspbuf[10] = ocs; … … 529 529 case 0: 530 530 531 ip->idhos1c = (i p->idhos1c & ~OC_SYN) | (t ? OC_SYN : 0);531 ip->idhos1c = (int8_t)((ip->idhos1c & ~OC_SYN) | (t ? OC_SYN : 0)); 532 532 break; 533 533 534 534 case 1: 535 535 536 ip->idhos2c = (i p->idhos2c & ~OC_SYN) | (t ? OC_SYN : 0);536 ip->idhos2c = (int8_t)((ip->idhos2c & ~OC_SYN) | (t ? OC_SYN : 0)); 537 537 break; 538 538 539 539 case 2: 540 540 541 ip->idhos3c = (i p->idhos3c & ~OC_SYN) | (t ? OC_SYN : 0);541 ip->idhos3c = (int8_t)((ip->idhos3c & ~OC_SYN) | (t ? OC_SYN : 0)); 542 542 break; 543 543 … … 632 632 } else { 633 633 634 ebuf[stccol - 41] = k + '0';634 ebuf[stccol - 41] = (int8_t)(k + '0'); 635 635 } 636 636 637 dspbuf[0] = ( k > 9) ? k : (k + '0');637 dspbuf[0] = (int8_t)((k > 9) ? k : (k + '0')); 638 638 dspbuf[1] = '\0'; 639 639 … … 656 656 if (k) { 657 657 658 ebuf[0] = dspbuf[0] = k + '0';658 ebuf[0] = dspbuf[0] = (int8_t)(k + '0'); 659 659 dspbuf[1] = '\0'; 660 660 … … 677 677 if (k) { 678 678 679 ebuf[2] = dspbuf[0] = k + '0';679 ebuf[2] = dspbuf[0] = (int8_t)(k + '0'); 680 680 dspbuf[1] = '\0'; 681 681 … … 700 700 return(FAILURE); 701 701 702 ebuf[stccol - 40] = k + '0';703 dspbuf[0] = k + '0';702 ebuf[stccol - 40] = (int8_t)(k + '0'); 703 dspbuf[0] = (int8_t)(k + '0'); 704 704 dspbuf[1] = '\0'; 705 705 … … 726 726 case 40: 727 727 728 ebuf[0] = k;729 dspbuf[0] = k + '0';728 ebuf[0] = (int8_t)k; 729 dspbuf[0] = (int8_t)(k + '0'); 730 730 break; 731 731 … … 735 735 return(FAILURE); 736 736 737 ebuf[1] = k;738 dspbuf[0] = k + 'A';737 ebuf[1] = (int8_t)k; 738 dspbuf[0] = (int8_t)(k + 'A'); 739 739 break; 740 740 … … 743 743 if (k EQ 7) { /* blank */ 744 744 745 ebuf[2] = k;745 ebuf[2] = (int8_t)k; 746 746 dspbuf[0] = sfdsp[0]; 747 747 break; … … 749 749 } else if (k EQ 8) { /* flat */ 750 750 751 ebuf[2] = k;751 ebuf[2] = (int8_t)k; 752 752 dspbuf[0] = sfdsp[1]; 753 753 break; … … 755 755 } else if (k EQ 9) { /* sharp */ 756 756 757 ebuf[2] = k;757 ebuf[2] = (int8_t)k; 758 758 dspbuf[0] = sfdsp[2]; 759 759 break; … … 764 764 case 44: 765 765 766 ebuf[stccol - 40] = k;767 dspbuf[0] = k + '0';766 ebuf[stccol - 40] = (int8_t)k; 767 dspbuf[0] = (int8_t)(k + '0'); 768 768 break; 769 769 } -
ram/etiosc.x
r3ac8e1b r8cc57e6 17 17 18 18 extern int16_t ndvals[10]; 19 extern int 16_t notes[];19 extern int8_t notes[]; 20 20 extern int16_t pitches[]; 21 21 extern int16_t ratio[100]; 22 22 extern int8_t sfdsp[]; 23 extern int 16_t sharps[];23 extern int8_t sharps[]; 24 24 extern int16_t shrpflt[]; 25 25
Note:
See TracChangeset
for help on using the changeset viewer.