source: buchla-68k/ram/etaint.c@ 7258c6a

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

Use standard integer types.

  • Property mode set to 100644
File size: 2.4 KB
Line 
1/*
2 =============================================================================
3 etaint.c -- MIDAS assignment editor - phase shifter intensity field
4 Version 5 -- 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 uint16_t *asgob;
18
19extern int16_t stcrow, stccol;
20extern int16_t ps_intn;
21
22extern int16_t adbox[][8];
23
24extern int8_t dspbuf[];
25
26/*
27
28*/
29
30/*
31 =============================================================================
32 et_aint() -- load the edit buffer
33 =============================================================================
34*/
35
36int16_t et_aint(int16_t n)
37{
38 sprintf(ebuf, "%02d", ps_intn);
39 ebflag = TRUE;
40
41 return(SUCCESS);
42}
43
44/*
45 =============================================================================
46 ef_aint() -- parse (unload) the edit buffer
47 =============================================================================
48*/
49
50int16_t ef_aint(int16_t n)
51{
52 register int16_t 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_intn = tmpval;
62 sendval(1, 0, ((ps_intn * 10) << 5));
63 modasg();
64 return(SUCCESS);
65}
66
67/*
68
69*/
70
71/*
72 =============================================================================
73 rd_aint() -- (re)display the field
74 =============================================================================
75*/
76
77int16_t rd_aint(int16_t nn)
78{
79 register int16_t n;
80
81 n = nn & 0xFF;
82 sprintf(dspbuf, "%02.2d", ps_intn);
83
84 vbank(0);
85 vcputsv(asgob, 64, adbox[n][4], adbox[n][5],
86 adbox[n][6] + 1, adbox[n][7] + 8, dspbuf, 14);
87
88 return(SUCCESS);
89}
90
91/*
92 =============================================================================
93 nd_aint() -- handle new data entry
94 =============================================================================
95*/
96
97int16_t nd_aint(int16_t nn, int16_t k)
98{
99 register int16_t 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.