source: buchla-68k/orig/RAM/ETVEL.C@ 4f508e6

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

Imported original source code.

  • Property mode set to 100755
File size: 2.6 KB
Line 
1/*
2 =============================================================================
3 etvel.c -- velocity field handlers
4 Version 2 -- 1988-06-13 -- D.N. Lynx Crowe
5 =============================================================================
6*/
7
8#include "stddefs.h"
9#include "fields.h"
10#include "hwdefs.h"
11#include "graphdef.h"
12#include "vsdd.h"
13#include "vsddsw.h"
14#include "score.h"
15#include "scfns.h"
16
17#include "midas.h"
18#include "scdsp.h"
19#include "instdsp.h"
20
21extern unsigned *obj8;
22
23extern short recsw;
24extern short stccol;
25
26extern short grpmode[];
27extern short grpstat[];
28extern short lastvel[];
29
30/*
31
32*/
33
34/*
35 =============================================================================
36 et_vel() -- load edit buffer
37 =============================================================================
38*/
39
40short
41et_vel(n)
42short n;
43{
44 sprintf(ebuf, "%03d", lastvel[n] / 252);
45
46 ebflag = TRUE;
47 return(SUCCESS);
48}
49
50/*
51
52*/
53
54/*
55 =============================================================================
56 ef_vel() -- parse edit buffer
57 =============================================================================
58*/
59
60short
61ef_vel(n)
62short n;
63{
64 register short ival, i;
65 register struct s_entry *ep;
66
67 ival = 0;
68
69 for (i = 0; i < 3; i++)
70 ival = (ival * 10) + (ebuf[i] - '0');
71
72 ebflag = FALSE;
73
74 if (ival > 127)
75 return(FAILURE);
76
77 ival = SM_SCALE(ival);
78
79 if (recsw AND grpstat[n] AND (2 EQ grpmode[n])) {
80
81 lastvel[n] = ival;
82 ep = ep_adj(p_cur, 1, t_cur);
83
84 while (t_cur EQ ep->e_time) {
85
86 if ((EV_NBEG EQ (0x007F & ep->e_type)) AND
87 (ep->e_data2 EQ n)) {
88
89 ((struct n_entry *)ep)->e_vel = ival;
90 }
91
92 ep = ep->e_fwd;
93 }
94 }
95
96 return(SUCCESS);
97}
98
99/*
100
101*/
102
103/*
104 =============================================================================
105 rd_vel() -- (re)display the field
106 =============================================================================
107*/
108
109short
110rd_vel(n)
111short n;
112{
113 char buf[6];
114
115 sprintf(buf, "%03d", lastvel[n] / 252);
116
117 if (v_regs[5] & 0x0180)
118 vbank(0);
119
120 vputs(obj8, 5, 6 + (n * 5), buf, SDW11ATR);
121
122 return(SUCCESS);
123}
124
125/*
126
127*/
128
129/*
130 =============================================================================
131 nd_vel() -- data entry function
132 =============================================================================
133*/
134
135short
136nd_vel(n, k)
137register short n, k;
138{
139 register short ec;
140
141 ec = stccol - cfetp->flcol; /* setup edit buffer column */
142 ebuf[ec] = k + '0';
143
144 if (v_regs[5] & 0x0180)
145 vbank(0);
146
147 vputc(obj8, 5, stccol, k + '0', SDW11DEA);
148 advscur();
149
150 return(SUCCESS);
151}
Note: See TracBrowser for help on using the repository browser.