Was inspired by SenorQuack's replacement for fb_write in SDL (converting 32-bit color to a GP2X 16-bit framebuffer), so I made my own.
FastBlitV1 and FastBlitV2 were my two optimizations, both went from 12 to 8 instructions per pixel, and both require alpha channel (typ 8 bits in the pixel word) to be 0. Normally not a problem, since this is for letting SDL render sprites, mix, overlay, etc in 32 bit mode to a final 32-bpp buffer. So unless those bits are used as (garbage?) storage in your game or engine h34r: you only have to strip them when you load pictures, if at all.
The top one on the page, Version 1, does 8 pixels at a time, Version 2 further down does 16.
FastBlitV2 takes 74.1% of A_SN's original fb_write, or 22.2% faster than Senor Quack's fb_write. It's a plug-in replacement for both.
Download link
FastBlitV1 and FastBlitV2 were my two optimizations, both went from 12 to 8 instructions per pixel, and both require alpha channel (typ 8 bits in the pixel word) to be 0. Normally not a problem, since this is for letting SDL render sprites, mix, overlay, etc in 32 bit mode to a final 32-bpp buffer. So unless those bits are used as (garbage?) storage in your game or engine h34r: you only have to strip them when you load pictures, if at all.
The top one on the page, Version 1, does 8 pixels at a time, Version 2 further down does 16.
FastBlitV2 takes 74.1% of A_SN's original fb_write, or 22.2% faster than Senor Quack's fb_write. It's a plug-in replacement for both.
Download link