source: buchla-68k/ram/etaccn.c@ 0580615

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

Point of no return.

  • Property mode set to 100644
File size: 2.7 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(char *buf, short n);
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 et_accn(short n)
40{
41 register short ctl;
42
43 char buf[4];
44
45 ctl = 0x00FF & (n >> 8);
46
47 numblk(ebuf, (mctlnum[ctl] & 0x00FF));
48 ebflag = TRUE;
49
50 return(SUCCESS);
51}
52
53/*
54 =============================================================================
55 ef_accn() -- parse (unload) the edit buffer
56 =============================================================================
57*/
58
59short ef_accn(short n)
60{
61 register short tmpval, ctl, i;
62
63 ctl = 0x00FF & (n >> 8);
64
65 ebuf[2] = '\0'; /* terminate the string in ebuf */
66 ebflag = FALSE;
67 tmpval = 0;
68
69 if ((ebuf[0] EQ ' ') AND (ebuf[1] EQ ' ')) {
70
71 tmpval = -1;
72
73 } else {
74
75 for (i = 0; i < 2; i++) {
76
77 if (ebuf[i] EQ ' ')
78 ebuf[i] = '0';
79
80 tmpval = (tmpval * 10) + (ebuf[i] - '0');
81 }
82 }
83
84 if (mctlnum[ctl] EQ -1)
85 mctlnum[ctl] = tmpval;
86 else
87 mctlnum[ctl] = (mctlnum[ctl] & 0xFF00) | tmpval;
88
89 modasg();
90 return(SUCCESS);
91}
92
93/*
94
95*/
96
97/*
98 =============================================================================
99 rd_accn() -- (re)display the field
100 =============================================================================
101*/
102
103short rd_accn(short nn)
104{
105 register short n, ctl;
106 char buf[4];
107
108 n = 0x00FF & nn;
109 ctl = 0x00FF & (nn >> 8);
110
111 vbank(0);
112 vcputsv(asgob, 64, adbox[n][4], adbox[n][5],
113 cfetp->frow, cfetp->flcol,
114 numblk(buf, (mctlnum[ctl] & 0x00FF)), 14);
115
116 return(SUCCESS);
117}
118
119/*
120
121*/
122
123/*
124 =============================================================================
125 nd_accn() -- handle new data entry
126 =============================================================================
127*/
128
129short nd_accn(short nn, short k)
130{
131 register short n;
132
133 n = nn & 0xFF;
134 ebuf[stccol - cfetp->flcol] = k + '0';
135 ebuf[2] = '\0';
136
137 dspbuf[0] = k + '0';
138 dspbuf[1] = '\0';
139
140 vbank(0);
141 vcputsv(asgob, 64, AK_ENTRY, adbox[n][5],
142 stcrow, stccol, dspbuf, 14);
143
144 advacur();
145 return(SUCCESS);
146}
147
Note: See TracBrowser for help on using the repository browser.