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

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

Added include files for global functions and variables.

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