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
RevLine 
[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]10int16_t ctcsw; /* text cursor status */
[f40a309]11
[7258c6a]12int16_t mtcoldc; /* previous cursor column location */
13int16_t mtcoldr; /* previous cursor row location */
[f40a309]14
15/*
16 =============================================================================
17 ctcpos() -- position the patch text cursor at ('row', 'col')
18 =============================================================================
19*/
20
[7258c6a]21void ctcpos(int16_t row, int16_t col)
[f40a309]22{
[7258c6a]23 register int16_t nrow;
[f40a309]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
[0580615]49void ctcoff(void)
[f40a309]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
[0580615]66void ctcon(void)
[f40a309]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
[7258c6a]84void mtcpos(int16_t row, int16_t col)
[f40a309]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
[0580615]115void mtcoff(void)
[f40a309]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}
[6262b5c]123
Note: See TracBrowser for help on using the repository browser.