Skip to content

Commit

Permalink
pcsx2: Partially fix IPU PACK command
Browse files Browse the repository at this point in the history
The pack command converts from RGB32 to RGB16/INDX4, not RAW8 to
RGB16/INDX4.

Also, the VQ conversion (still unimplemented) only occurs when the
output format is 0, so fix that as well.
  • Loading branch information
turtleli committed Sep 29, 2019
1 parent e506dc1 commit 45687cd
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions pcsx2/IPU/IPU.cpp
Expand Up @@ -606,15 +606,14 @@ static __ri bool ipuPACK(tIPU_CMD_CSC csc)

for (;ipu_cmd.index < (int)csc.MBC; ipu_cmd.index++)
{
for(;ipu_cmd.pos[0] < 8; ipu_cmd.pos[0]++)
for(;ipu_cmd.pos[0] < (int)sizeof(macroblock_rgb32) / 8; ipu_cmd.pos[0]++)
{
if (!getBits64((u8*)&decoder.mb8 + 8 * ipu_cmd.pos[0], 1)) return false;
if (!getBits64((u8*)&decoder.rgb32 + 8 * ipu_cmd.pos[0], 1)) return false;
}

ipu_csc(decoder.mb8, decoder.rgb32, 0);
ipu_dither(decoder.rgb32, decoder.rgb16, csc.DTE);

if (csc.OFM) ipu_vq(decoder.rgb16, indx4);
if (!csc.OFM) ipu_vq(decoder.rgb16, indx4);

if (csc.OFM)
{
Expand Down

0 comments on commit 45687cd

Please sign in to comment.