source: buchla-68k/orig/RAM/ETACCN.C@ 4b63bf3

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

Imported original source code.

  • Property mode set to 100755
File size: 2.8 KB
Line 
1/*
2 =============================================================================
3 etaccn.c -- assignment editor - source controller number field handlers
4 Version 7 -- 1988-03-19 -- D.N. Lynx Crowe
5 =============================================================================
6*/
7
8#include "stddefs.h"
9#include "fields.h"
10#include "vsdd.h"
11#include "vsddsw.h"
12#include "graphdef.h"
13
14#include "midas.h"
15#include "asgdsp.h"
16
17extern char *numblk();
18
19extern unsigned *asgob;
20
21extern short stcrow, stccol;
22
23extern short adbox[][8];
24
25extern char dspbuf[];
26
27extern short mctlnum[4]; /* MIDI controller number table (-1, 00..99) */
28
29/*
30
31*/
32
33/*
34 =============================================================================
35 et_accn() -- load the edit buffer
36 =============================================================================
37*/
38
39short
40et_accn(n)
41short n;
42{
43 register short ctl;
44
45 char buf[4];
46
47 ctl = 0x00FF & (n >> 8);
48
49 numblk(ebuf, (mctlnum[ctl] & 0x00FF));
50 ebflag = TRUE;
51
52 return(SUCCESS);
53}
54
55/*
56 =============================================================================
57 ef_accn() -- parse (unload) the edit buffer
58 =============================================================================
59*/
60
61short
62ef_accn(n)
63short n;
64{
65 register short tmpval, ctl, i;
66
67 ctl = 0x00FF & (n >> 8);
68
69 ebuf[2] = '\0'; /* terminate the string in ebuf */
70 ebflag = FALSE;
71 tmpval = 0;
72
73 if ((ebuf[0] EQ ' ') AND (ebuf[1] EQ ' ')) {
74
75 tmpval = -1;
76
77 } else {
78
79 for (i = 0; i < 2; i++) {
80
81 if (ebuf[i] EQ ' ')
82 ebuf[i] = '0';
83
84 tmpval = (tmpval * 10) + (ebuf[i] - '0');
85 }
86 }
87
88 if (mctlnum[ctl] EQ -1)
89 mctlnum[ctl] = tmpval;
90 else
91 mctlnum[ctl] = (mctlnum[ctl] & 0xFF00) | tmpval;
92
93 modasg();
94 return(SUCCESS);
95}
96
97/*
98
99*/
100
101/*
102 =============================================================================
103 rd_accn() -- (re)display the field
104 =============================================================================
105*/
106
107short
108rd_accn(nn)
109short nn;
110{
111 register short n, ctl;
112 char buf[4];
113
114 n = 0x00FF & nn;
115 ctl = 0x00FF & (nn >> 8);
116
117 vbank(0);
118 vcputsv(asgob, 64, adbox[n][4], adbox[n][5],
119 cfetp->frow, cfetp->flcol,
120 numblk(buf, (mctlnum[ctl] & 0x00FF)), 14);
121
122 return(SUCCESS);
123}
124
125/*
126
127*/
128
129/*
130 =============================================================================
131 nd_accn() -- handle new data entry
132 =============================================================================
133*/
134
135short
136nd_accn(nn, k)
137short nn;
138register short k;
139{
140 register short n;
141
142 n = nn & 0xFF;
143 ebuf[stccol - cfetp->flcol] = k + '0';
144 ebuf[2] = '\0';
145
146 dspbuf[0] = k + '0';
147 dspbuf[1] = '\0';
148
149 vbank(0);
150 vcputsv(asgob, 64, AK_ENTRY, adbox[n][5],
151 stcrow, stccol, dspbuf, 14);
152
153 advacur();
154 return(SUCCESS);
155}
156
Note: See TracBrowser for help on using the repository browser.