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

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

Added missing includes and declarations.

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