by retrac · 1y ago · 0 comments
Apple II high resolution graphics are 280x192 pixels stored in 8 kilobytes at 2000 - 3fff or 4000 - 5fff. (With a fun interleaving where bits in memory are not in the same order as the bits on the display. Woz saved a few chips that way.)
That is to say, there are no hardware sprites.
The fastest way to clear the display is an unrolled loop in the form of LDA #0, STA $2000, STA $2001, STA $2002 etc. That works out to about 30,000 cycles which takes 30 milliseconds. A more plausible operation - displaying a whole-screen bitmap by copying it from another location in RAM to the framebuffer using a loop with indexes - weighs in at several hundred thousand cycles, or an appreciable fraction of a second.
Apple added VBL polling with the IIe in 1983, and then broke it a year later with the IIc. And an unfortunate typo in the IIc technical reference manual meant that developers couldn't figure out how to do it properly.
The only official, cross-platform way to do it was through the mouse firmware, but most users didn't have the mouse hardware installed.
This game uses the mouse firmware, if available (II+ w/ mouse card, IIc, IIgs), to generate VBL interrupts. On the IIe without a mouse card, it polls for VBL.
By the way, if you're running this game on the Virtual ][ emulator for MacOS, be sure to disable the mouse card. Its emulated mouse card only generates VBL interrupts at 30 Hz, so the game runs at half speed.
But this exists now: https://github.com/fadden/fdraw
These smoothly moving graphics over a background image would have blown everyone out of the water in 1982.