/*_|_| MODE12H.CPP PUBLIC DOMAIN ( part 2 of 4 )
_|_|_| Simple demonstration of pixel manipulation
_|_|_| in 640x480x16 video mode 12h.
_|_|_| Kurt Kuzba (5/13/1998)*/
void Mode12h::PutPixel(int y, int x, int color)
{
unsigned char far *V = (unsigned char far*)0xa0000000l;
int bit = g_iPix[y & 7], bitmask = g_iPox[y & 7];
V += ((x * 80) + y / 8);
if(y = 640 || x >= 480)
return;
_asm {
mov dx, 3ceh
mov al, 04h
out dx, al
mov dx, 3c4h
mov al, 02h
out dx, al
mov dx, 3cfh
mov al, 00h
out dx, al
mov dx, 3c5h
mov al, 01h
out dx, al
}
if(color & 1)
{
*V |= bit;
}
else
*V &= bitmask;
_asm {
mov dx, 3cfh
mov al, 01h
out dx, al
mov dx, 3c5h
mov al, 02h
out dx, al
}
if(color & 2)
{
*V |= bit;
}
else
*V &= bitmask;
_asm {
mov dx, 3cfh
mov al, 02h
out dx, al
mov dx, 3c5h
mov al, 04h
out dx, al
}
if(color & 4)
{
*V |= bit;
}
else
*V &= bitmask;
_asm {
mov dx, 3cfh
mov al, 03h
out dx, al
mov dx, 3c5h
mov al, 08h
out dx, al
}
if(color & 8)
{
*V |= bit;
}
else
*V &= bitmask;
}
/*_|_| end MODE12H.CPP PUBLIC DOMAIN ( part 2 of 4 )*/
> ] Within every pearl there lies a tiny grain of truth.........
---
---------------
* Origin: *YOPS ]I[* 8.4 GIG * RA/FD/FE * Milwaukee, WI (1:154/750)
|