source: buchla-68k/ram/etvel.c@ b28a12e

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

Zero redundant declarations.

  • Property mode set to 100644
File size: 2.2 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 "ram.h"
9
10/*
11 =============================================================================
12 et_vel() -- load edit buffer
13 =============================================================================
14*/
15
16int16_t et_vel(int16_t n)
17{
18 sprintf(ebuf, "%03d", lastvel[n] / 252);
19
20 ebflag = TRUE;
21 return(SUCCESS);
22}
23
24/*
25
26*/
27
28/*
29 =============================================================================
30 ef_vel() -- parse edit buffer
31 =============================================================================
32*/
33
34int16_t ef_vel(int16_t n)
35{
36 register int16_t ival, i;
37 register struct s_entry *ep;
38
39 ival = 0;
40
41 for (i = 0; i < 3; i++)
42 ival = (ival * 10) + (ebuf[i] - '0');
43
44 ebflag = FALSE;
45
46 if (ival > 127)
47 return(FAILURE);
48
49 ival = SM_SCALE(ival);
50
51 if (recsw AND grpstat[n] AND (2 EQ grpmode[n])) {
52
53 lastvel[n] = ival;
54 ep = ep_adj(p_cur, 1, t_cur);
55
56 while (t_cur EQ ep->e_time) {
57
58 if ((EV_NBEG EQ (0x007F & ep->e_type)) AND
59 (ep->e_data2 EQ n)) {
60
61 ((struct n_entry *)ep)->e_vel = ival;
62 }
63
64 ep = ep->e_fwd;
65 }
66 }
67
68 return(SUCCESS);
69}
70
71/*
72
73*/
74
75/*
76 =============================================================================
77 rd_vel() -- (re)display the field
78 =============================================================================
79*/
80
81int16_t rd_vel(int16_t n)
82{
83 int8_t buf[6];
84
85 sprintf(buf, "%03d", lastvel[n] / 252);
86
87 if (v_regs[5] & 0x0180)
88 vbank(0);
89
90 vputs(obj8, 5, 6 + (n * 5), buf, SDW11ATR);
91
92 return(SUCCESS);
93}
94
95/*
96
97*/
98
99/*
100 =============================================================================
101 nd_vel() -- data entry function
102 =============================================================================
103*/
104
105int16_t nd_vel(int16_t n, int16_t k)
106{
107 register int16_t ec;
108
109 ec = stccol - cfetp->flcol; /* setup edit buffer column */
110 ebuf[ec] = k + '0';
111
112 if (v_regs[5] & 0x0180)
113 vbank(0);
114
115 vputc(obj8, 5, stccol, k + '0', SDW11DEA);
116 advscur();
117
118 return(SUCCESS);
119}
120
Note: See TracBrowser for help on using the repository browser.