richard@gryphon.CTS.COM (Richard Sexton) (06/24/88)
this is froma kaleidoscope program and therfore has symetry
to it, but you can get the gist of it I'm sure.
plotpoint (ix,iy)
USHORT ix,iy;
{
static UBYTE masks[8] = {128, 64, 32, 16, 8, 4, 2, 1};
register temp1, temp2, temp3, temp4;
register USHORT row1, col1, mask1, row2, col2, mask2;
USHORT tt1x;
col1 = (tt1x = xres2 - ix) / 8;
col2 = (bpr - 1) - col1;
row1 = (yres2 - iy) * bpr;
row2 = bigrows - row1;
mask1 = masks[tt1x = (tt1x - (col1 * 8))];
mask2 = masks[7 - tt1x];
temp1 = row1 + col1; temp2 = row1 + col2;
temp3 = row2 + col1; temp4 = row2 + col2;
if (color & 1)
{
*(pln0 + temp1) |= mask1;
*(pln0 + temp2) |= mask2;
*(pln0 + temp3) |= mask1;
*(pln0 + temp4) |= mask2;
}
if (color & 2)
{
*(pln1 + temp1) |= mask1;
*(pln1 + temp2) |= mask2;
*(pln1 + temp3) |= mask1;
*(pln1 + temp4) |= mask2;
}
if (color & 4)
{
*(pln2 + temp1) |= mask1;
*(pln2 + temp2) |= mask2;
*(pln2 + temp3) |= mask1;
*(pln2 + temp4) |= mask2;
}
if (color & 8)
{
*(pln3 + temp1) |= mask1;
*(pln3 + temp2) |= mask2;
*(pln3 + temp3) |= mask1;
*(pln3 + temp4) |= mask2;
}
if (color & 16)
{
*(pln4 + temp1) |= mask1;
*(pln4 + temp2) |= mask2;
*(pln4 + temp3) |= mask1;
*(pln4 + temp4) |= mask2;
}
if (color & 32)
{
*(pln5 + temp1) |= mask1;
*(pln5 + temp2) |= mask2;
*(pln5 + temp3) |= mask1;
*(pln5 + temp4) |= mask2;
}
}
--
"Oh great. I have no mouse. And I must click."
richard@gryphon.CTS.COM {backbone}!gryphon!richard