source: buchla-68k/ram/etatab.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.7 KB
Line 
1/*
2 =============================================================================
3 etatab.c -- assignment editor - assignment table number field handlers
4 Version 9 -- 1988-08-22 -- D.N. Lynx Crowe
5 =============================================================================
6*/
7
8#include "stddefs.h"
9#include "fields.h"
10#include "hwdefs.h"
11#include "vsdd.h"
12#include "vsddsw.h"
13#include "graphdef.h"
14
15#include "midas.h"
16#include "asgdsp.h"
17
18extern void adpoint(int16_t x, int16_t y, int16_t pen);
19
20extern void (*point)(int16_t x, int16_t y, int16_t pen);
21
22extern uint16_t *asgob;
23
24extern int16_t asgmod;
25extern int16_t curasg;
26extern int16_t stccol;
27extern int16_t stcrow;
28
29extern int16_t adbox[][8];
30
31extern int8_t dspbuf[];
32
33/*
34
35*/
36
37/*
38 =============================================================================
39 et_atab() -- load the edit buffer
40 =============================================================================
41*/
42
43int16_t et_atab(int16_t n)
44{
45 sprintf(ebuf, "%02d", curasg);
46 ebflag = TRUE;
47
48 return(SUCCESS);
49}
50
51/*
52 =============================================================================
53 ef_atab() -- parse (unload) the edit buffer
54 =============================================================================
55*/
56
57int16_t ef_atab(int16_t n)
58{
59 register int16_t i, tmpval;
60
61 ebuf[2] = '\0'; /* terminate the string in ebuf */
62 ebflag = FALSE;
63 tmpval = 0;
64
65 for (i = 0; i < 2; i++) /* convert from ASCII to binary */
66 tmpval = (tmpval * 10) + (ebuf[i] - '0');
67
68 if (tmpval GE NASGS)
69 return(FAILURE);
70
71 curasg = tmpval;
72 asgmod = TRUE;
73 adswin(0);
74
75 settc(2, 6);
76
77 return(SUCCESS);
78}
79
80/*
81
82*/
83
84/*
85 =============================================================================
86 rd_atab() -- (re)display the field
87 =============================================================================
88*/
89
90int16_t rd_atab(int16_t nn)
91{
92 register int16_t n;
93
94 n = nn & 0xFF;
95 sprintf(dspbuf, "%02.2d", curasg);
96
97 point = adpoint;
98
99 if (v_regs[5] & 0x0180)
100 vbank(0);
101
102 vcputsv(asgob, 64, (asgmod ? exp_c(AK_MODC) : adbox[n][4]), adbox[n][5],
103 cfetp->frow, cfetp->flcol, dspbuf, 14);
104
105 lseg(0, 0, 128, 0, AK_BORD);
106
107 return(SUCCESS);
108}
109
110/*
111 =============================================================================
112 nd_atab() -- handle new data entry
113 =============================================================================
114*/
115
116int16_t nd_atab(int16_t nn, int16_t k)
117{
118 register int16_t ec, n;
119
120 n = nn & 0xFF;
121 ec = stccol - cfetp->flcol; /* setup edit buffer column */
122
123 ebuf[ec] = k + '0';
124 ebuf[2] = '\0';
125
126 dspbuf[0] = k + '0';
127 dspbuf[1] = '\0';
128
129 point = adpoint;
130
131 if (v_regs[5] & 0x0180)
132 vbank(0);
133
134 vcputsv(asgob, 64, AK_ENTRY, adbox[n][5],
135 stcrow, stccol, dspbuf, 14);
136
137 lseg(0, 0, 128, 0, AK_BORD);
138
139 advacur();
140 return(SUCCESS);
141}
142
Note: See TracBrowser for help on using the repository browser.