During vertical blank time, none of the display lines are
allowed to be on. If they were, that line would be noticeably
'brighter' than the others. Additionally, the magic 'P'
counter has to be set to match the LCD scan rate. The formula
is:
INT((((line time - .5us) / 15) * 4) -1)
Don't forget to set the display control bits. Normal 4 bit
color is:
'DISPCTL' (FD92) = x'0D'
Some frame rate choices are:
The maximum frame rate occurs when Hcount is 121 (backup = 120) which results in a vertical frequency of 78.7 Hz. 75 Hz (a useful rate) is achieved by setting the H backup value to 126 (x'7E'). The vertical values do not change.
We notice that 50Hz operation causes a massive flicker that is probably due to the speed of the LCD itself. 50 Hz may not be usable.
------------------------------------------------------ ------------- | R | G | B || R | G | B || R | G | B || R | G | B || .... | R | G | B | ------------------------------------------------------ ------------- ------------------------------------------------------ ------------- | R | G | B || R | G | B || R | G | B || R | G | B || .... | R | G | B | ------------------------------------------------------ -------------
The 160 pixel by 102 line Suzy painting buffer can be positioned anywhere in that world by setting a horizontal and vertical offset. The numbers sent to the Suzy hardware will be the distance from the upper left corner of the display world to the upper left corner of the Suzy painting buffer. Portions of sprites outside the Suzy painting buffer will be 'clipped' by the hardware and therefore not drawn into any RAM. Since the offset numbers are used in the placement of a sprite in real RAM, changing the numbers will affect previously drawn sprites differently from sprites yet to be drawn. Any sprites drawn prior to a change in the offset numbers will remain unmoved in the Suzy painting buffer. Any sprites drawn after the change in the offset numbers will be positioned in accordance with those new numbers.
The Mikey Display buffer is the 8160 byte (102 lines x 80 bytes) area of RAM that is displayed on the LCD.
The value in the register is the start (upper left corner) of the display buffer in normal mode and the end (lower right corner) of the display buffer in FLIP mode. The address of the upper left corner of any display buffer must have '00' in the bottom 2 bits (only the upper 14 bits of the address are used). The hardware registers in Suzy are loaded with the start (upper left corner) of the painting or collision buffer, regardless of FLIP mode.
Since the I/O pin we are using used to be an output (backlight control), it is set to 'output' by the Mikey ROM. While this will not cause any damage to the parts, the pin will not function correctly until the software has set it to 'input'.