source: buchla-68k/ram/etaprg.c@ b28a12e

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

Zero redundant declarations.

  • Property mode set to 100644
File size: 2.2 KB
Line 
1/*
2 =============================================================================
3 etaprg.c -- MIDAS assignment editor - program change channel field
4 Version 3 -- 1987-12-21 -- D.N. Lynx Crowe
5 =============================================================================
6*/
7
8#define DEBUGIT 0
9
10#include "ram.h"
11
12/*
13 =============================================================================
14 et_aprg() -- load the edit buffer
15 =============================================================================
16*/
17
18int16_t et_aprg(int16_t n)
19{
20 sprintf(ebuf, "%02d", prgchan);
21 ebflag = TRUE;
22
23 return(SUCCESS);
24}
25
26/*
27 =============================================================================
28 ef_aprg() -- parse (unload) the edit buffer
29 =============================================================================
30*/
31
32int16_t ef_aprg(int16_t n)
33{
34 register int16_t i, tmpval;
35
36 ebuf[2] = '\0'; /* terminate the string in ebuf */
37 ebflag = FALSE;
38 tmpval = 0;
39
40 for (i = 0; i < 2; i++) /* convert from ASCII to binary */
41 tmpval = (tmpval * 10) + (ebuf[i] - '0');
42
43#if DEBUGIT
44 if (debugsw)
45 printf("ef_aprg($%04.4X): ebuf=[%s], tmpval=%d\n",
46 n, ebuf, tmpval);
47#endif
48
49 if ((tmpval EQ 0) OR (tmpval GT 16))
50 return(FAILURE);
51
52 prgchan = tmpval;
53 return(SUCCESS);
54}
55
56/*
57
58*/
59
60/*
61 =============================================================================
62 rd_aprg() -- (re)display the field
63 =============================================================================
64*/
65
66int16_t rd_aprg(int16_t nn)
67{
68 register int16_t n;
69
70 n = nn & 0xFF;
71 sprintf(dspbuf, "%02.2d", prgchan);
72
73 vbank(0);
74 vcputsv(asgob, 64, adbox[n][4], adbox[n][5],
75 adbox[n][6], adbox[n][7] + 8, dspbuf, 14);
76
77 return(SUCCESS);
78}
79
80/*
81 =============================================================================
82 nd_aprg() -- handle new data entry
83 =============================================================================
84*/
85
86int16_t nd_aprg(int16_t nn, int16_t k)
87{
88 register int16_t ec, n;
89
90 n = nn & 0xFF;
91
92 ec = stccol - cfetp->flcol; /* setup edit buffer column */
93
94 ebuf[ec] = k + '0';
95 ebuf[2] = '\0';
96
97 dspbuf[0] = k + '0';
98 dspbuf[1] = '\0';
99
100 vbank(0);
101 vcputsv(asgob, 64, AK_ENTRY, adbox[n][5], stcrow, stccol, dspbuf, 14);
102
103 advacur();
104 return(SUCCESS);
105}
106
107
Note: See TracBrowser for help on using the repository browser.