Changeset 7258c6a in buchla-68k for ram/librw.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/librw.c
r0292fbb r7258c6a 42 42 #endif 43 43 44 extern char *slotnam(unsigned slot, unsignedkind);45 46 extern long chksum(char *area, longlen);47 48 extern short ldslot, lderrsw, lrasw;49 extern short tunlib[][128];50 51 extern longlcsum, schksum, sntlreq;52 53 extern chartunname[][32];54 extern charldfile[9];55 extern charldcmnt[38];44 extern int8_t *slotnam(uint16_t slot, uint16_t kind); 45 46 extern int32_t chksum(int8_t *area, int32_t len); 47 48 extern int16_t ldslot, lderrsw, lrasw; 49 extern int16_t tunlib[][128]; 50 51 extern int32_t lcsum, schksum, sntlreq; 52 53 extern int8_t tunname[][32]; 54 extern int8_t ldfile[9]; 55 extern int8_t ldcmnt[38]; 56 56 57 57 extern struct mlibhdr ldhead; … … 71 71 */ 72 72 73 short wrt_asg(short slot)74 { 75 register FILE *fp; 76 register int i;77 charcstemp[8];73 int16_t wrt_asg(int16_t slot) 74 { 75 register FILE *fp; 76 register int16_t i; 77 int8_t cstemp[8]; 78 78 79 79 preio(); /* kill LCD backlight */ … … 84 84 85 85 ldermsg("Couldn't create a file", 86 " for the assignments", ( char*)NULL,86 " for the assignments", (int8_t *)NULL, 87 87 LD_EMCF, LD_EMCB); 88 88 … … 95 95 96 96 for (i = 0; i < NASGLIB; i++) 97 lcsum += chksum(&asgtab[i + 1], ( long)(sizeof (struct asgent)));97 lcsum += chksum(&asgtab[i + 1], (int32_t)(sizeof (struct asgent))); 98 98 99 99 sprintf(cstemp, "%08.8lX", lcsum); … … 108 108 109 109 */ 110 if (wr_ec(fp, &ldhead, ( long)LH_LEN)) { /* header */110 if (wr_ec(fp, &ldhead, (int32_t)LH_LEN)) { /* header */ 111 111 112 112 streset(); … … 116 116 for (i = 0; i < NASGLIB; i++) { 117 117 118 if (wr_ec(fp, &asgtab[i + 1], ( long)(sizeof (struct asgent)))) {118 if (wr_ec(fp, &asgtab[i + 1], (int32_t)(sizeof (struct asgent)))) { 119 119 120 120 streset(); … … 138 138 */ 139 139 140 short get_asg(void)141 { 142 register FILE *fp; 143 register int i;140 int16_t get_asg(void) 141 { 142 register FILE *fp; 143 register int16_t i; 144 144 145 145 preio(); /* kill LCD backlight */ … … 150 150 151 151 ldermsg("Couldn't open the file", 152 " for the assignments", ( char*)NULL,152 " for the assignments", (int8_t *)NULL, 153 153 LD_EMCF, LD_EMCB); 154 154 … … 166 166 167 167 */ 168 if (rd_ec(fp, &ldhead, ( long)LH_LEN)) { /* header */168 if (rd_ec(fp, &ldhead, (int32_t)LH_LEN)) { /* header */ 169 169 170 170 clrlsel(); … … 180 180 for (i = 0; i < NASGLIB; i++) { 181 181 182 if (rd_ec(fp, &asgtab[i + 1], ( long)(sizeof (struct asgent)))) {182 if (rd_ec(fp, &asgtab[i + 1], (int32_t)(sizeof (struct asgent)))) { 183 183 184 184 clrlsel(); … … 203 203 */ 204 204 205 short wrt_orc(short slot, short lorh)206 { 207 register FILE *fp; 208 register int i;205 int16_t wrt_orc(int16_t slot, int16_t lorh) 206 { 207 register FILE *fp; 208 register int16_t i; 209 209 register struct instdef *ip; 210 charcstemp[8];210 int8_t cstemp[8]; 211 211 212 212 if (lorh) … … 222 222 223 223 ldermsg("Couldn't create a file", 224 " for the orchestra", ( char*)NULL,224 " for the orchestra", (int8_t *)NULL, 225 225 LD_EMCF, LD_EMCB); 226 226 … … 236 236 ip = &idefs[i + 1 + (lorh ? NINORC : 0)]; 237 237 238 lcsum += chksum(ip, ( long)OR_LEN1);239 lcsum += chksum(ip->idhwvao, ( long)OR_LEN2);240 lcsum += chksum(ip->idhwvbo, ( long)OR_LEN2);238 lcsum += chksum(ip, (int32_t)OR_LEN1); 239 lcsum += chksum(ip->idhwvao, (int32_t)OR_LEN2); 240 lcsum += chksum(ip->idhwvbo, (int32_t)OR_LEN2); 241 241 } 242 242 … … 252 252 253 253 */ 254 if (wr_ec(fp, &ldhead, ( long)LH_LEN)) { /* header */254 if (wr_ec(fp, &ldhead, (int32_t)LH_LEN)) { /* header */ 255 255 256 256 streset(); … … 262 262 ip = &idefs[i + 1 + (lorh ? NINORC : 0)]; 263 263 264 if (wr_ec(fp, ip, ( long)OR_LEN1)) { /* functions */264 if (wr_ec(fp, ip, (int32_t)OR_LEN1)) { /* functions */ 265 265 266 266 streset(); … … 268 268 } 269 269 270 if (wr_ec(fp, ip->idhwvao, ( long)OR_LEN2)) { /* WS A */270 if (wr_ec(fp, ip->idhwvao, (int32_t)OR_LEN2)) { /* WS A */ 271 271 272 272 streset(); … … 274 274 } 275 275 276 if (wr_ec(fp, ip->idhwvbo, ( long)OR_LEN2)) { /* WS B */276 if (wr_ec(fp, ip->idhwvbo, (int32_t)OR_LEN2)) { /* WS B */ 277 277 278 278 streset(); … … 296 296 */ 297 297 298 short get_orc(short lorh, short kind)299 { 300 register FILE *fp; 301 register int i;298 int16_t get_orc(int16_t lorh, int16_t kind) 299 { 300 register FILE *fp; 301 register int16_t i; 302 302 register struct instdef *ip; 303 303 … … 314 314 315 315 ldermsg("Couldn't open the file", 316 " for the orchestra", ( char*)NULL,316 " for the orchestra", (int8_t *)NULL, 317 317 LD_EMCF, LD_EMCB); 318 318 … … 330 330 331 331 */ 332 if (rd_ec(fp, &ldhead, ( long)LH_LEN)) { /* header */332 if (rd_ec(fp, &ldhead, (int32_t)LH_LEN)) { /* header */ 333 333 334 334 clrlsel(); … … 346 346 ip = &idefs[i + 1 + (lorh ? NINORC : 0)]; 347 347 348 if (rd_ec(fp, ip, ( long)OR_LEN1)) { /* functions */348 if (rd_ec(fp, ip, (int32_t)OR_LEN1)) { /* functions */ 349 349 350 350 clrlsel(); … … 352 352 } 353 353 354 if (rd_ec(fp, ip->idhwvao, ( long)OR_LEN2)) { /* WS A */354 if (rd_ec(fp, ip->idhwvao, (int32_t)OR_LEN2)) { /* WS A */ 355 355 356 356 clrlsel(); … … 358 358 } 359 359 360 if (rd_ec(fp, ip->idhwvbo, ( long)OR_LEN2)) { /* WS B */360 if (rd_ec(fp, ip->idhwvbo, (int32_t)OR_LEN2)) { /* WS B */ 361 361 362 362 clrlsel(); … … 386 386 */ 387 387 388 short wrt_tun(short slot)389 { 390 register FILE *fp; 391 register int i;392 charcstemp[8];388 int16_t wrt_tun(int16_t slot) 389 { 390 register FILE *fp; 391 register int16_t i; 392 int8_t cstemp[8]; 393 393 394 394 preio(); /* kill LCD backlight */ … … 399 399 400 400 ldermsg("Couldn't create a file", 401 " for the tunings", ( char*)NULL,401 " for the tunings", (int8_t *)NULL, 402 402 LD_EMCF, LD_EMCB); 403 403 … … 426 426 427 427 */ 428 if (wr_ec(fp, &ldhead, ( long)LH_LEN)) { /* header */428 if (wr_ec(fp, &ldhead, (int32_t)LH_LEN)) { /* header */ 429 429 430 430 streset(); … … 462 462 */ 463 463 464 short get_tun(void)465 { 466 register FILE *fp; 467 register int i;464 int16_t get_tun(void) 465 { 466 register FILE *fp; 467 register int16_t i; 468 468 469 469 preio(); /* kill LCD backlight */ … … 474 474 475 475 ldermsg("Couldn't open the file", 476 " for the tunings", ( char*)NULL,476 " for the tunings", (int8_t *)NULL, 477 477 LD_EMCF, LD_EMCB); 478 478 … … 490 490 491 491 */ 492 if (rd_ec(fp, &ldhead, ( long)LH_LEN)) { /* header */492 if (rd_ec(fp, &ldhead, (int32_t)LH_LEN)) { /* header */ 493 493 494 494 clrlsel(); … … 533 533 */ 534 534 535 short wrt_pat(short slot)536 { 537 register FILE *fp; 538 charcstemp[8];535 int16_t wrt_pat(int16_t slot) 536 { 537 register FILE *fp; 538 int8_t cstemp[8]; 539 539 540 540 preio(); /* kill LCD backlight */ … … 545 545 546 546 ldermsg("Couldn't create a file", 547 " for the patches", ( char*)NULL,547 " for the patches", (int8_t *)NULL, 548 548 LD_EMCF, LD_EMCB); 549 549 … … 566 566 567 567 */ 568 if (wr_ec(fp, &ldhead, ( long)LH_LEN)) { /* header */568 if (wr_ec(fp, &ldhead, (int32_t)LH_LEN)) { /* header */ 569 569 570 570 streset(); … … 593 593 */ 594 594 595 short get_pat(void)595 int16_t get_pat(void) 596 596 { 597 597 register FILE *fp; … … 604 604 605 605 ldermsg("Couldn't open the file", 606 " for the patches", ( char*)NULL,606 " for the patches", (int8_t *)NULL, 607 607 LD_EMCF, LD_EMCB); 608 608 … … 620 620 621 621 */ 622 if (rd_ec(fp, &ldhead, ( long)LH_LEN)) { /* header */622 if (rd_ec(fp, &ldhead, (int32_t)LH_LEN)) { /* header */ 623 623 624 624 clrlsel(); … … 656 656 */ 657 657 658 short wrt_scr(short slot)659 { 660 register FILE *fp; 661 register int i;662 longtnb;663 charcstemp[8];658 int16_t wrt_scr(int16_t slot) 659 { 660 register FILE *fp; 661 register int16_t i; 662 int32_t tnb; 663 int8_t cstemp[8]; 664 664 665 665 preio(); /* kill LCD backlight */ … … 670 670 671 671 ldermsg("Couldn't create a file", 672 " for the scores", ( char*)NULL,672 " for the scores", (int8_t *)NULL, 673 673 LD_EMCF, LD_EMCB); 674 674 … … 693 693 694 694 */ 695 if (wr_ec(fp, &ldhead, ( long)LH_LEN)) { /* header */695 if (wr_ec(fp, &ldhead, (int32_t)LH_LEN)) { /* header */ 696 696 697 697 streset(); … … 729 729 */ 730 730 731 short get_scr(void)732 { 733 register FILE *fp; 734 register int i;735 longtnl;731 int16_t get_scr(void) 732 { 733 register FILE *fp; 734 register int16_t i; 735 int32_t tnl; 736 736 737 737 preio(); /* kill LCD backlight */ … … 742 742 743 743 ldermsg("Couldn't open the file", 744 " for the scores", ( char*)NULL,744 " for the scores", (int8_t *)NULL, 745 745 LD_EMCF, LD_EMCB); 746 746 … … 758 758 759 759 */ 760 if (rd_ec(fp, &ldhead, ( long)LH_LEN)) { /* header */760 if (rd_ec(fp, &ldhead, (int32_t)LH_LEN)) { /* header */ 761 761 762 762 clrlsel(); … … 812 812 */ 813 813 814 short wrt_seq(short slot)815 { 816 register FILE *fp; 817 charcstemp[8];814 int16_t wrt_seq(int16_t slot) 815 { 816 register FILE *fp; 817 int8_t cstemp[8]; 818 818 819 819 preio(); /* kill LCD backlight */ … … 824 824 825 825 ldermsg("Couldn't create a file", 826 " for the sequences", ( char*)NULL,826 " for the sequences", (int8_t *)NULL, 827 827 LD_EMCF, LD_EMCB); 828 828 … … 845 845 846 846 */ 847 if (wr_ec(fp, &ldhead, ( long)LH_LEN)) { /* header */847 if (wr_ec(fp, &ldhead, (int32_t)LH_LEN)) { /* header */ 848 848 849 849 streset(); … … 872 872 */ 873 873 874 short get_seq(void)874 int16_t get_seq(void) 875 875 { 876 876 register FILE *fp; … … 883 883 884 884 ldermsg("Couldn't open the file", 885 " for the sequences", ( char*)NULL,885 " for the sequences", (int8_t *)NULL, 886 886 LD_EMCF, LD_EMCB); 887 887 … … 899 899 900 900 */ 901 if (rd_ec(fp, &ldhead, ( long)LH_LEN)) { /* header */901 if (rd_ec(fp, &ldhead, (int32_t)LH_LEN)) { /* header */ 902 902 903 903 clrlsel(); … … 934 934 */ 935 935 936 short wrt_wav(short slot)937 { 938 register FILE *fp; 939 register int i;940 charcstemp[8];936 int16_t wrt_wav(int16_t slot) 937 { 938 register FILE *fp; 939 register int16_t i; 940 int8_t cstemp[8]; 941 941 register struct wstbl *wp; 942 942 … … 948 948 949 949 ldermsg("Couldn't create a file", 950 " for the waveshapes", ( char*)NULL,950 " for the waveshapes", (int8_t *)NULL, 951 951 LD_EMCF, LD_EMCB); 952 952 … … 962 962 wp = &wslib[i]; 963 963 964 lcsum += chksum(wp->offset, ( long)(NUMWPNT * 2));965 lcsum += chksum(wp->harmon, ( long)(NUMHARM * 2));964 lcsum += chksum(wp->offset, (int32_t)(NUMWPNT * 2)); 965 lcsum += chksum(wp->harmon, (int32_t)(NUMHARM * 2)); 966 966 } 967 967 … … 977 977 978 978 */ 979 if (wr_ec(fp, &ldhead, ( long)LH_LEN)) { /* header */979 if (wr_ec(fp, &ldhead, (int32_t)LH_LEN)) { /* header */ 980 980 981 981 streset(); … … 987 987 wp = &wslib[i]; 988 988 989 if (wr_ec(fp, wp->offset, ( long)(NUMWPNT * 2))) {989 if (wr_ec(fp, wp->offset, (int32_t)(NUMWPNT * 2))) { 990 990 991 991 streset(); … … 993 993 } 994 994 995 if (wr_ec(fp, wp->harmon, ( long)(NUMHARM * 2))) {995 if (wr_ec(fp, wp->harmon, (int32_t)(NUMHARM * 2))) { 996 996 997 997 streset(); … … 1015 1015 */ 1016 1016 1017 short get_wav(void)1018 { 1019 register FILE *fp; 1020 register int i;1017 int16_t get_wav(void) 1018 { 1019 register FILE *fp; 1020 register int16_t i; 1021 1021 register struct wstbl *wp; 1022 1022 … … 1028 1028 1029 1029 ldermsg("Couldn't open the file", 1030 " for the waveshapes", ( char*)NULL,1030 " for the waveshapes", (int8_t *)NULL, 1031 1031 LD_EMCF, LD_EMCB); 1032 1032 … … 1044 1044 1045 1045 */ 1046 if (rd_ec(fp, &ldhead, ( long)LH_LEN)) { /* header */1046 if (rd_ec(fp, &ldhead, (int32_t)LH_LEN)) { /* header */ 1047 1047 1048 1048 clrlsel(); … … 1060 1060 wp = &wslib[i]; 1061 1061 1062 if (rd_ec(fp, wp->offset, ( long)(NUMWPNT * 2))) {1062 if (rd_ec(fp, wp->offset, (int32_t)(NUMWPNT * 2))) { 1063 1063 1064 1064 clrlsel(); … … 1066 1066 } 1067 1067 1068 if (rd_ec(fp, wp->harmon, ( long)(NUMHARM * 2))) {1068 if (rd_ec(fp, wp->harmon, (int32_t)(NUMHARM * 2))) { 1069 1069 1070 1070 clrlsel();
Note:
See TracChangeset
for help on using the changeset viewer.