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