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
RevLine 
[f40a309]1/*
2 =============================================================================
3 etwavs.c -- waveshape editor - waveshape number field handlers
4 Version 8 -- 1987-12-11 -- D.N. Lynx Crowe
5 =============================================================================
6*/
7
[6262b5c]8#include "all.h"
[e225e77]9
[0580615]10extern void advwcur(void);
[f40a309]11
[e225e77]12extern uint16_t exp_c(uint16_t c);
13
[7258c6a]14extern uint16_t *waveob;
[f40a309]15
[7258c6a]16extern int16_t stccol, curwave, curvce, curwslt;
[f40a309]17
[7258c6a]18extern int16_t wsnmod[12][2];
[f40a309]19
[7258c6a]20extern int16_t wdbox[][8];
[f40a309]21
[7258c6a]22extern int8_t dspbuf[];
[f40a309]23
24/*
25
26*/
27
28/*
29 =============================================================================
30 et_wavs() -- load the edit buffer
31 =============================================================================
32*/
[7258c6a]33
[f40a309]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*/
[7258c6a]47
[f40a309]48int16_t ef_wavs(int16_t n)
[7258c6a]49{
[f40a309]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 =============================================================================
[7258c6a]76*/
[f40a309]77
[7258c6a]78int16_t rd_wavs(int16_t nn)
79{
[f40a309]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 =============================================================================
[7258c6a]99*/
[f40a309]100
[7258c6a]101int16_t nd_wavs(int16_t nn, int16_t k)
[f40a309]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);
[6262b5c]119}
120
121
Note: See TracBrowser for help on using the repository browser.