source: buchla-68k/ram/etaccn.c@ ea9a162

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

Fix conversion warnings.

  • Property mode set to 100644
File size: 2.3 KB
RevLine 
[f40a309]1/*
2 =============================================================================
3 etaccn.c -- assignment editor - source controller number field handlers
4 Version 7 -- 1988-03-19 -- D.N. Lynx Crowe
5 =============================================================================
6*/
7
[b28a12e]8#include "ram.h"
[f40a309]9
10/*
11 =============================================================================
12 et_accn() -- load the edit buffer
13 =============================================================================
14*/
15
[7258c6a]16int16_t et_accn(int16_t n)
[f40a309]17{
[7258c6a]18 register int16_t ctl;
[f40a309]19
20 ctl = 0x00FF & (n >> 8);
21
22 numblk(ebuf, (mctlnum[ctl] & 0x00FF));
23 ebflag = TRUE;
24
25 return(SUCCESS);
26}
27
28/*
29 =============================================================================
30 ef_accn() -- parse (unload) the edit buffer
31 =============================================================================
32*/
33
[7258c6a]34int16_t ef_accn(int16_t n)
[f40a309]35{
[7258c6a]36 register int16_t tmpval, ctl, i;
[f40a309]37
38 ctl = 0x00FF & (n >> 8);
39
40 ebuf[2] = '\0'; /* terminate the string in ebuf */
41 ebflag = FALSE;
42 tmpval = 0;
43
44 if ((ebuf[0] EQ ' ') AND (ebuf[1] EQ ' ')) {
45
46 tmpval = -1;
47
48 } else {
49
50 for (i = 0; i < 2; i++) {
51
52 if (ebuf[i] EQ ' ')
53 ebuf[i] = '0';
54
55 tmpval = (tmpval * 10) + (ebuf[i] - '0');
56 }
57 }
58
59 if (mctlnum[ctl] EQ -1)
60 mctlnum[ctl] = tmpval;
61 else
[432327d]62 mctlnum[ctl] = (mctlnum[ctl] & (int16_t)0xFF00) | tmpval;
[f40a309]63
64 modasg();
65 return(SUCCESS);
66}
67
68/*
69 =============================================================================
70 rd_accn() -- (re)display the field
71 =============================================================================
72*/
73
[7258c6a]74int16_t rd_accn(int16_t nn)
[f40a309]75{
[7258c6a]76 register int16_t n, ctl;
77 int8_t buf[4];
[f40a309]78
79 n = 0x00FF & nn;
80 ctl = 0x00FF & (nn >> 8);
81
82 vbank(0);
83 vcputsv(asgob, 64, adbox[n][4], adbox[n][5],
84 cfetp->frow, cfetp->flcol,
85 numblk(buf, (mctlnum[ctl] & 0x00FF)), 14);
86
87 return(SUCCESS);
88}
89
90/*
91 =============================================================================
92 nd_accn() -- handle new data entry
93 =============================================================================
94*/
95
[7258c6a]96int16_t nd_accn(int16_t nn, int16_t k)
[f40a309]97{
[7258c6a]98 register int16_t n;
[f40a309]99
100 n = nn & 0xFF;
[432327d]101 ebuf[stccol - cfetp->flcol] = (int8_t)(k + '0');
[f40a309]102 ebuf[2] = '\0';
103
[432327d]104 dspbuf[0] = (int8_t)(k + '0');
[f40a309]105 dspbuf[1] = '\0';
106
107 vbank(0);
108 vcputsv(asgob, 64, AK_ENTRY, adbox[n][5],
109 stcrow, stccol, dspbuf, 14);
110
111 advacur();
112 return(SUCCESS);
113}
114
[6262b5c]115
Note: See TracBrowser for help on using the repository browser.