source: buchla-68k/ram/etarat.c@ e225e77

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

Added missing includes and declarations.

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