source: buchla-68k/ram/etaopt.c@ e225e77

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

Added missing includes and declarations.

  • Property mode set to 100644
File size: 2.3 KB
Line 
1/*
2 =============================================================================
3 etaopt.c -- assignment editor - MIDI output port number field handlers
4 Version 4 -- 1987-12-11 -- D.N. Lynx Crowe
5 =============================================================================
6*/
7
8#include "stddefs.h"
9#include "fields.h"
10#include "vsdd.h"
11#include "vsddsw.h"
12#include "graphdef.h"
13
14#include "midas.h"
15#include "asgdsp.h"
16
17#include "stdio.h"
18
19extern void modasg(void);
20
21extern uint16_t *asgob;
22
23extern int16_t stcrow, stccol;
24extern int16_t curmop;
25
26extern int16_t adbox[][8];
27
28extern int8_t dspbuf[];
29
30extern int8_t *gprep[];
31
32/*
33
34*/
35
36/*
37 =============================================================================
38 et_aopt() -- load the edit buffer
39 =============================================================================
40*/
41
42int16_t et_aopt(int16_t n)
43{
44 sprintf(ebuf, "%01.1d", curmop);
45 ebflag = TRUE;
46
47 return(SUCCESS);
48}
49
50/*
51 =============================================================================
52 ef_aopt() -- parse (unload) the edit buffer
53 =============================================================================
54*/
55
56int16_t ef_aopt(int16_t n)
57{
58 register int16_t tmpval;
59
60 ebuf[1] = '\0'; /* terminate the string in ebuf */
61 ebflag = FALSE;
62
63 tmpval = ebuf[0] - '0';
64
65 if (tmpval GT 3)
66 return(FAILURE);
67
68 curmop = tmpval;
69 modasg();
70 return(SUCCESS);
71}
72
73/*
74
75*/
76
77/*
78 =============================================================================
79 rd_aopt() -- (re)display the field
80 =============================================================================
81*/
82
83int16_t rd_aopt(int16_t nn)
84{
85 register int16_t n;
86
87 n = nn & 0xFF;
88
89 vbank(0);
90 vcputsv(asgob, 64, adbox[n][4], adbox[n][5],
91 adbox[n][6], adbox[n][7] + 9, gprep[curmop], 14);
92
93 return(SUCCESS);
94}
95
96/*
97 =============================================================================
98 nd_aopt() -- handle new data entry
99 =============================================================================
100*/
101
102int16_t nd_aopt(int16_t nn, int16_t k)
103{
104 register int16_t n;
105
106 if ((k < 1) OR (k > 2))
107 return(FAILURE);
108
109 n = nn & 0xFF;
110 ebuf[0] = k + '0';
111 ebuf[1] = '\0';
112
113 dspbuf[0] = k + '0';
114 dspbuf[1] = '\0';
115
116 vbank(0);
117 vcputsv(asgob, 64, AK_ENTRY, adbox[n][5], stcrow, stccol, dspbuf, 14);
118
119 return(SUCCESS);
120}
121
Note: See TracBrowser for help on using the repository browser.