/* ============================================================================= etscor.c -- score field handlers Version 7 -- 1988-08-16 -- D.N. Lynx Crowe ============================================================================= */ #include "fields.h" #include "hwdefs.h" #include "graphdef.h" #include "vsdd.h" #include "vsddsw.h" #include "stddefs.h" #include "score.h" #include "midas.h" #include "scdsp.h" extern uint16_t *obj8; extern int16_t curscor; extern int16_t insmode; extern int16_t stccol; extern int8_t dspbuf[]; /* ============================================================================= et_scor() -- load edit buffer ============================================================================= */ int16_t et_scor(int16_t n) { sprintf(ebuf, "%02.2d", curscor + 1); ebflag = TRUE; return(SUCCESS); } /* */ /* ============================================================================= ef_scor() -- parse edit buffer ============================================================================= */ int16_t ef_scor(int16_t n) { register int16_t ival; ebuf[2] = '\0'; ival = ((ebuf[0] - '0') * 10) + (ebuf[1] - '0'); ebflag = FALSE; if ((ival GT N_SCORES) OR (ival EQ 0)) return(FAILURE); if (insmode) { icancel(); dsimode(); } selscor(ival - 1); sdwins(); return(SUCCESS); } /* ============================================================================= rd_scor() -- redisplay field ============================================================================= */ int16_t rd_scor(int16_t n) { sprintf(dspbuf, "%02.2d", curscor + 1); if (v_regs[5] & 0x0180) vbank(0); vputs(obj8, 8, 7, dspbuf, SDW13ATR); return(SUCCESS); } /* */ /* ============================================================================= nd_scor() -- data entry ============================================================================= */ int16_t nd_scor(int16_t n, int16_t k) { register int16_t ec; ec = stccol - cfetp->flcol; ebuf[ec] = k + '0'; if (v_regs[5] & 0x0180) vbank(0); vputc(obj8, 8, stccol, k + '0', SDW13DEA); advscur(); return(SUCCESS); }