- Everything in the Apple II is synchronized with a master clock, including the video.
- The video chip in some 8-bit systems in this era could generate an IRQ when it was generating a specific raster line--the VIC-II in the Commodore 64 for example. This enabled split screen effects or updating during vertical blank (set interrupt to happen at last scan line).
- Apple II's video did not have this capability.
- This hardware adds a VIA, with the timer-generated interrupt. Since the VIA clock is synced with the same clock that everything else is synced with, including the video, it should be possible to generate an IRQ exactly once per frame. If that IRQ can happen at the right time, it can be used to effectively emulate a raster line IRQ.
- So--starting that timer at the right time: if you fill the framebuffer with 0x01, except for the last line, and keep peeking at what the video chip is putting out, enabling the timer when you no longer see 1's, you then have a reference point to enable the VIA timer IRQ at a right place.
- Once you have the timer set you can clear the frame buffer and use it normally.
- Everything in the Apple II is synchronized with a master clock, including the video.
- The video chip in some 8-bit systems in this era could generate an IRQ when it was generating a specific raster line--the VIC-II in the Commodore 64 for example. This enabled split screen effects or updating during vertical blank (set interrupt to happen at last scan line).
- Apple II's video did not have this capability.
- This hardware adds a VIA, with the timer-generated interrupt. Since the VIA clock is synced with the same clock that everything else is synced with, including the video, it should be possible to generate an IRQ exactly once per frame. If that IRQ can happen at the right time, it can be used to effectively emulate a raster line IRQ.
- So--starting that timer at the right time: if you fill the framebuffer with 0x01, except for the last line, and keep peeking at what the video chip is putting out, enabling the timer when you no longer see 1's, you then have a reference point to enable the VIA timer IRQ at a right place.
- Once you have the timer set you can clear the frame buffer and use it normally.