2 typedef struct Cursor Cursor;
4 extern void mousetrack(int, int, int, ulong);
5 extern void absmousetrack(int, int, int, ulong);
6 extern Point mousexy(void);
8 extern void mouseaccelerate(int);
9 extern int m3mouseputc(Queue*, int);
10 extern int m5mouseputc(Queue*, int);
11 extern int mouseputc(Queue*, int);
14 * Generic VGA registers.
17 MiscW = 0x03C2, /* Miscellaneous Output (W) */
18 MiscR = 0x03CC, /* Miscellaneous Output (R) */
19 Status0 = 0x03C2, /* Input status 0 (R) */
20 Status1 = 0x03DA, /* Input Status 1 (R) */
21 FeatureR = 0x03CA, /* Feature Control (R) */
22 FeatureW = 0x03DA, /* Feature Control (W) */
24 Seqx = 0x03C4, /* Sequencer Index, Data at Seqx+1 */
25 Crtx = 0x03D4, /* CRT Controller Index, Data at Crtx+1 */
26 Grx = 0x03CE, /* Graphics Controller Index, Data at Grx+1 */
27 Attrx = 0x03C0, /* Attribute Controller Index and Data */
29 PaddrW = 0x03C8, /* Palette Address Register, write */
30 Pdata = 0x03C9, /* Palette Data Register */
31 Pixmask = 0x03C6, /* Pixel Mask Register */
32 PaddrR = 0x03C7, /* Palette Address Register, read */
33 Pstatus = 0x03C7, /* DAC Status (RO) */
35 Pcolours = 256, /* Palette */
44 #define VGAMEM() 0xA0000
45 #define vgai(port) inb(port)
46 #define vgao(port, data) outb(port, data)
48 extern int vgaxi(long, uchar);
49 extern int vgaxo(long, uchar, uchar);
53 typedef struct VGAdev VGAdev;
54 typedef struct VGAcur VGAcur;
55 typedef struct VGAscr VGAscr;
60 void (*enable)(VGAscr*);
61 void (*disable)(VGAscr*);
62 void (*page)(VGAscr*, int);
63 void (*linear)(VGAscr*, int, int);
64 void (*drawinit)(VGAscr*);
65 int (*fill)(VGAscr*, Rectangle, ulong);
66 void (*ovlctl)(VGAscr*, Chan*, void*, int);
67 int (*ovlwrite)(VGAscr*, void*, int, vlong);
68 void (*flush)(VGAscr*, Rectangle);
74 void (*enable)(VGAscr*);
75 void (*disable)(VGAscr*);
76 void (*load)(VGAscr*, Cursor*);
77 int (*move)(VGAscr*, Point);
95 uintptr paddr; /* frame buffer */
99 ulong io; /* device specific registers */
102 ulong colormap[Pcolours][3];
106 Memdata* gscreendata;
107 Memsubfont* memdefont;
109 int (*fill)(VGAscr*, Rectangle, ulong);
110 int (*scroll)(VGAscr*, Rectangle, Rectangle);
111 void (*blank)(VGAscr*, int);
112 ulong id; /* internal identifier for driver use */
117 extern VGAscr vgascreen[];
120 Backgnd = 0, /* black */
124 extern void mousectl(Cmdbuf*);
125 extern void mouseresize(void);
126 extern void mouseredraw(void);
129 extern int hwaccel; /* use hw acceleration */
130 extern int hwblank; /* use hw blanking */
131 extern int panning; /* use virtual screen panning */
132 extern void addvgaseg(char*, ulong, ulong);
133 extern Memdata* attachscreen(Rectangle*, ulong*, int*, int*, int*);
134 extern void flushmemscreen(Rectangle);
135 extern void cursoron(void);
136 extern void cursoroff(void);
137 extern void setcursor(Cursor*);
138 extern int screensize(int, int, int, ulong);
139 extern int screenaperture(int, int);
140 extern Rectangle physgscreenr; /* actual monitor size */
141 extern void blankscreen(int);
142 extern char* rgbmask2chan(char *buf, int depth, u32int rm, u32int gm, u32int bm);
143 extern void bootscreeninit(void);
144 extern void bootscreenconf(VGAscr*);
147 extern void deletescreenimage(void);
148 extern void resetscreenimage(void);
149 extern void setscreenimageclipr(Rectangle);
150 extern void drawflush(void);
151 extern QLock drawlock;
154 extern void vgascreenwin(VGAscr*);
155 extern void vgaimageinit(ulong);
156 extern void vgalinearpci(VGAscr*);
157 extern void vgalinearaddr(VGAscr*, ulong, int);
158 extern void vgablank(VGAscr*, int);
159 extern Lock vgascreenlock;
161 #define ishwimage(i) (vgascreen[0].gscreendata && (i)->data->bdata == vgascreen[0].gscreendata->bdata)
164 void swcursorhide(int);
165 void swcursoravoid(Rectangle);
166 void swcursordraw(Point);
167 void swcursorload(Cursor *);
168 void swcursorinit(void);