void EMU_copyMasterBuffer() { video.srcBuffer = (u8*)GPU_screen; //convert pixel format to 32bpp for compositing //why do we do this over and over? well, we are compositing to //filteredbuffer32bpp, and it needs to get refreshed each frame.. const int size = video.size(); u16* src = (u16*)video.srcBuffer; u32* dest = video.buffer; for(int i=0;i<size;++i) *dest++ = 0xFF000000 | RGB15TO32_NOALPHA(src[i]); }
static u8* Convert15To24(const u16* src, int width, int height) { u8 *tmp_buffer; u8 *tmp_inc; tmp_inc = tmp_buffer = (u8 *)malloc(width * height * 3); for(int y=0;y<height;y++) { for(int x=0;x<width;x++) { u16 pixel = *src++; u32 expanded = RGB15TO32_NOALPHA(pixel); *tmp_inc++ = (expanded>>16)&0xFF; *tmp_inc++ = (expanded>>8)&0xFF; *tmp_inc++ = expanded&0xFF; } } return tmp_buffer; }