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

Last change on this file was e15f784, checked in by Thomas Lopatic <thomas@…>, 6 years ago

Fixed etaopt.c.

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