* disable the cursor ont he pipe
@ 2016-05-24 6:01 kokamoto
0 siblings, 0 replies; only message in thread
From: kokamoto @ 2016-05-24 6:01 UTC (permalink / raw)
To: 9front
Following the manuaql, they say we must disable the cursor
before loading cursor date, and then enable it.
I tested two cases:
Both tests failed, and resulted into the same results before.
1)
igfxcurload(VGAscr* scr, Cursor* curs)
{
uchar set, clr;
u32int *p, *r;
int i, j;
if(scr->storage == 0)
return;
print("calling curload\n");
for(i=0; i<3; i++) { /* disable the Pipe cursor */
if((scr->mmio[(0x70008 | (i*0x1000))/4] & (1<<31)) != 0) {
scr->mmio[(0x70008 | (i*0x1000))/4] |= 1<<18;
print("Cursor i=%d disabled\n", i);
}
}
p = (u32int*)((uchar*)scr->vaddr + scr->storage);
memset(p, 0, 64*64*4);
for(i=0;i<32;i++) {
set = curs->set[i];
clr = curs->clr[i];
for(j=0x80; j; j>>=1){
if((set|clr)&j)
*p++ = (0xFF<<24) | (set&j ? 0x000000 : 0xFFFFFF);
else
*p++ = 0;
}
if(i & 1)
p += 64-16;
}
for(i=0; i<3; i++) { /* enable the Pipe cursor */
if((scr->mmio[(0x70008 | (i*0x1000))/4] & (1<<31)) != 0) {
scr->mmio[(0x70008 | (i*0x1000))/4] &= 0xFFFBFFFF;
print("Cursor i=%d enabled\n", i);
}
}
scr->offset = curs->offset;
}
2)
igfxcurload(VGAscr* scr, Cursor* curs)
{
uchar set, clr;
u32int *p, *r;
int i, j;
if(scr->storage == 0)
return;
print("calling curload\n");
for(i=0; i<NPIPE; i++){
if((r = igfxcurregs(scr, i)) != nil) {
r[CURCTL] &= ~(1<<5 | 7); /* disable the cursor */
}
} p = (u32int*)((uchar*)scr->vaddr + scr->storage);
memset(p, 0, 64*64*4);
for(i=0;i<32;i++) {
set = curs->set[i];
clr = curs->clr[i];
for(j=0x80; j; j>>=1){
if((set|clr)&j)
*p++ = (0xFF<<24) | (set&j ? 0x000000 : 0xFFFFFF);
else
*p++ = 0;
}
if(i & 1)
p += 64-16;
}
for(i=0; i<NPIPE; i++){
if((r = igfxcurregs(scr, i)) != nil){
r[CURCTL] = (r[CURCTL] & ~(3<<28 | 1<<5)) | (i<<28) | 7; /* enable the cursor */
r[CURBASE] = scr->storage;
}
scr->offset = curs->offset;
}
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2016-05-24 6:01 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-05-24 6:01 disable the cursor ont he pipe kokamoto
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).