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

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

Use standard integer types.

  • Property mode set to 100644
File size: 2.1 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
19extern uint16_t *obj8;
20
21extern int16_t curscor;
22extern int16_t insmode;
23extern int16_t stccol;
24
25extern int8_t dspbuf[];
26
27/*
28 =============================================================================
29 et_scor() -- load edit buffer
30 =============================================================================
31*/
32
33int16_t et_scor(int16_t n)
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
51int16_t ef_scor(int16_t n)
52{
53 register int16_t 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
80int16_t rd_scor(int16_t n)
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
102int16_t nd_scor(int16_t n, int16_t k)
103{
104 register int16_t 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}
Note: See TracBrowser for help on using the repository browser.