source: buchla-68k/ram/etatab.c@ b28a12e

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

Zero redundant declarations.

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