source: buchla-68k/orig/RAM/ETSNBT.C@ 7bf3856

Last change on this file since 7bf3856 was 3ae31e9, checked in by Thomas Lopatic <thomas@…>, 8 years ago

Imported original source code.

  • Property mode set to 100755
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
19extern unsigned *obj8;
20
21extern short clkrun;
22extern short insmode;
23extern short stccol;
24
25extern long t_cur;
26
27/*
28
29*/
30
31/*
32 =============================================================================
33 et_snbt() -- load edit buffer
34 =============================================================================
35*/
36
37short
38et_snbt(n)
39short n;
40{
41 register long curfr, beat;
42
43 if (clkrun) {
44
45 ebflag = FALSE;
46 return(FAILURE);
47 }
48
49 curfr = t_cur;
50 beat = curfr / 48;
51
52 sprintf(ebuf, "%05ld", beat);
53 ebflag = TRUE;
54
55 return(SUCCESS);
56}
57
58/*
59 =============================================================================
60 ef_snbt() -- parse edit buffer
61 =============================================================================
62*/
63
64short
65ef_snbt(n)
66short n;
67{
68 register long ival;
69 register short i;
70
71 if (clkrun)
72 return(FAILURE);
73
74 ival = 0L;
75
76 for (i = 0; i < 5; i++)
77 ival = (ival * 10) + (ebuf[i] - '0');
78
79 ebflag = FALSE;
80
81 if (insmode) {
82
83 icancel();
84 dsimode();
85 }
86
87 sc_goto(fc_val = ival * 48L);
88 return(SUCCESS);
89}
90
91/*
92
93*/
94
95/*
96 =============================================================================
97 rd_snbt() -- (re)display the field
98 =============================================================================
99*/
100
101short
102rd_snbt(n)
103short n;
104{
105 register long curfr, beat;
106 char 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
130short
131nd_snbt(n, k)
132register short n, k;
133{
134 register short 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.