source: buchla-68k/ram/ctcpos.c@ fe7b401

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

Removed form-feed comments.

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