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