source: buchla-68k/ram/etwavs.c@ 6262b5c

Last change on this file since 6262b5c 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.5 KB
Line 
1/*
2 =============================================================================
3 etwavs.c -- waveshape editor - waveshape 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);
11
12extern uint16_t exp_c(uint16_t c);
13
14extern uint16_t *waveob;
15
16extern int16_t stccol, curwave, curvce, curwslt;
17
18extern int16_t wsnmod[12][2];
19
20extern int16_t wdbox[][8];
21
22extern int8_t dspbuf[];
23
24/*
25
26*/
27
28/*
29 =============================================================================
30 et_wavs() -- load the edit buffer
31 =============================================================================
32*/
33
34int16_t et_wavs(int16_t n)
35{
36 sprintf(ebuf, "%02d", curwave + 1);
37 ebflag = TRUE;
38
39 return(SUCCESS);
40}
41
42/*
43 =============================================================================
44 ef_wavs() -- parse (unload) the edit buffer
45 =============================================================================
46*/
47
48int16_t ef_wavs(int16_t n)
49{
50 register int16_t i, tmpval;
51
52 ebuf[2] = '\0'; /* terminate the string in ebuf */
53 ebflag = FALSE;
54
55 tmpval = 0;
56
57 for (i = 0; i < 2; i++) /* convert from ASCII to binary */
58 tmpval = (tmpval * 10) + (ebuf[i] - '0');
59
60 if ((tmpval GT NUMWAVS) OR (tmpval EQ 0))
61 return(FAILURE);
62
63 wsnmod[curvce][curwslt] = TRUE;
64 curwave = tmpval - 1;
65 return(SUCCESS);
66}
67
68/*
69
70*/
71
72/*
73 =============================================================================
74 rd_wavs() -- (re)display the field
75 =============================================================================
76*/
77
78int16_t rd_wavs(int16_t nn)
79{
80 register int16_t n;
81 register uint16_t cx;
82
83 cx = exp_c(wsnmod[curvce][curwslt] ? WS_CHGC : wdbox[n][4]);
84 n = nn & 0x00FF;
85
86 sprintf(dspbuf, "%02d", curwave + 1);
87
88 vbank(0);
89 vcputsv(waveob, 64, cx, wdbox[n][5],
90 wdbox[n][6], wdbox[n][7] + WAVE_OFF, dspbuf, 14);
91
92 return(SUCCESS);
93}
94
95/*
96 =============================================================================
97 nd_wavs() -- handle new data entry
98 =============================================================================
99*/
100
101int16_t nd_wavs(int16_t nn, int16_t k)
102{
103 register int16_t ec, n;
104
105 n = nn & 0xFF;
106 ec = stccol - cfetp->flcol; /* setup edit buffer column */
107 ebuf[ec] = k + '0';
108 ebuf[2] = '\0';
109
110 dspbuf[0] = k + '0';
111 dspbuf[1] = '\0';
112
113 vbank(0);
114 vcputsv(waveob, 64, WS_ENTRY, wdbox[n][5],
115 wdbox[n][6], stccol, dspbuf, 14);
116
117 advwcur();
118 return(SUCCESS);
119}
120
121
Note: See TracBrowser for help on using the repository browser.