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

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

Added include files for global functions and variables.

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