source: buchla-68k/ram/etsnbt.c@ 411371e

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

Removed redundant declarations.

  • Property mode set to 100644
File size: 2.5 KB
Line 
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#include "score.h"
20#include "scfns.h"
21#include "stdio.h"
22
23extern void advscur(void);
24extern void dsimode(void);
25extern void icancel(void);
26
27extern uint16_t *obj8;
28
29extern int16_t clkrun;
30extern int16_t insmode;
31extern int16_t stccol;
32
33/*
34
35*/
36
37/*
38 =============================================================================
39 et_snbt() -- load edit buffer
40 =============================================================================
41*/
42
43int16_t et_snbt(int16_t n)
44{
45 register int32_t curfr, beat;
46
47 if (clkrun) {
48
49 ebflag = FALSE;
50 return(FAILURE);
51 }
52
53 curfr = t_cur;
54 beat = curfr / 48;
55
56 sprintf(ebuf, "%05ld", beat);
57 ebflag = TRUE;
58
59 return(SUCCESS);
60}
61
62/*
63 =============================================================================
64 ef_snbt() -- parse edit buffer
65 =============================================================================
66*/
67
68int16_t ef_snbt(int16_t n)
69{
70 register int32_t ival;
71 register int16_t i;
72
73 if (clkrun)
74 return(FAILURE);
75
76 ival = 0L;
77
78 for (i = 0; i < 5; i++)
79 ival = (ival * 10) + (ebuf[i] - '0');
80
81 ebflag = FALSE;
82
83 if (insmode) {
84
85 icancel();
86 dsimode();
87 }
88
89 sc_goto(fc_val = ival * 48L);
90 return(SUCCESS);
91}
92
93/*
94
95*/
96
97/*
98 =============================================================================
99 rd_snbt() -- (re)display the field
100 =============================================================================
101*/
102
103int16_t rd_snbt(int16_t n)
104{
105 register int32_t curfr, beat;
106 int8_t buf[8];
107
108 curfr = t_cur;
109 beat = curfr / 48;
110 sprintf(buf, "%05ld", beat);
111
112 if (v_regs[5] & 0x0180)
113 vbank(0);
114
115 vputs(obj8, 0, 11, buf, SDW00ATR);
116
117 return(SUCCESS);
118}
119
120/*
121
122*/
123
124/*
125 =============================================================================
126 nd_snbt() -- data entry function
127 =============================================================================
128*/
129
130int16_t nd_snbt(int16_t n, int16_t k)
131{
132 register int16_t ec;
133
134 if (clkrun)
135 return(FAILURE);
136
137 ec = stccol - cfetp->flcol;
138 ebuf[ec] = k + '0';
139
140 if (v_regs[5] & 0x0180)
141 vbank(0);
142
143 vputc(obj8, 0, stccol, k + '0', SDW00DEA);
144 advscur();
145
146 return(SUCCESS);
147}
Note: See TracBrowser for help on using the repository browser.