Try fixing sceJpegGetOutputInfo again

I guess the colour info address isn't supposed to be updated if the jpeg errors out, or I think so based on reports from the God Eater Burst thread in the forums. This shouldn't affect working jpegs since the address is still being updated before returning, just not if it errors out. If this doesn't work for the save from the forums, it would have never worked in PPSSPP builds up to today (it basically makes the function _only_ return null without updating the colour address, making it the equivalent of the only implementation other than mine, which was a stub, if it errors out). The previous commit I made worked in the Japanese version, but still bounced back in the US version (wtf?).
This commit is contained in:
CPkmn 2013-08-07 16:39:42 -07:00
parent e954bd11da
commit 1cf0b62e70

View File

@ -95,14 +95,6 @@ int sceJpegGetOutputInfo(u32 jpegAddr, int jpegSize, u32 colourInfoAddr, int dht
{
ERROR_LOG_REPORT(HLE, "sceJpegGetOutputInfo(%i, %i, %i, %i)", jpegAddr, jpegSize, colourInfoAddr, dhtMode);
// Buffer to store info about the color space in use.
// - Bits 24 to 32 (Always empty): 0x00
// - Bits 16 to 24 (Color mode): 0x00 (Unknown), 0x01 (Greyscale) or 0x02 (YCbCr)
// - Bits 8 to 16 (Vertical chroma subsampling value): 0x00, 0x01 or 0x02
// - Bits 0 to 8 (Horizontal chroma subsampling value): 0x00, 0x01 or 0x02
if (Memory::IsValidAddress(colourInfoAddr))
Memory::Write_U32(0x00020202, colourInfoAddr);
int w = 0, h = 0, actual_components = 0;
if (!Memory::IsValidAddress(jpegAddr))
@ -129,6 +121,14 @@ int sceJpegGetOutputInfo(u32 jpegAddr, int jpegSize, u32 colourInfoAddr, int dht
}
}
// Buffer to store info about the color space in use.
// - Bits 24 to 32 (Always empty): 0x00
// - Bits 16 to 24 (Color mode): 0x00 (Unknown), 0x01 (Greyscale) or 0x02 (YCbCr)
// - Bits 8 to 16 (Vertical chroma subsampling value): 0x00, 0x01 or 0x02
// - Bits 0 to 8 (Horizontal chroma subsampling value): 0x00, 0x01 or 0x02
if (Memory::IsValidAddress(colourInfoAddr))
Memory::Write_U32(0x00020202, colourInfoAddr);
#ifdef JPEG_DEBUG
char jpeg_fname[256];
u8 *jpegBuf = Memory::GetPointer(jpegAddr);