[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 curscor;
|
---|
| 30 | extern int16_t insmode;
|
---|
| 31 | extern int16_t stccol;
|
---|
[f40a309] | 32 |
|
---|
[7258c6a] | 33 | extern int8_t dspbuf[];
|
---|
[f40a309] | 34 |
|
---|
| 35 | /*
|
---|
| 36 | =============================================================================
|
---|
| 37 | et_scor() -- load edit buffer
|
---|
| 38 | =============================================================================
|
---|
| 39 | */
|
---|
| 40 |
|
---|
[7258c6a] | 41 | int16_t et_scor(int16_t n)
|
---|
[f40a309] | 42 | {
|
---|
| 43 | sprintf(ebuf, "%02.2d", curscor + 1);
|
---|
| 44 | ebflag = TRUE;
|
---|
| 45 |
|
---|
| 46 | return(SUCCESS);
|
---|
| 47 | }
|
---|
| 48 |
|
---|
| 49 | /* |
---|
| 50 |
|
---|
| 51 | */
|
---|
| 52 |
|
---|
| 53 | /*
|
---|
| 54 | =============================================================================
|
---|
| 55 | ef_scor() -- parse edit buffer
|
---|
| 56 | =============================================================================
|
---|
| 57 | */
|
---|
[7258c6a] | 58 |
|
---|
[f40a309] | 59 | int16_t ef_scor(int16_t n)
|
---|
[7258c6a] | 60 | {
|
---|
[f40a309] | 61 | register int16_t ival;
|
---|
| 62 |
|
---|
| 63 | ebuf[2] = '\0';
|
---|
| 64 | ival = ((ebuf[0] - '0') * 10) + (ebuf[1] - '0');
|
---|
| 65 |
|
---|
| 66 | ebflag = FALSE;
|
---|
| 67 |
|
---|
| 68 | if ((ival GT N_SCORES) OR (ival EQ 0))
|
---|
| 69 | return(FAILURE);
|
---|
| 70 |
|
---|
| 71 | if (insmode) {
|
---|
| 72 |
|
---|
| 73 | icancel();
|
---|
| 74 | dsimode();
|
---|
| 75 | }
|
---|
| 76 |
|
---|
| 77 | selscor(ival - 1);
|
---|
| 78 | sdwins();
|
---|
| 79 | return(SUCCESS);
|
---|
| 80 | }
|
---|
| 81 |
|
---|
| 82 | /*
|
---|
| 83 | =============================================================================
|
---|
| 84 | rd_scor() -- redisplay field
|
---|
| 85 | =============================================================================
|
---|
| 86 | */
|
---|
[7258c6a] | 87 |
|
---|
[f40a309] | 88 | int16_t rd_scor(int16_t n)
|
---|
| 89 | {
|
---|
| 90 | sprintf(dspbuf, "%02.2d", curscor + 1);
|
---|
| 91 |
|
---|
| 92 | if (v_regs[5] & 0x0180)
|
---|
| 93 | vbank(0);
|
---|
| 94 |
|
---|
| 95 | vputs(obj8, 8, 7, dspbuf, SDW13ATR);
|
---|
| 96 |
|
---|
| 97 | return(SUCCESS);
|
---|
| 98 | }
|
---|
| 99 |
|
---|
| 100 | /* |
---|
[9519422] | 101 |
|
---|
[f40a309] | 102 | */
|
---|
| 103 |
|
---|
| 104 | /*
|
---|
| 105 | =============================================================================
|
---|
| 106 | nd_scor() -- data entry
|
---|
| 107 | =============================================================================
|
---|
[7258c6a] | 108 | */
|
---|
[f40a309] | 109 |
|
---|
[7258c6a] | 110 | int16_t nd_scor(int16_t n, int16_t k)
|
---|
[f40a309] | 111 | {
|
---|
| 112 | register int16_t ec;
|
---|
| 113 |
|
---|
| 114 | ec = stccol - cfetp->flcol;
|
---|
| 115 | ebuf[ec] = k + '0';
|
---|
| 116 |
|
---|
| 117 | if (v_regs[5] & 0x0180)
|
---|
| 118 | vbank(0);
|
---|
| 119 |
|
---|
| 120 | vputc(obj8, 8, stccol, k + '0', SDW13DEA);
|
---|
| 121 | advscur();
|
---|
| 122 |
|
---|
| 123 | return(SUCCESS);
|
---|
| 124 | }
|
---|