source: buchla-68k/ram/etaopt.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.1 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 "all.h"
9
10extern void modasg(void);
11
12extern uint16_t *asgob;
13
14extern int16_t stcrow, stccol;
15extern int16_t curmop;
16
17extern int16_t adbox[][8];
18
19extern int8_t dspbuf[];
20
21extern int8_t *gprep[];
22
23/*
24
25*/
26
27/*
28 =============================================================================
29 et_aopt() -- load the edit buffer
30 =============================================================================
31*/
32
33int16_t et_aopt(int16_t n)
34{
35 sprintf(ebuf, "%01.1d", curmop);
36 ebflag = TRUE;
37
38 return(SUCCESS);
39}
40
41/*
42 =============================================================================
43 ef_aopt() -- parse (unload) the edit buffer
44 =============================================================================
45*/
46
47int16_t ef_aopt(int16_t n)
48{
49 register int16_t tmpval;
50
51 ebuf[1] = '\0'; /* terminate the string in ebuf */
52 ebflag = FALSE;
53
54 tmpval = ebuf[0] - '0';
55
56 if (tmpval GT 3)
57 return(FAILURE);
58
59 curmop = tmpval;
60 modasg();
61 return(SUCCESS);
62}
63
64/*
65
66*/
67
68/*
69 =============================================================================
70 rd_aopt() -- (re)display the field
71 =============================================================================
72*/
73
74int16_t rd_aopt(int16_t nn)
75{
76 register int16_t n;
77
78 n = nn & 0xFF;
79
80 vbank(0);
81 vcputsv(asgob, 64, adbox[n][4], adbox[n][5],
82 adbox[n][6], adbox[n][7] + 9, gprep[curmop], 14);
83
84 return(SUCCESS);
85}
86
87/*
88 =============================================================================
89 nd_aopt() -- handle new data entry
90 =============================================================================
91*/
92
93int16_t nd_aopt(int16_t nn, int16_t k)
94{
95 register int16_t n;
96
97 if ((k < 1) OR (k > 2))
98 return(FAILURE);
99
100 n = nn & 0xFF;
101 ebuf[0] = k + '0';
102 ebuf[1] = '\0';
103
104 dspbuf[0] = k + '0';
105 dspbuf[1] = '\0';
106
107 vbank(0);
108 vcputsv(asgob, 64, AK_ENTRY, adbox[n][5], stcrow, stccol, dspbuf, 14);
109
110 return(SUCCESS);
111}
112
113
Note: See TracBrowser for help on using the repository browser.