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