[f40a309] | 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 "stddefs.h"
|
---|
| 9 | #include "hwdefs.h"
|
---|
| 10 | #include "vsdd.h"
|
---|
| 11 | #include "graphdef.h"
|
---|
| 12 | #include "fields.h"
|
---|
| 13 | #include "curpak.h"
|
---|
| 14 |
|
---|
| 15 | #include "midas.h"
|
---|
| 16 |
|
---|
| 17 | #define SCOPEOLD 0x0014 /* scope old text attribute */
|
---|
| 18 | #define SCOPENEW 0x0054 /* scope new text attribute */
|
---|
| 19 |
|
---|
| 20 | short scopec; /* scope col position */
|
---|
| 21 | short scopef; /* scope control flag */
|
---|
| 22 | short scoper; /* scope row position */
|
---|
| 23 |
|
---|
| 24 | unsigned scopev; /* last scope value */
|
---|
| 25 |
|
---|
| 26 | unsigned *scopeob; /* scope display object */
|
---|
| 27 |
|
---|
| 28 | char scopebf[65]; /* scope display buffer */
|
---|
| 29 |
|
---|
[60288f5] | 30 | extern short stdctp2(void);
|
---|
| 31 | extern void nokey(void);
|
---|
| 32 | extern void nodkey(short k);
|
---|
| 33 | extern short nonf(short k);
|
---|
[0580615] | 34 | extern void stdmkey(void);
|
---|
[f40a309] | 35 |
|
---|
| 36 | extern short astat;
|
---|
| 37 | extern short ndisp;
|
---|
| 38 |
|
---|
| 39 | extern short scorpal[][3];
|
---|
| 40 |
|
---|
| 41 | extern short crate1[];
|
---|
| 42 |
|
---|
| 43 | /* forward reference */
|
---|
| 44 |
|
---|
[0580615] | 45 | void scptogl(void);
|
---|
[f40a309] | 46 |
|
---|
| 47 | /* |
---|
| 48 |
|
---|
| 49 | */
|
---|
| 50 |
|
---|
| 51 | struct curpak dt_flds = {
|
---|
[60288f5] | 52 |
|
---|
[f40a309] | 53 | stdctp2, /* curtype */
|
---|
| 54 | nokey, /* premove */
|
---|
| 55 | nokey, /* pstmove */
|
---|
| 56 | nokey, /* cx_key */
|
---|
| 57 | nokey, /* cy_key */
|
---|
| 58 | nokey, /* cx_upd */
|
---|
| 59 | nokey, /* cy_upd */
|
---|
| 60 | nokey, /* xy_up */
|
---|
| 61 | nokey, /* xy_dn */
|
---|
| 62 | nokey, /* x_key */
|
---|
| 63 | scptogl, /* e_key */
|
---|
[60288f5] | 64 | stdmkey, /* m_key */
|
---|
| 65 | nodkey, /* d_key */
|
---|
[f40a309] | 66 | nonf, /* not_fld */
|
---|
| 67 | (struct fet *)NULL, /* curfet */
|
---|
| 68 | (struct selbox *)NULL, /* csbp */
|
---|
| 69 | crate1, /* cratex */
|
---|
| 70 | crate1, /* cratey */
|
---|
| 71 | CT_GRAF, /* cmtype */
|
---|
| 72 | 0, /* cxval */
|
---|
| 73 | 0 /* cyval */
|
---|
| 74 | };
|
---|
| 75 |
|
---|
| 76 | /* |
---|
| 77 |
|
---|
| 78 | */
|
---|
| 79 |
|
---|
| 80 | /*
|
---|
| 81 | =============================================================================
|
---|
| 82 | scope() -- display a value in binary on the crt
|
---|
| 83 | =============================================================================
|
---|
[0580615] | 84 | */
|
---|
[f40a309] | 85 |
|
---|
| 86 | void scope(unsigned val)
|
---|
| 87 | {
|
---|
| 88 | register short i;
|
---|
| 89 | register char *bp = scopebf;
|
---|
| 90 |
|
---|
| 91 | if ((ndisp NE 11) OR (NOT scopef))
|
---|
| 92 | return;
|
---|
| 93 |
|
---|
| 94 | vputs(scopeob, scoper++, scopec, scopebf, SCOPEOLD);
|
---|
| 95 |
|
---|
| 96 | *bp++ = ' ';
|
---|
| 97 |
|
---|
| 98 | if (scoper > 24) {
|
---|
| 99 |
|
---|
| 100 | scoper = 0;
|
---|
| 101 | scopec += 12;
|
---|
| 102 |
|
---|
| 103 | if (scopec GE 60)
|
---|
| 104 | scopec = 0;
|
---|
| 105 | }
|
---|
| 106 |
|
---|
| 107 | scopev = val;
|
---|
| 108 |
|
---|
| 109 | for (i = 0; i < 4; i++)
|
---|
| 110 | if (val & (0x0080 >> i))
|
---|
| 111 | *bp++ = '1';
|
---|
| 112 | else
|
---|
| 113 | *bp++ = '0';
|
---|
| 114 |
|
---|
| 115 | *bp++ = ' ';
|
---|
| 116 |
|
---|
| 117 | for (i = 4; i < 8; i++)
|
---|
| 118 | if (val & (0x0080 >> i))
|
---|
| 119 | *bp++ = '1';
|
---|
| 120 | else
|
---|
| 121 | *bp++ = '0';
|
---|
| 122 |
|
---|
| 123 | *bp++ = ' ';
|
---|
| 124 | *bp = 0;
|
---|
| 125 |
|
---|
| 126 | vputs(scopeob, scoper, scopec, scopebf, SCOPENEW);
|
---|
| 127 | }
|
---|
| 128 |
|
---|
| 129 | /* |
---|
| 130 |
|
---|
| 131 | */
|
---|
| 132 |
|
---|
| 133 | /*
|
---|
| 134 | =============================================================================
|
---|
| 135 | scptogl() -- toggle "scope" status
|
---|
[0580615] | 136 | =============================================================================
|
---|
[f40a309] | 137 | */
|
---|
| 138 |
|
---|
| 139 | void scptogl(void)
|
---|
| 140 | {
|
---|
| 141 | if (NOT astat)
|
---|
| 142 | return;
|
---|
| 143 |
|
---|
| 144 | scopef = NOT scopef;
|
---|
| 145 | }
|
---|
| 146 |
|
---|
| 147 | /* |
---|
| 148 |
|
---|
| 149 | */
|
---|
| 150 |
|
---|
| 151 | /*
|
---|
| 152 | =============================================================================
|
---|
[0580615] | 153 | scopeon() -- put up the "scope" display
|
---|
[f40a309] | 154 | =============================================================================
|
---|
| 155 | */
|
---|
| 156 |
|
---|
| 157 | void scopeon(void)
|
---|
| 158 | {
|
---|
| 159 | scopeob = &v_score[0];
|
---|
| 160 |
|
---|
| 161 | curset(&dt_flds);
|
---|
| 162 |
|
---|
| 163 | scopec = 0;
|
---|
| 164 | scopef = TRUE;
|
---|
| 165 | scoper = 0;
|
---|
| 166 | scopev = 0;
|
---|
| 167 |
|
---|
| 168 | strcpy(scopebf, " ???? ???? ");
|
---|
| 169 |
|
---|
| 170 | dswap();
|
---|
| 171 |
|
---|
| 172 | vbank(0);
|
---|
| 173 |
|
---|
| 174 | memsetw(scopeob, 0, 32767);
|
---|
| 175 | memsetw(scopeob+32767L, 0, 12033);
|
---|
| 176 |
|
---|
| 177 | SetObj(0, 1, 0, scopeob, 512, 350, 0, 0, CHR3, -1);
|
---|
| 178 | vsndpal(scorpal);
|
---|
| 179 |
|
---|
| 180 | SetPri(0, 15);
|
---|
| 181 | }
|
---|