1 | /*
|
---|
2 | =============================================================================
|
---|
3 | etscor.c -- score field handlers
|
---|
4 | Version 7 -- 1988-08-16 -- D.N. Lynx Crowe
|
---|
5 | =============================================================================
|
---|
6 | */
|
---|
7 |
|
---|
8 | #include "all.h"
|
---|
9 |
|
---|
10 | extern void advscur(void);
|
---|
11 | extern void dsimode(void);
|
---|
12 | extern void icancel(void);
|
---|
13 | extern void sdwins(void);
|
---|
14 |
|
---|
15 | extern uint16_t *obj8;
|
---|
16 |
|
---|
17 | extern int16_t insmode;
|
---|
18 | extern int16_t stccol;
|
---|
19 |
|
---|
20 | extern int8_t dspbuf[];
|
---|
21 |
|
---|
22 | /*
|
---|
23 | =============================================================================
|
---|
24 | et_scor() -- load edit buffer
|
---|
25 | =============================================================================
|
---|
26 | */
|
---|
27 |
|
---|
28 | int16_t et_scor(int16_t n)
|
---|
29 | {
|
---|
30 | sprintf(ebuf, "%02.2d", curscor + 1);
|
---|
31 | ebflag = TRUE;
|
---|
32 |
|
---|
33 | return(SUCCESS);
|
---|
34 | }
|
---|
35 |
|
---|
36 | /* |
---|
37 |
|
---|
38 | */
|
---|
39 |
|
---|
40 | /*
|
---|
41 | =============================================================================
|
---|
42 | ef_scor() -- parse edit buffer
|
---|
43 | =============================================================================
|
---|
44 | */
|
---|
45 |
|
---|
46 | int16_t ef_scor(int16_t n)
|
---|
47 | {
|
---|
48 | register int16_t ival;
|
---|
49 |
|
---|
50 | ebuf[2] = '\0';
|
---|
51 | ival = ((ebuf[0] - '0') * 10) + (ebuf[1] - '0');
|
---|
52 |
|
---|
53 | ebflag = FALSE;
|
---|
54 |
|
---|
55 | if ((ival GT N_SCORES) OR (ival EQ 0))
|
---|
56 | return(FAILURE);
|
---|
57 |
|
---|
58 | if (insmode) {
|
---|
59 |
|
---|
60 | icancel();
|
---|
61 | dsimode();
|
---|
62 | }
|
---|
63 |
|
---|
64 | selscor(ival - 1);
|
---|
65 | sdwins();
|
---|
66 | return(SUCCESS);
|
---|
67 | }
|
---|
68 |
|
---|
69 | /*
|
---|
70 | =============================================================================
|
---|
71 | rd_scor() -- redisplay field
|
---|
72 | =============================================================================
|
---|
73 | */
|
---|
74 |
|
---|
75 | int16_t rd_scor(int16_t n)
|
---|
76 | {
|
---|
77 | sprintf(dspbuf, "%02.2d", curscor + 1);
|
---|
78 |
|
---|
79 | if (v_regs[5] & 0x0180)
|
---|
80 | vbank(0);
|
---|
81 |
|
---|
82 | vputs(obj8, 8, 7, dspbuf, SDW13ATR);
|
---|
83 |
|
---|
84 | return(SUCCESS);
|
---|
85 | }
|
---|
86 |
|
---|
87 | /* |
---|
88 |
|
---|
89 | */
|
---|
90 |
|
---|
91 | /*
|
---|
92 | =============================================================================
|
---|
93 | nd_scor() -- data entry
|
---|
94 | =============================================================================
|
---|
95 | */
|
---|
96 |
|
---|
97 | int16_t nd_scor(int16_t n, int16_t k)
|
---|
98 | {
|
---|
99 | register int16_t ec;
|
---|
100 |
|
---|
101 | ec = stccol - cfetp->flcol;
|
---|
102 | ebuf[ec] = k + '0';
|
---|
103 |
|
---|
104 | if (v_regs[5] & 0x0180)
|
---|
105 | vbank(0);
|
---|
106 |
|
---|
107 | vputc(obj8, 8, stccol, k + '0', SDW13DEA);
|
---|
108 | advscur();
|
---|
109 |
|
---|
110 | return(SUCCESS);
|
---|
111 | }
|
---|
112 |
|
---|