source: buchla-68k/ram/scope.c@ b28a12e

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

Zero redundant declarations.

  • Property mode set to 100644
File size: 2.8 KB
Line 
1/*
2 =============================================================================
3 scope.c -- MIDAS-VII diagnostic scope functions
4 Version 6 -- 1988-10-12 -- D.N. Lynx Crowe
5 =============================================================================
6*/
7
8#include "ram.h"
9
10#define SCOPEOLD 0x0014 /* scope old text attribute */
11#define SCOPENEW 0x0054 /* scope new text attribute */
12
13int16_t scopec; /* scope col position */
14int16_t scopef; /* scope control flag */
15int16_t scoper; /* scope row position */
16
17uint16_t scopev; /* last scope value */
18
19uint16_t *scopeob; /* scope display object */
20
21int8_t scopebf[65]; /* scope display buffer */
22
23struct curpak dt_flds = {
24
25 stdctp2, /* curtype */
26 nokey, /* premove */
27 nokey, /* pstmove */
28 nokey, /* cx_key */
29 nokey, /* cy_key */
30 nokey, /* cx_upd */
31 nokey, /* cy_upd */
32 nokey, /* xy_up */
33 nokey, /* xy_dn */
34 nokey, /* x_key */
35 scptogl, /* e_key */
36 stdmkey, /* m_key */
37 nodkey, /* d_key */
38 nonf, /* not_fld */
39 (struct fet *)NULL, /* curfet */
40 (struct selbox *)NULL, /* csbp */
41 crate1, /* cratex */
42 crate1, /* cratey */
43 CT_GRAF, /* cmtype */
44 0, /* cxval */
45 0 /* cyval */
46};
47
48/*
49
50*/
51
52/*
53 =============================================================================
54 scope() -- display a value in binary on the crt
55 =============================================================================
56*/
57
58void scope(uint16_t val)
59{
60 register int16_t i;
61 register int8_t *bp = scopebf;
62
63 if ((ndisp NE 11) OR (NOT scopef))
64 return;
65
66 vputs(scopeob, scoper++, scopec, scopebf, SCOPEOLD);
67
68 *bp++ = ' ';
69
70 if (scoper > 24) {
71
72 scoper = 0;
73 scopec += 12;
74
75 if (scopec GE 60)
76 scopec = 0;
77 }
78
79 scopev = val;
80
81 for (i = 0; i < 4; i++)
82 if (val & (0x0080 >> i))
83 *bp++ = '1';
84 else
85 *bp++ = '0';
86
87 *bp++ = ' ';
88
89 for (i = 4; i < 8; i++)
90 if (val & (0x0080 >> i))
91 *bp++ = '1';
92 else
93 *bp++ = '0';
94
95 *bp++ = ' ';
96 *bp = 0;
97
98 vputs(scopeob, scoper, scopec, scopebf, SCOPENEW);
99}
100
101/*
102
103*/
104
105/*
106 =============================================================================
107 scptogl() -- toggle "scope" status
108 =============================================================================
109*/
110
111void scptogl(void)
112{
113 if (NOT astat)
114 return;
115
116 scopef = NOT scopef;
117}
118
119/*
120
121*/
122
123/*
124 =============================================================================
125 scopeon() -- put up the "scope" display
126 =============================================================================
127*/
128
129void scopeon(void)
130{
131 scopeob = &v_score[0];
132
133 curset(&dt_flds);
134
135 scopec = 0;
136 scopef = TRUE;
137 scoper = 0;
138 scopev = 0;
139
140 strcpy(scopebf, " ???? ???? ");
141
142 dswap();
143
144 vbank(0);
145
146 memsetw(scopeob, 0, 32767);
147 memsetw(scopeob+32767L, 0, 12033);
148
149 SetObj(0, 1, 0, scopeob, 512, 350, 0, 0, CHR3, -1);
150 vsndpal(scorpal);
151
152 SetPri(0, 15);
153}
154
Note: See TracBrowser for help on using the repository browser.