source: buchla-68k/orig/RAM/PTDKEY.C@ c93e44d

Last change on this file since c93e44d was 3ae31e9, checked in by Thomas Lopatic <thomas@…>, 7 years ago

Imported original source code.

  • Property mode set to 100755
File size: 22.6 KB
Line 
1/*
2 =============================================================================
3 ptdkey.c -- MIDAS-VII patch display data entry functions
4 Version 29 -- 1988-12-08 -- D.N. Lynx Crowe
5 =============================================================================
6*/
7
8#define DEBUGPD 0
9#define DEBUGVP 0
10#define DUMPDEF 0
11#define DUMPSTM 0
12
13#include "stddefs.h"
14#include "hwdefs.h"
15#include "vsdd.h"
16#include "fields.h"
17#include "curpak.h"
18#include "patch.h"
19#include "macros.h"
20
21#include "midas.h"
22#include "ptdisp.h"
23
24#if DEBUGPD
25short debugpd = 1;
26short snappb = 0;
27#endif
28
29#if DEBUGVP
30short debugvp = 1;
31#endif
32
33#if DUMPDEF
34short dumpdef = 0;
35#endif
36
37#if DUMPSTM
38short dumpstm = 0;
39#endif
40
41#if (DEBUGPD|DEBUGVP|DUMPDEF|DUMPSTM)
42extern short debugsw;
43#endif
44
45extern short asig, astat;
46
47extern short dpepred, dpecpos, dpesucc;
48
49extern short ptegood, ptedfok, ptestok, ptedsok, ptedtok;
50
51extern short ptedef, ptestm, ptespec, ptesuba, ptedat1, ptedat2;
52
53extern short ptedftp, ptedfst, ptedest, ptedata;
54
55extern short pteset, ptbflag, ptemenu;
56
57extern short ptepred, ptecpos, ptesucc;
58
59extern short stccol, stcrow;
60
61extern char ptdebuf[50];
62
63extern struct patch ptebuf;
64
65/*
66
67*/
68
69short dsdecol[5][2][2] = { /* destination data entry column table */
70
71 6, 8, 19, 21, /* 0 -- key, rel -- key number */
72 7, 8, 20, 21, /* 1 -- trg -- trigger number */
73 8, 8, 21, 21, /* 2 -- pls -- pulse number */
74 10, 10, 23, 23, /* 3 -- key, rel -- port number */
75 12, 13, 25, 26 /* 4 -- key, rel -- channel number */
76};
77
78short des2fmt[] = { /* destination type to data entry format */
79
80 -1, 0, 1, 2, 3, 4, 4, 5,
81 4, 4, 6, 9, 6, 6, 6, 10,
82 9, 9, 10, 10, 10, 10, 7, 7,
83 7, 7, 8
84};
85
86short dtabl7[] = { 11, 1, 2, 3, 10 }; /* aux datum format table */
87
88short dtabl9[] = { 11, 1, 2, 3, 9 }; /* FPU datum format table */
89
90/*
91
92*/
93
94/*
95 =============================================================================
96 SnapPTV() -- snap dump patch variables
97 =============================================================================
98*/
99
100SnapPTV(s)
101char *s;
102{
103 register unsigned short stim;
104 register short i;
105 char dbuf[50];
106
107 printf("\n%s(): called SnapPTV()\n", s);
108
109 memcpy(dbuf, ptdebuf, 48);
110
111 for (i = 0; i < 48; i++)
112 if (dbuf[i] EQ '\0')
113 dbuf[i] = ' ';
114 else if (dbuf[i] & 0x0080)
115 dbuf[i] = '~';
116
117 dbuf[48] = '\0';
118
119 printf(" ptdebuf = \"%s\"\n", dbuf);
120
121 printf(" pte $%04.4X $%04.4X $%04.4X $%04.4X $%04.4X $%04.4X\n",
122 ptedef, ptestm, ptespec, ptesuba, ptedat1, ptedat2);
123
124 printf(" ptb $%04.4X $%04.4X $%04.4X $%04.4X $%04.4X $%04.4X\n",
125 ptebuf.defnum, ptebuf.stmnum, ptebuf.paspec,
126 ptebuf.pasuba, ptebuf.padat1, ptebuf.padat2);
127
128 printf(" pte dftp: %2d dfst: %2d dest: %2d data: %2d menu: %2d\n",
129 ptedftp, ptedfst, ptedest, ptedata, ptemenu);
130
131 printf(" pte good: %d dfok: %d stok: %d dsok: %d dtok: %d set: %d flag: %d\n",
132 ptegood, ptedfok, ptestok, ptedsok, ptedtok, pteset, ptbflag);
133
134 printf(" pte pred: %3d cpos: %3d succ: %3d\n",
135 ptepred, ptecpos, ptesucc);
136
137/*
138
139*/
140
141#if DUMPDEF
142
143 if (dumpdef) {
144
145 printf(" dpe pred: %3d cpos: %3d succ: %3d\n",
146 dpepred, dpecpos, dpesucc);
147
148 for (stim = 0; stim < NDEFSTMS; stim++) {
149
150 if (defptr[stim]) {
151
152 printf(" defptr[$%04.4X] = %3d%s\n",
153 stim, defptr[stim],
154 ((TRG_MASK & ptedef) EQ stim) ?
155 " <-- ptedef" : "");
156 }
157 }
158 }
159#endif
160
161#if DUMPSTM
162 if (dumpstm) {
163
164 for (stim = 0; stim < NDEFSTMS; stim++)
165 if (stmptr[stim])
166 printf(" stmptr[$%04.4X] = %3d%s\n",
167 stim, stmptr[stim],
168 ((TRG_MASK & ptestm) EQ stim) ?
169 " <-- ptestm" : "");
170 }
171#endif
172
173 printf("\n");
174}
175
176/*
177
178*/
179
180/*
181 =============================================================================
182 buf2pte() -- pack the patch buffer
183 =============================================================================
184*/
185
186buf2pte()
187{
188 ptebuf.defnum = ptedef;
189 ptebuf.stmnum = ptestm;
190 ptebuf.paspec = ptespec;
191 ptebuf.pasuba = ptesuba;
192 ptebuf.padat1 = ptedat1;
193 ptebuf.padat2 = ptedat2;
194
195 pteset = TRUE;
196
197#if DEBUGPD
198 if (debugsw AND debugpd) {
199
200 if (snappb)
201 SnapPTV("buf2pte");
202
203 printf("buf2pte(): ptebuf setup\n");
204 }
205#endif
206
207}
208
209/*
210
211*/
212
213/*
214 =============================================================================
215 voidpb() -- void the patch buffer
216 =============================================================================
217*/
218
219voidpb()
220{
221 memset(ptdebuf, ' ', 50); /* clear data entry buffer */
222
223 ptebuf.defnum = ptedef = NULL_DEF; /* blank definer */
224 ptebuf.stmnum = ptestm = 0x0000;
225 ptebuf.paspec = ptespec = 0x0000;
226 ptebuf.pasuba = ptesuba = 0x0000;
227 ptebuf.padat1 = ptedat1 = 0x0000;
228 ptebuf.padat2 = ptedat2 = 0x0000;
229
230 ptbflag = FALSE;
231
232 pteset = FALSE;
233
234 ptegood = FALSE;
235
236 ptedfok = TRUE; /* definer is OK until it's screwed up */
237 ptestok = FALSE;
238 ptedsok = FALSE;
239 ptedtok = FALSE;
240
241 ptedfst = -1;
242 ptedest = -1;
243 ptedata = -1;
244
245#if DEBUGVP
246 if (debugsw AND debugvp) {
247
248 if (snappb)
249 SnapPTV("voidpb");
250
251 printf("voidpb(): patch buffer VOIDED\n");
252 }
253#endif
254
255}
256
257/*
258
259*/
260
261/*
262 =============================================================================
263
264 =============================================================================
265*/
266
267setptcv()
268{
269 register unsigned short spec;
270
271 ptedest = des2fmt[spec = ptespec & PE_SPEC];
272
273 switch (ptedest) { /* setup datum entry format */
274
275 case 0: /* key */
276 case 2: /* pulse */
277
278 ptedata = 8;
279 break;
280
281 case 1: /* trigger */
282
283 ptedata = 9;
284 break;
285
286 case 3: /* led */
287
288 ptedata = 14;
289 break;
290/*
291
292*/
293 case 4: /* seq, reg */
294
295 if (spec EQ PA_SLIN)
296 ptedata = 13;
297 else if (spec EQ PA_SCTL)
298 ptedata = 9;
299 else
300 ptedata = 12;
301
302 break;
303
304 case 5: /* tuning */
305
306 ptedata = 18;
307 break;
308
309 case 6: /* inst, wave, config */
310
311 if (spec EQ PA_INST)
312 ptedata = 15;
313 else if (spec EQ PA_CNFG)
314 ptedata = 17;
315 else
316 ptedata = 16;
317
318 break;
319
320 case 7: /* aux, rate, inten, dpth */
321 case 8: /* vout */
322
323 ptedata = dtabl7[ptedat1];
324 break;
325
326 case 9: /* osc, ind, frq */
327 case 10: /* level, filtr, fil q, loctn, dynmc */
328
329 if (spec EQ PA_OSC)
330 ptedata = ptedat1 + 4;
331 else
332 ptedata = dtabl9[ptedat1];
333
334 break;
335
336 default: /* something weird got in here somehow ... */
337
338#if DEBUGPD
339 if (debugsw AND debugpd)
340 printf("setptcv(): BAD ptedest ($%04.4X), spec = $%04.4X\n",
341 ptedest, spec);
342#endif
343
344 ptedata = -1;
345 break;
346 }
347}
348
349/*
350
351*/
352
353/*
354 =============================================================================
355 pte2buf() -- convert ptebuf to ptdebuf format and load edit variables
356 =============================================================================
357*/
358
359pte2buf()
360{
361 register unsigned short spec;
362
363 memset(ptdebuf, ' ', 50);
364
365 ptbflag = TRUE;
366
367 if (pteset) { /* if ptebuf is valid ... */
368
369 ptedef = ptebuf.defnum; /* ... setup the edit variables */
370 ptestm = ptebuf.stmnum;
371 ptespec = ptebuf.paspec;
372 ptesuba = ptebuf.pasuba;
373 ptedat1 = ptebuf.padat1;
374 ptedat2 = ptebuf.padat2;
375
376 setptcv(); /* setup control variables */
377
378 dspdfst(&ptdebuf[ 2], ptedef); /* setup the patch buffer */
379 dspdfst(&ptdebuf[15], ptestm);
380 dspdest(&ptdebuf[28], &ptebuf);
381 ptdebuf[ 0] = ' ';
382 ptdebuf[ 1] = ' ';
383 ptdebuf[14] = ' ';
384 ptdebuf[27] = ' ';
385
386/*
387
388*/
389 ptegood = TRUE; /* validate the patch buffer */
390 ptedfok = TRUE;
391 ptestok = TRUE;
392 ptedsok = TRUE;
393 ptedtok = TRUE;
394
395#if DEBUGPD
396 if (debugsw AND debugpd) {
397
398 if (snappb)
399 SnapPTV("pte2buf");
400
401 printf("pte2buf(): patch buffer LOADED\n");
402 }
403#endif
404
405 } else {
406
407 voidpb(); /* void the patch buffer */
408
409#if DEBUGPD
410 if (debugsw AND debugpd)
411 printf("pte2buf(): patch buffer VOIDED\n");
412#endif
413
414 }
415}
416
417/*
418
419*/
420
421/*
422 =============================================================================
423 ptde_ds() -- digit data entry for definer / stimulus fields
424 =============================================================================
425*/
426
427ptde_ds(n, key)
428register short n, key;
429{
430 register short chan, port, stim;
431 char buf[8], buf2[8];
432
433 if (n ? ptestok : ptedfok) {
434
435 if ((n EQ 0) AND (ptedef EQ 0xFFFF))
436 return;
437
438 port = ((n ? ptestm : ptedef) >> 11) & 0x0003;
439 chan = ((n ? ptestm : ptedef) >> 7) & 0x000F;
440 stim = (n ? ptestm : ptedef) & 0x007F;
441
442 if ((port EQ 0) OR (port EQ 1) OR ((port EQ 2) AND (chan < 2))) {
443
444 /* Key / Rel */
445
446 if (inrange(stccol, dsdecol[0][n][0], dsdecol[0][n][1]) OR
447 inrange(stccol, dsdecol[3][n][0], dsdecol[3][n][1]) OR
448 inrange(stccol, dsdecol[4][n][0], dsdecol[4][n][1])) {
449
450 if (stccol EQ dsdecol[3][n][1]) {
451
452 if ((key < 1) OR (key > 3))
453 return;
454
455 if (key EQ 3) {
456
457 buf[0] = 'L';
458 UpdVid(7, n ? 25 : 12, " ", PTDATR);
459
460 if (n)
461 ptestm &= 0xF87F;
462 else
463 ptedef &= 0xF87F;
464
465 } else {
466
467 sprintf(buf2, "%02d", 1 + chan);
468 buf[0] = key + '0';
469 UpdVid(7, n ? 25 : 12, buf2, PTDATR);
470 }
471/*
472
473*/
474 port = key - 1;
475
476 if (n)
477 ptestm = (ptestm & 0xE7FF) | (port << 11);
478 else
479 ptedef = (ptestm & 0xE7FF) | (port << 11);
480
481 } else {
482
483 buf[0] = key + '0';
484 }
485
486 ptdebuf[stccol] = buf[0];
487 buf[1] = '\0';
488
489 UpdVid(7, stccol, buf, PTDATR);
490
491 if (stccol EQ dsdecol[4][n][1]) {
492
493 ctcon();
494 return;
495 }
496
497 if ((stccol EQ dsdecol[0][n][1]) OR
498 (stccol EQ dsdecol[3][n][1]))
499 ++stccol;
500
501 movectc(stcrow, ++stccol);
502 }
503
504 return;
505/*
506
507*/
508 } else if ((port EQ 2) AND (chan EQ 2)) {
509
510 /* Trig */
511
512 if (inrange(stccol, dsdecol[1][n][0], dsdecol[1][n][1])) {
513
514 ptdebuf[stccol] = key + '0';
515 buf[0] = key + '0';
516 buf[1] = '\0';
517
518 UpdVid(7, stccol, buf, PTDATR);
519
520 if (stccol EQ dsdecol[1][n][1]) {
521
522 ctcon();
523 return;
524 }
525
526 movectc(stcrow, ++stccol);
527 }
528
529 return;
530
531 } else if ((port EQ 2) AND (chan EQ 3)) {
532
533 /* Pulse */
534
535 if (stccol EQ dsdecol[2][n][1]) {
536
537 if ((key < 1) OR (key > 2))
538 return;
539
540 ptdebuf[stccol] = key + '0';
541 buf[0] = key + '0';
542 buf[1] = '\0';
543
544 UpdVid(7, stccol, buf, PTDATR);
545 ctcon();
546 }
547
548 return;
549 }
550 }
551}
552
553/*
554
555*/
556
557/*
558 =============================================================================
559 ptdkey() -- patch digit data entry function
560 =============================================================================
561*/
562
563ptdkey()
564{
565 register short key, val, vg;
566 char buf[8];
567
568 if (NOT astat) /* only do this on key closures */
569 return;
570
571 if (NOT ptbflag) /* load up the edit buffer */
572 pte2buf();
573
574 key = asig - 60;
575
576 if (inrange(stccol, 2, 13)) { /* DEFINER */
577
578 ptde_ds(0, key);
579 return;
580
581 } else if (inrange(stccol, 15, 26)) { /* STIMULUS */
582
583 ptde_ds(1, key);
584 return;
585/*
586
587*/
588 } else if (inrange(stccol, 28, 40)) { /* DESTINATION */
589
590 if (ptedsok) {
591
592 switch (ptedest) {
593
594 case 0: /* key */
595
596 if (inrange(stccol, 30, 32) OR
597 (stccol EQ 34) OR
598 inrange(stccol, 36, 37)) {
599
600 if (stccol EQ 34) {
601
602 if ((key < 1) OR (key > 3))
603 return;
604
605 if (key EQ 3)
606 buf[0] = 'L';
607 else
608 buf[0] = key + '0';
609
610 } else {
611
612 buf[0] = key + '0';
613 }
614
615 ptdebuf[stccol] = buf[0];
616 buf[1] = '\0';
617
618 UpdVid(7, stccol, buf, PTDATR);
619
620 if ((stccol EQ 32) OR (stccol EQ 34))
621 ++stccol;
622
623 if (stccol EQ 37)
624 ctcon();
625 else
626 movectc(stcrow, ++stccol);
627 }
628
629 return;
630/*
631
632*/
633 case 1: /* trg */
634
635 if (inrange(stccol, 36, 37)) {
636
637 ptdebuf[stccol] = key + '0';
638 buf[0] = key + '0';
639 buf[1] = '\0';
640
641 UpdVid(7, stccol, buf, PTDATR);
642
643 if (stccol EQ 37)
644 ctcon();
645 else
646 movectc(stcrow, ++stccol);
647 }
648
649 return;
650
651 case 2: /* pls */
652
653 if (stccol EQ 34) {
654
655 if ((key < 1) OR (key > 2))
656 return;
657
658 ptdebuf[stccol] = key + '0';
659 buf[0] = key + '0';
660 buf[1] = '\0';
661
662 UpdVid(7, stccol, buf, PTDATR);
663 ctcon();
664 }
665
666 return;
667/*
668
669*/
670 case 3: /* led */
671
672 if (stccol EQ 32) {
673
674 if (key > 6)
675 return;
676
677 ptdebuf[stccol] = key + 'A';
678 buf[0] = key + 'A';
679 buf[1] = '\0';
680
681 UpdVid(7, stccol, buf, PTDATR);
682 ctcon();
683 }
684
685 return;
686
687 case 4: /* seqlin, seqctl, regset, regadd */
688
689 if (inrange(stccol, 32, 33)) {
690
691 ptdebuf[stccol] = key + '0';
692 buf[0] = key + '0';
693 buf[1] = '\0';
694
695 UpdVid(7, stccol, buf, PTDATR);
696
697 if (stccol EQ 33)
698 ctcon();
699 else
700 movectc(stcrow, ++stccol);
701 }
702
703 return;
704/*
705
706*/
707 case 5: /* tune */
708 case 7: /* aux, rate, inten, depth */
709
710 return;
711
712 case 8: /* v out */
713
714 if (stccol EQ 32) {
715
716 if ((key < 1) OR (key > 5))
717 return;
718
719 ptdebuf[stccol] = key + '0';
720 buf[0] = key + '0';
721 buf[1] = '\0';
722
723 UpdVid(7, stccol, buf, PTDATR);
724 movectc(DATAROW, 34);
725 }
726
727 return;
728
729 case 9: /* osc, index, freq */
730
731 if (stccol EQ 32) {
732
733 if ((key < 1) OR (key > 4))
734 return;
735
736 ptdebuf[stccol] = key + '0';
737 buf[0] = key + '0';
738 buf[1] = '\0';
739
740 UpdVid(7, stccol, buf, PTDATR);
741 movectc(DATAROW, 34);
742 return;
743 }
744
745 /* FALL-THROUGH to handle v/g in columns 39..40 */
746/*
747
748*/
749 case 6: /* inst, wava, wavb, conf */
750 case 10: /* level, filtr, fil q, loctn, dynmc */
751
752 if (inrange(stccol, 39, 40)) {
753
754 vg = (ptesuba >> 8) & 0x00FF;
755
756 if (stccol EQ 39) {
757
758 if ((key EQ 8) OR (key EQ 9)) {
759
760 if (vg > 11) {
761
762 vg -= 12;
763 val = 'V';
764
765 } else {
766
767 vg += 12;
768 val = 'G';
769 }
770
771 ptesuba = (ptesuba & 0x00FF) |
772 (vg << 8);
773
774 } else {
775
776 return;
777 }
778/*
779
780*/
781 } else { /* column 40 */
782
783 if ( ((vg EQ 0) OR (vg EQ 12)) AND
784 ((key EQ 0) OR (key EQ 1) OR (key EQ 2)) )
785 key += 10;
786 else if (key EQ 0)
787 return;
788
789 val = key + ((key > 9) ? '\242' :'0') ;
790
791 --key;
792
793 if (vg > 11)
794 vg = key + 12;
795 else
796 vg = key;
797
798 ptesuba = (ptesuba & 0x00FF) |
799 (vg << 8);
800 }
801
802 ptdebuf[stccol] = val;
803 buf[0] = val;
804 buf[1] = '\0';
805
806 UpdVid(7, stccol, buf, PTDATR);
807
808 if (stccol EQ 40)
809 ctcon();
810 else
811 movectc(stcrow, ++stccol);
812 }
813
814 return;
815
816 default: /* Eh ? */
817
818 return;
819 }
820 }
821/*
822
823*/
824 } else if (inrange(stccol, 42, 46)) { /* DATUM */
825
826 switch (ptedata) {
827
828 case 1: /* multiplier -- +1.00 */
829
830 switch (stccol) {
831
832 case 42: /* + | - */
833
834 if (key EQ 8)
835 buf[0] = '-';
836 else if (key EQ 9)
837 buf[0] = '+';
838 else
839 return;
840
841 break;
842
843 case 43: /* 0 | 1 */
844
845 if ((key EQ 0) OR (key EQ 1))
846 buf[0] = key + '0';
847 else
848 return;
849
850 break;
851
852 case 45: /* 0..9 */
853 case 46: /* 0..9 */
854
855 buf[0] = key + '0';
856 break;
857
858 case 44: /* . */
859 default:
860
861 return;
862 }
863/*
864
865*/
866 buf[1] = '\0';
867 ptdebuf[stccol] = buf[0];
868
869 UpdVid(7, stccol, buf, PTDATR);
870
871 if (stccol EQ 43)
872 ++stccol;
873
874 if (stccol EQ 46)
875 ctcon();
876 else
877 movectc(stcrow, ++stccol);
878
879 return;
880/*
881
882*/
883 case 2: /* time -- 32767 */
884
885 if ((stccol EQ 42) AND (key > 3))
886 return;
887
888 buf[0] = key + '0';
889 buf[1] = '\0';
890 ptdebuf[stccol] = buf[0];
891
892 UpdVid(7, stccol, buf, PTDATR);
893
894 if (stccol EQ 46)
895 ctcon();
896 else
897 movectc(stcrow, ++stccol);
898
899 return;
900
901/*
902
903*/
904 case 3: /* value -- +10.00 */
905
906 switch (stccol) {
907
908 case 42:
909
910 if (key EQ 8) {
911
912 if (ptdebuf[42] EQ '\240')
913 buf[0] = '\241';
914 else if (ptdebuf[42] EQ '\241')
915 buf[0] = '\241';
916 else
917 buf[0] = '-';
918
919 } else if (key EQ 9) {
920
921 if (ptdebuf[42] EQ '\240')
922 buf[0] = '\240';
923 else if (ptdebuf[42] EQ '\241')
924 buf[0] = '\240';
925 else
926 buf[0] = '+';
927
928 } else if (key EQ 0) {
929
930 if (ptdebuf[42] EQ '\240')
931 buf[0] = '+';
932 else if (ptdebuf[42] EQ '\241')
933 buf[0] = '-';
934 else
935 return;
936
937 } else if (key EQ 1) {
938
939 if (ptdebuf[42] EQ '\240')
940 buf[0] = '\240';
941 else if (ptdebuf[42] EQ '\241')
942 buf[0] = '\241';
943 else if (ptdebuf[42] EQ '+')
944 buf[0] = '\240';
945 else if (ptdebuf[42] EQ '-')
946 buf[0] = '\241';
947 else
948 return;
949
950 } else
951 return;
952
953 break;
954/*
955
956*/
957 case 43:
958 case 45:
959 case 46:
960
961 buf[0] = key + '0';
962 break;
963
964 case 44:
965 default:
966 return;
967 }
968
969 buf[1] = '\0';
970 ptdebuf[stccol] = buf[0];
971
972 UpdVid(7, stccol, buf, PTDATR);
973
974 if (stccol EQ 43)
975 ++stccol;
976
977 if (stccol EQ 46)
978 ctcon();
979 else
980 movectc(stcrow, ++stccol);
981
982 return;
983/*
984
985*/
986 case 4: /* interval -- +1200 */
987
988 if (stccol EQ 42) {
989
990 if (key EQ 8)
991 buf[0] = '-';
992 else if (key EQ 9)
993 buf[0] = '+';
994 else
995 return;
996
997 } else if (stccol EQ 43) {
998
999 if (key > 1)
1000 return;
1001 else
1002 buf[0] = key + '0';
1003
1004 } else {
1005
1006 buf[0] = key + '0';
1007 }
1008
1009 ptdebuf[stccol] = buf[0];
1010 buf[1] = '\0';
1011
1012 UpdVid(7, stccol, buf, PTDATR);
1013
1014 if (stccol EQ 46)
1015 ctcon();
1016 else
1017 movectc(stcrow, ++stccol);
1018
1019 return;
1020/*
1021
1022*/
1023 case 5: /* ratio -- 9/9 */
1024
1025 switch (stccol) {
1026
1027 case 42:
1028 case 44:
1029
1030 buf[0] = key +'0';
1031 break;
1032
1033 case 43:
1034 case 45:
1035 case 46:
1036
1037 return;
1038 }
1039
1040 ptdebuf[stccol] = buf[0];
1041 buf[1] = '\0';
1042
1043 UpdVid(7, stccol, buf, PTDATR);
1044
1045 if (stccol EQ 42)
1046 ++stccol;
1047
1048 if (stccol EQ 44)
1049 ctcon();
1050 else
1051 movectc(stcrow, ++stccol);
1052
1053 return;
1054/*
1055
1056*/
1057 case 6: /* frequency -- 15.9 */
1058
1059 switch (stccol) {
1060
1061 case 42:
1062
1063 if (key > 1)
1064 return;
1065
1066 /* FALL-THROUGH */
1067
1068 case 43:
1069 case 45:
1070
1071 buf[0] = key + '0';
1072 break;
1073
1074 case 44:
1075 case 46:
1076
1077 return;
1078 }
1079
1080 ptdebuf[stccol] = buf[0];
1081 buf[1] = '\0';
1082
1083 UpdVid(7, stccol, buf, PTDATR);
1084
1085 if (stccol EQ 43)
1086 ++stccol;
1087
1088 if (stccol EQ 45)
1089 ctcon();
1090 else
1091 movectc(stcrow, ++stccol);
1092
1093 return;
1094/*
1095
1096*/
1097 case 7: /* pitch -- 9C#99 */
1098
1099 switch (stccol) {
1100
1101 case 43:
1102
1103 if (key > 6)
1104 return;
1105
1106 buf[0] = key + 'A';
1107 break;
1108
1109 case 44:
1110
1111 if (key EQ 7)
1112 buf[0] = ' ';
1113 else if (key EQ 8)
1114 buf[0] = '\251';
1115 else if (key EQ 9)
1116 buf[0] = '\250';
1117 else
1118 return;
1119
1120 break;
1121
1122 case 42:
1123 case 45:
1124 case 46:
1125
1126 buf[0] = key + '0';
1127 break;
1128 }
1129
1130 ptdebuf[stccol] = buf[0];
1131 buf[1] = '\0';
1132
1133 UpdVid(7, stccol, buf, PTDATR);
1134
1135 if (stccol EQ 46)
1136 ctcon();
1137 else
1138 movectc(stcrow, ++stccol);
1139
1140 return;
1141/*
1142
1143*/
1144 case 8: /* trans | stop | start */
1145
1146 switch (key) {
1147
1148 case 7: /* trans */
1149
1150 strcpy(buf, "Trans");
1151 ptedat2 = 0;
1152 break;
1153
1154 case 8: /* stop */
1155
1156 strcpy(buf, "Stop ");
1157 ptedat2 = 1;
1158 break;
1159
1160 case 9: /* start */
1161
1162 strcpy(buf, "Start");
1163 ptedat2 = 2;
1164 break;
1165
1166 default:
1167
1168 return;
1169 }
1170
1171 strcpy(&ptdebuf[42], buf);
1172 UpdVid(7, 42, buf, PTDATR);
1173 movectc(stcrow, 46);
1174 return;
1175/*
1176
1177*/
1178 case 9: /* stop | start */
1179
1180 if (key EQ 8) { /* stop */
1181
1182 strcpy(buf, "Stop ");
1183 ptedat2 = 0;
1184
1185 } else if (key EQ 9) { /* start */
1186
1187 strcpy(buf, "Start");
1188 ptedat2 = 1;
1189
1190 } else {
1191
1192 return;
1193 }
1194
1195 strcpy(&ptdebuf[42], buf);
1196 UpdVid(7, 42, buf, PTDATR);
1197 movectc(stcrow, 46);
1198 return;
1199
1200 case 10: /* off | on */
1201
1202 if (key EQ 8) { /* off */
1203
1204 strcpy(buf, "Off ");
1205 ptedat2 = 0;
1206
1207 } else if (key EQ 9) { /* on */
1208
1209 strcpy(buf, "On ");
1210 ptedat2 = 1;
1211
1212 } else {
1213
1214 return;
1215 }
1216
1217 strcpy(&ptdebuf[42], buf);
1218 UpdVid(7, 42, buf, PTDATR);
1219 movectc(stcrow, 46);
1220 return;
1221/*
1222
1223*/
1224 case 11: /* source */
1225
1226 return;
1227
1228 case 12: /* register | value */
1229
1230 switch (stccol) {
1231
1232 case 42:
1233
1234 if (key EQ 7)
1235 buf[0] = 'R';
1236 else if (key EQ 8 AND ((PE_SPEC & ptespec) NE PA_RSET))
1237 buf[0] = '-';
1238 else if (key EQ 9)
1239 buf[0] = '+';
1240 else
1241 return;
1242
1243 break;
1244
1245 case 43:
1246 case 44:
1247
1248 buf[0] = key + '0';
1249 break;
1250
1251 default:
1252
1253 return;
1254 }
1255
1256 ptdebuf[stccol] = buf[0];
1257 buf[1] = '\0';
1258
1259 UpdVid(7, stccol, buf, PTDATR);
1260
1261 if (stccol EQ 44)
1262 ctcon();
1263 else
1264 movectc(stcrow, ++stccol);
1265
1266 return;
1267/*
1268
1269*/
1270 case 13: /* sequence line */
1271
1272 if (stccol > 44)
1273 return;
1274
1275 buf[0] = key + '0';
1276 ptdebuf[stccol] = buf[0];
1277 buf[1] = '\0';
1278
1279 UpdVid(7, stccol, buf, PTDATR);
1280
1281 if (stccol EQ 44)
1282 ctcon();
1283 else
1284 movectc(stcrow, ++stccol);
1285
1286 return;
1287
1288 case 14: /* LED controls */
1289
1290 if ((key > 3) OR (stccol EQ 46))
1291 return;
1292
1293 if ((stccol EQ 45) AND (0 EQ (ptesuba & 0x0001)))
1294 return;
1295
1296 buf[0] = key + '0';
1297 buf[1] = '\0';
1298 ptdebuf[stccol] = buf[0];
1299
1300 UpdVid(7, stccol, buf, PTDATR);
1301
1302 if (((ptesuba & 0x0001) AND (stccol EQ 45)) OR
1303 ((0 EQ ptesuba & 0x0001) AND (stccol EQ 44)))
1304 ctcon();
1305 else
1306 movectc(stcrow, ++stccol);
1307
1308 return;
1309/*
1310
1311*/
1312 case 15: /* instrument number */
1313
1314 if (stccol > 43)
1315 return;
1316
1317 if ((stccol EQ 42) AND (key > 4))
1318 return;
1319
1320 buf[0] = key + '0';
1321 buf[1] = '\0';
1322 ptdebuf[stccol] = buf[0];
1323
1324 UpdVid(7, stccol, buf, PTDATR);
1325
1326 if (stccol EQ 43)
1327 ctcon();
1328 else
1329 movectc(stcrow, ++stccol);
1330
1331 return;
1332/*
1333
1334*/
1335 case 16: /* waveshape number */
1336
1337 if (stccol > 43)
1338 return;
1339
1340 if ((stccol EQ 42) AND (key > 2))
1341 return;
1342
1343 buf[0] = key + '0';
1344 buf[1] = '\0';
1345 ptdebuf[stccol] = buf[0];
1346
1347 UpdVid(7, stccol, buf, PTDATR);
1348
1349 if (stccol EQ 43)
1350 ctcon();
1351 else
1352 movectc(stcrow, ++stccol);
1353
1354 return;
1355
1356 case 17: /* configuration number */
1357
1358 if (stccol > 43)
1359 return;
1360
1361 if ((stccol EQ 42) AND (key > 1))
1362 return;
1363
1364 buf[0] = key + '0';
1365 buf[1] = '\0';
1366 ptdebuf[stccol] = buf[0];
1367
1368 UpdVid(7, stccol, buf, PTDATR);
1369
1370 if (stccol EQ 43)
1371 ctcon();
1372 else
1373 movectc(stcrow, ++stccol);
1374
1375 return;
1376/*
1377
1378*/
1379 case 18: /* tuning table number */
1380
1381 if (stccol > 42)
1382 return;
1383
1384 buf[0] = key + '0';
1385 buf[1] = '\0';
1386 ptdebuf[stccol] = buf[0];
1387
1388 UpdVid(7, stccol, buf, PTDATR);
1389
1390 ctcon();
1391 return;
1392
1393 default:
1394
1395 return;
1396 }
1397 }
1398}
Note: See TracBrowser for help on using the repository browser.