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

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

Use standard integer types.

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