[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 | scope() -- display a value in binary on the crt
|
---|
| 51 | =============================================================================
|
---|
| 52 | */
|
---|
| 53 |
|
---|
[7258c6a] | 54 | void scope(uint16_t val)
|
---|
[f40a309] | 55 | {
|
---|
[7258c6a] | 56 | register int16_t i;
|
---|
| 57 | register int8_t *bp = scopebf;
|
---|
[f40a309] | 58 |
|
---|
| 59 | if ((ndisp NE 11) OR (NOT scopef))
|
---|
| 60 | return;
|
---|
| 61 |
|
---|
| 62 | vputs(scopeob, scoper++, scopec, scopebf, SCOPEOLD);
|
---|
| 63 |
|
---|
| 64 | *bp++ = ' ';
|
---|
| 65 |
|
---|
| 66 | if (scoper > 24) {
|
---|
| 67 |
|
---|
| 68 | scoper = 0;
|
---|
| 69 | scopec += 12;
|
---|
| 70 |
|
---|
| 71 | if (scopec GE 60)
|
---|
| 72 | scopec = 0;
|
---|
| 73 | }
|
---|
| 74 |
|
---|
| 75 | scopev = val;
|
---|
| 76 |
|
---|
| 77 | for (i = 0; i < 4; i++)
|
---|
| 78 | if (val & (0x0080 >> i))
|
---|
| 79 | *bp++ = '1';
|
---|
| 80 | else
|
---|
| 81 | *bp++ = '0';
|
---|
| 82 |
|
---|
| 83 | *bp++ = ' ';
|
---|
| 84 |
|
---|
| 85 | for (i = 4; i < 8; i++)
|
---|
| 86 | if (val & (0x0080 >> i))
|
---|
| 87 | *bp++ = '1';
|
---|
| 88 | else
|
---|
| 89 | *bp++ = '0';
|
---|
| 90 |
|
---|
| 91 | *bp++ = ' ';
|
---|
| 92 | *bp = 0;
|
---|
| 93 |
|
---|
| 94 | vputs(scopeob, scoper, scopec, scopebf, SCOPENEW);
|
---|
| 95 | }
|
---|
| 96 |
|
---|
| 97 | /*
|
---|
| 98 | =============================================================================
|
---|
| 99 | scptogl() -- toggle "scope" status
|
---|
| 100 | =============================================================================
|
---|
| 101 | */
|
---|
| 102 |
|
---|
[0580615] | 103 | void scptogl(void)
|
---|
[f40a309] | 104 | {
|
---|
| 105 | if (NOT astat)
|
---|
| 106 | return;
|
---|
| 107 |
|
---|
| 108 | scopef = NOT scopef;
|
---|
| 109 | }
|
---|
| 110 |
|
---|
| 111 | /*
|
---|
| 112 | =============================================================================
|
---|
| 113 | scopeon() -- put up the "scope" display
|
---|
| 114 | =============================================================================
|
---|
| 115 | */
|
---|
| 116 |
|
---|
[0580615] | 117 | void scopeon(void)
|
---|
[f40a309] | 118 | {
|
---|
| 119 | scopeob = &v_score[0];
|
---|
| 120 |
|
---|
| 121 | curset(&dt_flds);
|
---|
| 122 |
|
---|
| 123 | scopec = 0;
|
---|
| 124 | scopef = TRUE;
|
---|
| 125 | scoper = 0;
|
---|
| 126 | scopev = 0;
|
---|
| 127 |
|
---|
| 128 | strcpy(scopebf, " ???? ???? ");
|
---|
| 129 |
|
---|
| 130 | dswap();
|
---|
| 131 |
|
---|
| 132 | vbank(0);
|
---|
| 133 |
|
---|
| 134 | memsetw(scopeob, 0, 32767);
|
---|
| 135 | memsetw(scopeob+32767L, 0, 12033);
|
---|
| 136 |
|
---|
| 137 | SetObj(0, 1, 0, scopeob, 512, 350, 0, 0, CHR3, -1);
|
---|
| 138 | vsndpal(scorpal);
|
---|
| 139 |
|
---|
| 140 | SetPri(0, 15);
|
---|
| 141 | }
|
---|
[6262b5c] | 142 |
|
---|