source: buchla-68k/ram/etadep.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.4 KB
Line 
1/*
2 =============================================================================
3 etadep.c -- MIDAS assignment editor - phase shifter depth field
4 Version 4 -- 1987-12-19 -- D.N. Lynx Crowe
5 =============================================================================
6*/
7
8#include "all.h"
9
10extern void advacur(void);
11extern void modasg(void);
12extern void sendval(int16_t voice, int16_t par, int16_t ival);
13
14extern uint16_t *asgob;
15
16extern int16_t stcrow, stccol;
17extern int16_t ps_dpth;
18
19extern int16_t adbox[][8];
20
21extern int8_t dspbuf[];
22
23/*
24
25*/
26
27/*
28 =============================================================================
29 et_adep() -- load the edit buffer
30 =============================================================================
31*/
32
33int16_t et_adep(int16_t n)
34{
35 sprintf(ebuf, "%02d", ps_dpth);
36 ebflag = TRUE;
37
38 return(SUCCESS);
39}
40
41/*
42 =============================================================================
43 ef_adep() -- parse (unload) the edit buffer
44 =============================================================================
45*/
46
47int16_t ef_adep(int16_t n)
48{
49 register int16_t i, tmpval;
50
51 ebuf[2] = '\0'; /* terminate the string in ebuf */
52 ebflag = FALSE;
53 tmpval = 0;
54
55 for (i = 0; i < 2; i++) /* convert from ASCII to binary */
56 tmpval = (tmpval * 10) + (ebuf[i] - '0');
57
58 ps_dpth = tmpval;
59 sendval(3, 0, ((ps_dpth * 10) << 5));
60 modasg();
61 return(SUCCESS);
62}
63
64/*
65
66*/
67
68/*
69 =============================================================================
70 rd_adep() -- (re)display the field
71 =============================================================================
72*/
73
74int16_t rd_adep(int16_t nn)
75{
76 register int16_t n;
77
78 n = nn & 0xFF;
79 sprintf(dspbuf, "%02.2d", ps_dpth);
80
81 vbank(0);
82 vcputsv(asgob, 64, adbox[n][4], adbox[n][5],
83 adbox[n][6] + 3, adbox[n][7] + 8, dspbuf, 14);
84
85 return(SUCCESS);
86}
87
88/*
89 =============================================================================
90 nd_adep() -- handle new data entry
91 =============================================================================
92*/
93
94int16_t nd_adep(int16_t nn, int16_t k)
95{
96 register int16_t ec, n;
97
98 n = nn & 0xFF;
99
100 ec = stccol - cfetp->flcol; /* setup edit buffer column */
101
102 ebuf[ec] = k + '0';
103 ebuf[2] = '\0';
104
105 dspbuf[0] = k + '0';
106 dspbuf[1] = '\0';
107
108 vbank(0);
109 vcputsv(asgob, 64, AK_ENTRY, adbox[n][5], stcrow, stccol, dspbuf, 14);
110
111 advacur();
112 return(SUCCESS);
113}
114
115
Note: See TracBrowser for help on using the repository browser.