Skip to content

Commit

Permalink
HLE: simplify some error formats
Browse files Browse the repository at this point in the history
  • Loading branch information
Megamouse committed Apr 22, 2022
1 parent 1d6fbf1 commit 8acb62f
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 10 deletions.
4 changes: 2 additions & 2 deletions rpcs3/Emu/Cell/Modules/cellGame.cpp
Expand Up @@ -218,7 +218,7 @@ error_code cellHddGameCheck(ppu_thread& ppu, u32 version, vm::cptr<char> 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 };
}
}

Expand Down Expand Up @@ -636,7 +636,7 @@ error_code cellGameDataCheck(u32 type, vm::cptr<char> dirName, vm::ptr<CellGameC
if (psf_error != psf::error::stream)
{
init.cancel();
return {CELL_GAME_ERROR_BROKEN, fmt::format("psf::error='%s', type='%d' CATEGORY='%s'", psf_error, type, cat)};
return {CELL_GAME_ERROR_BROKEN, "psf::error='%s', type='%d' CATEGORY='%s'", psf_error, type, cat};
}
}

Expand Down
4 changes: 2 additions & 2 deletions rpcs3/Emu/Cell/Modules/cellSearch.cpp
Expand Up @@ -1477,13 +1477,13 @@ error_code cellSearchGetMusicSelectionContext(CellSearchId searchId, vm::cptr<Ce
// Check if the type of the found content is correct
if (content->second->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
Expand Down
12 changes: 6 additions & 6 deletions rpcs3/Emu/Cell/Modules/cellVdec.cpp
Expand Up @@ -1004,7 +1004,7 @@ error_code cellVdecDecodeAu(u32 handle, CellVdecDecodeMode mode, vm::cptr<CellVd

if (!vdec || !auInfo || !auInfo->size || !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 };
}

{
Expand All @@ -1018,14 +1018,14 @@ error_code cellVdecDecodeAu(u32 handle, CellVdecDecodeMode mode, vm::cptr<CellVd

if (mode < 0 || mode > (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))
Expand All @@ -1046,7 +1046,7 @@ error_code cellVdecDecodeAuEx2(u32 handle, CellVdecDecodeMode mode, vm::cptr<Cel

if (!vdec || !auInfo || !auInfo->size || !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 };
}

{
Expand All @@ -1060,14 +1060,14 @@ error_code cellVdecDecodeAuEx2(u32 handle, CellVdecDecodeMode mode, vm::cptr<Cel

if (mode < 0 || mode > (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))
Expand Down

0 comments on commit 8acb62f

Please sign in to comment.