From 8acb62f6ee159f0c6bc7df76399cf83d9348d764 Mon Sep 17 00:00:00 2001 From: Megamouse Date: Fri, 22 Apr 2022 20:35:08 +0200 Subject: [PATCH] HLE: simplify some error formats --- rpcs3/Emu/Cell/Modules/cellGame.cpp | 4 ++-- rpcs3/Emu/Cell/Modules/cellSearch.cpp | 4 ++-- rpcs3/Emu/Cell/Modules/cellVdec.cpp | 12 ++++++------ 3 files changed, 10 insertions(+), 10 deletions(-) diff --git a/rpcs3/Emu/Cell/Modules/cellGame.cpp b/rpcs3/Emu/Cell/Modules/cellGame.cpp index 8d651a552b..78ba1f29f6 100644 --- a/rpcs3/Emu/Cell/Modules/cellGame.cpp +++ b/rpcs3/Emu/Cell/Modules/cellGame.cpp @@ -218,7 +218,7 @@ error_code cellHddGameCheck(ppu_thread& ppu, u32 version, vm::cptr dirName const auto cat = psf::get_string(sfo, "CATEGORY", ""); if (!psf::is_cat_hdd(cat)) { - return { CELL_GAMEDATA_ERROR_BROKEN, fmt::format("CATEGORY='%s'", cat) }; + return { CELL_GAMEDATA_ERROR_BROKEN, "CATEGORY='%s'", cat }; } } @@ -636,7 +636,7 @@ error_code cellGameDataCheck(u32 type, vm::cptr dirName, vm::ptrsecond->type != CELL_SEARCH_CONTENTTYPE_MUSIC) { - return { CELL_SEARCH_ERROR_INVALID_CONTENTTYPE, fmt::format("Type: %d, Expected: CELL_SEARCH_CONTENTTYPE_MUSIC")}; + return { CELL_SEARCH_ERROR_INVALID_CONTENTTYPE, "Type: %d, Expected: CELL_SEARCH_CONTENTTYPE_MUSIC"}; } // Check if the type of the found content matches our search content type if (content->second->type != first_content->type) { - return { CELL_SEARCH_ERROR_NOT_SUPPORTED_CONTEXT, fmt::format("Type: %d, Expected: %d", +content->second->type, +first_content->type) }; + return { CELL_SEARCH_ERROR_NOT_SUPPORTED_CONTEXT, "Type: %d, Expected: %d", +content->second->type, +first_content->type }; } // Use the found content diff --git a/rpcs3/Emu/Cell/Modules/cellVdec.cpp b/rpcs3/Emu/Cell/Modules/cellVdec.cpp index 63f2686900..deecb06955 100644 --- a/rpcs3/Emu/Cell/Modules/cellVdec.cpp +++ b/rpcs3/Emu/Cell/Modules/cellVdec.cpp @@ -1004,7 +1004,7 @@ error_code cellVdecDecodeAu(u32 handle, CellVdecDecodeMode mode, vm::cptrsize || !auInfo->startAddr) { - return { CELL_VDEC_ERROR_ARG, fmt::format("vdec=%d, auInfo=%d, size=%d, startAddr=0x%x", !!vdec, !!auInfo, auInfo ? auInfo->size.value() : 0, auInfo ? auInfo->startAddr.value() : 0) }; + return { CELL_VDEC_ERROR_ARG, "vdec=%d, auInfo=%d, size=%d, startAddr=0x%x", !!vdec, !!auInfo, auInfo ? auInfo->size.value() : 0, auInfo ? auInfo->startAddr.value() : 0 }; } { @@ -1018,14 +1018,14 @@ error_code cellVdecDecodeAu(u32 handle, CellVdecDecodeMode mode, vm::cptr (CELL_VDEC_DEC_MODE_B_SKIP | CELL_VDEC_DEC_MODE_PB_SKIP)) { - return { CELL_VDEC_ERROR_ARG, fmt::format("mode=%d", +mode) }; + return { CELL_VDEC_ERROR_ARG, "mode=%d", +mode }; } // TODO: what does the 3 stand for ? if ((mode == (CELL_VDEC_DEC_MODE_B_SKIP | CELL_VDEC_DEC_MODE_PB_SKIP) && vdec->type != 3) || (mode == CELL_VDEC_DEC_MODE_PB_SKIP && vdec->type != CELL_VDEC_CODEC_TYPE_AVC)) { - return { CELL_VDEC_ERROR_ARG, fmt::format("mode=%d, type=%d", +mode, vdec->type) }; + return { CELL_VDEC_ERROR_ARG, "mode=%d, type=%d", +mode, vdec->type }; } if (!vdec->au_count.try_inc(4)) @@ -1046,7 +1046,7 @@ error_code cellVdecDecodeAuEx2(u32 handle, CellVdecDecodeMode mode, vm::cptrsize || !auInfo->startAddr) { - return { CELL_VDEC_ERROR_ARG, fmt::format("vdec=%d, auInfo=%d, size=%d, startAddr=0x%x", !!vdec, !!auInfo, auInfo ? auInfo->size.value() : 0, auInfo ? auInfo->startAddr.value() : 0) }; + return { CELL_VDEC_ERROR_ARG, "vdec=%d, auInfo=%d, size=%d, startAddr=0x%x", !!vdec, !!auInfo, auInfo ? auInfo->size.value() : 0, auInfo ? auInfo->startAddr.value() : 0 }; } { @@ -1060,14 +1060,14 @@ error_code cellVdecDecodeAuEx2(u32 handle, CellVdecDecodeMode mode, vm::cptr (CELL_VDEC_DEC_MODE_B_SKIP | CELL_VDEC_DEC_MODE_PB_SKIP)) { - return { CELL_VDEC_ERROR_ARG, fmt::format("mode=%d", +mode) }; + return { CELL_VDEC_ERROR_ARG, "mode=%d", +mode }; } // TODO: what does the 3 stand for ? if ((mode == (CELL_VDEC_DEC_MODE_B_SKIP | CELL_VDEC_DEC_MODE_PB_SKIP) && vdec->type != 3) || (mode == CELL_VDEC_DEC_MODE_PB_SKIP && vdec->type != CELL_VDEC_CODEC_TYPE_AVC)) { - return { CELL_VDEC_ERROR_ARG, fmt::format("mode=%d, type=%d", +mode, vdec->type) }; + return { CELL_VDEC_ERROR_ARG, "mode=%d, type=%d", +mode, vdec->type }; } if (!vdec->au_count.try_inc(4))