Merge pull request #667 from RetroPortingToolKit/work/prepared-resource-overlays

Support verified prepared resources as disc overlays
This commit is contained in:
Matt Stanley
2026-10-15 00:51:10 -07:00
committed by GitHub
7 changed files with 234 additions and 26 deletions
+9 -1
View File
@@ -196,6 +196,9 @@ struct ModOverlay {
ModPatchTarget target = ModPatchTarget::DiscRaw;
uint64_t location = 0;
std::filesystem::path file;
// Format 10: verified same-feature derived resource instead of a package file.
std::string resource_id;
uint64_t resource_offset = 0;
std::string sha256;
std::string expected_sha256;
uint64_t size = 0;
@@ -315,6 +318,9 @@ struct ModPackage {
std::vector<ModDerivedDisc> derived_discs;
};
// False requests cancellation. Providers report between bounded work units
// and before publishing outputs; no UI code runs on the preparation worker.
using ModPrepareProgress = std::function<bool(float, const std::string&)>;
struct ModPrepareContext {
const ModPackage& package;
std::string feature_id;
@@ -322,6 +328,7 @@ struct ModPrepareContext {
std::filesystem::path cache_root;
std::filesystem::path application_dir;
std::map<std::string, std::filesystem::path> inputs;
ModPrepareProgress progress;
};
using ModMediaPreparer = std::function<bool(const ModPrepareContext&,
std::map<std::string, std::filesystem::path>&, std::string&)>;
@@ -469,7 +476,8 @@ public:
bool prepare_resources(const std::string& game_id,
const std::filesystem::path& disc_path,
const std::filesystem::path& cache_root,
std::string* error = nullptr, bool cached_only = false);
std::string* error = nullptr, bool cached_only = false,
const ModPrepareProgress& progress = {});
bool install_archive(const std::filesystem::path& archive,
std::string* installed_id = nullptr,
+2 -1
View File
@@ -24,7 +24,8 @@ bool mod_runtime_commit(const std::filesystem::path& disc_path = {},
bool save_selection = true);
/* Prepare a preboot launcher selection; the audited runtime retains a ticket. */
bool mod_runtime_prepare_for_launcher(const std::filesystem::path& disc_path,
std::string* error = nullptr);
std::string* error = nullptr,
const ModPrepareProgress& progress = {});
/* Audited preboot only: load and verify a plan using existing receipts.
* A miss never invokes a media converter or computes a disc digest. */