summaryrefslogtreecommitdiff
path: root/src/core/core.cpp
diff options
context:
space:
mode:
authorGravatar Feng Chen2021-07-20 13:10:05 +0800
committerGravatar GitHub2021-07-20 01:10:05 -0400
commit07073734ed3785d1dee487f0c898a645fbd5f03c (patch)
treee7c72b615b7a551cc1fb8a6a336bce60e5a0d314 /src/core/core.cpp
parentMerge pull request #6580 from ReinUsesLisp/xfb-radv (diff)
downloadyuzu-07073734ed3785d1dee487f0c898a645fbd5f03c.tar.gz
yuzu-07073734ed3785d1dee487f0c898a645fbd5f03c.tar.xz
yuzu-07073734ed3785d1dee487f0c898a645fbd5f03c.zip
file_sys: Support load game collection (#6582)
Adds support for loading games with multiple programs embedded within such as the Dragon Quest 1+2+3 Collection
Diffstat (limited to 'src/core/core.cpp')
-rw-r--r--src/core/core.cpp13
1 files changed, 6 insertions, 7 deletions
diff --git a/src/core/core.cpp b/src/core/core.cpp
index 406320ed6..15226cf41 100644
--- a/src/core/core.cpp
+++ b/src/core/core.cpp
@@ -216,9 +216,9 @@ struct System::Impl {
216 } 216 }
217 217
218 ResultStatus Load(System& system, Frontend::EmuWindow& emu_window, const std::string& filepath, 218 ResultStatus Load(System& system, Frontend::EmuWindow& emu_window, const std::string& filepath,
219 std::size_t program_index) { 219 u64 program_id, std::size_t program_index) {
220 app_loader = Loader::GetLoader(system, GetGameFileFromPath(virtual_filesystem, filepath), 220 app_loader = Loader::GetLoader(system, GetGameFileFromPath(virtual_filesystem, filepath),
221 program_index); 221 program_id, program_index);
222 222
223 if (!app_loader) { 223 if (!app_loader) {
224 LOG_CRITICAL(Core, "Failed to obtain loader for {}!", filepath); 224 LOG_CRITICAL(Core, "Failed to obtain loader for {}!", filepath);
@@ -269,11 +269,10 @@ struct System::Impl {
269 } 269 }
270 } 270 }
271 271
272 u64 title_id{0}; 272 if (app_loader->ReadProgramId(program_id) != Loader::ResultStatus::Success) {
273 if (app_loader->ReadProgramId(title_id) != Loader::ResultStatus::Success) {
274 LOG_ERROR(Core, "Failed to find title id for ROM (Error {})", load_result); 273 LOG_ERROR(Core, "Failed to find title id for ROM (Error {})", load_result);
275 } 274 }
276 perf_stats = std::make_unique<PerfStats>(title_id); 275 perf_stats = std::make_unique<PerfStats>(program_id);
277 // Reset counters and set time origin to current frame 276 // Reset counters and set time origin to current frame
278 GetAndResetPerfStats(); 277 GetAndResetPerfStats();
279 perf_stats->BeginSystemFrame(); 278 perf_stats->BeginSystemFrame();
@@ -459,8 +458,8 @@ void System::Shutdown() {
459} 458}
460 459
461System::ResultStatus System::Load(Frontend::EmuWindow& emu_window, const std::string& filepath, 460System::ResultStatus System::Load(Frontend::EmuWindow& emu_window, const std::string& filepath,
462 std::size_t program_index) { 461 u64 program_id, std::size_t program_index) {
463 return impl->Load(*this, emu_window, filepath, program_index); 462 return impl->Load(*this, emu_window, filepath, program_id, program_index);
464} 463}
465 464
466bool System::IsPoweredOn() const { 465bool System::IsPoweredOn() const {