top of page
  • Writer's picturerehsd

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. :)

33 views2 comments

Recent Posts

See All

2 Comments


Joe Plocki
Joe Plocki
Apr 21, 2022

Are you handling transparency in code or in hardware? And you're still out of the FPGA business for VGA, having gone back to discreet logic? (Sorry, I haven't even looked at my '816 build, or VGA in something close to 2 months, and haven't been following along). If you're doing all this in discreet logic, I can't wait to see the final schematic... thinking about the dozens upon dozens of chips I thought I'd need for a discreet implementation for my "ambitious" VGA implementation is what drove me to FPGA.


Regardless, what you've got here, while maybe not as performant as you'd like, is still wicked cool and hella impressive...

Like
rehsd
rehsd
Apr 21, 2022
Replying to

The transparency is entirely 65816 code. I am not using an FPGA on this system. I have a bunch of info on the video card available at the link below, along with schematic/PCB files. I know I can improve performance of the sprites as I learn how to better handle tiles, sprites, and related -- and improve my 65816 coding abilities.


VGA Add-in Card for My 65816 PC

Like
bottom of page