Changeset 7258c6a in buchla-68k for ram/instdsp.c
- Timestamp:
- 07/09/2017 04:45:34 PM (7 years ago)
- Branches:
- master
- Children:
- 8618599
- Parents:
- 0292fbb
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
ram/instdsp.c
r0292fbb r7258c6a 30 30 /* things defined elsewhere */ 31 31 32 extern void (*point)( short x, short y, short pen);32 extern void (*point)(int16_t x, int16_t y, int16_t pen); 33 33 34 34 extern void fpuint(void); 35 extern u nsigned setipl(unsignedarg);36 extern void cnvc2p( char *buf, short cv);37 38 extern u nsigned tofpu(unsignedtime);39 extern u nsigned fromfpu(unsignedfputime);40 extern u nsigned exp_c(unsignedc);41 42 extern char *dsimlt(char *buf, short src, short mltval);43 44 extern longrand24(void);45 46 /* 47 48 */ 49 50 extern short cxval, cyval, stcrow, stccol, initcfg;51 extern short curslim, idimsw;52 53 extern u nsigned*obj0, *obj2;54 55 extern charbfs[], *srctbl[], sfdsp[];56 extern charvtlin1[], vtlin2[], vtlin3[];35 extern uint16_t setipl(uint16_t arg); 36 extern void cnvc2p(int8_t *buf, int16_t cv); 37 38 extern uint16_t tofpu(uint16_t time); 39 extern uint16_t fromfpu(uint16_t fputime); 40 extern uint16_t exp_c(uint16_t c); 41 42 extern int8_t *dsimlt(int8_t *buf, int16_t src, int16_t mltval); 43 44 extern int32_t rand24(void); 45 46 /* 47 48 */ 49 50 extern int16_t cxval, cyval, stcrow, stccol, initcfg; 51 extern int16_t curslim, idimsw; 52 53 extern uint16_t *obj0, *obj2; 54 55 extern int8_t bfs[], *srctbl[], sfdsp[]; 56 extern int8_t vtlin1[], vtlin2[], vtlin3[]; 57 57 58 58 extern struct sment sments[]; … … 60 60 extern struct sment *vpsms[]; 61 61 62 extern short s_inst[], vce2trg[], vce2grp[];63 64 extern short curfunc; /* current function number */65 extern short curinst; /* current instrument number */66 extern short curpnt; /* current point number (absolute) */67 extern short curvce; /* current voice number */68 extern short idcfsw; /* copy / fetch menu switch */69 extern short idintmp; /* temporary for instrument number */70 extern short idnamsw; /* typewriter switch */71 extern short idsrcsw; /* source menu switch */72 extern short npts; /* number of points in function */73 extern short pecase; /* point edit case variable */74 extern short pntsv; /* point selection state variable */75 extern short subj; /* edited point number (relative) */76 extern short submenu; /* submenu cursor switch */77 extern short temax; /* time upper limit */78 extern short temin; /* time lower limit */79 extern short vlbtype; /* type of message window display */80 extern short wcflag; /* ws/cf menu type */81 extern short wcpage; /* ws/cf menu page */82 83 extern short instmod[12]; /* intrument data modified */84 85 extern u nsigned*instob; /* instrument object pointer */62 extern int16_t s_inst[], vce2trg[], vce2grp[]; 63 64 extern int16_t curfunc; /* current function number */ 65 extern int16_t curinst; /* current instrument number */ 66 extern int16_t curpnt; /* current point number (absolute) */ 67 extern int16_t curvce; /* current voice number */ 68 extern int16_t idcfsw; /* copy / fetch menu switch */ 69 extern int16_t idintmp; /* temporary for instrument number */ 70 extern int16_t idnamsw; /* typewriter switch */ 71 extern int16_t idsrcsw; /* source menu switch */ 72 extern int16_t npts; /* number of points in function */ 73 extern int16_t pecase; /* point edit case variable */ 74 extern int16_t pntsv; /* point selection state variable */ 75 extern int16_t subj; /* edited point number (relative) */ 76 extern int16_t submenu; /* submenu cursor switch */ 77 extern int16_t temax; /* time upper limit */ 78 extern int16_t temin; /* time lower limit */ 79 extern int16_t vlbtype; /* type of message window display */ 80 extern int16_t wcflag; /* ws/cf menu type */ 81 extern int16_t wcpage; /* ws/cf menu page */ 82 83 extern int16_t instmod[12]; /* intrument data modified */ 84 85 extern uint16_t *instob; /* instrument object pointer */ 86 86 87 87 extern struct octent *idoct; /* instrument display octent pointer */ … … 91 91 extern struct instdef vbufs[12]; /* voice instrument buffers */ 92 92 93 extern char*funcndx[256][2]; /* function header pointers */94 extern char*vlbptr[3]; /* variable label pointers */95 96 extern charidbuf[65]; /* display conversion work area */93 extern int8_t *funcndx[256][2]; /* function header pointers */ 94 extern int8_t *vlbptr[3]; /* variable label pointers */ 95 96 extern int8_t idbuf[65]; /* display conversion work area */ 97 97 98 98 /* … … 102 102 /* forward references */ 103 103 104 void idpoint( short x, short y, short pen);105 106 short idbox[][8] = { /* display box parameters */104 void idpoint(int16_t x, int16_t y, int16_t pen); 105 106 int16_t idbox[][8] = { /* display box parameters */ 107 107 108 108 { 1, 1, 84, 26, CFBX00, CBBX00, 0, 1}, /* 0: Freq 1 */ … … 144 144 /* instrument function to FPU function table */ 145 145 146 short fnoff[NFINST] = {146 int16_t fnoff[NFINST] = { 147 147 148 148 1, /* 0: Freq 1 */ … … 161 161 }; 162 162 163 short inspal[16][3] = { /* instrument display color palette */163 int16_t inspal[16][3] = { /* instrument display color palette */ 164 164 165 165 {0, 0, 0}, /* 0 */ … … 185 185 */ 186 186 187 char*idbxlbl[] = { /* display box labels */187 int8_t *idbxlbl[] = { /* display box labels */ 188 188 189 189 " Frq 1", /* 0 */ … … 213 213 }; 214 214 215 charidhlbl[] = /* main function time axis label */215 int8_t idhlbl[] = /* main function time axis label */ 216 216 " \324\302 \325\305 \326 \301 \302 \304 \310 \321\306 \323\302"; 217 217 218 218 219 char*osclbl[] = { /* oscillator mode labels */219 int8_t *osclbl[] = { /* oscillator mode labels */ 220 220 /* NOTE: must match values in instdsp.h */ 221 221 … … 230 230 */ 231 231 232 longrngdiv[] = { /* divisors for ranges of 0..9 */232 int32_t rngdiv[] = { /* divisors for ranges of 0..9 */ 233 233 234 234 MAXRAND, /* 0..0 */ … … 254 254 */ 255 255 256 void drawpt( short px, short py, short pc)257 { 258 register short tmp;256 void drawpt(int16_t px, int16_t py, int16_t pc) 257 { 258 register int16_t tmp; 259 259 260 260 tmp = px - 1; … … 291 291 */ 292 292 293 void drawfn( short fn, short how, short pen, short wn)293 void drawfn(int16_t fn, int16_t how, int16_t pen, int16_t wn) 294 294 { 295 295 struct idfnhdr *fp; 296 296 struct instdef *ip; 297 297 register struct instpnt *pt1, *pt2; 298 register short i, npt1, npt2, xp;299 register u nsignedcolor;300 short np, ptx, pty, ptc;298 register int16_t i, npt1, npt2, xp; 299 register uint16_t color; 300 int16_t np, ptx, pty, ptc; 301 301 302 302 ip = &vbufs[curvce]; … … 413 413 */ 414 414 415 short addpch(short p1, short p2)416 { 417 register longpl;418 419 pl = (((( long)p1 >> 5) - 500L) << LSPCH) + (long)p2;415 int16_t addpch(int16_t p1, int16_t p2) 416 { 417 register int32_t pl; 418 419 pl = ((((int32_t)p1 >> 5) - 500L) << LSPCH) + (int32_t)p2; 420 420 421 421 if (pl > PITCHMAX) 422 422 pl = PITCHMAX; 423 423 424 return(( short)pl);424 return((int16_t)pl); 425 425 } 426 426 … … 435 435 */ 436 436 437 short irand(short range)437 int16_t irand(int16_t range) 438 438 { 439 439 if (range LE 0) /* limit things to 'reasonable' values */ … … 443 443 range = 9; 444 444 445 return(( short)(rand24() / rngdiv[range]));445 return((int16_t)(rand24() / rngdiv[range])); 446 446 } 447 447 … … 456 456 */ 457 457 458 short xgetran(short mlt)459 { 460 register short sltmp;461 462 sltmp = ( short)rand24();458 int16_t xgetran(int16_t mlt) 459 { 460 register int16_t sltmp; 461 462 sltmp = (int16_t)rand24(); 463 463 464 464 if (mlt < 0) 465 sltmp += ( short)rand24();465 sltmp += (int16_t)rand24(); 466 466 467 467 return(sltmp); … … 478 478 */ 479 479 480 void dosync( short vce)481 { 482 register short sync;480 void dosync(int16_t vce) 481 { 482 register int16_t sync; 483 483 register struct instdef *ip; 484 484 … … 495 495 sync |= 0x8000; 496 496 497 *(io_fpu + vce + ( long)FPU_OCFG) = sync;497 *(io_fpu + vce + (int32_t)FPU_OCFG) = sync; 498 498 } 499 499 … … 508 508 */ 509 509 510 void oscdsp( short row, short val, short n, short frq, char*lbl)511 { 512 register short fh, fl;510 void oscdsp(int16_t row, int16_t val, int16_t n, int16_t frq, int8_t *lbl) 511 { 512 register int16_t fh, fl; 513 513 514 514 tsplot4(instob, 64, idbox[n][4], row, 34, lbl, 14); … … 576 576 */ 577 577 578 void pltws(u nsigned ws[], short pen)579 { 580 register short i, x, y;578 void pltws(uint16_t ws[], int16_t pen) 579 { 580 register int16_t i, x, y; 581 581 582 582 for (i = 1; i < 254; i++) { … … 599 599 */ 600 600 601 void dswin( short n)602 { 603 short th, tl, vh, vl, vv, mltval, lboff;604 char*s1, mltstr[6], mltsgn;605 longtt, sc;606 register short cx, pnt, par;601 void dswin(int16_t n) 602 { 603 int16_t th, tl, vh, vl, vv, mltval, lboff; 604 int8_t *s1, mltstr[6], mltsgn; 605 int32_t tt, sc; 606 register int16_t cx, pnt, par; 607 607 register struct instdef *ip; 608 608 register struct idfnhdr *fp; … … 881 881 void allwins(void) 882 882 { 883 register short i;883 register int16_t i; 884 884 885 885 for (i = 0; i < 24; i++) … … 893 893 */ 894 894 895 void idpoint( short x, short y, short pen)895 void idpoint(int16_t x, int16_t y, int16_t pen) 896 896 { 897 897 if (v_regs[5] & 0x0180)
Note:
See TracChangeset
for help on using the changeset viewer.