source: buchla-68k/ram/etdyn.c@ ea9a162

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

Fixed etdyn.c.

  • Property mode set to 100644
File size: 2.4 KB
Line 
1/*
2 =============================================================================
3 etdyn.c -- dynamics field handlers
4 Version 8 -- 1988-06-08 -- D.N. Lynx Crowe
5 =============================================================================
6*/
7
8#include "ram.h"
9
10/*
11 =============================================================================
12 et_dyn() -- load edit buffer
13 =============================================================================
14*/
15
16int16_t et_dyn(int16_t n)
17{
18 ebuf[0] = (int8_t)(grpdyn[n] + '0');
19 ebuf[1] = '\0';
20 ebflag = TRUE;
21 return(SUCCESS);
22}
23
24/*
25 =============================================================================
26 ef_dyn() -- parse edit buffer
27 =============================================================================
28*/
29
30int16_t ef_dyn(int16_t n)
31{
32 register int16_t ival;
33 register struct s_entry *ep;
34
35 ebuf[1] = '\0';
36 ival = ebuf[0] - '0';
37 ebflag = FALSE;
38
39 setdyn(n, ival);
40
41 if (recsw AND grpmode[n] AND (2 EQ grpmode[n])) {
42
43 if (E_NULL NE (ep = findev(p_cur, t_cur, EV_DYN, n, -1))) {
44
45 ep->e_data2 = (int8_t)ival;
46
47 } else if (E_NULL NE (ep = e_alc(E_SIZE2))) {
48
49 ep->e_type = EV_DYN;
50 ep->e_data1 = (int8_t)n;
51 ep->e_data2 = (int8_t)ival;
52 ep->e_time = t_cur;
53 p_cur = e_ins(ep, ep_adj(p_cur, 0, t_cur))->e_fwd;
54 eh_ins(ep, EH_DYN);
55 ctrsw = TRUE;
56 se_disp(ep, D_FWD, gdstbc, 1);
57 scupd();
58 }
59 }
60
61 return(SUCCESS);
62}
63
64/*
65 =============================================================================
66 rd_dyn() -- (re)display the field
67 =============================================================================
68*/
69
70int16_t rd_dyn(int16_t n)
71{
72 if (v_regs[5] & 0x0180)
73 vbank(0);
74
75 vputc(obj8, 4, 6+(n*5), (grpdyn[n] + '0'), SDW11ATR);
76
77 return(SUCCESS);
78}
79
80/*
81 =============================================================================
82 ds_dyn() -- display all dynamics to group assignments
83 =============================================================================
84*/
85
86void ds_dyn(void)
87{
88 register int16_t i;
89
90 for (i = 0; i < 12; i++)
91 rd_dyn(i);
92}
93
94/*
95 =============================================================================
96 nd_dyn() -- data entry function
97 =============================================================================
98*/
99
100int16_t nd_dyn(int16_t n, int16_t k)
101{
102 (void)n;
103
104 ebuf[0] = (int8_t)(k + '0');
105
106 if (v_regs[5] & 0x0180)
107 vbank(0);
108
109 vputc(obj8, 4, stccol, k + '0', SDW11DEA);
110 advscur();
111
112 return(SUCCESS);
113}
114
Note: See TracBrowser for help on using the repository browser.