2 #include "../port/lib.h"
7 #include "../port/pci.h"
8 #include "../port/error.h"
16 typedef struct Cursor546x Cursor546x;
31 clgd546xlinear(VGAscr* scr, int, int)
37 clgd546xenable(VGAscr* scr)
48 scr->mmio = vmap(p->mem[1].bar&~0x0F, p->mem[1].size);
51 addvgaseg("clgd546xmmio", p->mem[1].bar&~0x0F, p->mem[1].size);
55 clgd546xcurdisable(VGAscr* scr)
57 Cursor546x *cursor546x;
61 cursor546x = (Cursor546x*)((uchar*)scr->mmio+CursorMMIO);
62 cursor546x->enable = 0;
66 clgd546xcurload(VGAscr* scr, Cursor* curs)
70 Cursor546x *cursor546x;
74 cursor546x = (Cursor546x*)((uchar*)scr->mmio+CursorMMIO);
77 * Disable the cursor then change only the bits
80 cursor546x->enable = 0;
81 p = (uchar*)scr->vaddr + scr->storage;
82 for(y = 0; y < 16; y++){
85 for(i = 0; i < 8; i++){
90 c = curs->set[2*y + 1];
92 for(i = 0; i < 8; i++){
98 c = curs->set[2*y]|curs->clr[2*y];
100 for(i = 0; i < 8; i++){
105 c = curs->set[2*y + 1]|curs->clr[2*y + 1];
107 for(i = 0; i < 8; i++){
116 * Save the cursor hotpoint and enable the cursor.
118 scr->offset = curs->offset;
119 cursor546x->enable = 1;
123 clgd546xcurmove(VGAscr* scr, Point p)
126 Cursor546x *cursor546x;
130 cursor546x = (Cursor546x*)((uchar*)scr->mmio+CursorMMIO);
132 if((x = p.x+scr->offset.x) < 0){
138 if((y = p.y+scr->offset.y) < 0){
145 cursor546x->preset = (xo<<8)|yo;
153 clgd546xcurenable(VGAscr* scr)
156 Cursor546x *cursor546x;
161 cursor546x = (Cursor546x*)((uchar*)scr->mmio+CursorMMIO);
165 * Can't call setcolor here as cursor is already locked.
167 p = (uchar*)scr->mmio+PaletteState;
180 * Find a place for the cursor data in display memory.
181 * 2 cursor images might be needed, 1KB each so use the last
182 * 2KB of the framebuffer and initialise them to be
185 scr->storage = ((vgaxi(Seqx, 0x14) & 0x07)+1)*1024*1022;
186 cursor546x->addr = (scr->storage>>10)<<2;
187 memset((uchar*)scr->vaddr + scr->storage, 0, 2*64*16);
190 * Load, locate and enable the 64x64 cursor.
192 clgd546xcurload(scr, &cursor);
193 clgd546xcurmove(scr, ZP);
194 cursor546x->enable = 1;
197 VGAdev vgaclgd546xdev = {
206 VGAcur vgaclgd546xcur = {