[f40a309] | 1 | /*
|
---|
| 2 | =============================================================================
|
---|
| 3 | ctcpos.c -- character text cursor positioning
|
---|
| 4 | Version 12 -- 1989-11-15 -- D.N. Lynx Crowe
|
---|
| 5 | =============================================================================
|
---|
| 6 | */
|
---|
| 7 |
|
---|
[b28a12e] | 8 | #include "ram.h"
|
---|
[e225e77] | 9 |
|
---|
[7258c6a] | 10 | int16_t ctcsw; /* text cursor status */
|
---|
[f40a309] | 11 |
|
---|
[7258c6a] | 12 | int16_t mtcoldc; /* previous cursor column location */
|
---|
| 13 | int16_t mtcoldr; /* previous cursor row location */
|
---|
[f40a309] | 14 |
|
---|
| 15 | /* |
---|
| 16 |
|
---|
| 17 | */
|
---|
| 18 |
|
---|
| 19 | /*
|
---|
| 20 | =============================================================================
|
---|
| 21 | ctcpos() -- position the patch text cursor at ('row', 'col')
|
---|
| 22 | =============================================================================
|
---|
| 23 | */
|
---|
[7258c6a] | 24 |
|
---|
[f40a309] | 25 | void ctcpos(int16_t row, int16_t col)
|
---|
[7258c6a] | 26 | {
|
---|
[f40a309] | 27 | register int16_t nrow;
|
---|
| 28 |
|
---|
| 29 | if (ctcsw) {
|
---|
| 30 |
|
---|
| 31 | if (v_regs[5] & 0x0180) /* point at the control bank */
|
---|
| 32 | vbank(0);
|
---|
| 33 |
|
---|
| 34 | nrow = CurLine + 7;
|
---|
| 35 |
|
---|
| 36 | if (stcrow EQ DATAROW) /* turn off old cursor */
|
---|
| 37 | vclrav(obj9, nrow, stccol, C_ULINE, 48);
|
---|
| 38 |
|
---|
| 39 | if (row EQ DATAROW) /* turn on new cursor */
|
---|
| 40 | vsetav(obj9, nrow, col, C_ULINE, 48);
|
---|
| 41 | }
|
---|
| 42 |
|
---|
| 43 | stcrow = row; /* update cursor position */
|
---|
| 44 | stccol = col;
|
---|
| 45 | }
|
---|
| 46 |
|
---|
| 47 | /* |
---|
| 48 |
|
---|
| 49 | */
|
---|
| 50 |
|
---|
| 51 | /*
|
---|
| 52 | =============================================================================
|
---|
| 53 | ctcoff() -- turn off the patch text cursor
|
---|
| 54 | =============================================================================
|
---|
[0580615] | 55 | */
|
---|
[f40a309] | 56 |
|
---|
| 57 | void ctcoff(void)
|
---|
| 58 | {
|
---|
| 59 | if (v_regs[5] & 0x0180) /* point at the control bank */
|
---|
| 60 | vbank(0);
|
---|
| 61 |
|
---|
| 62 | if (stcrow EQ DATAROW) /* turn off cursor */
|
---|
| 63 | vclrav(obj9, CurLine + 7, stccol, C_ULINE, 48);
|
---|
| 64 |
|
---|
| 65 | ctcsw = FALSE;
|
---|
| 66 | }
|
---|
| 67 |
|
---|
| 68 | /*
|
---|
| 69 | =============================================================================
|
---|
| 70 | ctcon() -- turn on the patch text cursor
|
---|
| 71 | =============================================================================
|
---|
[0580615] | 72 | */
|
---|
[f40a309] | 73 |
|
---|
| 74 | void ctcon(void)
|
---|
| 75 | {
|
---|
| 76 | if (v_regs[5] & 0x0180) /* point at the control bank */
|
---|
| 77 | vbank(0);
|
---|
| 78 |
|
---|
| 79 | if (stcrow EQ DATAROW) { /* turn on cursor */
|
---|
| 80 |
|
---|
| 81 | ctcsw = TRUE;
|
---|
| 82 | vsetav(obj9, CurLine + 7, stccol, C_ULINE, 48);
|
---|
| 83 | }
|
---|
| 84 | }
|
---|
| 85 |
|
---|
| 86 | /* |
---|
| 87 |
|
---|
| 88 | */
|
---|
| 89 |
|
---|
| 90 | /*
|
---|
| 91 | =============================================================================
|
---|
| 92 | mtcpos() -- position the menu text cursor at ('row', 'col')
|
---|
[7258c6a] | 93 | =============================================================================
|
---|
[f40a309] | 94 | */
|
---|
| 95 |
|
---|
| 96 | void mtcpos(int16_t row, int16_t col)
|
---|
| 97 | {
|
---|
| 98 | if (v_regs[5] & 0x0180) /* point at the control bank */
|
---|
| 99 | vbank(0);
|
---|
| 100 |
|
---|
| 101 | if (inrange(mtcoldr, 19, 23)) { /* turn off old cursor */
|
---|
| 102 |
|
---|
| 103 | vclrav(obj11, mtcoldr - 18, mtcoldc, C_ULINE, 64);
|
---|
| 104 |
|
---|
| 105 | mtcoldr = 0; /* void old cursor location */
|
---|
| 106 | mtcoldc = 0;
|
---|
| 107 | }
|
---|
| 108 |
|
---|
| 109 | if (inrange(row, 19, 23)) { /* turn on new cursor */
|
---|
| 110 |
|
---|
| 111 | vsetav(obj11, row - 18, col, C_ULINE, 64);
|
---|
| 112 |
|
---|
| 113 | mtcoldr = row; /* keep track of new cursor */
|
---|
| 114 | mtcoldc = col;
|
---|
| 115 | }
|
---|
| 116 |
|
---|
| 117 | vtcrow = row; /* update cursor position */
|
---|
| 118 | vtccol = col;
|
---|
| 119 | }
|
---|
| 120 |
|
---|
| 121 | /*
|
---|
| 122 | =============================================================================
|
---|
| 123 | mtcoff() -- turn off the menu text cursor
|
---|
[0580615] | 124 | =============================================================================
|
---|
[f40a309] | 125 | */
|
---|
| 126 |
|
---|
| 127 | void mtcoff(void)
|
---|
| 128 | {
|
---|
| 129 | if (v_regs[5] & 0x0180) /* point at the control bank */
|
---|
| 130 | vbank(0);
|
---|
| 131 |
|
---|
[6262b5c] | 132 | if (inrange(mtcoldr, 19, 23)) /* turn off cursor */
|
---|
| 133 | vclrav(obj11, mtcoldr - 18, mtcoldc, C_ULINE, 64);
|
---|
| 134 | }
|
---|
| 135 |
|
---|