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