source: buchla-68k/orig/RAM/ETWPNT.C@ 0170798

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

Imported original source code.

  • Property mode set to 100755
File size: 2.5 KB
Line 
1/*
2 =============================================================================
3 etwpnt.c -- waveshape editor - point number field handlers
4 Version 8 -- 1987-12-11 -- 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 "wsdsp.h"
16
17extern short advwcur(), wdswin(), newws();
18
19extern unsigned *waveob;
20
21extern short stccol, curwpnt;
22
23extern short wdbox[][8];
24
25extern char dspbuf[];
26
27/*
28
29*/
30
31/*
32 =============================================================================
33 et_wpnt() -- load the edit buffer
34 =============================================================================
35*/
36
37short
38et_wpnt(n)
39short n;
40{
41 sprintf(ebuf, "%03d", curwpnt);
42 ebflag = TRUE;
43
44 return(SUCCESS);
45}
46
47/*
48
49*/
50
51/*
52 =============================================================================
53 ef_wpnt() -- parse (unload) the edit buffer
54 =============================================================================
55*/
56
57short
58ef_wpnt(n)
59short n;
60{
61 register short i, tmpval;
62
63 ebuf[3] = '\0'; /* terminate the string in ebuf */
64 ebflag = FALSE;
65
66 tmpval = 0;
67
68 for (i = 0; i < 3; i++) /* convert from ASCII to binary */
69 tmpval = (tmpval * 10) + (ebuf[i] - '0');
70
71 if (tmpval GE NUMWPNT)
72 return(FAILURE);
73
74 curwpnt = tmpval;
75 newws();
76 wdswin(4);
77 return(SUCCESS);
78}
79
80/*
81
82*/
83
84/*
85 =============================================================================
86 rd_wpnt() -- (re)display the field
87 =============================================================================
88*/
89
90short
91rd_wpnt(nn)
92short nn;
93{
94 register short n;
95
96 n = nn & 0xFF;
97 sprintf(dspbuf, "%03d", curwpnt);
98
99 vbank(0);
100 vcputsv(waveob, 64, wdbox[n][4], wdbox[n][5],
101 wdbox[n][6], wdbox[n][7] + WPNT_OFF, dspbuf, 14);
102
103 return(SUCCESS);
104}
105
106/*
107
108*/
109
110/*
111 =============================================================================
112 nd_wpnt() -- handle new data entry
113 =============================================================================
114*/
115
116short
117nd_wpnt(nn, k)
118short nn;
119register short k;
120{
121 register short ec, n;
122
123 n = nn & 0xFF;
124 ec = stccol - cfetp->flcol; /* setup edit buffer column */
125 ebuf[ec] = k + '0';
126 ebuf[3] = '\0';
127
128 dspbuf[0] = k + '0';
129 dspbuf[1] = '\0';
130
131 vbank(0);
132
133 vcputsv(waveob, 64, WS_ENTRY, wdbox[n][5],
134 wdbox[n][6], stccol, dspbuf, 14);
135
136 advwcur();
137
138 return(SUCCESS);
139}
Note: See TracBrowser for help on using the repository browser.