source: buchla-68k/ram/ttcpos.c@ e225e77

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

Added missing includes and declarations.

  • Property mode set to 100644
File size: 2.5 KB
Line 
1/*
2 =============================================================================
3 ttcpos.c -- virtual typewriter cursor positioning
4 Version 9 -- 1988-03-08 -- D.N. Lynx Crowe
5 =============================================================================
6*/
7
8#include "stddefs.h"
9#include "graphdef.h"
10#include "vsdd.h"
11#include "vsddsw.h"
12#include "vsddvars.h"
13#include "hwdefs.h"
14#include "memory.h"
15#include "fields.h"
16
17#include "midas.h"
18#include "libdsp.h"
19
20#define CW_0 0x0000
21#define CW_F 0xFFFF
22
23extern uint16_t exp_c(uint16_t c);
24
25extern void andcopy(uint16_t *to, uint16_t *from, uint16_t with, int16_t len);
26
27extern int16_t vtcrow; /* virtual typewriter cursor row */
28extern int16_t vtccol; /* virtual typewriter cursor column */
29
30/*
31
32*/
33
34static int16_t ttcur[] = {
35
36 CW_0, CW_0, CW_0, CW_0, /* 0 */
37 CW_0, CW_0, CW_0, CW_0, /* 1 */
38 CW_0, CW_0, CW_0, CW_0, /* 2 */
39 CW_0, CW_0, CW_0, CW_0, /* 3 */
40 CW_0, CW_0, CW_0, CW_0, /* 4 */
41 CW_0, CW_0, CW_0, CW_0, /* 5 */
42 CW_0, CW_0, CW_0, CW_0, /* 6 */
43 CW_0, CW_0, CW_0, CW_0, /* 7 */
44 CW_0, CW_0, CW_0, CW_0, /* 8 */
45 CW_0, CW_0, CW_0, CW_0, /* 9 */
46 CW_0, CW_0, CW_0, CW_0, /* 10 */
47 CW_0, CW_0, CW_0, CW_0, /* 11 */
48 CW_F, CW_F, CW_0, CW_0, /* 12 */
49 CW_0, CW_0, CW_0, CW_0, /* 13 */
50 CW_0, CW_0, CW_0, CW_0, /* 14 */
51 CW_0, CW_0, CW_0, CW_0 /* 15 */
52};
53
54/*
55
56*/
57
58/*
59 =============================================================================
60 ttcini() -- initialize typewriter cursor
61 =============================================================================
62*/
63
64void ttcini(uint16_t color)
65{
66 if ((v_regs[5] & 0x0180) NE 0x0100)
67 vbank(1);
68
69 andcopy(v_tcur, ttcur, exp_c(color), 64);
70}
71
72/*
73 =============================================================================
74 ttcpos() -- position the typewriter cursor at ('row', 'col')
75 =============================================================================
76*/
77
78void ttcpos(int16_t row, int16_t col)
79{
80 register int16_t yrow, xcol;
81 register struct octent *op;
82
83 if (v_regs[5] & 0x0180) /* point at the control bank */
84 vbank(0);
85
86 yrow = row * 14; /* get cursor display position */
87 xcol = col << 3;
88
89 op = &v_obtab[TTCURS]; /* point at v_obtab entry */
90
91 v_odtab[TTCPRI][0] |= V_BLA; /* blank the object */
92 objclr(TTCPRI); /* turn off the old location */
93
94 op->objx = xcol; /* update v_obtab entry */
95 op->objy = yrow;
96 op->odtw1 = 0x0400 | (0x03FF & (xcol >> 1));
97
98 SetPri(TTCURS, TTCPRI); /* turn on the new location */
99
100 vtcrow = row; /* update cursor position variables */
101 vtccol = col;
102}
Note: See TracBrowser for help on using the repository browser.