Apple ][ Hi-Res Graphics – Learning the screen

I decided to get back into working on my game, but this time I decided I should learn to program graphics on the Apple ][ as part of it.  Something I never really did what I was younger.  I’m follow the Apple ][ Enthusiasts group of FaceBook so I reached out to them about pointers to books, sites, and tutorials for it.  I’ve see some people in the group do some pretty amazing things.  I had a lot of suggestions and tips.

One book that people recommended was “Apple Graphics & Arcade Game Design” by Jeffery Stanton.  (You can find it on the Internet Archive, if you are interested).  I started reading that on Hi-Res graphics and learned a ton.  I highly suggest the book.

One main thing I learned, is that Hi-Res graphics is that it’s not easy.  The way the hardware designers laid out the hardware (to keep costs down) was pretty much a mess.

Lines are not sequential in memory.  It’s hard to explain, but if you’ve ever seen a Hi-Res image load you can see the “interlacing” effect when it loads.  Here is an image from the book the illustrates writing sequential data to the screen:

Screen Shot 2016-03-18 at 5.57.40 PM

Now, if that isn’t bad enough.  One byte in memory contains 7 horizontal pixels, bits 1-7. And the bits alternate colors within the 7 bits.  It’s a mess really.  It makes me even more impressed at how game developers in the day were able to make the amazing games they did.  My hats off to them.

Back to the 7-bits of pixels.  It gets more fun.  In even bytes the pixels alternate violet-green, in odd bytes they alternate green-violet. Well, unless the high bit is on then they alternate blue-orange and orange-blue respectively.  But, if you turn on bits 1 and 2, you get a 2 pixel white line. If you turn on bits 1 and 3 you get a 3 pixel line of violet, 2 and 4 you get a 3 pixel line of green.  Clear as mud?

Here is a picture:

Screen Shot 2016-03-18 at 6.10.48 PM     Screen Shot 2016-03-18 at 6.14.42 PM

Lines in order (second image has high bit set in each byte)

  1. Bit 1 on
  2. Bit 2 on
  3. Bit 1 and 2 on
  4. Bit 1 and 3 on
  5. Bit 2 and 4 on
  6. Bit 1, 2, and 3 on
  7. Bit 1, 2, 3, and 4 on

Also notice, you need to choose between using green/violet in those 7 pixels or orange/blue.  Not both.

Enough of this, let’s draw something.

Leave a Reply

Your email address will not be published. Required fields are marked *