| plan 9 kernel history: overview | file list | diff list |
1994/0804/pc/vgas3.c (diff list | history)
| 1994/0803/sys/src/9/pc/vgas3.c:16,21 – 1994/0804/sys/src/9/pc/vgas3.c:16,22 (short | long | prev | next) | ||
| 1994/0803 | */ static Lock s3pagelock; static ulong storage; | |
| 1994/0804 | static Point hotpoint; | |
| 1994/0803 | extern Bitmap gscreen; | |
| 1994/0803/sys/src/9/pc/vgas3.c:80,94 – 1994/0804/sys/src/9/pc/vgas3.c:81,96 | ||
| 1994/0803 | /* * Cursor colours. Set both the CR0[EF] and the colour * stack in case we are using a 16-bit RAMDAC. | |
| 1994/0804 | * Why are these colours reversed? | |
| 1994/0803 | */ | |
| 1994/0804 | vgaxo(Crtx, 0x0E, 0xFF); vgaxo(Crtx, 0x0F, 0x00); | |
| 1994/0803 | vgaxi(Crtx, 0x45); for(i = 0; i < 4; i++) | |
| 1994/0804 | vgaxo(Crtx, 0x4A, 0xFF); | |
| 1994/0803 | vgaxi(Crtx, 0x45); for(i = 0; i < 4; i++) | |
| 1994/0804 | vgaxo(Crtx, 0x4B, 0x00); | |
| 1994/0803 | /* * Find a place for the cursor data in display memory. | |
| 1994/0803/sys/src/9/pc/vgas3.c:110,116 – 1994/0804/sys/src/9/pc/vgas3.c:112,118 | ||
| 1994/0803 | static void load(Cursor *c) { | |
| 1994/0804 | uchar *p; | |
| 1994/0803 | int x, y; /* | |
| 1994/0803/sys/src/9/pc/vgas3.c:118,131 – 1994/0804/sys/src/9/pc/vgas3.c:120,133 | ||
| 1994/0803 | * memory so we can update the cursor bitmap. * Set the display page (do we need to restore * the current contents when done?) and the | |
| 1994/0804 | * pointer to the two planes. What if this crosses * into a new page? | |
| 1994/0803 | */ disable(); lock(&s3pagelock); sets3page(storage>>16); | |
| 1994/0804 | p = ((uchar*)gscreen.base) + (storage & 0xFFFF); | |
| 1994/0803 | /* * The cursor is set in X11 mode which gives the following | |
| 1994/0803/sys/src/9/pc/vgas3.c:138,151 – 1994/0804/sys/src/9/pc/vgas3.c:140,157 | ||
| 1994/0803 | * Put the cursor into the top-left of the 64x64 array. */ for(y = 0; y < 64; y++){ | |
| 1994/0804 | for(x = 0; x < 64/8; x += 2){ if(x < 16/8 && y < 16){ *p++ = c->clr[2*y + x]|c->set[2*y + x]; *p++ = c->clr[2*y + x+1]|c->set[2*y + x+1]; *p++ = c->set[2*y + x]; *p++ = c->set[2*y + x+1]; | |
| 1994/0803 | } else { | |
| 1994/0804 | *p++ = 0x00; *p++ = 0x00; *p++ = 0x00; *p++ = 0x00; | |
| 1994/0803 | } } } | |
| 1994/0803/sys/src/9/pc/vgas3.c:152,161 – 1994/0804/sys/src/9/pc/vgas3.c:158,166 | ||
| 1994/0803 | unlock(&s3pagelock); /* | |
| 1994/0804 | * Set the cursor hotpoint and enable the cursor. | |
| 1994/0803 | */ | |
| 1994/0804 | hotpoint = c->offset; | |
| 1994/0803 | vsyncactive(); vgaxo(Crtx, 0x45, 0x01); } | |
| 1994/0803/sys/src/9/pc/vgas3.c:163,172 – 1994/0804/sys/src/9/pc/vgas3.c:168,200 | ||
| 1994/0803 | static int move(Point p) { | |
| 1994/0804 | int x, xo, y, yo; /* * Mustn't position the cursor offscreen even partially, * or it disappears. Therefore, if x or y is -ve, adjust the * cursor offset instead. */ if((x = p.x+hotpoint.x) < 0){ xo = -x; xo = ((xo+1)/2)*2; x = 0; } else xo = 0; if((y = p.y+hotpoint.y) < 0){ yo = -y; y = 0; } else yo = 0; vgaxo(Crtx, 0x46, (x>>8) & 0x07); vgaxo(Crtx, 0x47, x & 0xFF); vgaxo(Crtx, 0x49, y & 0xFF); vgaxo(Crtx, 0x4E, xo); vgaxo(Crtx, 0x4F, yo); vgaxo(Crtx, 0x48, (y>>8) & 0x07); | |
| 1994/0803 | return 0; } | |