source: buchla-68k/ram/setgc.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: 1.5 KB
Line 
1/*
2 =============================================================================
3 setgc.c -- set cursors and keep them in sync
4 Version 2 -- 1988-08-19 -- D.N. Lynx Crowe
5 =============================================================================
6*/
7
8#include "stddefs.h"
9#include "curpak.h"
10#include "fields.h"
11
12extern int16_t infield(int16_t row, int16_t col, struct fet *fetp);
13
14extern int16_t gcurpos(int16_t xloc, int16_t yloc);
15extern void itcpos(int16_t row, int16_t col);
16
17extern int16_t cmtype;
18extern int16_t cxval;
19extern int16_t cyval;
20extern int16_t sgcsw;
21extern int16_t stccol;
22extern int16_t stcrow;
23
24/*
25 =============================================================================
26 setgc() -- set graphics cursor
27 =============================================================================
28*/
29
30void setgc(int16_t xv, int16_t yv)
31{
32 gcurpos(xv, yv);
33
34 cxval = xv;
35 cyval = yv;
36
37 stcrow = yv / 14;
38 stccol = xv >> 3;
39
40 sgcsw = TRUE;
41 cmtype = CT_GRAF;
42
43 if (infield(stcrow, stccol, curfet))
44 cfetp = infetp;
45 else
46 cfetp = (struct fet *)NULL;
47}
48
49/*
50
51*/
52
53/*
54 =============================================================================
55 settc() -- set text cursor
56 =============================================================================
57*/
58
59void settc(int16_t rv, int16_t cv)
60{
61 itcpos(rv, cv);
62
63 stcrow = rv;
64 stccol = cv;
65
66 cyval = rv * 14;
67 cxval = cv << 3;
68
69 sgcsw = FALSE;
70 cmtype = CT_TEXT;
71
72 if (infield(stcrow, stccol, curfet))
73 cfetp = infetp;
74 else
75 cfetp = (struct fet *)NULL;
76}
Note: See TracBrowser for help on using the repository browser.