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

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

Unused variables and parameters.

  • Property mode set to 100644
File size: 2.2 KB
RevLine 
[f40a309]1/*
2 =============================================================================
3 etwhar.c -- waveshape editor - harmonic number field handlers
4 Version 5 -- 1987-12-11 -- D.N. Lynx Crowe
5 =============================================================================
6*/
7
[b28a12e]8#include "ram.h"
[f40a309]9
10/*
11 =============================================================================
12 et_whar() -- load the edit buffer
13 =============================================================================
14*/
15
[7258c6a]16int16_t et_whar(int16_t n)
[f40a309]17{
[7ecfb7b]18 (void)n;
19
[f40a309]20 sprintf(ebuf, "%02d", curwhrm + 1);
21 ebflag = TRUE;
22 return(SUCCESS);
23}
24
25/*
26 =============================================================================
27 ef_whar() -- parse (unload) the edit buffer
28 =============================================================================
29*/
30
[7258c6a]31int16_t ef_whar(int16_t n)
[f40a309]32{
[7258c6a]33 register int16_t i, tmpval;
[f40a309]34
[7ecfb7b]35 (void)n;
36
[f40a309]37 ebuf[2] = '\0'; /* terminate the string in ebuf */
38 ebflag = FALSE;
39
40 tmpval = 0;
41
42 for (i = 0; i < 2; i++) /* convert from ASCII to binary */
43 tmpval = (tmpval * 10) + (ebuf[i] - '0');
44
45 if ((tmpval GT NUMHARM) OR (tmpval EQ 0))
46 return(FAILURE);
47
48 curwhrm = tmpval - 1;
49 newws();
50 wdswin(5);
51 return(SUCCESS);
52}
53
54/*
55 =============================================================================
56 rd_whar() -- (re)display the field
57 =============================================================================
58*/
59
[7258c6a]60int16_t rd_whar(int16_t nn)
[f40a309]61{
[7258c6a]62 register int16_t n;
[f40a309]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
[7258c6a]80int16_t nd_whar(int16_t nn, int16_t k)
[f40a309]81{
[7258c6a]82 register int16_t ec, n;
[f40a309]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}
[6262b5c]99
Note: See TracBrowser for help on using the repository browser.