source: buchla-68k/ram/etwhar.c@ b28a12e

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

Zero redundant declarations.

  • Property mode set to 100644
File size: 2.2 KB
Line 
1/*
2 =============================================================================
3 etwhar.c -- waveshape editor - harmonic number field handlers
4 Version 5 -- 1987-12-11 -- D.N. Lynx Crowe
5 =============================================================================
6*/
7
8#include "ram.h"
9
10/*
11 =============================================================================
12 et_whar() -- load the edit buffer
13 =============================================================================
14*/
15
16int16_t et_whar(int16_t n)
17{
18 sprintf(ebuf, "%02d", curwhrm + 1);
19 ebflag = TRUE;
20 return(SUCCESS);
21}
22
23/*
24 =============================================================================
25 ef_whar() -- parse (unload) the edit buffer
26 =============================================================================
27*/
28
29int16_t ef_whar(int16_t n)
30{
31 register int16_t i, tmpval;
32
33 ebuf[2] = '\0'; /* terminate the string in ebuf */
34 ebflag = FALSE;
35
36 tmpval = 0;
37
38 for (i = 0; i < 2; i++) /* convert from ASCII to binary */
39 tmpval = (tmpval * 10) + (ebuf[i] - '0');
40
41 if ((tmpval GT NUMHARM) OR (tmpval EQ 0))
42 return(FAILURE);
43
44 curwhrm = tmpval - 1;
45 newws();
46 wdswin(5);
47 return(SUCCESS);
48}
49
50/*
51
52*/
53
54/*
55 =============================================================================
56 rd_whar() -- (re)display the field
57 =============================================================================
58*/
59
60int16_t rd_whar(int16_t nn)
61{
62 register int16_t n;
63
64 n = nn & 0xFF;
65 sprintf(dspbuf, "%02d", curwhrm + 1);
66
67 vbank(0); /* display the value */
68 vcputsv(waveob, 64, wdbox[n][4], wdbox[n][5],
69 wdbox[n][6], wdbox[n][7] + WHRM_OFF, dspbuf, 14);
70
71 return(SUCCESS);
72}
73
74/*
75 =============================================================================
76 nd_whar() -- handle new data entry
77 =============================================================================
78*/
79
80int16_t nd_whar(int16_t nn, int16_t k)
81{
82 register int16_t ec, n;
83
84 n = nn & 0xFF;
85 ec = stccol - cfetp->flcol; /* setup edit buffer column */
86 ebuf[ec] = k + '0';
87 ebuf[2] = '\0';
88
89 dspbuf[0] = k + '0';
90 dspbuf[1] = '\0';
91
92 vbank(0);
93 vcputsv(waveob, 64, WS_ENTRY, wdbox[n][5],
94 wdbox[n][6], stccol, dspbuf, 14);
95
96 advwcur();
97 return(SUCCESS);
98}
99
Note: See TracBrowser for help on using the repository browser.