A89: HW2 grayscale
[Prev][Next][Index][Thread]
A89: HW2 grayscale
Hi!
Last week I found a way to synchronize with the HW2 screen. This means that
flicker free grayscale is possible. I write this mail because I want
everyone to benefit from my "discovery."
Bit 7 of $70001D toggles each time the display controller restarts at the
top of the screen, i.e. with each FS.
As an example of how this can be used, here's a quick description of my
(first) (TI89) implementation:
The screen height is set to 108 lines, and at the same time autoint 5 is
set to trigger after about 101 lines. (It doesn't matter if it triggers
after 100 or 102 lines, the idea is that is should trigger as soon as
possible when the screen is refreshing invisible lines. It must *not*
trigger when the screen is still refreshing visible lines, or else there
will be flicker.)
In the autoint 5 interrupt handler:
1. copy the new frame to the frame buffer ($4C00)
2. busy wait until $70001D:7 toggles (to get in sync with the screen)
3. restart autoint 5 (write to $600017)
The CPU is idle for e.g. game logic and graphics update between each
interrupt.
A really smart grayscale routine would of course calculate the optimal
screen height given the battery status and other important factors, to
reduce the CPU busy time. I think it's possible (but magic, more or less)
to force the screen to skip refreshing the remaining (invisible) lines and
start over immediately.
--
Johan "Knowledge is an illusion without answers."