From fb3752a8efdce6d7f45ca0115a544f543408e918 Mon Sep 17 00:00:00 2001 From: Megamouse Date: Tue, 12 Apr 2022 01:32:28 +0200 Subject: [PATCH] CellVdecDivxSpecificInfo2 (who knows if this is correct...) --- rpcs3/Emu/Cell/Modules/cellVdec.cpp | 32 ++++++++++++++++++++++++++++- 1 file changed, 31 insertions(+), 1 deletion(-) diff --git a/rpcs3/Emu/Cell/Modules/cellVdec.cpp b/rpcs3/Emu/Cell/Modules/cellVdec.cpp index 290323846a..95701e6cd9 100644 --- a/rpcs3/Emu/Cell/Modules/cellVdec.cpp +++ b/rpcs3/Emu/Cell/Modules/cellVdec.cpp @@ -719,10 +719,40 @@ static error_code vdecQueryAttr(s32 type, u32 profile, u32 spec_addr /* may be 0 { cellVdec.warning("cellVdecQueryAttr: DivX (profile=%d)", profile); - //const vm::ptr sinfo = vm::cast(spec_addr); + const vm::ptr sinfo = vm::cast(spec_addr); + + if (sinfo) + { + if (sinfo->thisSize != sizeof(CellVdecDivxSpecificInfo2)) + { + return CELL_VDEC_ERROR_ARG; + } + } // TODO: sinfo + //const u32 maxDecH = sinfo ? +sinfo->maxDecodedFrameHeight : 0; + //const u32 maxDecW = sinfo ? +sinfo->maxDecodedFrameWidth : 0; + u32 nrOfBuf = sinfo ? +sinfo->numberOfDecodedFrameBuffer : 0; + + if (nrOfBuf == 0) + { + nrOfBuf = 4; + } + else if (nrOfBuf == 2) + { + if (profile != CELL_VDEC_DIVX_QMOBILE && profile != CELL_VDEC_DIVX_MOBILE) + { + return CELL_VDEC_ERROR_ARG; + } + } + else if (nrOfBuf != 4 && nrOfBuf != 3) + { + return CELL_VDEC_ERROR_ARG; + } + + // TODO: change memSize based on buffercount. + switch (profile) { case CELL_VDEC_DIVX_QMOBILE : memSize = new_sdk ? 0x11B720 : 0x1DEF30; break;