[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Graphics Hacks, Part II
Michael A. Balfour wrote:
> How the heck does hi-res graphics work???
>
> Case 1: poke a 127 into memory, with a 255 underneath it. You see the
> following, where each X represents a half-pixel.
> XXXXXXXXXXXXXX
> XXXXXXXXXXXXX
[very interesting stuff deleted; see original message]
It takes a bit of experimenting to find out, but the rules of the half
pixel in between two bytes are as follows:
- If a byte is less than 128, it starts on a whole pixel boundary
- If a byte is 128 or greater, it starts a half pixel to the right,
extending the last half pixel of the previous byte, regardless of
whether this byte was greater than 128.
So, representing a half black pixel by . and a half white pixel by X, a
value of 64 followed by a value of 0 looks like this:
............XX..............
and a value of 64 followed by 128 looks like this:
............XXX.............
Similarly, if you poke 192 and 0, and underneath it 192 and 128, you
get:
............X..............
............XX.............
The only way you can get a half pixel sized gap, is to shift the left
byte, not to shift the right byte, and leave the rightmost pixel of the
left byte black. E.g. poke 160 and 1:
..........XX.XX............
That's about it. Hope this clarifies things a bit. If you have any other
questions, just ask. But please don't ask me to explain the 16 color
scheme of double hires. ;-)
--
Pim Blokland
if replying by e-mail, replace the DOT in my name with a dot.