source: buchla-68k/ram/ptdkey.c@ b28a12e

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

Zero redundant declarations.

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