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

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

Removed form-feed comments.

  • 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 rd_snbt() -- (re)display the field
69 =============================================================================
70*/
71
72int16_t rd_snbt(int16_t n)
73{
74 register int32_t curfr, beat;
75 int8_t buf[8];
76
77 curfr = t_cur;
78 beat = curfr / 48;
79 sprintf(buf, "%05ld", beat);
80
81 if (v_regs[5] & 0x0180)
82 vbank(0);
83
84 vputs(obj8, 0, 11, buf, SDW00ATR);
85
86 return(SUCCESS);
87}
88
89/*
90 =============================================================================
91 nd_snbt() -- data entry function
92 =============================================================================
93*/
94
95int16_t nd_snbt(int16_t n, int16_t k)
96{
97 register int16_t ec;
98
99 if (clkrun)
100 return(FAILURE);
101
102 ec = stccol - cfetp->flcol;
103 ebuf[ec] = k + '0';
104
105 if (v_regs[5] & 0x0180)
106 vbank(0);
107
108 vputc(obj8, 0, stccol, k + '0', SDW00DEA);
109 advscur();
110
111 return(SUCCESS);
112}
113
Note: See TracBrowser for help on using the repository browser.