1
0
mirror of https://github.com/blawar/GLideN64.git synced 2024-07-04 10:03:36 +00:00

fix copying 32bit framebuffers to RDRAM

this fixes issue #348
This commit is contained in:
purplemarshmallow 2015-11-16 22:27:10 +01:00 committed by Sergey Lipskiy
parent 5b4455288b
commit 2b95cc4037

View File

@ -1061,10 +1061,13 @@ void FrameBufferToRDRAM::CopyToRDRAM(u32 _address, bool _sync)
if (pBuffer->m_size == G_IM_SIZ_32b) {
u32 *ptr_dst = (u32*)(RDRAM + _address);
u32 *ptr_src = (u32*)pixelData;
RGBA c;
for (u32 y = 0; y < height; ++y) {
for (u32 x = 0; x < pBuffer->m_width; ++x)
ptr_dst[x + y*pBuffer->m_width] = ptr_src[x + (height - y - 1)*pBuffer->m_width];
for (u32 x = 0; x < pBuffer->m_width; ++x) {
c.raw = ptr_src[x + (height - y - 1)*pBuffer->m_width];
ptr_dst[(x + y*pBuffer->m_width)] = (c.r << 24) | (c.g << 16) | (c.b << 8) | c.a;
}
}
} else if (pBuffer->m_size == G_IM_SIZ_16b) {
u16 *ptr_dst = (u16*)(RDRAM + _address);