[Kernel] Add UserProfile::GetTitles, add title_id param to UpdateTitleGpd
Also changed GetTItleGpd to check for -1 to use current GPD (some games might be using 00... as title id, eg. protos)
This commit is contained in:
parent
00cffcacbb
commit
fa2cd63b1f
|
@ -294,7 +294,7 @@ util::GpdFile* UserProfile::SetTitleSpaData(const util::SpaFile& spa_data) {
|
|||
}
|
||||
|
||||
util::GpdFile* UserProfile::GetTitleGpd(uint32_t title_id) {
|
||||
if (!title_id) {
|
||||
if (title_id == -1) {
|
||||
return curr_gpd_;
|
||||
}
|
||||
|
||||
|
@ -306,16 +306,25 @@ util::GpdFile* UserProfile::GetTitleGpd(uint32_t title_id) {
|
|||
return &(*gpd).second;
|
||||
}
|
||||
|
||||
bool UserProfile::UpdateTitleGpd() {
|
||||
void UserProfile::GetTitles(std::vector<util::GpdFile*>& titles) {
|
||||
for (auto title : title_gpds_) {
|
||||
titles.push_back(&title.second);
|
||||
}
|
||||
}
|
||||
|
||||
bool UserProfile::UpdateTitleGpd(uint32_t title_id) {
|
||||
if (title_id == -1) {
|
||||
if (!curr_gpd_ || curr_title_id_ == -1) {
|
||||
return false;
|
||||
}
|
||||
title_id = curr_title_id_;
|
||||
}
|
||||
|
||||
bool result = UpdateGpd(curr_title_id_, *curr_gpd_);
|
||||
bool result = UpdateGpd(title_id, *curr_gpd_);
|
||||
if (!result) {
|
||||
XELOGE("UpdateTitleGpd failed on title %X!", curr_title_id_);
|
||||
XELOGE("UpdateTitleGpd failed on title %X!", title_id);
|
||||
} else {
|
||||
XELOGD("Updated title %X GPD successfully!", curr_title_id_);
|
||||
XELOGD("Updated title %X GPD successfully!", title_id);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
|
|
@ -208,9 +208,11 @@ class UserProfile {
|
|||
Setting* GetSetting(uint32_t setting_id);
|
||||
|
||||
util::GpdFile* SetTitleSpaData(const util::SpaFile& spa_data);
|
||||
util::GpdFile* GetTitleGpd(uint32_t title_id = 0);
|
||||
util::GpdFile* GetTitleGpd(uint32_t title_id = -1);
|
||||
|
||||
bool UpdateTitleGpd();
|
||||
void GetTitles(std::vector<util::GpdFile*>& titles);
|
||||
|
||||
bool UpdateTitleGpd(uint32_t title_id = -1);
|
||||
bool UpdateAllGpds();
|
||||
|
||||
private:
|
||||
|
|
Loading…
Reference in New Issue