9fans archive / 1995 / 12 / 61 /    prev next

From: Rob Pike  rob@pla...
Subject: Do bitblt function codes work?
Date: Thu, 21 Dec 1995 13:53:56 -0500

> From: nsof.co.IL!amos (Amos Shapir)

> On a PC with vga and "out of the box" drivers, the following program
> generates only 4 distinct images, not 16.  It seems somewhere along
> the line to/from the bitblt server, the lower two bits of the function
> codes get hardwired to (binary)10.

This is correct behavior.  Since you're drawing the line with code 
		segment(d, Pt(mid.x, r.min.y), Pt(mid.x, r.max.y), ~0, t);
using drawing function 0<=t<=15, you might expect 16 different
results.  But since the source function is the constant ~0, not a general
value, symmetries fold up and the number of results is reduced.
The possible answers are 0->0, 0->1, 1->0, and 1->1.  It is not
the full matrix of possibilities because the source is a single value (1).

For related information, see the comment in /sys/src/libgnot/gsegment.c.

-rob