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
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
[6262b5c]10#include "all.h"
[e225e77]11
[0580615]12extern void advwcur(void);
[7258c6a]13extern void wdswin(int16_t n);
[0580615]14extern void newws(void);
15extern void dsnewws(void);
[f40a309]16
[7258c6a]17extern uint16_t *waveob;
[f40a309]18
[7258c6a]19extern int16_t stcrow, stccol, curwslt;
[f40a309]20
[7258c6a]21extern int16_t wdbox[][8];
[f40a309]22
[7258c6a]23extern int8_t dspbuf[];
[f40a309]24
25/*
26
27*/
28
29/*
30 =============================================================================
31 et_wslt() -- load the edit buffer
32 =============================================================================
33*/
[7258c6a]34
[f40a309]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*/
[7258c6a]48
[f40a309]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 =============================================================================
[7258c6a]73*/
[f40a309]74
[7258c6a]75int16_t rd_wslt(int16_t nn)
[f40a309]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 =============================================================================
[7258c6a]93*/
[f40a309]94
[7258c6a]95int16_t nd_wslt(int16_t nn, int16_t k)
[f40a309]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();
[6262b5c]123 return(SUCCESS);
124}
125
Note: See TracBrowser for help on using the repository browser.