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

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

Added include files for global functions and variables.

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