Feature/mc0 IO + Win IO fixes (#57)

* mc0: map memory card paths to mcRoot and related io tests

* Fix mc0 test setup to initialize temp paths

* fix: implementing WIN32 I/O support in syscalls

* fix: avoid fioWrite deadlock

Do not lock the fd map while calling getHostFile; use the syscall file mutex around fwrite instead
This commit is contained in:
Antonio Guastella
2026-02-17 16:40:57 +01:00
committed by GitHub
parent c4555f6723
commit cf5f57180f
8 changed files with 356 additions and 47 deletions
+7
View File
@@ -118,6 +118,7 @@ namespace
defaults.elfDirectory = ec ? std::filesystem::path(".") : cwd.lexically_normal();
defaults.hostRoot = defaults.elfDirectory;
defaults.cdRoot = defaults.elfDirectory;
defaults.mcRoot = defaults.elfDirectory / "mc0";
return defaults;
}();
@@ -404,6 +405,7 @@ void PS2Runtime::setIoPaths(const IoPaths &paths)
normalized.elfDirectory = normalizeAbsolutePath(normalized.elfDirectory);
normalized.hostRoot = normalizeAbsolutePath(normalized.hostRoot);
normalized.cdRoot = normalizeAbsolutePath(normalized.cdRoot);
normalized.mcRoot = normalizeAbsolutePath(normalized.mcRoot);
normalized.cdImage = normalizeAbsolutePath(normalized.cdImage);
if (normalized.elfDirectory.empty() && !normalized.elfPath.empty())
@@ -419,6 +421,10 @@ void PS2Runtime::setIoPaths(const IoPaths &paths)
{
normalized.cdRoot = normalized.elfDirectory;
}
if (normalized.mcRoot.empty())
{
normalized.mcRoot = normalized.elfDirectory / "mc0";
}
runtimeIoPaths() = normalized;
}
@@ -436,6 +442,7 @@ void PS2Runtime::configureIoPathsFromElf(const std::string &elfPath)
{
paths.hostRoot = paths.elfDirectory;
paths.cdRoot = paths.elfDirectory;
paths.mcRoot = paths.elfDirectory / "mc0";
}
paths.cdImage.clear();