2 #include "../port/lib.h"
7 #include "../port/error.h"
16 ark2000pvpageset(VGAscr*, int page)
20 seq15 = vgaxi(Seqx, 0x15);
21 vgaxo(Seqx, 0x15, page);
22 vgaxo(Seqx, 0x16, page);
28 ark2000pvpage(VGAscr* scr, int page)
31 ark2000pvpageset(scr, page);
32 unlock(&scr->devlock);
36 ark2000pvdisable(VGAscr*)
40 seq20 = vgaxi(Seqx, 0x20) & ~0x08;
41 vgaxo(Seqx, 0x20, seq20);
45 ark2000pvenable(VGAscr* scr)
51 * Disable the cursor then configure for X-Windows style,
52 * 32x32 and 4/8-bit colour depth.
53 * Set cursor colours for 4/8-bit.
55 seq20 = vgaxi(Seqx, 0x20) & ~0x1F;
56 vgaxo(Seqx, 0x20, seq20);
59 vgaxo(Seqx, 0x26, 0x00);
60 vgaxo(Seqx, 0x27, 0x00);
61 vgaxo(Seqx, 0x28, 0x00);
62 vgaxo(Seqx, 0x29, 0xFF);
63 vgaxo(Seqx, 0x2A, 0xFF);
64 vgaxo(Seqx, 0x2B, 0xFF);
67 * Cursor storage is a 256 byte or 1Kb block located in the last
68 * 16Kb of video memory. Crt25 is the index of which block.
70 storage = (vgaxi(Seqx, 0x10)>>6) & 0x03;
71 storage = (1024*1024)<<storage;
73 scr->storage = storage;
74 vgaxo(Seqx, 0x25, 0x3F);
79 vgaxo(Seqx, 0x20, seq20);
83 ark2000pvload(VGAscr* scr, Cursor* curs)
89 * Is linear addressing turned on? This will determine
90 * how we access the cursor storage.
92 seq10 = vgaxi(Seqx, 0x10);
97 opage = ark2000pvpageset(scr, scr->storage>>16);
98 p += (scr->storage & 0xFFFF);
104 * The cursor is set in X11 mode which gives the following
107 * 0 0 underlying pixel colour
108 * 0 1 underlying pixel colour
109 * 1 0 background colour
110 * 1 1 foreground colour
111 * Put the cursor into the top-left of the 32x32 array.
112 * The manual doesn't say what the data layout in memory is -
113 * this worked out by trial and error.
115 for(y = 0; y < 32; y++){
116 for(x = 0; x < 32/8; x++){
117 if(x < 16/8 && y < 16){
118 *p++ = curs->clr[2*y + x]|curs->set[2*y + x];
119 *p++ = curs->set[2*y + x];
129 ark2000pvpageset(scr, opage);
130 unlock(&scr->devlock);
134 * Save the cursor hotpoint.
136 scr->offset = curs->offset;
140 ark2000pvmove(VGAscr* scr, Point p)
145 * Mustn't position the cursor offscreen even partially,
146 * or it might disappear. Therefore, if x or y is -ve, adjust the
147 * cursor origins instead.
149 if((x = p.x+scr->offset.x) < 0){
155 if((y = p.y+scr->offset.y) < 0){
163 * Load the new values.
165 vgaxo(Seqx, 0x2C, xo);
166 vgaxo(Seqx, 0x2D, yo);
167 vgaxo(Seqx, 0x21, (x>>8) & 0x0F);
168 vgaxo(Seqx, 0x22, x & 0xFF);
169 vgaxo(Seqx, 0x23, (y>>8) & 0x0F);
170 vgaxo(Seqx, 0x24, y & 0xFF);
175 VGAdev vgaark2000pvdev = {
184 VGAcur vgaark2000pvcur = {