Look Here First

Curious why I created this blog? The following two posts explain it all. Click on the titles below to read more.

What this Blog is about.

Project Description.

Sunday, April 10, 2011

Displaying Sprites: Game Board

Displaying small sprites to the screen was simple enough. So one would think that displaying large sprites would be simple too. It is not. Something about larger display areas causes the screen (or screen controller) to become very temperamental. Why this happens, the student has not discovered, but the student has found  conditions that trigger the odd behavior as shown below.

       Odd Behavior                 Correct behavior.
Photobucket   Photobucket

As can be seen certain columns display in a weird fashion and the overall display quality degrades when the type of conditions exist.

The student discovered that when the area of the sprite approached the size of the screen, the amount of rows need to be set precisely.  Odd behavior occurs when the area has an odd number of rows or if the row bottom row is an odd numbered row.

For example the calls below both cause the weird screen drawing behavior.
LCDDrawSprite(0, 3, 128, 126, maze, colors);
LCDDrawSprite(0, 2, 128, 127, maze, colors);

Also if the the first row to be out put was entirely a solid color, this behavior could occur.  And if the bottom row was below row 4 the top of the sprite would wrap to the bottom with unpredictable results.

With all the conditions above the student tried to revise his code to fix the problems.  The odd behavior seems to be occurring within the display or display controller. So the student decided to work around the problems instead of spending more time finding the root cause, with possibility of still needing to work around problems.  The student found that displaying the maze array using the following call had the best results.

LCDDrawSprite(0, 4, 128, 126, maze, colors);

No comments:

Post a Comment