gsdx memory: implement read texture of PS GPU24

convert the swizzled block as tightly packed 24 bits RGB

Then convert scanline to standard 32 bits RGBA

The HW renderer requires the preload data hack
This commit is contained in:
Pseudonym 2016-10-05 21:56:29 +02:00 committed by Gregory Hainaut
parent 1c900e780a
commit a0629587be
2 changed files with 15 additions and 7 deletions

View File

@ -1657,6 +1657,21 @@ void GSLocalMemory::ReadTexture24(const GSOffset* RESTRICT off, const GSVector4i
void GSLocalMemory::ReadTextureGPU24(const GSOffset* RESTRICT off, const GSVector4i& r, uint8* dst, int dstpitch, const GIFRegTEXA& TEXA) void GSLocalMemory::ReadTextureGPU24(const GSOffset* RESTRICT off, const GSVector4i& r, uint8* dst, int dstpitch, const GIFRegTEXA& TEXA)
{ {
FOREACH_BLOCK_START(r, 16, 8, 16)
{
GSBlock::ReadBlock16(src, read_dst, dstpitch);
}
FOREACH_BLOCK_END
// Convert packed RGB scanline to 32 bits RGBA
ASSERT(dstpitch >= r.width() * 4);
for(int y = r.top; y < r.bottom; y ++) {
uint8* line = dst + y * dstpitch;
for(int x = r.right; x >= r.left; x--) {
*(uint32*)&line[x * 4] = *(uint32*)&line[x * 3] & 0xFFFFFF;
}
}
} }
void GSLocalMemory::ReadTexture16(const GSOffset* RESTRICT off, const GSVector4i& r, uint8* dst, int dstpitch, const GIFRegTEXA& TEXA) void GSLocalMemory::ReadTexture16(const GSOffset* RESTRICT off, const GSVector4i& r, uint8* dst, int dstpitch, const GIFRegTEXA& TEXA)

View File

@ -252,13 +252,6 @@ GSTexture* GSRendererSW::GetOutput(int i, int& y_offset)
GSRegDISPFB DISPFB = m_regs->DISP[i].DISPFB; GSRegDISPFB DISPFB = m_regs->DISP[i].DISPFB;
#if 1
// Hack for PSX until we find the correct way to decode it
if (DISPFB.PSM == 18) {
DISPFB.PSM = PSM_PSMCT16;
}
#endif
int w = DISPFB.FBW * 64; int w = DISPFB.FBW * 64;
int h = GetFrameRect(i).bottom; int h = GetFrameRect(i).bottom;