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

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

Added include files for global functions and variables.

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