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

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

Removed form-feed comments.

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