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

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

Removed form-feed comments.

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