2 #include "../port/lib.h"
7 #include "../port/error.h"
16 Xrx = 0x3D6, /* Configuration Extensions Index */
20 hiqvideoxi(long port, uchar index)
31 hiqvideoxo(long port, uchar index, uchar data)
38 hiqvideolinear(VGAscr*, int, int)
43 hiqvideoenable(VGAscr* scr)
49 * Only once, can't be disabled for now.
53 if(p = pcimatch(nil, 0x102C, 0)){
55 case 0x00C0: /* 69000 HiQVideo */
58 case 0x00E0: /* 65550 HiQV32 */
59 case 0x00E4: /* 65554 HiQV32 */
60 case 0x00E5: /* 65555 HiQV32 */
61 switch((hiqvideoxi(Xrx, 0x43)>>1) & 0x03){
82 addvgaseg("hiqvideoscreen", scr->paddr, scr->apsize);
86 * Find a place for the cursor data in display memory.
87 * Must be on a 4096-byte boundary.
88 * scr->mmio holds the virtual address of the cursor
89 * storage area in the framebuffer region.
91 scr->storage = vmsize-4096;
92 scr->mmio = (ulong*)((uchar*)scr->vaddr+scr->storage);
96 hiqvideocurdisable(VGAscr*)
98 hiqvideoxo(Xrx, 0xA0, 0x10);
102 hiqvideocurload(VGAscr* scr, Cursor* curs)
108 * Disable the cursor.
110 hiqvideocurdisable(scr);
114 p = (uchar*)scr->mmio;
116 for(y = 0; y < 16; y += 2){
117 *p++ = ~(curs->clr[2*y]|curs->set[2*y]);
118 *p++ = ~(curs->clr[2*y+1]|curs->set[2*y+1]);
121 *p++ = ~(curs->clr[2*y+2]|curs->set[2*y+2]);
122 *p++ = ~(curs->clr[2*y+3]|curs->set[2*y+3]);
125 *p++ = curs->set[2*y];
126 *p++ = curs->set[2*y+1];
129 *p++ = curs->set[2*y+2];
130 *p++ = curs->set[2*y+3];
135 for(x = 0; x < 64; x += 8)
137 for(x = 0; x < 64; x += 8)
143 * Save the cursor hotpoint and enable the cursor.
145 scr->offset = curs->offset;
146 hiqvideoxo(Xrx, 0xA0, 0x11);
150 hiqvideocurmove(VGAscr* scr, Point p)
157 if((x = p.x+scr->offset.x) < 0)
158 x = 0x8000|(-x & 0x07FF);
159 if((y = p.y+scr->offset.y) < 0)
160 y = 0x8000|(-y & 0x07FF);
162 hiqvideoxo(Xrx, 0xA4, x & 0xFF);
163 hiqvideoxo(Xrx, 0xA5, (x>>8) & 0xFF);
164 hiqvideoxo(Xrx, 0xA6, y & 0xFF);
165 hiqvideoxo(Xrx, 0xA7, (y>>8) & 0xFF);
171 hiqvideocurenable(VGAscr* scr)
180 * Disable the cursor.
182 hiqvideocurdisable(scr);
186 * Can't call setcolor here as cursor is already locked.
187 * When done make sure the cursor enable in Xr80 is set.
189 xr80 = hiqvideoxi(Xrx, 0x80);
190 hiqvideoxo(Xrx, 0x80, xr80|0x01);
198 hiqvideoxo(Xrx, 0x80, xr80|0x10);
200 hiqvideoxo(Xrx, 0xA2, (scr->storage>>12)<<4);
201 hiqvideoxo(Xrx, 0xA3, (scr->storage>>16) & 0x3F);
204 * Load, locate and enable the 32x32 cursor.
205 * Cursor enable in Xr80 better be set already.
207 hiqvideocurload(scr, &arrow);
208 hiqvideocurmove(scr, ZP);
209 hiqvideoxo(Xrx, 0xA0, 0x11);
212 VGAdev vgahiqvideodev = {
215 hiqvideoenable, /* enable */
218 hiqvideolinear, /* linear */
221 VGAcur vgahiqvideocur = {
224 hiqvideocurenable, /* enable */
225 hiqvideocurdisable, /* disable */
226 hiqvideocurload, /* load */
227 hiqvideocurmove, /* move */