source: buchla-68k/ram/etwslt.c@ c3aee8a

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

Added missing includes and declarations.

  • Property mode set to 100644
File size: 2.6 KB
Line 
1/*
2 =============================================================================
3 etwslt.c -- waveshape editor - waveshape slot field handlers
4 Version 8 -- 1987-12-11 -- D.N. Lynx Crowe
5 =============================================================================
6*/
7
8#define DEBUGIT 0
9
10#include "stddefs.h"
11#include "fields.h"
12#include "vsdd.h"
13#include "vsddsw.h"
14#include "graphdef.h"
15#include "charset.h"
16
17#include "midas.h"
18#include "instdsp.h"
19#include "wsdsp.h"
20
21#include "stdio.h"
22
23extern void advwcur(void);
24extern void wdswin(int16_t n);
25extern void newws(void);
26extern void dsnewws(void);
27
28extern uint16_t *waveob;
29
30extern int16_t stcrow, stccol, curwslt;
31
32extern int16_t wdbox[][8];
33
34extern int8_t dspbuf[];
35
36/*
37
38*/
39
40/*
41 =============================================================================
42 et_wslt() -- load the edit buffer
43 =============================================================================
44*/
45
46int16_t et_wslt(int16_t n)
47{
48 sprintf(ebuf, "%c", curwslt + 'A');
49 ebflag = TRUE;
50
51 return(SUCCESS);
52}
53
54/*
55 =============================================================================
56 ef_wslt() -- parse (unload) the edit buffer
57 =============================================================================
58*/
59
60int16_t ef_wslt(int16_t n)
61{
62 ebuf[1] = '\0'; /* terminate the string in ebuf */
63 ebflag = FALSE;
64
65 curwslt = ebuf[0] - 'A';
66
67#if DEBUGIT
68 printf("ef_wslt($%04X): ebuf[%s], curwslt=%d\r\n", n, ebuf, curwslt);
69#endif
70
71 newws();
72 dsnewws();
73 return(SUCCESS);
74}
75
76/*
77
78*/
79
80/*
81 =============================================================================
82 rd_wslt() -- (re)display the field
83 =============================================================================
84*/
85
86int16_t rd_wslt(int16_t nn)
87{
88 register int16_t n;
89
90 n = nn & 0xFF;
91 sprintf(dspbuf, "%c", curwslt + 'A');
92
93 vbank(0);
94 vcputsv(waveob, 64, wdbox[n][4], wdbox[n][5],
95 wdbox[n][6] + 1, wdbox[n][7] + WSLT_OFF, dspbuf, 14);
96
97 return(SUCCESS);
98}
99
100/*
101 =============================================================================
102 nd_wslt() -- handle new data entry
103 =============================================================================
104*/
105
106int16_t nd_wslt(int16_t nn, int16_t k)
107{
108 register int16_t n;
109
110 n = nn & 0xFF;
111
112#if DEBUGIT
113 printf("nd_wslt($%04X, %d)\r\n", nn, k);
114#endif
115
116 if (k GT 1)
117 return(FAILURE);
118
119 ebuf[0] = k + 'A';
120 ebuf[1] = '\0';
121
122 dspbuf[0] = k + 'A';
123 dspbuf[1] = '\0';
124
125#if DEBUGIT
126 printf("nd_wslt($%04X, %d): ebuf[%s]\r\n", nn, k, ebuf);
127#endif
128
129 vbank(0);
130 vcputsv(waveob, 64, WS_ENTRY, wdbox[n][5],
131 stcrow, stccol, dspbuf, 14);
132
133 advwcur();
134 return(SUCCESS);
135}
Note: See TracBrowser for help on using the repository browser.