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

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

Unused variables and parameters.

  • Property mode set to 100644
File size: 2.2 KB
RevLine 
[f40a309]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
[b28a12e]10#include "ram.h"
[f40a309]11
12/*
13 =============================================================================
14 et_aprg() -- load the edit buffer
15 =============================================================================
16*/
17
[7258c6a]18int16_t et_aprg(int16_t n)
[f40a309]19{
[7ecfb7b]20 (void)n;
21
[f40a309]22 sprintf(ebuf, "%02d", prgchan);
23 ebflag = TRUE;
24
25 return(SUCCESS);
26}
27
28/*
29 =============================================================================
30 ef_aprg() -- parse (unload) the edit buffer
31 =============================================================================
32*/
33
[7258c6a]34int16_t ef_aprg(int16_t n)
[f40a309]35{
[7258c6a]36 register int16_t i, tmpval;
[f40a309]37
[7ecfb7b]38 (void)n;
39
[f40a309]40 ebuf[2] = '\0'; /* terminate the string in ebuf */
41 ebflag = FALSE;
42 tmpval = 0;
43
44 for (i = 0; i < 2; i++) /* convert from ASCII to binary */
45 tmpval = (tmpval * 10) + (ebuf[i] - '0');
46
47#if DEBUGIT
48 if (debugsw)
49 printf("ef_aprg($%04.4X): ebuf=[%s], tmpval=%d\n",
50 n, ebuf, tmpval);
51#endif
52
53 if ((tmpval EQ 0) OR (tmpval GT 16))
54 return(FAILURE);
55
56 prgchan = tmpval;
57 return(SUCCESS);
58}
59
60/*
61 =============================================================================
62 rd_aprg() -- (re)display the field
63 =============================================================================
64*/
65
[7258c6a]66int16_t rd_aprg(int16_t nn)
[f40a309]67{
[7258c6a]68 register int16_t n;
[f40a309]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
[7258c6a]86int16_t nd_aprg(int16_t nn, int16_t k)
[f40a309]87{
[7258c6a]88 register int16_t ec, n;
[f40a309]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
[6262b5c]107
Note: See TracBrowser for help on using the repository browser.