On 25 Jul 00, rednuht@... (rednuht) wrote:
> this is what i my sprite routine does (trys).
>
> 1: take Y coord for sprite and find correct offset to 1st byte of that
> row in LCD memory. $80 + offset
> 2: take the X coord and by dividing by 8 find how many bytes should be
> added to the offset and the subtracting that value from the original X
> coord get how mang Bits need to be shifted.
> 3: shift the byte the correct number bits and as it is shifted take the
> shifted bits into another location.
> 4: output shifted data to the LCD memory.
IMHO shifting a sprite image is way too time-consuming to be efficient.
Better create eight different images, each showing the sprite one more
pixel to the right, and then use step 2. to determine which of the eight
images you have to copy to the LCD screen (that's also how I did it in
"Pacman")...
Also, don't forget to AND / OR the sprite data with the LCD background
data (to blend out the bits where the sprite will be placed / keep the
bits where the sprite won't be), otherwise movement over a background
image might look a bit strange. ;)
Bye
Alessandro
---
You get what anyone gets. You get a lifetime.