Skip to content

Commit

Permalink
cellGameGetParamString: fix patch mode
Browse files Browse the repository at this point in the history
  • Loading branch information
Megamouse committed Apr 22, 2022
1 parent f92b487 commit f0fdd18
Showing 1 changed file with 20 additions and 2 deletions.
22 changes: 20 additions & 2 deletions rpcs3/Emu/Cell/Modules/cellGame.cpp
Expand Up @@ -175,6 +175,24 @@ struct content_permission final
}
};

template<>
void fmt_class_string<content_permission::check_mode>::format(std::string& out, u64 arg)
{
format_enum(out, arg, [](auto error)
{
switch (error)
{
STR_CASE(content_permission::check_mode::not_set);
STR_CASE(content_permission::check_mode::game_data);
STR_CASE(content_permission::check_mode::patch);
STR_CASE(content_permission::check_mode::hdd_game);
STR_CASE(content_permission::check_mode::disc_game);
}

return unknown;
});
}

error_code cellHddGameCheck(ppu_thread& ppu, u32 version, vm::cptr<char> dirName, u32 errDialog, vm::ptr<CellHddGameStatCallback> funcStat, u32 container)
{
cellGame.warning("cellHddGameCheck(version=%d, dirName=%s, errDialog=%d, funcStat=*0x%x, container=%d)", version, dirName, errDialog, funcStat, container);
Expand Down Expand Up @@ -1099,10 +1117,10 @@ struct string_key_info
switch (mode)
{
case content_permission::check_mode::game_data:
case content_permission::check_mode::patch: // TODO: it's unclear if patch mode should also support these flags
{
return !!(flags & (is_setter ? strkey_flag::set_game_data : strkey_flag::get_game_data));
}
case content_permission::check_mode::patch:
case content_permission::check_mode::hdd_game:
case content_permission::check_mode::disc_game:
{
Expand Down Expand Up @@ -1185,7 +1203,7 @@ error_code cellGameGetParamString(s32 id, vm::ptr<char> buf, u32 bufsize)
if (!key.is_supported(false, perm.mode))
{
// TODO: this error is possibly only returned during debug mode
return CELL_GAME_ERROR_NOTSUPPORTED;
return { CELL_GAME_ERROR_NOTSUPPORTED, "id %d is not supported in the current check mode: %s", id, perm.mode.load() };
}

const auto value = psf::get_string(perm.sfo, key.name);
Expand Down

0 comments on commit f0fdd18

Please sign in to comment.