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

Last change on this file was c0cb375, checked in by Thomas Lopatic <thomas@…>, 6 years ago

Fixed etwslt.c.

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