Merge pull request #6162 from JosJuice/nand-check-save-game-name

When NAND is damaged, show title names from save files
This commit is contained in:
Anthony
2017-11-06 23:11:34 -08:00
committed by GitHub
16 changed files with 213 additions and 77 deletions

View File

@ -166,12 +166,12 @@ std::string TitleDatabase::GetTitleName(const std::string& game_id, TitleType ty
return iterator != map.end() ? iterator->second : "";
}
std::string TitleDatabase::GetTitleName(u64 title_id) const
std::string TitleDatabase::GetChannelName(u64 title_id) const
{
const std::string id{
{static_cast<char>((title_id >> 24) & 0xff), static_cast<char>((title_id >> 16) & 0xff),
static_cast<char>((title_id >> 8) & 0xff), static_cast<char>(title_id & 0xff)}};
return GetTitleName(id, IOS::ES::IsChannel(title_id) ? TitleType::Channel : TitleType::Other);
return GetTitleName(id, TitleType::Channel);
}
std::string TitleDatabase::Describe(const std::string& game_id, TitleType type) const

View File

@ -27,7 +27,9 @@ public:
// Get a user friendly title name for a game ID.
// This falls back to returning an empty string if none could be found.
std::string GetTitleName(const std::string& game_id, TitleType = TitleType::Other) const;
std::string GetTitleName(u64 title_id) const;
// Same as above, but takes a title ID instead of a game ID, and can only find names of channels.
std::string GetChannelName(u64 title_id) const;
// Get a description for a game ID (title name if available + game ID).
std::string Describe(const std::string& game_id, TitleType = TitleType::Other) const;