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

Last change on this file since 202bf8c was 9738a78, checked in by Thomas Lopatic <thomas@…>, 6 years ago

Fixed etatab.c.

  • 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 (void)n;
19
20 sprintf(ebuf, "%02d", curasg);
21 ebflag = TRUE;
22
23 return(SUCCESS);
24}
25
26/*
27 =============================================================================
28 ef_atab() -- parse (unload) the edit buffer
29 =============================================================================
30*/
31
32int16_t ef_atab(int16_t n)
33{
34 register int16_t i, tmpval;
35
36 (void)n;
37
38 ebuf[2] = '\0'; /* terminate the string in ebuf */
39 ebflag = FALSE;
40 tmpval = 0;
41
42 for (i = 0; i < 2; i++) /* convert from ASCII to binary */
43 tmpval = (tmpval * 10) + (ebuf[i] - '0');
44
45 if (tmpval GE NASGS)
46 return(FAILURE);
47
48 curasg = tmpval;
49 asgmod = TRUE;
50 adswin(0);
51
52 settc(2, 6);
53
54 return(SUCCESS);
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 ? 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] = (int8_t)(k + '0');
97 ebuf[2] = '\0';
98
99 dspbuf[0] = (int8_t)(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.