How “oldschool” graphics work, part 2 – Apple and Atari
Welcome to part 2 of “How Old School Graphics Work”. Now, in the last episode, I covered some of the more popular systems in the eighties, like the Nintendo and the Commodore systems, and in this episode I’m going to cover the Apple II and some other systems. Now, the Apple II is one of the more complicated and hard to explain graphics of all, and to be honest it actually works like two completely different computers depending upon whether you have a monochrome monitor or color monitor attached to it take this example this is a zoomed in view of what the pixels would look like on each type. Now, to better understand why it works this way let’s break it down a bit further. The screen is divided up into sections of 7 pixels each. So, let’s see what goes on inside these sections. Eight bits of memory are used to define the 7 pixels. The leftover bit is used to change the palette. So, here’s how this works: on a monochrome monitor, if you turn on some bits in memory like this, the corresponding pixels will turn on, and you’ll get the result you pretty much expected. So, what happens when we toggle this bit on and off? Pretty much nothing. So, on a monochrome screen, the Apple II had a very crisp graphics display and was generally great for business applications. OK, now let’s add a color monitor for comparison. One of the first things you might notice when looking at an Apple II on a color monitor is that the text often looks rainbow-colored. Now, there’s actually a reason for this and it has to do with the way the machine produces color. So, let’s go back to our pixel diagram. If you turn on some bits you’ll end up with colors, and you change the color by moving the location of the pixel like this. If you move the pixel to one side, you get green, and on the other side you get violet. Now, if you put two pixels next to each other you get white. So, that gives you four possible colors. But remember this control bit here? Watch what happens when we turn it on now. Notice the colors change to orange and blue. So, that extra control bit allows you to use two additional colors. But keep in mind that you can’t use these colors in the same 7-bit section as these colors, so it’s very difficult to have blue and green next to each other on the screen, unless you line it up just perfectly. And now you can see why text would look rainbow-colored when using a color monitor. Now, we’ve been talking about high resolution mode, which almost all games were designed for, but Apple also gave us a low resolution mode with 40 by 48 pixels. The pixels are huge and chunky, but you do get a total of 16 colors, hence why the Apple II claims to be a 16-color computer. Now, later on, when Apple introduced the Apple IIc and Apple IIe computers, they did add the ability for more colors in high resolution mode, but it was rarely used because game developers wanted to maintain compatibility with older Apples. All right. So if you found that confusing, don’t feel bad. There are very few people that really comprehend how Apple II graphics work. And also I want to defend the computer a little bit for those who might say, “Wow! It can only do six colors when in high resolution graphics mode for games and stuff. That’s terrible!” But you kind of have to keep it in perspective that this machine came out in 1977, which was a good five years earlier than systems like the Nintendo and the Commodore. So, OK, there’s one more type of graphics system I want to talk about. It’s called CPU-driven graphics, and let me show you how this works. I created some oversized pixels on this illustration. First of all, you have to keep in mind that the pixels are drawn on the screen one at a time starting on the top-left, moving to the right, and then dropping down. Of course, all this happens in the blink of an eye. In fact, that happens 30 times a second. Most computers have a dedicated video chip that sends pulses to the monitor, in the correct order and timing, to draw the picture on the screen. However, some systems had no video chip at all, and use the CPU to drive the pulses directly. OK, so this does actually work, but it requires an enormous amount of the CPU’s time in order to pull this off. So, that left very little CPU time left over to run game code. Imagine if they did this on a modern system, and you opened your task manager, and there was always a task running called “Video Generator”, and it took up ninety percent of your computer’s CPU time. What a drag that would be, huh? Games designed for the Atari 2600 were quite a challenge because of this. In fact, if you ever noticed in some games, if you look over to the left side of the screen and see these mysterious black lines, those are there because game code is running and there’s just not enough time to draw the screen and run the game code at the same time. Now, one last thing I’m going to mention is it is actually possible to use a little bit of CPU-driven graphics even on a machine that has a traditional graphics chip. You know those color cells we talked about in the last episode? Well, if a programmer wanted, he could use the CPU to change the color palette on each scanline. This allowed some pretty fantastic artwork on the Commodore 64, but this was never used in games because it pretty much chewed up all of the available CPU time. All right, so that about wraps it up for this episode. In the next episode, I’m going to be covering how old school sound and music worked, and if there’s enough interest I might actually make one on IBM, CGA, EGA, and VGA graphics modes. Don’t forget to like my video and subscribe, and also check out my Facebook page–there’s a link down at the bottom. I’ll see you next time!