summaryrefslogtreecommitdiffstats
path: root/src/core/core.cpp
diff options
context:
space:
mode:
authorLioncash <mathew1800@gmail.com>2020-11-26 20:03:27 +0100
committerLioncash <mathew1800@gmail.com>2020-11-26 20:05:13 +0100
commit9d3d0ae999d6dfaf2d51f1b774dd400aa6e9e13a (patch)
tree513093179fc27e50447b3bf717d1a37dbc47b43d /src/core/core.cpp
parentMerge pull request #4975 from comex/invalid-syncpoint-id (diff)
downloadyuzu-9d3d0ae999d6dfaf2d51f1b774dd400aa6e9e13a.tar
yuzu-9d3d0ae999d6dfaf2d51f1b774dd400aa6e9e13a.tar.gz
yuzu-9d3d0ae999d6dfaf2d51f1b774dd400aa6e9e13a.tar.bz2
yuzu-9d3d0ae999d6dfaf2d51f1b774dd400aa6e9e13a.tar.lz
yuzu-9d3d0ae999d6dfaf2d51f1b774dd400aa6e9e13a.tar.xz
yuzu-9d3d0ae999d6dfaf2d51f1b774dd400aa6e9e13a.tar.zst
yuzu-9d3d0ae999d6dfaf2d51f1b774dd400aa6e9e13a.zip
Diffstat (limited to '')
-rw-r--r--src/core/core.cpp34
1 files changed, 22 insertions, 12 deletions
diff --git a/src/core/core.cpp b/src/core/core.cpp
index 7ca3652af..6acdffa6f 100644
--- a/src/core/core.cpp
+++ b/src/core/core.cpp
@@ -92,33 +92,43 @@ FileSys::VirtualFile GetGameFileFromPath(const FileSys::VirtualFilesystem& vfs,
std::string dir_name;
std::string filename;
Common::SplitPath(path, &dir_name, &filename, nullptr);
+
if (filename == "00") {
const auto dir = vfs->OpenDirectory(dir_name, FileSys::Mode::Read);
std::vector<FileSys::VirtualFile> concat;
- for (u8 i = 0; i < 0x10; ++i) {
- auto next = dir->GetFile(fmt::format("{:02X}", i));
- if (next != nullptr)
+
+ for (u32 i = 0; i < 0x10; ++i) {
+ const auto file_name = fmt::format("{:02X}", i);
+ auto next = dir->GetFile(file_name);
+
+ if (next != nullptr) {
concat.push_back(std::move(next));
- else {
- next = dir->GetFile(fmt::format("{:02x}", i));
- if (next != nullptr)
- concat.push_back(std::move(next));
- else
+ } else {
+ next = dir->GetFile(file_name);
+
+ if (next == nullptr) {
break;
+ }
+
+ concat.push_back(std::move(next));
}
}
- if (concat.empty())
+ if (concat.empty()) {
return nullptr;
+ }
- return FileSys::ConcatenatedVfsFile::MakeConcatenatedFile(concat, dir->GetName());
+ return FileSys::ConcatenatedVfsFile::MakeConcatenatedFile(std::move(concat),
+ dir->GetName());
}
- if (Common::FS::IsDirectory(path))
- return vfs->OpenFile(path + "/" + "main", FileSys::Mode::Read);
+ if (Common::FS::IsDirectory(path)) {
+ return vfs->OpenFile(path + "/main", FileSys::Mode::Read);
+ }
return vfs->OpenFile(path, FileSys::Mode::Read);
}
+
struct System::Impl {
explicit Impl(System& system)
: kernel{system}, fs_controller{system}, memory{system},