source: buchla-68k/ram/etwpnt.c@ 1efe224

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

Zero redundant declarations.

  • Property mode set to 100644
File size: 2.1 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 "ram.h"
9
10/*
11 =============================================================================
12 et_wpnt() -- load the edit buffer
13 =============================================================================
14*/
15
16int16_t et_wpnt(int16_t n)
17{
18 sprintf(ebuf, "%03d", curwpnt);
19 ebflag = TRUE;
20
21 return(SUCCESS);
22}
23
24/*
25
26*/
27
28/*
29 =============================================================================
30 ef_wpnt() -- parse (unload) the edit buffer
31 =============================================================================
32*/
33
34int16_t ef_wpnt(int16_t n)
35{
36 register int16_t i, tmpval;
37
38 ebuf[3] = '\0'; /* terminate the string in ebuf */
39 ebflag = FALSE;
40
41 tmpval = 0;
42
43 for (i = 0; i < 3; i++) /* convert from ASCII to binary */
44 tmpval = (tmpval * 10) + (ebuf[i] - '0');
45
46 if (tmpval GE NUMWPNT)
47 return(FAILURE);
48
49 curwpnt = tmpval;
50 newws();
51 wdswin(4);
52 return(SUCCESS);
53}
54
55/*
56
57*/
58
59/*
60 =============================================================================
61 rd_wpnt() -- (re)display the field
62 =============================================================================
63*/
64
65int16_t rd_wpnt(int16_t nn)
66{
67 register int16_t n;
68
69 n = nn & 0xFF;
70 sprintf(dspbuf, "%03d", curwpnt);
71
72 vbank(0);
73 vcputsv(waveob, 64, wdbox[n][4], wdbox[n][5],
74 wdbox[n][6], wdbox[n][7] + WPNT_OFF, dspbuf, 14);
75
76 return(SUCCESS);
77}
78
79/*
80
81*/
82
83/*
84 =============================================================================
85 nd_wpnt() -- handle new data entry
86 =============================================================================
87*/
88
89int16_t nd_wpnt(int16_t nn, int16_t k)
90{
91 register int16_t ec, n;
92
93 n = nn & 0xFF;
94 ec = stccol - cfetp->flcol; /* setup edit buffer column */
95 ebuf[ec] = k + '0';
96 ebuf[3] = '\0';
97
98 dspbuf[0] = k + '0';
99 dspbuf[1] = '\0';
100
101 vbank(0);
102
103 vcputsv(waveob, 64, WS_ENTRY, wdbox[n][5],
104 wdbox[n][6], stccol, dspbuf, 14);
105
106 advwcur();
107
108 return(SUCCESS);
109}
110
Note: See TracBrowser for help on using the repository browser.