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

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

Point of no return.

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