Mockingboard 4c+

submited by
Style Pass
2021-06-23 19:00:03

The Apple II was (well, still is) a computer devoid of interrupts. I think most modern software engineers probably under-appreciate the implications of that. Folks skilled in writing main loops for games or graphics will at least be familiar with the evolution of main loops in games, so let’s start there.

Back in the old days, games had a “main loop” within which you serviced each activity required by the game- rendering graphics, updating physics and collision detection, processing inputs, starting audio sequences, etc. Each trip through this loop is generally considered a “frame”. On many very early platforms, this loop simply ran as fast as it could, because it was always going to be slower than you wish it would be. The second step in the evolution came with vertical blanking synchronization. Interestingly, even the concept of “vertical blanking” is becoming archaic knowledge because it’s much more of an abstract concept on modern LCD displays. In fact, under the hood they generally fake the concept because many old layers of software are still expecting it. However, they’re capable of essentially displaying continuously and updating any given pixel as needed. This is a slight oversimplification, because in reality pixels are still updated sequentially through shift registers and the like, mainly to save on circuitry. However it happens so fast as to be effectively instantaneous to software.

In the old days of cathode ray tube displays, however, vertical blanking was far from an abstract concept supported only to coddle dated software layers. It was an immutable physical property of the video device. As the electron gun scans across each row of pixels to “draw” it on the glowing phosphors, it reaches the bottom and must shoot back up to the top in order to do it again for the next frame. This is the “vertical blank”, so named because the screen is not updating during that time. In fact, the screen would go black during this time if not for the glowing phosphors buying us a little time. There’s also a much smaller horizontal blank during which the electron gun is shooting back to the start of each row. Some early computers leveraged this as well, but for this conversation the vertical blank is all we care about.

Leave a Comment
Related Posts