source: buchla-68k/ram/scordsp.c@ e225e77

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

Added missing includes and declarations.

  • Property mode set to 100644
File size: 24.1 KB
Line 
1/*
2 =============================================================================
3 scordsp.c -- MIDAS score display driver
4 Version 136 -- 1988-12-08 -- D.N. Lynx Crowe
5 =============================================================================
6*/
7
8#include "stddefs.h"
9#include "biosdefs.h"
10#include "glcdefs.h"
11#include "glcfns.h"
12#include "graphdef.h"
13#include "lcdline.h"
14#include "memory.h"
15#include "secops.h"
16#include "vsdd.h"
17#include "vsddsw.h"
18#include "vsddvars.h"
19#include "hwdefs.h"
20#include "cmeta.h"
21#include "macros.h"
22#include "panel.h"
23#include "smdefs.h"
24
25#include "midas.h"
26#include "score.h"
27#include "scdsp.h"
28#include "scfns.h"
29#include "secdefs.h"
30#include "neddefs.h"
31
32#include "stdio.h"
33
34/*
35
36*/
37
38extern uint16_t exp_c(uint16_t c);
39
40extern int16_t rd_intp(int16_t n);
41extern int16_t rd_ioas(int16_t n);
42extern int16_t rd_tmpo(int16_t n);
43extern int16_t rd_tune(int16_t n);
44extern int16_t sc_refr(int32_t t);
45extern void arcurs(uint16_t icolor);
46extern void clrsctl(void);
47extern void ds_dyn(void);
48extern void ds_inst(void);
49extern void ds_loc(void);
50extern void ds_trns(void);
51extern void dswap(void);
52extern void setgc(int16_t xv, int16_t yv);
53extern void stcclr(void);
54extern void stcset(void);
55extern void ttcini(uint16_t color);
56extern void vputa(uint16_t *sbase, uint16_t row, uint16_t col, uint16_t attrib);
57extern void vsndpal(int16_t pp[16][3]);
58
59/* variables defined elsewhere */
60
61extern void (*point)(int16_t x, int16_t y, int16_t pen);
62
63extern uint16_t *obj0, *obj2, *obj3, *obj8, *obj11, *obj13, *obj14, *obj15;
64
65extern uint16_t *consl; /* constant slice pointer */
66extern uint16_t *saddr; /* score VSDD RAM base pointer */
67
68extern uint16_t scrl; /* score VSDD object scroll register image */
69
70extern int16_t ancmsw; /* analog variable r/p control source */
71extern int16_t angroup; /* analog variable group being shown */
72extern int16_t clkctl; /* clock control */
73extern int16_t clkrun; /* clock run switch */
74extern int16_t clksrc; /* clock source */
75extern int16_t cxval; /* cursor x */
76extern int16_t cyval; /* cursor y */
77extern int16_t dubsw; /* overdub / replace switch */
78extern int16_t insmode; /* insert switch */
79extern int16_t lastam; /* last assignment menu page */
80extern int16_t ndisp; /* display number */
81extern int16_t pchsw; /* punch-in enable switch */
82extern int16_t recsw; /* record / play switch */
83extern int16_t sbase; /* score VSDD RAM scroll offset */
84extern int16_t scmctl; /* score submenu #2 state */
85extern int16_t sd; /* score scroll direction */
86extern int16_t sdmctl; /* score submenu #1 state */
87extern int16_t secop; /* section operation */
88extern int16_t sgcsw; /* score graphic / text cursor switch */
89extern int16_t sliders; /* slider function */
90extern int16_t soffset; /* score scroll offset */
91extern int16_t stccol; /* text cursor column */
92extern int16_t stcrow; /* text cursor row */
93extern int16_t submenu; /* submenu cursor switch */
94extern int16_t velflag; /* velocity display enable flag */
95
96extern int8_t bfs[]; /* display generation buffer */
97
98extern int8_t *nedlbl[]; /* note edit labels */
99
100extern int16_t kbobj[]; /* keyboard icon */
101
102extern int16_t grpmode[]; /* group mode - 0 = play, 1 = stdby, 2 = rec */
103extern int16_t grpstat[]; /* group status - 0 = off, non-0 = on */
104extern int16_t lastvel[]; /* last velocity sent to group */
105
106extern int16_t anrs[][16]; /* analog variable resolution */
107extern int16_t varmode[][16]; /* analog variable record mode */
108
109extern uint16_t slices[]; /* score display slices */
110
111extern struct valent valents[]; /* s/m value table */
112
113/*
114
115*/
116
117/* initialized stuff */
118
119int16_t var2src[6] = { /* analog variable map */
120
121 SM_HTPW, SM_VTMW, SM_LPBR, SM_CTL1, SM_PED1, SM_KPRS
122};
123
124int16_t simled[3] = { /* simulated LED colors for group modes */
125
126 0x00A2, /* play mode = green */
127 0x0062, /* standby mode = yellow */
128 0x0052 /* record mode = red */
129};
130
131int8_t nsvtab[] = { /* note value modifier (accidental) table */
132
133 0, 1, 0, 0, 1, 0, 1, 0, 0, 1, 0, 1, /* 21 .. 32 -- A0 .. G#0 */
134 0, 1, 0, 0, 1, 0, 1, 0, 0, 1, 0, 1, /* 33 .. 44 -- A1 .. G#1 */
135 0, 1, 0, 0, 1, 0, 1, 0, 0, 1, 0, 1, /* 45 .. 56 -- A2 .. G#2 */
136 0, 1, 0, 0, 1, 0, 1, 0, 0, 1, 0, 1, /* 57 .. 68 -- A3 .. G#3 */
137 0, 1, 0, 0, 1, 0, 1, 0, 0, 1, 0, 1, /* 69 .. 80 -- A4 .. G#4 */
138 0, 1, 0, 0, 1, 0, 1, 0, 0, 1, 0, 1, /* 81 .. 92 -- A5 .. G#5 */
139 0, 1, 0, 0, 1, 0, 1, 0, 0, 1, 0, 1, /* 93 .. 104 -- A6 .. G#6 */
140 0, 1, 0, 0 /* 105 .. 108 -- A7 .. C7 */
141};
142
143int16_t scorpal[16][3] = { /* score palette */
144
145 {0, 0, 0}, /* 0 - black */
146 {2, 3, 3}, /* 1 - white */
147 {0, 0, 1}, /* 2 - dark blue #1 */
148 {2, 0, 2}, /* 3 - dark violet */
149 {0, 0, 3}, /* 4 - dark blue #2 */
150 {3, 0, 0}, /* 5 - red */
151 {3, 3, 0}, /* 6 - yellow */
152 {1, 2, 0}, /* 7 - dark green */
153 {0, 3, 3}, /* 8 - light blue */
154 {3, 2, 0}, /* 9 - tan */
155 {0, 3, 0}, /* 10 - light green */
156 {3, 1, 2}, /* 11 - light violet */
157 {0, 2, 3}, /* 12 - medium blue */
158 {2, 0, 0}, /* 13 - dark red */
159 {2, 2, 1}, /* 14 - ivory */
160 {3, 3, 3} /* 15 - bright white */
161};
162
163/*
164
165*/
166
167int8_t *clklbl[] = { /* clock control and scource labels */
168
169 "Local", /* 0 - CK_LOCAL */
170 "MIDI ", /* 1 - CK_MIDI */
171 "SMPTE", /* 2 - CK_SMPTE */
172 "PLS24", /* 3 - CK_PLS24 */
173 "PLS48", /* 4 - CK_PLS48 */
174 "PLS96", /* 5 - CK_PLS96 */
175 "Step " /* 6 - CK_STEP */
176};
177
178int8_t *sdisp[] = { /* score display fixed text strings */
179
180 /* 0 */ "\230\231\232\233 ", /* Interpolate */
181
182 /* 1 */ "\200\201\202\203 1 2 3 4 5 6 7 8 9 \254 \255 \256 ",
183 /* Group / Instrument */
184
185 /* 2 */ "\220\221\222\223 Pch/Hor Mod/Vrt Brth/LP GPC/CV1 Pedal 1 Key Prs Group",
186 /* Analog Source */
187
188 /* 3 */ "\015\016\017 Play Recrd OvrDub PunchIn ",
189 /* Rec Mode */
190
191 /* 4 */ "\204\205\206\207", /* Transpose */
192
193 /* 5 */ "\210\211\212\213 / / / / / / / / / / / / ",
194 /* Dynamics / Location */
195
196 /* 6 */ "\214\215\216\217", /* Velocity */
197
198 /* 7 */ "\224\225\226\227 0/+00.0 0/+00.0 0/+00.0 0/+00.0 0/+00.0 0/+00.0 # 00 ",
199 /* Resolution / Value */
200
201 /* 8 */ " "
202
203
204};
205
206/*
207
208*/
209
210/*
211 =============================================================================
212 makeln(lnc, lec) -- create the constant slice at 'consl'.
213 make the line object color 'lnc', and ledger line color 'lec',
214 =============================================================================
215*/
216
217void makeln(uint16_t lnc, uint16_t lew)
218{
219 register uint16_t *lp, *cp;
220 register int16_t i;
221 register uint16_t lbg;
222
223 lp = obj15; /* setup line object pointer */
224 cp = consl; /* setup constant slice pointer */
225
226 lew = exp_c(lew); /* create ledger line constant */
227
228 lnc &= 0x000F; /* mask cursor line color */
229
230/*
231
232*/
233 for (i = 0; i < 224; i++) {
234
235 /* stuff data into line object */
236
237 if ((i EQ 42) OR /* top ledger line */
238 (i EQ 50) OR /* top ledger line */
239 (i EQ 58) OR /* top ledger line */
240 (i EQ 66) OR /* top ledger line */
241 (i EQ 162) OR /* bottom ledger line */
242 (i EQ 170) OR /* bottom ledger line */
243 (i EQ 178) OR /* bottom ledger line */
244 (i EQ 186)) {
245
246 lbg = lew;
247 *lp++ = lbg & 0xFFF0;
248 *lp++ = lbg;
249 *lp++ = lbg;
250 *lp++ = lbg;
251
252 } else if (i > 209) { /* new data area */
253
254 lbg = 0;
255 *lp++ = lbg & 0xFFF0;
256 *lp++ = lbg;
257 *lp++ = lbg;
258 *lp++ = lbg;
259
260 } else {
261
262 lbg = 0;
263 *lp++ = lbg & 0xFFF0;
264 *lp++ = lbg;
265 *lp++ = (lbg & 0xFFF0) | lnc;
266 *lp++ = lbg;
267 }
268
269 *cp++ = 0; /* clear a line in the constant slice */
270 }
271
272/*
273
274*/
275
276 consl[74] = lew; /* constant slice treble clef lines */
277 consl[82] = lew;
278 consl[90] = lew;
279 consl[98] = lew;
280 consl[106] = lew;
281
282 consl[122] = lew; /* constant slice bass clef lines */
283 consl[130] = lew;
284 consl[138] = lew;
285 consl[146] = lew;
286 consl[154] = lew;
287
288 consl[210] = exp_c(NDMC); /* constant slice new data margin line */
289}
290
291/*
292
293*/
294
295/*
296 =============================================================================
297 ds_vmod() -- display velocity mode
298 =============================================================================
299*/
300
301void ds_vmod(void)
302{
303 if (ndisp NE 2)
304 return;
305
306 if (v_regs[5] & 0x0180)
307 vbank(0);
308
309 vputs(obj8, 5, 0, sdisp[6],
310 velflag ? ((SD_CHNG << 4) | SDBG11) : SDW11ATR);
311}
312
313/*
314 =============================================================================
315 ds_vel() -- display velocities
316 =============================================================================
317*/
318
319void ds_vel(void)
320{
321 register int16_t i;
322 int8_t buf[6];
323
324 if (ndisp NE 2)
325 return;
326
327 if (v_regs[5] & 0x0180)
328 vbank(0);
329
330 ds_vmod();
331
332 for (i = 0; i < 12; i++) {
333
334 sprintf(buf, "%03d", lastvel[i] / 252);
335 vputs(obj8, 5, (i * 5) + 6, buf, SDW11ATR);
336 }
337}
338
339/*
340
341*/
342
343/*
344 =============================================================================
345 dsvmode() -- display variable mode
346 =============================================================================
347*/
348
349void dsvmode(int16_t n)
350{
351 if (ndisp NE 2)
352 return;
353
354 if (v_regs[5] & 0x0180)
355 vbank(0);
356
357 vputc(obj8, 6, 5 + (n * 9), '*', simled[varmode[n][abs(angroup) - 1]]);
358}
359
360
361/*
362 =============================================================================
363 ds_anmd() -- display mode for all variables
364 =============================================================================
365*/
366
367void ds_anmd(void)
368{
369 register int16_t i;
370
371 if (ndisp NE 2)
372 return;
373
374 for (i = 0; i < 6; i++)
375 dsvmode(i);
376}
377
378/*
379
380*/
381
382/*
383 =============================================================================
384 ds_angr() -- display analog variable group number
385 =============================================================================
386*/
387
388void ds_angr(void)
389{
390 int8_t buf[4];
391
392 if (ndisp NE 2)
393 return;
394
395 if (v_regs[5] & 0x0180)
396 vbank(0);
397
398 sprintf(buf, "# %2.2d", abs(angroup));
399 vputs(obj8, 7, 59, buf, SDW12ATR);
400}
401
402/*
403
404*/
405
406/*
407 =============================================================================
408 ds_anrs() -- display analog resolution
409 =============================================================================
410*/
411
412void ds_anrs(void)
413{
414 register int16_t i;
415 int8_t buf[3];
416
417 if (ndisp NE 2)
418 return;
419
420 if (v_regs[5] & 0x0180)
421 vbank(0);
422
423 buf[1] = '/';
424 buf[2] = '\0';
425
426 for (i = 0; i < 6; i++) {
427
428 buf[0] = '0' + anrs[i][abs(angroup) - 1];
429 vputs(obj8, 7, 6 + (i * 9), buf, SDW12ATR);
430 }
431}
432
433/*
434
435*/
436
437/*
438 =============================================================================
439 dsanval() -- display analog value
440 =============================================================================
441*/
442
443void dsanval(int16_t var)
444{
445 register int16_t tmp, val, v1, v2;
446 int8_t buf[16];
447
448 if (ndisp NE 2)
449 return;
450
451 if (v_regs[5] & 0x0180)
452 vbank(0);
453
454 val = valents[((abs(angroup) - 1) << 4) | var2src[var]].val >> 5;
455 tmp = abs(val);
456 v1 = tmp / 100;
457 v2 = (tmp - (v1 * 100)) / 10;
458 sprintf(buf, "%c%02d.%1d", ((val < 0) ? '-' : '+'), v1, v2);
459 vputs(obj8, 7, 8 + (var * 9), buf, SDW12ATR);
460}
461
462/*
463 =============================================================================
464 ds_anvl() -- display analog values
465 =============================================================================
466*/
467
468void ds_anvl(void)
469{
470 register int16_t i;
471
472 if (ndisp NE 2)
473 return;
474
475 for (i = 0; i < 6; i++)
476 dsanval(i);
477}
478
479/*
480
481*/
482
483/*
484 =============================================================================
485 uclk() -- underline clock label
486 =============================================================================
487*/
488
489void uclk(void)
490{
491 if (sliders NE LS_VOICE) {
492
493 point = GLCplot;
494
495 GLCcurs(G_ON);
496
497 if (clkrun)
498 lseg(CK_XL, CK_Y, CK_XR, CK_Y, 1); /* clock on */
499 else
500 lseg(CK_XL, CK_Y, CK_XR, CK_Y, 0); /* clock off */
501
502 GLCcurs(G_OFF);
503 }
504}
505
506/*
507
508*/
509
510/*
511 =============================================================================
512 dclkmd() -- display clock mode
513 =============================================================================
514*/
515
516void dclkmd(void)
517{
518 uclk();
519
520 if (ndisp NE 2)
521 return;
522
523 if (v_regs[5] & 0x0180)
524 vbank(0);
525
526 vputs(obj8, 0, 29, "Clock",
527 clkrun ? ((SD_CHNG << 4) | SDBG02) : SDW02ATR);
528}
529
530/*
531
532*/
533
534/*
535 =============================================================================
536 dsclk() -- display clock status, control, and source
537 =============================================================================
538*/
539
540void dsclk(void)
541{
542 int16_t atr[26];
543
544 uclk();
545
546 if (ndisp NE 2)
547 return;
548
549 memsetw(atr, SDW02ATR, 26);
550
551 if (clkrun)
552 memsetw(atr, (SDBG02 | (SD_CHNG << 4)), 5);
553
554 sprintf(bfs, "Clock Con %5.5s Src %5.5s ",
555 clklbl[clkctl], clklbl[clksrc]);
556
557 if (v_regs[5] & 0x0180)
558 vbank(0);
559
560 vputsa(obj8, 0, 29, bfs, atr);
561}
562
563/*
564
565*/
566
567/*
568 =============================================================================
569 dssect() -- display current score section
570 =============================================================================
571*/
572
573void dssect(void)
574{
575 if (ndisp NE 2)
576 return;
577
578 sprintf(bfs, "%02d", cursect + 1);
579
580 if (v_regs[5] & 0x0180)
581 vbank(0);
582
583 vputs(obj8, 0, 6, bfs, SDW01ATR);
584}
585
586/*
587
588*/
589
590/*
591 =============================================================================
592 dslocn() -- display current score location
593 =============================================================================
594*/
595
596void dslocn(void)
597{
598 register int32_t curfr, beat;
599 register int16_t frame;
600
601 if (ndisp NE 2)
602 return;
603
604 curfr = t_ctr;
605 beat = curfr / 48;
606 frame = curfr % 48;
607
608 sprintf(bfs, "%05ld F %02d", beat, frame);
609
610 if (v_regs[5] & 0x0180)
611 vbank(0);
612
613 vputs(obj8, 0, 11, bfs, SDW00ATR);
614}
615
616/*
617
618*/
619
620/*
621 =============================================================================
622 dnedmod() -- display note edit mode
623 =============================================================================
624*/
625
626void dnedmod(void)
627{
628 if (ndisp NE 2)
629 return;
630
631 if (v_regs[5] & 0x0180)
632 vbank(0);
633
634 vputs(obj8, 0, 55, nedlbl[noteop],
635 (notesel ? ((SD_CHNG << 4) | SDBG03) : SDW03ATR) |
636 (noteop EQ NOP_NUL ? 0 : C_BLINK));
637}
638
639/*
640 =============================================================================
641 dsmem() -- display remaining memory 'units' (long words)
642 =============================================================================
643*/
644
645void dsmem(void)
646{
647 if (ndisp NE 2)
648 return;
649
650 sprintf(bfs, "M %05ld", evleft());
651
652 if (v_regs[5] & 0x0180)
653 vbank(0);
654
655 vputs(obj8, 8, 57, bfs, SDW15ATR);
656}
657
658/*
659
660*/
661
662/*
663 =============================================================================
664 dsgstat() -- display group status
665 =============================================================================
666*/
667
668void dsgstat(int16_t n)
669{
670 int8_t c;
671
672 if (ndisp NE 2)
673 return;
674
675 if (v_regs[5] & 0x0180)
676 vbank(0);
677
678 c = 1 + n + (grpstat[n] ? ((n > 8) ? 162 : '0') : 192);
679 vputc(obj8, 2, 5 + (n * 5), c, (((n + 3) << 4) | 2));
680}
681
682/*
683 =============================================================================
684 dsgmode() -- display group mode
685 =============================================================================
686*/
687
688void dsgmode(int16_t n)
689{
690 if (ndisp NE 2)
691 return;
692
693 if (v_regs[5] & 0x0180)
694 vbank(0);
695
696 vputc(obj8, 2, 6 + (n * 5), '*', simled[grpmode[n]]);
697}
698
699/*
700
701*/
702
703/*
704 =============================================================================
705 dsgmods() -- display mode and status for all groups
706 =============================================================================
707*/
708
709void dsgmods(void)
710{
711 register int16_t i;
712
713 if (ndisp NE 2)
714 return;
715
716 for (i = 0; i < 12; i++) {
717
718 dsgstat(i);
719 dsgmode(i);
720 }
721}
722
723/*
724 =============================================================================
725 dsgmodz() -- display modes for all groups and variables
726 =============================================================================
727*/
728
729void dsgmodz(void)
730{
731 register int16_t i;
732
733 if (ndisp NE 2)
734 return;
735
736 for (i = 0; i < 12; i++) /* group modes */
737 dsgmode(i);
738
739 for (i = 0; i < 6; i++) /* variable modes */
740 dsvmode(i);
741}
742
743/*
744
745*/
746
747/*
748 =============================================================================
749 dsrpmod() -- display record / play modes
750 =============================================================================
751*/
752
753void dsrpmod(void)
754{
755 int16_t atr[25];
756
757 switch (sliders) {
758
759 case LS_PRMTR:
760 case LS_OTHER:
761 case LS_EQ:
762 case LS_NGRP:
763
764 point = GLCplot;
765
766 GLCcurs(G_ON);
767
768 if (recsw) {
769
770 lseg(RP_RL, RP_Y, RP_RR, RP_Y, 1); /* record */
771 lseg(RP_PL, RP_Y, RP_PR, RP_Y, 0);
772
773 } else {
774
775 lseg(RP_RL, RP_Y, RP_RR, RP_Y, 0); /* play */
776 lseg(RP_PL, RP_Y, RP_PR, RP_Y, 1);
777 }
778
779 GLCcurs(G_OFF);
780 }
781/*
782
783*/
784 if (ndisp NE 2)
785 return;
786
787 memsetw(atr, SDW14ATR, 25);
788
789 if (recsw) /* record */
790 memsetw(&atr[5], (C_BLINK | SDBG14 | (SD_CHNG << 4)), 5);
791 else /* play */
792 memsetw(&atr[0], (SDBG14 | (SD_CHNG << 4)), 4);
793
794 if (dubsw) /* overdub */
795 memsetw(&atr[11], (SDBG14 | (SD_CHNG << 4)), 6);
796
797 if (pchsw) /* punch in enable */
798 memsetw(&atr[18], (SDBG14 | (SD_CHNG << 4)), 7);
799
800 if (v_regs[5] & 0x0180)
801 vbank(0);
802
803 vputsa(obj8, 8, 31, "Play Recrd OvrDub PunchIn", atr);
804}
805
806/*
807
808*/
809
810/*
811 =============================================================================
812 dsimode() -- display insert mode
813 =============================================================================
814*/
815
816void dsimode(void)
817{
818 int16_t atr[7];
819
820 if (ndisp NE 2)
821 return;
822
823 if (insmode)
824 memsetw(atr, (SDBG01 | (SD_CHNG << 4)), 7);
825 else
826 memsetw(atr, SDW01ATR, 7);
827
828 if (v_regs[5] & 0x0180)
829 vbank(0);
830
831 vputsa(obj8, 0, 22, "Insert ", atr);
832}
833
834/*
835
836*/
837
838/*
839 =============================================================================
840 sdwin() -- fill in a score display window
841 =============================================================================
842*/
843
844void sdwin(int16_t n)
845{
846 int16_t atr[64], atrib, i;
847
848 if (ndisp NE 2) /* only if score is selected */
849 return;
850
851 if (v_regs[5] & 0x0180) /* select bank 0 */
852 vbank(0);
853
854 switch (n) { /* dispatch off of window number */
855
856 case 0: /* score location */
857
858 vputs(obj8, 0, 0,
859 ac_code EQ N_SHARP ? "\250 " : "\251 ",
860 SDW00ATR);
861
862 vputs(obj8, 0, 2, "Sec ", SDW01ATR);
863 vputs(obj8, 0, 9, "B F ", SDW00ATR);
864
865 dssect(); /* display current section */
866 dslocn(); /* display score location */
867 return;
868
869 case 1: /* insert mode */
870
871 dsimode(); /* display score insert mode */
872 return;
873
874 case 2: /* clock */
875
876 dsclk(); /* display clock status */
877 return;
878
879 case 3: /* note edit */
880
881 dnedmod();
882 return;
883/*
884
885*/
886 case 4: /* assignment */
887
888 vputs(obj8, 1, 0, "Assignment ", SDW04ATR);
889 rd_ioas(0); /* display assignment table number */
890 return;
891
892 case 5: /* tuning */
893
894 vputs(obj8, 1, 14, "Tune ", SDW05ATR);
895 rd_tune(0); /* display tuning table number */
896 return;
897
898 case 6: /* tempo */
899
900 vputs(obj8, 1, 21, "Tempo ", SDW06ATR);
901 rd_tmpo(0); /* display tempo */
902 return;
903
904 case 7: /* interpolate */
905
906 vputs(obj8, 1, 31, "Int ", SDW07ATR);
907 rd_intp(0);
908 return;
909
910 case 8: /* stop/next */
911
912 vputs(obj8, 1, 40, "Stop/Next ", SDW08ATR);
913 return;
914/*
915
916*/
917
918 case 9: /* punch in/out */
919
920 vputs(obj8, 1, 50, "In/Out ", SDW09ATR);
921 return;
922
923 case 10: /* output */
924
925 vputs(obj8, 1, 57, "Output ", SDW10ATR);
926 return;
927
928 case 11: /* group/instr, transposition, dyn/loc, velocity */
929
930 vputs(obj8, 2, 0, sdisp[1], SDW11ATR);
931 dsgmods(); /* display mode and status for all groups */
932 ds_inst(); /* display instruments */
933
934 vputs(obj8, 3, 4, sdisp[8], SDW11ATR);
935 vputs(obj8, 3, 0, sdisp[4], SDW11ATR);
936 ds_trns(); /* display transpositions */
937
938 vputs(obj8, 4, 4, sdisp[8], SDW11ATR); /* dyn/loc */
939 vputs(obj8, 4, 0, sdisp[5], SDW11ATR);
940 ds_dyn(); /* display dynamics */
941 ds_loc(); /* display locations */
942
943 vputs(obj8, 5, 4, sdisp[8], SDW11ATR); /* velocity */
944 vputs(obj8, 5, 0, sdisp[6], SDW11ATR);
945 ds_vel(); /* display velocities */
946
947 return;
948/*
949
950*/
951 case 12: /* analog variables */
952
953 vputs(obj8, 6, 0, sdisp[2], SDW12ATR);
954 vputs(obj8, 7, 0, sdisp[7], SDW12ATR);
955
956 if (angroup < 0)
957 atrib = SDW12ATR;
958 else
959 atrib = (SD_CHNG << 4) | SDBG12;
960
961 for (i = 0; i < 4; i++)
962 vputa(obj8, 7, i, atrib);
963
964 if (ancmsw)
965 atrib = (SD_CHNG << 4) | SDBG12;
966 else
967 atrib = SDW12ATR;
968
969 for (i = 0; i < 4; i++)
970 vputa(obj8, 6, i, atrib);
971
972 ds_anmd();
973 ds_angr();
974 ds_anrs();
975 ds_anvl();
976
977 return;
978
979 case 13: /* score */
980
981 sprintf(bfs, "Score %02.2d %16.16s ",
982 curscor + 1, scname[curscor]);
983
984 vputs(obj8, 8, 0, bfs, SDW13ATR);
985 return;
986
987 case 14: /* record/play, overdub, punchin */
988
989 vputs(obj8, 8, 27, sdisp[3], SDW14ATR); /* Rec Mode */
990 dsrpmod(); /* display rec/play modes */
991 return;
992
993 case 15: /* memory */
994
995 dsmem(); /* display available events */
996 return;
997 }
998}
999
1000/*
1001
1002*/
1003
1004/*
1005 =============================================================================
1006 sdwins() -- display all score windows
1007 =============================================================================
1008*/
1009
1010void sdwins(void)
1011{
1012 register int16_t i;
1013
1014 if (ndisp NE 2) /* only if score display is selected */
1015 return;
1016
1017 for (i = 0; i < 17; i++) /* refresh each of the windows */
1018 sdwin(i);
1019}
1020
1021/*
1022
1023*/
1024
1025/*
1026 =============================================================================
1027 sdsetup() -- setup the score display
1028 =============================================================================
1029*/
1030
1031void sdsetup(void)
1032{
1033 dswap(); /* clear the video display */
1034
1035 sd = D_FWD; /* display direction = forward */
1036 noteop = NOP_NUL; /* no pending note edit operation */
1037 notesel = FALSE; /* no note selected */
1038 secop = SOP_NUL; /* no pending section edit operation */
1039 scmctl = -1; /* no area 1 menu up */
1040 sdmctl = -1; /* no area 2 menu up */
1041 submenu = FALSE; /* submenu cursor not enabled */
1042 lastam = 0; /* reset assignment menu page */
1043
1044 clrsctl(); /* clear out the slices */
1045
1046 /* setup object pointers */
1047
1048 obj0 = v_curs0; /* 0 - cursor (arrow) */
1049 obj2 = v_tcur; /* 2 - cursor (typewriter) */
1050 obj3 = v_cur; /* 3 - cursor (underline) */
1051 obj8 = v_ct0; /* 8 - character text */
1052 obj11 = v_win0; /* 11 - window */
1053 obj13 = v_kbobj; /* 13 - keyboard */
1054 obj14 = v_score; /* 14 - score */
1055 obj15 = v_lnobj; /* 15 - line */
1056
1057 /* ---------------- initialize object table -------------------- */
1058 /* obj, typ, bnk, base, xpix, ypix, x0, y0, flags, pri */
1059
1060 SetObj( 0, 0, 1, obj0, 16, 16, C1X, C1Y, OBFL_00, -1);
1061 SetObj(TTCURS, 0, 1, obj2, 16, 16, 0, 0, TTCCFL, -1);
1062 SetObj( 3, 0, 1, obj3, 512, 18, 0, 0, OBFL_01, -1);
1063 SetObj( 8, 1, 0, obj8, 512, 108, 0, 0, OBFL_08, -1);
1064 SetObj( 11, 0, 1, obj11, 512, 224, 0, 14, OBFL_11, -1);
1065 SetObj( 13, 0, 1, obj13, 16, 224, 0, 14, OBFL_13, -1);
1066 SetObj( 14, 0, 0, obj14, 512, 224, 0, 14, OBFL_14, -1);
1067 SetObj( 15, 0, 1, obj15, 16, 224, 248, 14, OBFL_15, -1);
1068
1069 if (v_regs[5] & 0x0180) /* select bank 0 */
1070 vbank(0);
1071
1072 memsetw(obj14, 0, 32767); /* clear score object */
1073 memsetw(obj14+32767L, 0, 24577);
1074
1075 vbank(1); /* select bank 1 */
1076
1077 stcset(); /* setup text cursor colors */
1078 stcclr(); /* clear text cursors */
1079 arcurs(SDCURSR); /* setup arrow cursor */
1080 ttcini(SDCURSR); /* setup typewriter cursor */
1081
1082/*
1083
1084*/
1085 if ((v_regs[5] & 0x0180) NE 0x0100)
1086 vbank(1); /* select bank 1 */
1087
1088 memcpyw(obj13, kbobj, 896); /* setup 'keyboard' object */
1089 makeln(LN_VRT, LN_HOR); /* setup 'lines' object */
1090 sdwins(); /* fill in the windows */
1091
1092 /* display some objects */
1093
1094 SetPri( 3, 12); /* Underline cursors */
1095 objclr(12);
1096 objon(12, 12, 2); /* ... row 0 */
1097 objon(12, 250, 2); /* ... row 17 */
1098 objon(12, 264, 2); /* ... row 18 */
1099 objon(12, 278, 2); /* ... row 19 */
1100 objon(12, 292, 2); /* ... row 20 */
1101 objon(12, 306, 2); /* ... row 21 */
1102 objon(12, 320, 2); /* ... row 22 */
1103 objon(12, 334, 2); /* ... row 23 */
1104 objon(12, 348, 2); /* ... row 24 */
1105
1106 SetPri( 8, 7); /* Character Text */
1107 objclr(7);
1108 objon(7, 0, 12); /* ... row 0 */
1109 objon(7, 238, 12); /* ... row 17 */
1110 objon(7, 252, 12); /* ... row 18 */
1111 objon(7, 266, 12); /* ... row 19 */
1112 objon(7, 280, 12); /* ... row 20 */
1113 objon(7, 294, 12); /* ... row 21 */
1114 objon(7, 308, 12); /* ... row 22 */
1115 objon(7, 322, 12); /* ... row 23 */
1116 objon(7, 336, 12); /* ... row 24 */
1117
1118 SetPri(13, 2); /* Keyboard object */
1119 SetPri(14, 1); /* Score object */
1120 SetPri(15, 0); /* Line object */
1121
1122 vsndpal(scorpal); /* set the palette */
1123
1124 SetPri( 0, 15); /* Turn on arrow cursor */
1125 setgc(C1X, C1Y);
1126
1127 sc_refr(t_cur); /* position the score on the display */
1128}
Note: See TracBrowser for help on using the repository browser.