source: buchla-68k/ram/etscor.c@ e225e77

Last change on this file since e225e77 was e225e77, checked in by Thomas Lopatic <thomas@…>, 7 years ago

Added missing includes and declarations.

  • Property mode set to 100644
File size: 2.3 KB
Line 
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#include "scfns.h"
20#include "stdio.h"
21
22extern void advscur(void);
23extern void dsimode(void);
24extern void icancel(void);
25extern void sdwins(void);
26
27extern uint16_t *obj8;
28
29extern int16_t curscor;
30extern int16_t insmode;
31extern int16_t stccol;
32
33extern int8_t dspbuf[];
34
35/*
36 =============================================================================
37 et_scor() -- load edit buffer
38 =============================================================================
39*/
40
41int16_t et_scor(int16_t n)
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*/
58
59int16_t ef_scor(int16_t n)
60{
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*/
87
88int16_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/*
101
102*/
103
104/*
105 =============================================================================
106 nd_scor() -- data entry
107 =============================================================================
108*/
109
110int16_t nd_scor(int16_t n, int16_t k)
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}
Note: See TracBrowser for help on using the repository browser.