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

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

Removed form-feed comments.

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