source: buchla-68k/ram/etwhrv.c@ 9738a78

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

Unused variables and parameters.

  • Property mode set to 100644
File size: 2.9 KB
Line 
1/*
2 =============================================================================
3 etwhrv.c -- waveshape editor - harmonic value field handlers
4 Version 12 -- 1988-09-09 -- D.N. Lynx Crowe
5 =============================================================================
6*/
7
8#include "ram.h"
9
10/*
11 =============================================================================
12 et_whrv() -- load the edit buffer
13 =============================================================================
14*/
15
16int16_t et_whrv(int16_t n)
17{
18 register int16_t harv;
19 register int8_t hvsgn;
20
21 (void)n;
22
23 if (curwhrv LT 0) {
24
25 hvsgn = '-';
26 harv = -curwhrv;
27
28 } else {
29
30 hvsgn = '+';
31 harv = curwhrv;
32 }
33
34 sprintf(ebuf, "%c%03d", hvsgn, harv);
35 ebflag = TRUE;
36
37 return(SUCCESS);
38}
39
40/*
41 =============================================================================
42 ef_whrv() -- parse (unload) the edit buffer
43 =============================================================================
44*/
45
46int16_t ef_whrv(int16_t n)
47{
48 register int16_t *hv;
49 register int16_t i, tmpval;
50
51 (void)n;
52
53 ebuf[4] = '\0'; /* terminate the string in ebuf */
54 ebflag = FALSE;
55
56 tmpval = 0;
57
58 for (i = 1; i < 4; i++) /* convert from ASCII to binary */
59 tmpval = (tmpval * 10) + (ebuf[i] - '0');
60
61 if (tmpval GT 100)
62 return(FAILURE);
63
64 if (ebuf[0] EQ '-')
65 curwhrv = -tmpval;
66 else
67 curwhrv = tmpval;
68
69 hv = curwslt ? vbufs[curvce].idhwvbh : vbufs[curvce].idhwvah;
70 hv[curwhrm] = curwhrv;
71 vmtab[curwhrm] = curwhrv;
72 adj(curwhrm);
73 wscalc();
74 whupd();
75 wsnmod[curvce][curwslt] = TRUE;
76 wdswin(0);
77 wdswin(2);
78 wdswin(4);
79 return(SUCCESS);
80}
81
82/*
83 =============================================================================
84 rd_whrv() -- (re)display the field
85 =============================================================================
86*/
87
88int16_t rd_whrv(int16_t nn)
89{
90 register int16_t harv, n;
91 register int8_t hvsgn;
92
93 n = nn & 0x00FF;
94
95 if (curwhrv LT 0) {
96
97 hvsgn = '-';
98 harv = -curwhrv;
99
100 } else {
101
102 hvsgn = '+';
103 harv = curwhrv;
104 }
105
106 sprintf(dspbuf, "%c%03d", hvsgn, harv);
107
108 vbank(0); /* display the value */
109 vcputsv(waveob, 64, wdbox[n][4], wdbox[n][5],
110 wdbox[n][6] + 1, wdbox[n][7] + WHRV_OFF, dspbuf, 14);
111
112 return(SUCCESS);
113}
114
115/*
116 =============================================================================
117 nd_whrv() -- handle new data entry
118 =============================================================================
119*/
120
121int16_t nd_whrv(int16_t nn, int16_t k)
122{
123 register int16_t ec, n;
124
125 n = nn & 0x00FF;
126 ec = stccol - cfetp->flcol; /* setup edit buffer column */
127
128 if (ec EQ 0) {
129
130 if (k EQ 8) {
131
132 ebuf[0] = dspbuf[0] = '-';
133 ebuf[4] = dspbuf[1] = '\0';
134
135 } else if (k EQ 9) {
136
137 ebuf[0] = dspbuf[0] = '+';
138 ebuf[4] = dspbuf[1] = '\0';
139
140 } else {
141
142 return(FAILURE);
143 }
144
145 } else {
146
147 ebuf[ec] = dspbuf[0] = k + '0';
148 ebuf[4] = dspbuf[1] = '\0';
149 }
150
151 vbank(0);
152 vcputsv(waveob, 64, WS_ENTRY, wdbox[n][5],
153 stcrow, stccol, dspbuf, 14);
154
155 advwcur();
156 return(SUCCESS);
157}
158
Note: See TracBrowser for help on using the repository browser.