-
Notifications
You must be signed in to change notification settings - Fork 0
/
screen.h
91 lines (78 loc) · 1.66 KB
/
screen.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
typedef struct Cursor Cursor;
typedef struct LCDmode LCDmode;
typedef struct LCDparam LCDparam;
typedef struct Vdisplay Vdisplay;
typedef struct Vmode Vmode;
typedef struct SWcursor SWcursor;
#define CURSWID 16
#define CURSHGT 16
struct Cursor {
Point offset;
uchar clr[CURSWID/BI2BY*CURSHGT];
uchar set[CURSWID/BI2BY*CURSHGT];
};
struct Vmode {
int x; /* 0 -> default or any match for all fields */
int y;
uchar depth;
uchar hz;
};
struct Vdisplay {
ushort* fb; /* frame buffer */
ushort* sfb; /* soft frame buffer */
ushort* upper;
ushort* lower;
ulong colormap[256][3];
int bwid;
Lock;
Vmode;
};
struct LCDparam {
uchar pbs;
uchar dual;
uchar mono;
uchar active;
uchar hsync_wid;
uchar sol_wait;
uchar eol_wait;
uchar vsync_hgt;
uchar sof_wait;
uchar eof_wait;
uchar lines_per_int;
uchar palette_delay;
uchar acbias_lines;
uchar obits;
uchar vsynclow;
uchar hsynclow;
};
struct LCDmode {
Vmode;
LCDparam;
};
int archlcdmode(LCDmode*);
Vdisplay *lcd_init(LCDmode*);
void lcd_setcolor(ulong, ulong, ulong, ulong);
void lcd_flush(void);
void flushmemscreen(Rectangle r);
void blankscreen(int);
void drawblankscreen(int);
Point mousexy(void);
extern ulong blanktime;
// needed by port/swcursor.c
enum
{
Backgnd = 0xFF, /* white */
Foregnd = 0x00, /* black */
};
extern Vdisplay *vd;
extern SWcursor *swc;
extern Memimage *gscreen;
SWcursor* swcurs_create(ulong *, int, int, Rectangle, int);
void swcurs_destroy(SWcursor*);
void swcurs_enable(SWcursor*);
void swcurs_disable(SWcursor*);
void swcurs_hide(SWcursor*);
void swcurs_unhide(SWcursor*);
void swcurs_load(SWcursor*, Cursor*);
void swcursupdate(int, int, int, int);
void cursorupdate(Rectangle);