next up previous contents
Next: The screen Up: Scrolling engine Previous: Scrolling engine   Contents


The scroll

The scrolling engine is based on one buffer that represent the real text to draw. If the wanted text size is 30 pixels width, then the buffer size will be 30 pixels width. And if the wanted text size is 3000 pixels width, then the buffer size will be 3000 pixels width. The height of this buffer is by defaut equal to $LCD\_HEIGHT + 2 * heightest\_line$.

Having this buffer, the first time, the buffer will be filled entirely with the lines to draw. To see it on the screen, a copy of the seeable part of the buffer is copied to the LCD memory. Here we have a screen filled with the first seeable lines.

When the user will want to see the other parts of the text, there will be the scrolling mechanism. Here, two cases are possible : the pixel line we want to see is already in the buffer or not.

If the pixel line is already in the buffer, then the scrolling engine will scroll the screen (not the buffer !) in the proper direction, and will copy the missing pixel line from the buffer to the screen. At this point, the screen is scrolled.

If the wanted line is missing in the buffer, then the buffer need to be scrolled too. As the screen is scrolled pixel by pixel, the buffer is scrolled by entire text lines. After the buffer is scrolled in the proper way, the lines we wanted is now here, so we can return to the previous case.

For the page scrolling, the mecanism is nearly the same. The difference is that we request to the scrolling engine to scroll of more than on pixel : in fact, the page is scrolled of $screen\_height - common\_band$ pixels ($common\_band$ is the height in pixel we want to be common between two following pages).

This scrolling mecanism is done for the foor directions (top, bottom, left and right) is the same way.

The special scrolling functions which go to the last page or to the first is done by the !hl_goTo! function (this function goes to the specified line).


next up previous contents
Next: The screen Up: Scrolling engine Previous: Scrolling engine   Contents
2006-02-19