[f40a309] | 1 | /*
|
---|
| 2 | =============================================================================
|
---|
| 3 | etscor.c -- score field handlers
|
---|
| 4 | Version 7 -- 1988-08-16 -- D.N. Lynx Crowe
|
---|
| 5 | =============================================================================
|
---|
| 6 | */
|
---|
| 7 |
|
---|
[6262b5c] | 8 | #include "all.h"
|
---|
[e225e77] | 9 |
|
---|
| 10 | extern void advscur(void);
|
---|
| 11 | extern void dsimode(void);
|
---|
| 12 | extern void icancel(void);
|
---|
| 13 | extern void sdwins(void);
|
---|
| 14 |
|
---|
[7258c6a] | 15 | extern uint16_t *obj8;
|
---|
[f40a309] | 16 |
|
---|
[7258c6a] | 17 | extern int16_t insmode;
|
---|
| 18 | extern int16_t stccol;
|
---|
[f40a309] | 19 |
|
---|
[7258c6a] | 20 | extern int8_t dspbuf[];
|
---|
[f40a309] | 21 |
|
---|
| 22 | /*
|
---|
| 23 | =============================================================================
|
---|
| 24 | et_scor() -- load edit buffer
|
---|
| 25 | =============================================================================
|
---|
| 26 | */
|
---|
| 27 |
|
---|
[7258c6a] | 28 | int16_t et_scor(int16_t n)
|
---|
[f40a309] | 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 | */
|
---|
[7258c6a] | 45 |
|
---|
[f40a309] | 46 | int16_t ef_scor(int16_t n)
|
---|
[7258c6a] | 47 | {
|
---|
[f40a309] | 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 | */
|
---|
[7258c6a] | 74 |
|
---|
[f40a309] | 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 | /* |
---|
[9519422] | 88 |
|
---|
[f40a309] | 89 | */
|
---|
| 90 |
|
---|
| 91 | /*
|
---|
| 92 | =============================================================================
|
---|
| 93 | nd_scor() -- data entry
|
---|
| 94 | =============================================================================
|
---|
[7258c6a] | 95 | */
|
---|
[f40a309] | 96 |
|
---|
[7258c6a] | 97 | int16_t nd_scor(int16_t n, int16_t k)
|
---|
[f40a309] | 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 |
|
---|
[6262b5c] | 110 | return(SUCCESS);
|
---|
| 111 | }
|
---|
| 112 |
|
---|