[Kernel] Added support for writing/reading GPD files

This breaks settings in games that are using them and savefiles in games that use settings to store progress
This commit is contained in:
Gliniak
2024-12-15 13:58:08 +01:00
committed by Radosław Gliński
parent ccf7adf015
commit 1110cdd372
58 changed files with 4642 additions and 2122 deletions

View File

@@ -16,6 +16,7 @@
#include "third_party/fmt/include/fmt/format.h"
#include "xenia/base/filesystem.h"
#include "xenia/base/string.h"
#include "xenia/emulator.h"
#include "xenia/kernel/kernel_state.h"
#include "xenia/kernel/xam/user_profile.h"
#include "xenia/kernel/xfile.h"
@@ -30,6 +31,7 @@ namespace xam {
static const char* kThumbnailFileName = "__thumbnail.png";
static const char* kGameContentHeaderDirName = "Headers";
static const char* kSpaFilename = "spa.bin";
static int content_device_id_ = 0;
@@ -381,6 +383,15 @@ X_RESULT ContentManager::OpenContent(const std::string_view root_name,
content_license = package->GetPackageLicense();
// Check for SPA file in package. Check it only for DLCs
if (data.content_type == XContentType::kMarketplaceContent) {
std::string spa_path = fmt::format("{}:\\{}", root_name, kSpaFilename);
auto spa_update = kernel_state_->file_system()->ResolvePath(spa_path);
if (spa_update) {
kernel_state_->UpdateSpaData(spa_update);
}
}
open_packages_.insert({string_key::create(root_name), package.release()});
return X_ERROR_SUCCESS;