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