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

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

Added include files for global functions and variables.

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