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