Sprite Transparency

My first attempt at sprite transparency... and it's pretty rough.

I updated my image conversion application to support converting images with alpha channel data. My video card is using a single byte for all colors (RRRGGGBB). In the conversion application, I replace any transparent pixels with 0x24 (0b00100100). I also search for 0x24 in any non-transparent pixels and update those pixels to 0x28 (0b00101000), which moves the green up a notch.

When I draw the image in video memory, if the RGB value is 0x24, I skip drawing the pixel. I also redraw the portion of the screen impacted by the moving sprite to restore the background, as the sprite moves.


The performance overhead of this approach seems too high. In the video above, the 65816 is running at 14 MHz. I am moving the sprite to the right one pixel at a time. I am going to experiment with moving a few pixels at a time.


I see many videos on YouTube about sprites. I have some video watching to do. :)

23 views2 comments

Recent Posts

See All