source: buchla-68k/ram/etstrn.c@ 0580615

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

Point of no return.

  • Property mode set to 100644
File size: 2.5 KB
Line 
1/*
2 =============================================================================
3 etstrn.c -- section edit group transposition field handlers
4 Version 3 -- 1989-11-14 -- D.N. Lynx Crowe
5 =============================================================================
6*/
7
8#include "fields.h"
9#include "hwdefs.h"
10#include "graphdef.h"
11#include "vsdd.h"
12#include "vsddsw.h"
13#include "stddefs.h"
14#include "score.h"
15#include "macros.h"
16
17#include "midas.h"
18#include "scdsp.h"
19
20extern unsigned *obj8;
21
22extern short grptran;
23extern short sdmctl;
24extern short vtccol;
25extern short vtcrow;
26extern short vtxval;
27extern short vtyval;
28
29extern char dspbuf[];
30
31/*
32 =============================================================================
33 et_strn() -- load edit buffer
34 =============================================================================
35*/
36
37short et_strn(void)
38{
39 sprintf(ebuf, "%c%02d", grptran < 0 ? '-' : '+', abs(grptran));
40
41 ebflag = TRUE;
42
43 return(SUCCESS);
44}
45
46/*
47
48*/
49
50/*
51 =============================================================================
52 ef_strn() -- parse edit buffer
53 =============================================================================
54*/
55
56short ef_strn(void)
57{
58 register short ival;
59
60 ebuf[3] = '\0';
61 ival = ((ebuf[1] - '0') * 10) + (ebuf[2] - '0');
62
63 ebflag = FALSE;
64
65 if ((ival NE 0) AND (ebuf[0] EQ '-'))
66 ival = -ival;
67
68 grptran = ival;
69
70 return(SUCCESS);
71}
72
73/*
74 =============================================================================
75 rd_strn() -- redisplay field
76 =============================================================================
77*/
78
79short rd_strn(void)
80{
81 sprintf(dspbuf, "%c%02d", grptran < 0 ? '-' : '+', abs(grptran));
82
83 if (v_regs[5] & 0x0180)
84 vbank(0);
85
86 vputs(obj8, 7, 22, dspbuf, SDMENUBG);
87
88 return(SUCCESS);
89}
90
91/*
92
93*/
94
95/*
96 =============================================================================
97 nd_strn() -- data entry
98 =============================================================================
99*/
100
101short nd_strn(short n, short k)
102{
103 register short ec;
104
105 if (sdmctl NE 4)
106 return(FAILURE);
107
108 if ((vtccol GE 22) AND (vtccol LE 24))
109 ec = vtccol - 22;
110 else
111 return(FAILURE);
112
113 if (ec EQ 0) {
114
115 if (k EQ 8)
116 k = '-';
117 else if (k EQ 9)
118 k = '+';
119 else
120 return(FAILURE);
121 } else
122 k += '0';
123
124 ebuf[ec] = k;
125
126 if (v_regs[5] & 0x0180)
127 vbank(0);
128
129 vputc(obj8, 7, vtccol, k, (SDBGMM | (SD_ENTR << 4)));
130
131 if (vtccol < 24) {
132
133 ++vtccol;
134 vtxval = CTOX(vtccol);
135 ttcpos(vtcrow, vtccol);
136 }
137
138 return(SUCCESS);
139}
Note: See TracBrowser for help on using the repository browser.