[f40a309] | 1 | /*
|
---|
| 2 | =============================================================================
|
---|
| 3 | scope.c -- MIDAS-VII diagnostic scope functions
|
---|
| 4 | Version 6 -- 1988-10-12 -- D.N. Lynx Crowe
|
---|
| 5 | =============================================================================
|
---|
| 6 | */
|
---|
| 7 |
|
---|
[b28a12e] | 8 | #include "ram.h"
|
---|
[e225e77] | 9 |
|
---|
[f40a309] | 10 | #define SCOPEOLD 0x0014 /* scope old text attribute */
|
---|
| 11 | #define SCOPENEW 0x0054 /* scope new text attribute */
|
---|
| 12 |
|
---|
[7258c6a] | 13 | int16_t scopec; /* scope col position */
|
---|
| 14 | int16_t scopef; /* scope control flag */
|
---|
| 15 | int16_t scoper; /* scope row position */
|
---|
[f40a309] | 16 |
|
---|
[7258c6a] | 17 | uint16_t scopev; /* last scope value */
|
---|
[f40a309] | 18 |
|
---|
[7258c6a] | 19 | uint16_t *scopeob; /* scope display object */
|
---|
[f40a309] | 20 |
|
---|
[7258c6a] | 21 | int8_t scopebf[65]; /* scope display buffer */
|
---|
[f40a309] | 22 |
|
---|
| 23 | struct curpak dt_flds = {
|
---|
| 24 |
|
---|
[60288f5] | 25 | stdctp2, /* curtype */
|
---|
[f40a309] | 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 */
|
---|
[60288f5] | 37 | nodkey, /* d_key */
|
---|
| 38 | nonf, /* not_fld */
|
---|
[f40a309] | 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 | */
|
---|
[7258c6a] | 57 |
|
---|
[f40a309] | 58 | void scope(uint16_t val)
|
---|
[7258c6a] | 59 | {
|
---|
| 60 | register int16_t i;
|
---|
[f40a309] | 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 | =============================================================================
|
---|
[0580615] | 109 | */
|
---|
[f40a309] | 110 |
|
---|
| 111 | void 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
|
---|
[0580615] | 126 | =============================================================================
|
---|
[f40a309] | 127 | */
|
---|
| 128 |
|
---|
| 129 | void 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);
|
---|
[6262b5c] | 151 |
|
---|
| 152 | SetPri(0, 15);
|
---|
| 153 | }
|
---|
| 154 |
|
---|