1 | /*
|
---|
2 | =============================================================================
|
---|
3 | etsnbt.c -- beat field handlers
|
---|
4 | Version 4 -- 1988-07-28 -- 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 |
|
---|
15 | #include "midas.h"
|
---|
16 | #include "scdsp.h"
|
---|
17 | #include "instdsp.h"
|
---|
18 |
|
---|
19 | extern unsigned *obj8;
|
---|
20 |
|
---|
21 | extern short clkrun;
|
---|
22 | extern short insmode;
|
---|
23 | extern short stccol;
|
---|
24 |
|
---|
25 | extern long t_cur;
|
---|
26 |
|
---|
27 | /* |
---|
28 |
|
---|
29 | */
|
---|
30 |
|
---|
31 | /*
|
---|
32 | =============================================================================
|
---|
33 | et_snbt() -- load edit buffer
|
---|
34 | =============================================================================
|
---|
35 | */
|
---|
36 |
|
---|
37 | short et_snbt(short n)
|
---|
38 | {
|
---|
39 | register long curfr, beat;
|
---|
40 |
|
---|
41 | if (clkrun) {
|
---|
42 |
|
---|
43 | ebflag = FALSE;
|
---|
44 | return(FAILURE);
|
---|
45 | }
|
---|
46 |
|
---|
47 | curfr = t_cur;
|
---|
48 | beat = curfr / 48;
|
---|
49 |
|
---|
50 | sprintf(ebuf, "%05ld", beat);
|
---|
51 | ebflag = TRUE;
|
---|
52 |
|
---|
53 | return(SUCCESS);
|
---|
54 | }
|
---|
55 |
|
---|
56 | /*
|
---|
57 | =============================================================================
|
---|
58 | ef_snbt() -- parse edit buffer
|
---|
59 | =============================================================================
|
---|
60 | */
|
---|
61 |
|
---|
62 | short ef_snbt(short n)
|
---|
63 | {
|
---|
64 | register long ival;
|
---|
65 | register short i;
|
---|
66 |
|
---|
67 | if (clkrun)
|
---|
68 | return(FAILURE);
|
---|
69 |
|
---|
70 | ival = 0L;
|
---|
71 |
|
---|
72 | for (i = 0; i < 5; i++)
|
---|
73 | ival = (ival * 10) + (ebuf[i] - '0');
|
---|
74 |
|
---|
75 | ebflag = FALSE;
|
---|
76 |
|
---|
77 | if (insmode) {
|
---|
78 |
|
---|
79 | icancel();
|
---|
80 | dsimode();
|
---|
81 | }
|
---|
82 |
|
---|
83 | sc_goto(fc_val = ival * 48L);
|
---|
84 | return(SUCCESS);
|
---|
85 | }
|
---|
86 |
|
---|
87 | /* |
---|
88 |
|
---|
89 | */
|
---|
90 |
|
---|
91 | /*
|
---|
92 | =============================================================================
|
---|
93 | rd_snbt() -- (re)display the field
|
---|
94 | =============================================================================
|
---|
95 | */
|
---|
96 |
|
---|
97 | short rd_snbt(short n)
|
---|
98 | {
|
---|
99 | register long curfr, beat;
|
---|
100 | char buf[8];
|
---|
101 |
|
---|
102 | curfr = t_cur;
|
---|
103 | beat = curfr / 48;
|
---|
104 | sprintf(buf, "%05ld", beat);
|
---|
105 |
|
---|
106 | if (v_regs[5] & 0x0180)
|
---|
107 | vbank(0);
|
---|
108 |
|
---|
109 | vputs(obj8, 0, 11, buf, SDW00ATR);
|
---|
110 |
|
---|
111 | return(SUCCESS);
|
---|
112 | }
|
---|
113 |
|
---|
114 | /* |
---|
115 |
|
---|
116 | */
|
---|
117 |
|
---|
118 | /*
|
---|
119 | =============================================================================
|
---|
120 | nd_snbt() -- data entry function
|
---|
121 | =============================================================================
|
---|
122 | */
|
---|
123 |
|
---|
124 | short nd_snbt(short n, short k)
|
---|
125 | {
|
---|
126 | register short ec;
|
---|
127 |
|
---|
128 | if (clkrun)
|
---|
129 | return(FAILURE);
|
---|
130 |
|
---|
131 | ec = stccol - cfetp->flcol;
|
---|
132 | ebuf[ec] = k + '0';
|
---|
133 |
|
---|
134 | if (v_regs[5] & 0x0180)
|
---|
135 | vbank(0);
|
---|
136 |
|
---|
137 | vputc(obj8, 0, stccol, k + '0', SDW00DEA);
|
---|
138 | advscur();
|
---|
139 |
|
---|
140 | return(SUCCESS);
|
---|
141 | }
|
---|