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

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

Point of no return.

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