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