2 #include "../port/lib.h"
7 #include "../port/error.h"
15 typedef struct Cursor546x Cursor546x;
30 clgd546xlinear(VGAscr* scr, int, int)
36 clgd546xenable(VGAscr* scr)
45 scr->mmio = vmap(p->mem[1].bar&~0x0F, p->mem[1].size);
48 addvgaseg("clgd546xmmio", p->mem[1].bar&~0x0F, p->mem[1].size);
52 clgd546xcurdisable(VGAscr* scr)
54 Cursor546x *cursor546x;
58 cursor546x = (Cursor546x*)((uchar*)scr->mmio+CursorMMIO);
59 cursor546x->enable = 0;
63 clgd546xcurload(VGAscr* scr, Cursor* curs)
67 Cursor546x *cursor546x;
71 cursor546x = (Cursor546x*)((uchar*)scr->mmio+CursorMMIO);
74 * Disable the cursor then change only the bits
77 cursor546x->enable = 0;
78 p = (uchar*)scr->vaddr + scr->storage;
79 for(y = 0; y < 16; y++){
82 for(i = 0; i < 8; i++){
87 c = curs->set[2*y + 1];
89 for(i = 0; i < 8; i++){
95 c = curs->set[2*y]|curs->clr[2*y];
97 for(i = 0; i < 8; i++){
102 c = curs->set[2*y + 1]|curs->clr[2*y + 1];
104 for(i = 0; i < 8; i++){
113 * Save the cursor hotpoint and enable the cursor.
115 scr->offset = curs->offset;
116 cursor546x->enable = 1;
120 clgd546xcurmove(VGAscr* scr, Point p)
123 Cursor546x *cursor546x;
127 cursor546x = (Cursor546x*)((uchar*)scr->mmio+CursorMMIO);
129 if((x = p.x+scr->offset.x) < 0){
135 if((y = p.y+scr->offset.y) < 0){
142 cursor546x->preset = (xo<<8)|yo;
150 clgd546xcurenable(VGAscr* scr)
153 Cursor546x *cursor546x;
158 cursor546x = (Cursor546x*)((uchar*)scr->mmio+CursorMMIO);
162 * Can't call setcolor here as cursor is already locked.
164 p = (uchar*)scr->mmio+PaletteState;
177 * Find a place for the cursor data in display memory.
178 * 2 cursor images might be needed, 1KB each so use the last
179 * 2KB of the framebuffer and initialise them to be
182 scr->storage = ((vgaxi(Seqx, 0x14) & 0x07)+1)*1024*1022;
183 cursor546x->addr = (scr->storage>>10)<<2;
184 memset((uchar*)scr->vaddr + scr->storage, 0, 2*64*16);
187 * Load, locate and enable the 64x64 cursor.
189 clgd546xcurload(scr, &cursor);
190 clgd546xcurmove(scr, ZP);
191 cursor546x->enable = 1;
194 VGAdev vgaclgd546xdev = {
203 VGAcur vgaclgd546xcur = {