Changeset 7258c6a in buchla-68k for ram/libdsp.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/libdsp.c
r0292fbb r7258c6a 45 45 #endif 46 46 47 extern short lcancel(short lct);48 49 extern longptsizer(void);50 extern longscsizer(void);51 extern longsqsizer(void);47 extern int16_t lcancel(int16_t lct); 48 49 extern int32_t ptsizer(void); 50 extern int32_t scsizer(void); 51 extern int32_t sqsizer(void); 52 52 53 53 /* … … 57 57 /* things defined elsewhere */ 58 58 59 extern void (*point)( short x, short y, short pen);60 61 extern void vbfill4(u nsigned *obj, short obwidth, short xmin, short ymin, short xmax, short ymax, unsignedcolor);62 extern void tsplot4(int *obase, int nw, int fg, int row, int col, char *str, int pitch);63 extern void lseg( short x1, short y1, short x2, short y2, short t);59 extern void (*point)(int16_t x, int16_t y, int16_t pen); 60 61 extern void vbfill4(uint16_t *obj, int16_t obwidth, int16_t xmin, int16_t ymin, int16_t xmax, int16_t ymax, uint16_t color); 62 extern void tsplot4(int16_t *obase, int16_t nw, int16_t fg, int16_t row, int16_t col, int8_t *str, int16_t pitch); 63 extern void lseg(int16_t x1, int16_t y1, int16_t x2, int16_t y2, int16_t t); 64 64 extern void clrlsel(void); 65 65 extern void _clsvol(void); 66 extern void setgc( short xv, short yv);67 68 extern int errno;69 extern int _bpbin;70 71 extern short chtime;72 extern short cmtype;73 extern short cvtime;74 extern short cxval;75 extern short cyval;76 extern short sgcsw;77 extern short stccol;78 extern short stcrow;79 extern short submenu;80 extern short thcwval;81 extern short tvcwval;82 83 extern u nsigned*obj0, *obj2;84 85 extern char*ldbxlb0[];86 extern charvtlin1[], vtlin2[], vtlin3[];87 88 extern short ldbox[][8];66 extern void setgc(int16_t xv, int16_t yv); 67 68 extern int16_t errno; 69 extern int16_t _bpbin; 70 71 extern int16_t chtime; 72 extern int16_t cmtype; 73 extern int16_t cvtime; 74 extern int16_t cxval; 75 extern int16_t cyval; 76 extern int16_t sgcsw; 77 extern int16_t stccol; 78 extern int16_t stcrow; 79 extern int16_t submenu; 80 extern int16_t thcwval; 81 extern int16_t tvcwval; 82 83 extern uint16_t *obj0, *obj2; 84 85 extern int8_t *ldbxlb0[]; 86 extern int8_t vtlin1[], vtlin2[], vtlin3[]; 87 88 extern int16_t ldbox[][8]; 89 89 extern struct instdef idefs[]; 90 90 … … 95 95 */ 96 96 97 extern u nsigned*librob; /* display object pointer */98 99 extern short catin; /* catalog read in flag */100 extern short lrasw; /* append (TRUE) / replace (FALSE) score */101 extern short lorchl; /* hi (TRUE) / lo (FALSE) orchestra */102 extern short ldrow; /* fetch select row */103 extern short ldslot; /* fetch select slot */104 extern short lselsw; /* fetch select switch */105 extern short ldkind; /* fetch file type */106 extern short lstrsw; /* store state switch */107 extern short lasgsw; /* assignments store switch */108 extern short lksel; /* librarian key slot selector */109 extern short lorchsw; /* hi orchestra (21 - 40) store switch */110 extern short lorclsw; /* lo orchestra (01 - 20) store switch */111 extern short lpatsw; /* patch store switch */112 extern short lscrsw; /* score store switch */113 extern short lseqsw; /* sequence store switch */114 extern short ltunsw; /* tunings store switch */115 extern short lwavsw; /* waveshapes store switch */116 extern short ldelsw; /* delete switch */117 extern short lderrsw; /* error message displayed switch */118 extern short ldidsiz; /* getcat() did showsiz() switch */119 extern short lmwtype; /* librarian message window type */120 extern short ltagged; /* load tag update in progress flag */121 extern short ndisp; /* display number currently up */122 123 extern longlcsum; /* library checksum */124 extern longndbytes; /* bytes needed for storage */125 126 extern char*lmln22; /* message window line 22 */127 extern char*lmln23; /* message window line 23 */128 extern char*lmln24; /* message window line 24 */129 130 extern charldfile[9]; /* file name field */131 extern charldcmnt[38]; /* comment field */132 extern charldmsg1[65]; /* messsage build area 1 */133 extern charldmsg2[65]; /* messsage build area 2 */134 extern charldmsg3[65]; /* messsage build area 3 */135 extern charerrbuf[65]; /* error message build area */97 extern uint16_t *librob; /* display object pointer */ 98 99 extern int16_t catin; /* catalog read in flag */ 100 extern int16_t lrasw; /* append (TRUE) / replace (FALSE) score */ 101 extern int16_t lorchl; /* hi (TRUE) / lo (FALSE) orchestra */ 102 extern int16_t ldrow; /* fetch select row */ 103 extern int16_t ldslot; /* fetch select slot */ 104 extern int16_t lselsw; /* fetch select switch */ 105 extern int16_t ldkind; /* fetch file type */ 106 extern int16_t lstrsw; /* store state switch */ 107 extern int16_t lasgsw; /* assignments store switch */ 108 extern int16_t lksel; /* librarian key slot selector */ 109 extern int16_t lorchsw; /* hi orchestra (21 - 40) store switch */ 110 extern int16_t lorclsw; /* lo orchestra (01 - 20) store switch */ 111 extern int16_t lpatsw; /* patch store switch */ 112 extern int16_t lscrsw; /* score store switch */ 113 extern int16_t lseqsw; /* sequence store switch */ 114 extern int16_t ltunsw; /* tunings store switch */ 115 extern int16_t lwavsw; /* waveshapes store switch */ 116 extern int16_t ldelsw; /* delete switch */ 117 extern int16_t lderrsw; /* error message displayed switch */ 118 extern int16_t ldidsiz; /* getcat() did showsiz() switch */ 119 extern int16_t lmwtype; /* librarian message window type */ 120 extern int16_t ltagged; /* load tag update in progress flag */ 121 extern int16_t ndisp; /* display number currently up */ 122 123 extern int32_t lcsum; /* library checksum */ 124 extern int32_t ndbytes; /* bytes needed for storage */ 125 126 extern int8_t *lmln22; /* message window line 22 */ 127 extern int8_t *lmln23; /* message window line 23 */ 128 extern int8_t *lmln24; /* message window line 24 */ 129 130 extern int8_t ldfile[9]; /* file name field */ 131 extern int8_t ldcmnt[38]; /* comment field */ 132 extern int8_t ldmsg1[65]; /* messsage build area 1 */ 133 extern int8_t ldmsg2[65]; /* messsage build area 2 */ 134 extern int8_t ldmsg3[65]; /* messsage build area 3 */ 135 extern int8_t errbuf[65]; /* error message build area */ 136 136 137 137 extern struct octent *ldoct; /* object control table pointer */ … … 141 141 /* forward references */ 142 142 143 void ldpoint( short x, short y, short pen);144 145 /* 146 147 */ 148 149 char*ftypes[][3] = { /* file types (must match libdsp.h) */143 void ldpoint(int16_t x, int16_t y, int16_t pen); 144 145 /* 146 147 */ 148 149 int8_t *ftypes[][3] = { /* file types (must match libdsp.h) */ 150 150 151 151 {"ASG", "Assignmnt", "Assignmnt"}, /* FT_ASG */ … … 160 160 }; 161 161 162 charld_em1[] = "No files stored on disk";163 charld_em2[] = " by this operation";164 165 short lbrpal[16][3] = { /* librarian color palette */162 int8_t ld_em1[] = "No files stored on disk"; 163 int8_t ld_em2[] = " by this operation"; 164 165 int16_t lbrpal[16][3] = { /* librarian color palette */ 166 166 167 167 {0, 0, 0}, /* 0 */ … … 196 196 */ 197 197 198 short ftkind(short ns)199 { 200 register short i;198 int16_t ftkind(int16_t ns) 199 { 200 register int16_t i; 201 201 202 202 for (i = 0; i < NFTYPES; i++) … … 216 216 */ 217 217 218 char *fctstr(short ns, short just)219 { 220 static charfcbad[11];221 register short i;218 int8_t *fctstr(int16_t ns, int16_t just) 219 { 220 static int8_t fcbad[11]; 221 register int16_t i; 222 222 223 223 for (i = 0; i < NFTYPES; i++) … … 239 239 */ 240 240 241 short ocslot(short slot)241 int16_t ocslot(int16_t slot) 242 242 { 243 243 if (memcmp(filecat[slot].fcsize, "000", 3) … … 254 254 */ 255 255 256 short ldline(short cy)256 int16_t ldline(int16_t cy) 257 257 { 258 258 if (cy > 292) … … 277 277 */ 278 278 279 short lin2slt(short line)280 { 281 register short slot, row;279 int16_t lin2slt(int16_t line) 280 { 281 register int16_t slot, row; 282 282 283 283 row = 0; … … 297 297 */ 298 298 299 u nsigned exp_c(unsignedc)299 uint16_t exp_c(uint16_t c) 300 300 { 301 301 c &= 0x000F; /* use low 4 bits as the basis */ … … 316 316 */ 317 317 318 void ldwmsg( char *line1, char *line2, char *line3, unsigned fgcolor, unsignedbgcolor)318 void ldwmsg(int8_t *line1, int8_t *line2, int8_t *line3, uint16_t fgcolor, uint16_t bgcolor) 319 319 { 320 320 lderrsw = FALSE; /* clear error switch */ … … 336 336 ldbox[10][2], ldbox[10][3], bgcolor); 337 337 338 if (( char*)NULL NE line1)338 if ((int8_t *)NULL NE line1) 339 339 tsplot4(librob, 64, fgcolor, ldbox[10][6], ldbox[10][7], 340 340 line1, 14); 341 341 342 if (( char*)NULL NE line2)342 if ((int8_t *)NULL NE line2) 343 343 tsplot4(librob, 64, fgcolor, (ldbox[10][6] + 1), ldbox[10][7], 344 344 line2, 14); 345 345 346 if (( char*)NULL NE line3)346 if ((int8_t *)NULL NE line3) 347 347 tsplot4(librob, 64, fgcolor, (ldbox[10][6] + 2), ldbox[10][7], 348 348 line3, 14); … … 359 359 */ 360 360 361 long chksum(char *area, longlen)362 { 363 register longcs, i;361 int32_t chksum(int8_t *area, int32_t len) 362 { 363 register int32_t cs, i; 364 364 365 365 cs = 0L; … … 377 377 */ 378 378 379 void makelh( short kind)379 void makelh(int16_t kind) 380 380 { 381 381 memset(ldhead.l_csum, '?', 8); /* checksum */ … … 384 384 memcpy(ldhead.l_cmnt, ldcmnt, 37); /* comment */ 385 385 386 lcsum = chksum(ldhead.l_name, ( long)(LH_LEN - 8));386 lcsum = chksum(ldhead.l_name, (int32_t)(LH_LEN - 8)); 387 387 } 388 388 … … 397 397 */ 398 398 399 void ldbusy( char*msg)399 void ldbusy(int8_t *msg) 400 400 { 401 401 if (ndisp NE 0) 402 402 return; 403 403 404 ldwmsg(( char*)NULL, " Busy - Please stand by", msg,404 ldwmsg((int8_t *)NULL, " Busy - Please stand by", msg, 405 405 ldbox[10][4], ldbox[10][5]); 406 406 } … … 412 412 */ 413 413 414 void noslot(int fctype)414 void noslot(int16_t fctype) 415 415 { 416 416 sprintf(ldmsg1, " the %s file,", ftypes[fctype - 1][2]); … … 430 430 */ 431 431 432 short wr_ec(FILE *fp, char *from, longlen)433 { 434 register longcount;435 register charc;432 int16_t wr_ec(FILE *fp, int8_t *from, int32_t len) 433 { 434 register int32_t count; 435 register int8_t c; 436 436 for (count = 0; count < len; count++) { 437 437 … … 444 444 445 445 ldermsg("Disk may be full", 446 errbuf, ( char*)NULL, LD_EMCF, LD_EMCB);446 errbuf, (int8_t *)NULL, LD_EMCF, LD_EMCB); 447 447 448 448 fclose(fp); … … 470 470 */ 471 471 472 short rd_ec(FILE *fp, char *to, longlen)473 { 474 register longcount;475 register int c;472 int16_t rd_ec(FILE *fp, int8_t *to, int32_t len) 473 { 474 register int32_t count; 475 register int16_t c; 476 476 477 477 for (count = 0; count < len; count++) { … … 484 484 485 485 ldermsg("Unexpected EOF", 486 errbuf, ( char*)NULL, LD_EMCF, LD_EMCB);486 errbuf, (int8_t *)NULL, LD_EMCF, LD_EMCB); 487 487 488 488 fclose(fp); … … 516 516 */ 517 517 518 short srchcat(charextn[])519 { 520 register short fcslot;518 int16_t srchcat(int8_t extn[]) 519 { 520 register int16_t fcslot; 521 521 522 522 for (fcslot = 0; fcslot < FCMAX; fcslot++) { … … 539 539 void clrcat(void) 540 540 { 541 register short i;542 charfcebuf[1 + sizeof (struct fcat)];541 register int16_t i; 542 int8_t fcebuf[1 + sizeof (struct fcat)]; 543 543 544 544 for (i = 0; i < FCMAX; i++) { … … 564 564 */ 565 565 566 short clreq(longbytes)567 { 568 register short rclusts;569 register longclmask;566 int16_t clreq(int32_t bytes) 567 { 568 register int16_t rclusts; 569 register int32_t clmask; 570 570 571 571 clmask = _thebpb->clsizb - 1; … … 587 587 */ 588 588 589 short spacerq(short kind)590 { 591 register short howmuch;592 register longk;589 int16_t spacerq(int16_t kind) 590 { 591 register int16_t howmuch; 592 register int32_t k; 593 593 594 594 k = 0L; … … 598 598 case FT_ASG: /* Assignment file */ 599 599 600 k = (sizeof (struct asgent) * ( long)NASGLIB) + LH_LEN;600 k = (sizeof (struct asgent) * (int32_t)NASGLIB) + LH_LEN; 601 601 break; 602 602 … … 605 605 case FT_ORC: 606 606 607 k = ((OR_LEN1 + (2 * OR_LEN2)) * ( long)NINORC) + LH_LEN;607 k = ((OR_LEN1 + (2 * OR_LEN2)) * (int32_t)NINORC) + LH_LEN; 608 608 break; 609 609 … … 630 630 case FT_WAV: /* Waveshape file */ 631 631 632 k = (( long)NUMWAVS * OR_LEN2) + LH_LEN;632 k = ((int32_t)NUMWAVS * OR_LEN2) + LH_LEN; 633 633 break; 634 634 … … 656 656 */ 657 657 658 short ckstor(void)658 int16_t ckstor(void) 659 659 { 660 660 if (lasgsw) /* assignments */ … … 695 695 */ 696 696 697 short ckdups(void)697 int16_t ckdups(void) 698 698 { 699 699 if (lasgsw) … … 747 747 */ 748 748 749 int showsiz(void)750 { 751 register short dcap, drem, dused;749 int16_t showsiz(void) 750 { 751 register int16_t dcap, drem, dused; 752 752 753 753 _bpbin = FALSE; /* force disk to be read */ … … 758 758 759 759 ldermsg("Disk not ready ?", 760 ( char *)NULL, (char*)NULL,760 (int8_t *)NULL, (int8_t *)NULL, 761 761 LD_EMCF, LD_EMCB); 762 762 … … 785 785 */ 786 786 787 short getcat(short msgsw)787 int16_t getcat(int16_t msgsw) 788 788 { 789 789 register FILE *fp; 790 int rc, fesize;790 int16_t rc, fesize; 791 791 792 792 ldidsiz = FALSE; /* we didn't show the size (yet) */ … … 837 837 838 838 ldermsg("File catalog is NULL", 839 ( char *)NULL, (char*)NULL,839 (int8_t *)NULL, (int8_t *)NULL, 840 840 LD_EMCF, LD_EMCB); 841 841 … … 865 865 */ 866 866 867 short putcat(void)867 int16_t putcat(void) 868 868 { 869 869 register FILE *fp; 870 register int i, rc, fesize;870 register int16_t i, rc, fesize; 871 871 872 872 for (i = 0; i < FCMAX; i++) { /* clean up the catalog */ … … 885 885 886 886 ldermsg("Unable to open catalog", 887 ( char*)NULL, ldmsg2, LD_EMCF, LD_EMCB);887 (int8_t *)NULL, ldmsg2, LD_EMCF, LD_EMCB); 888 888 889 889 return(FAILURE); … … 914 914 915 915 ldermsg("Disk may be full", 916 ( char*)NULL, ldmsg2,916 (int8_t *)NULL, ldmsg2, 917 917 LD_EMCF, LD_EMCB); 918 918 } … … 938 938 */ 939 939 940 void dslslot( short slot, unsigned fg, short row)941 { 942 register u nsignedcolor, chilon, chilorc;943 short c;944 charbuf[40];940 void dslslot(int16_t slot, uint16_t fg, int16_t row) 941 { 942 register uint16_t color, chilon, chilorc; 943 int16_t c; 944 int8_t buf[40]; 945 945 946 946 if (ndisp NE 0) … … 992 992 */ 993 993 994 short showcat(void)995 { 996 register short i, fcslot, fcrow, fcount;997 register u nsignedcolor;994 int16_t showcat(void) 995 { 996 register int16_t i, fcslot, fcrow, fcount; 997 register uint16_t color; 998 998 999 999 if (ndisp NE 0) … … 1038 1038 */ 1039 1039 1040 short fcindex(void)1040 int16_t fcindex(void) 1041 1041 { 1042 1042 if (NOT lderrsw) … … 1108 1108 */ 1109 1109 1110 short getslot(void)1111 { 1112 register short i;1110 int16_t getslot(void) 1111 { 1112 register int16_t i; 1113 1113 1114 1114 for (i = 0; i < FCMAX; i++) … … 1125 1125 */ 1126 1126 1127 char *slotnam(unsigned slot, unsignedkind)1128 { 1129 static charthename[13];1127 int8_t *slotnam(uint16_t slot, uint16_t kind) 1128 { 1129 static int8_t thename[13]; 1130 1130 1131 1131 sprintf(thename, "M7SLOT%02.2u.%-3.3s", … … 1145 1145 */ 1146 1146 1147 short wrtfile(short kind)1148 { 1149 register short slot, flspace, tkind;1150 charsizetmp[4];1147 int16_t wrtfile(int16_t kind) 1148 { 1149 register int16_t slot, flspace, tkind; 1150 int8_t sizetmp[4]; 1151 1151 1152 1152 slot = getslot(); … … 1229 1229 1230 1230 ldermsg("bad wrtfile argument:", 1231 ldmsg1, ( char*)NULL, LD_EMCF, LD_EMCB);1231 ldmsg1, (int8_t *)NULL, LD_EMCF, LD_EMCB); 1232 1232 1233 1233 return(FAILURE); … … 1272 1272 */ 1273 1273 1274 short writem(void)1274 int16_t writem(void) 1275 1275 { 1276 1276 if (lasgsw) /* Assignments */ … … 1319 1319 */ 1320 1320 1321 short storit(void)1322 { 1323 register int weneed, i, slotnd, slothv;1324 int rc, drem;1321 int16_t storit(void) 1322 { 1323 register int16_t weneed, i, slotnd, slothv; 1324 int16_t rc, drem; 1325 1325 1326 1326 /* make sure the file is named */ … … 1491 1491 void advlcur(void) 1492 1492 { 1493 register short newcol;1493 register int16_t newcol; 1494 1494 1495 1495 if (infield(stcrow, stccol, curfet)) … … 1515 1515 void bsplcur(void) 1516 1516 { 1517 register short newcol;1517 register int16_t newcol; 1518 1518 1519 1519 if (infield(stcrow, stccol, curfet)) … … 1541 1541 */ 1542 1542 1543 void ldswin( short n)1544 { 1545 register short cx, cy;1543 void ldswin(int16_t n) 1544 { 1545 register int16_t cx, cy; 1546 1546 1547 1547 if (ndisp NE 0) … … 1695 1695 void lwins(void) 1696 1696 { 1697 register short i;1697 register int16_t i; 1698 1698 1699 1699 for (i = 0; i < 11; i++) … … 1707 1707 */ 1708 1708 1709 void ldpoint( short x, short y, short pen)1709 void ldpoint(int16_t x, int16_t y, int16_t pen) 1710 1710 { 1711 1711 if (v_regs[5] & 0x0180)
Note:
See TracChangeset
for help on using the changeset viewer.