potatohead
Member
- Joined
- Mar 15, 2025
- Messages
- 24
I was not sure how much this software would let a guy write first thing out the gate, so I am using two comments to be safe.
Back to graphics!
Remember that bitfield and color clock relationship:
CC CC CC C C CC CC CC
PP PP PP P P PP PP PP
8192 8193
S bits ignored as they do not create pixels, just affect them.
And now I come to the final positive! I really like Apple graphics despite their crazy nature and limitations, and I like the Apple graphics because they deliver good color without sacrificing resolution.
I explained all I did about DMA and bytes per line and what not because I wanted to make a subtle, but important point about COLOR RESOLUTION.
The Apple has a 280x192 screen at all times. There is no "4 color" mode that cuts resolution in half to deliver more colors. Instead, there are just pixels and colors.
Try this: Set your HCOLOR = 7. This is basically "white" and it will set any pixel you want to be on. Using other HCOLORS is like a mask. The Apple will only set those pixels associated with a given color, ignoring others. This is nice, but also more confusing at this stage. We just need to turn any pixel we want on or off. HCOLOR = 7 does that.
Now, HPLOT 0,0 and you will see a single, blue pixel. (that is if you do it from a cold boot to insure the high bits are in the same state I am assuming right now.
That's a single, blue pixel. On a good display, it will look half the size of the usual 2 bpp type pixels seen often.
Now HPLOT 2,0 and 4, 0, and 6, 0, and then skip one and do 10, 0 to get another single blue pixel.
Try the same with odd pixels, say on line 5 to see things clearly:
HPLOT 1, 5 3, 5 5, 5 and then 9, 5 to get a single one again.
Now, on those two lines, you can unset any pixel you have set to get black, and you can set an additional one, even and odd together to get white.
The rules are then:
Two sequential unset pixels are black. Two set sequential pixels are white. A single even or odd pixel will be one of two possible colors given the state of the S shift bit.
This is different from a simple 2bpp display. THere can be details not possible on a display with half the resolution and it's this point that makes Apple 2 graphics as flexible as they are! Many patterns are possible to give the illusion of more colors and it's all quite a bit more robust than one might expect at first glance. The game art out there shows it all off pretty well.
So goes the "Total Replay" start screen.
Now, back to that 2 byte group bitfield:
CC CC CC C C CC CC CC
PP PP PP P P PP PP PP
Say we want red. That's an odd pixel, with the S shifter bit set to zero.
We do this, just set every "even" bit, right?
CC CC CC C C CC CC CC
01 01 01 0 1 01 01 01
And blue:
CC CC CC C C CC CC CC
10 10 10 1 0 10 10 10
And there is another rule!
Any 01 or 10 combination will produce a single color pixel, unless it's adjacent to another such combination, in which case the color will fill in to form a "full" or "bigger" pixel!
01 01 01 = a red bar, assuming S bit is 0
01 00 01 = two red dots!
Try it:
HGR to clear it all
HCOLOR = 7
HPLOT 1, 0 and then 5, 0 followed by 3,0
You get a red dot, then another one, then a single red bar.
Next comment
Back to graphics!
Remember that bitfield and color clock relationship:
CC CC CC C C CC CC CC
PP PP PP P P PP PP PP
8192 8193
S bits ignored as they do not create pixels, just affect them.
And now I come to the final positive! I really like Apple graphics despite their crazy nature and limitations, and I like the Apple graphics because they deliver good color without sacrificing resolution.
I explained all I did about DMA and bytes per line and what not because I wanted to make a subtle, but important point about COLOR RESOLUTION.
The Apple has a 280x192 screen at all times. There is no "4 color" mode that cuts resolution in half to deliver more colors. Instead, there are just pixels and colors.
Try this: Set your HCOLOR = 7. This is basically "white" and it will set any pixel you want to be on. Using other HCOLORS is like a mask. The Apple will only set those pixels associated with a given color, ignoring others. This is nice, but also more confusing at this stage. We just need to turn any pixel we want on or off. HCOLOR = 7 does that.
Now, HPLOT 0,0 and you will see a single, blue pixel. (that is if you do it from a cold boot to insure the high bits are in the same state I am assuming right now.
That's a single, blue pixel. On a good display, it will look half the size of the usual 2 bpp type pixels seen often.
Now HPLOT 2,0 and 4, 0, and 6, 0, and then skip one and do 10, 0 to get another single blue pixel.
Try the same with odd pixels, say on line 5 to see things clearly:
HPLOT 1, 5 3, 5 5, 5 and then 9, 5 to get a single one again.
Now, on those two lines, you can unset any pixel you have set to get black, and you can set an additional one, even and odd together to get white.
The rules are then:
Two sequential unset pixels are black. Two set sequential pixels are white. A single even or odd pixel will be one of two possible colors given the state of the S shift bit.
This is different from a simple 2bpp display. THere can be details not possible on a display with half the resolution and it's this point that makes Apple 2 graphics as flexible as they are! Many patterns are possible to give the illusion of more colors and it's all quite a bit more robust than one might expect at first glance. The game art out there shows it all off pretty well.
So goes the "Total Replay" start screen.
Now, back to that 2 byte group bitfield:
CC CC CC C C CC CC CC
PP PP PP P P PP PP PP
Say we want red. That's an odd pixel, with the S shifter bit set to zero.
We do this, just set every "even" bit, right?
CC CC CC C C CC CC CC
01 01 01 0 1 01 01 01
And blue:
CC CC CC C C CC CC CC
10 10 10 1 0 10 10 10
And there is another rule!
Any 01 or 10 combination will produce a single color pixel, unless it's adjacent to another such combination, in which case the color will fill in to form a "full" or "bigger" pixel!
01 01 01 = a red bar, assuming S bit is 0
01 00 01 = two red dots!
Try it:
HGR to clear it all
HCOLOR = 7
HPLOT 1, 0 and then 5, 0 followed by 3,0
You get a red dot, then another one, then a single red bar.
Next comment