source: buchla-68k/ram/etsnbt.c@ 1efe224

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

Zero redundant declarations.

  • Property mode set to 100644
File size: 2.1 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 "ram.h"
9
10/*
11 =============================================================================
12 et_snbt() -- load edit buffer
13 =============================================================================
14*/
15
16int16_t et_snbt(int16_t n)
17{
18 register int32_t curfr, beat;
19
20 if (clkrun) {
21
22 ebflag = FALSE;
23 return(FAILURE);
24 }
25
26 curfr = t_cur;
27 beat = curfr / 48;
28
29 sprintf(ebuf, "%05ld", beat);
30 ebflag = TRUE;
31
32 return(SUCCESS);
33}
34
35/*
36 =============================================================================
37 ef_snbt() -- parse edit buffer
38 =============================================================================
39*/
40
41int16_t ef_snbt(int16_t n)
42{
43 register int32_t ival;
44 register int16_t i;
45
46 if (clkrun)
47 return(FAILURE);
48
49 ival = 0L;
50
51 for (i = 0; i < 5; i++)
52 ival = (ival * 10) + (ebuf[i] - '0');
53
54 ebflag = FALSE;
55
56 if (insmode) {
57
58 icancel();
59 dsimode();
60 }
61
62 sc_goto(fc_val = ival * 48L);
63 return(SUCCESS);
64}
65
66/*
67
68*/
69
70/*
71 =============================================================================
72 rd_snbt() -- (re)display the field
73 =============================================================================
74*/
75
76int16_t rd_snbt(int16_t n)
77{
78 register int32_t curfr, beat;
79 int8_t buf[8];
80
81 curfr = t_cur;
82 beat = curfr / 48;
83 sprintf(buf, "%05ld", beat);
84
85 if (v_regs[5] & 0x0180)
86 vbank(0);
87
88 vputs(obj8, 0, 11, buf, SDW00ATR);
89
90 return(SUCCESS);
91}
92
93/*
94
95*/
96
97/*
98 =============================================================================
99 nd_snbt() -- data entry function
100 =============================================================================
101*/
102
103int16_t nd_snbt(int16_t n, int16_t k)
104{
105 register int16_t ec;
106
107 if (clkrun)
108 return(FAILURE);
109
110 ec = stccol - cfetp->flcol;
111 ebuf[ec] = k + '0';
112
113 if (v_regs[5] & 0x0180)
114 vbank(0);
115
116 vputc(obj8, 0, stccol, k + '0', SDW00DEA);
117 advscur();
118
119 return(SUCCESS);
120}
121
Note: See TracBrowser for help on using the repository browser.