![]()
|
The PDF Version 

void Unchain()
{asm (" movw $0x3c4,%%dx
movw $0x604,%%ax
out %%ax,%%dx
movw $0xf02,%%ax
out %%ax,%%dx
movw $0x3d4,%%dx
movw $0x0014,%%ax
out %%ax,%%dx
movw $0xE317,%%ax
out %%ax,%%dx
"
:
:
:"%ax","dx");
}
|
void Unchain()
{ outpw(0x3c4,0x604);
outpw(0x3c4,0xf02);
outpw(0x3d4,0x0014);
outpw(0x3d4,0xe317);
} |
outp(0x3c4,0x02); outp(0x3c5,(0x01<<plane));With two outp commands we select the second index under the Sequence Controller (0x3c4) which is the Map Mask Register (0x2) , which controls which plane we are allowed to write to. If we set all bits or send a 0xf to port 0x3c5, then any 8 bit value we write will set all 4 pixels to that value. This is great for quick clearscreen functions! In our function, plane is the plane we want to set. To move an offscreen buffer to Video Ram in Unchained Mode, it would look something like this.
void MoveBuffer()
{ long bufferposition;
for(short position=0;position < 64; position++)
{ for(short planenumber=0; planenumber<4; planenumber++,bufferposition++)
{ outp(0x3c4,0x02);
outp(0x3c5,(0x01<<planenumber));
memset(0xa000+position,buffer[bufferposition],1);
}
}
} |