From 047d59df0c9b42299c30adc3cd14f2e9d259b090 Mon Sep 17 00:00:00 2001 From: Raul Tambre Date: Thu, 18 Feb 2016 20:05:50 +0200 Subject: [PATCH] Implement UTF8stoUTF16s, minor cellPngDec fixes Need to find games to test the case, when fixed alpha isn't specified. --- rpcs3/Emu/SysCalls/Modules/cellL10n.cpp | 5 +++-- rpcs3/Emu/SysCalls/Modules/cellPngDec.cpp | 11 +++-------- 2 files changed, 6 insertions(+), 10 deletions(-) diff --git a/rpcs3/Emu/SysCalls/Modules/cellL10n.cpp b/rpcs3/Emu/SysCalls/Modules/cellL10n.cpp index 21be193baa..f10a030ac2 100644 --- a/rpcs3/Emu/SysCalls/Modules/cellL10n.cpp +++ b/rpcs3/Emu/SysCalls/Modules/cellL10n.cpp @@ -1146,9 +1146,10 @@ s32 SJIStoEUCJP() throw EXCEPTION(""); } -s32 UTF8stoUTF16s() +s32 UTF8stoUTF16s(vm::cptr src, vm::cptr src_len, vm::ptr dst, vm::ptr dst_len) { - throw EXCEPTION(""); + cellL10n.warning("UTF8stoUTF16s(src=*0x%x, src_len=*0x%x, dst=*0x%x, dst_len=*0x%x)", src, src_len, dst, dst_len); + return _L10nConvertStr(L10N_UTF8, src, src_len, L10N_UTF16, dst, dst_len); } s32 SJISstoUCS2s(vm::cptr src, vm::cptr src_len, vm::ptr dst, vm::ptr dst_len) diff --git a/rpcs3/Emu/SysCalls/Modules/cellPngDec.cpp b/rpcs3/Emu/SysCalls/Modules/cellPngDec.cpp index 4b26ca25c4..fb98adc097 100644 --- a/rpcs3/Emu/SysCalls/Modules/cellPngDec.cpp +++ b/rpcs3/Emu/SysCalls/Modules/cellPngDec.cpp @@ -591,10 +591,11 @@ s32 pngDecodeData(PPUThread& ppu, PHandle handle, PStream stream, vm::ptr da // Check if the outputWidthByte is smaller than the intended output length of a line. For example an image might be in RGB, but we need to output 4 components, so we need to perform alpha padding. else if (stream->out_param.outputWidthByte < (stream->out_param.outputWidth * stream->out_param.outputComponents)) { - // Not sure what to do, when a fixed alpha value isn't specified. + // Not sure what to do, when a fixed alpha value isn't specified, but specifying full opaque seems to cause no issues currently. Logging this just in case. if (!stream->fixed_alpha) { - throw EXCEPTION("Fixed alpha not specified for padding."); + cellPngDec.error("Fixed alpha not specified for padding. Please notify a developer of this."); + stream->fixed_alpha_colour = 255; } // We need to fill alpha (before or after, depending on the output colour format) using the fixed alpha value passed by the game. @@ -646,12 +647,6 @@ s32 pngDecodeData(PPUThread& ppu, PHandle handle, PStream stream, vm::ptr da // Check if we need to flip the image or leave empty space at the end of a line if ((bytes_per_line > stream->out_param.outputWidthByte) || flip) { - // Flipping is untested - if (flip) - { - throw EXCEPTION("Flipping is not yet supported."); - } - // Get how many bytes per line we need to output - bytesPerLine is total amount of bytes per line, rest is unused and the game can do as it pleases. const u32 line_size = std::min(bytes_per_line, stream->out_param.outputWidth * 4);