Ensure runtime directories are created in storage_root()

At the moment they end up wherever the command is run from on linux
or exe directory on Windows, which ignores the "portable" install
mechanism
This commit is contained in:
Herman S.
2025-08-29 00:18:50 +09:00
committed by Radosław Gliński
parent 3e89d53854
commit 3e6a74be13

View File

@@ -572,7 +572,7 @@ void EmulatorApp::EmulatorThread() {
if (cvars::mount_scratch) {
auto scratch_device = std::make_unique<xe::vfs::HostPathDevice>(
"\\SCRATCH", "scratch", false);
"\\SCRATCH", emulator_->storage_root() / "scratch", false);
if (!scratch_device->Initialize()) {
XELOGE("Unable to scan scratch path");
} else {
@@ -585,8 +585,8 @@ void EmulatorApp::EmulatorThread() {
}
if (cvars::mount_cache) {
auto cache0_device =
std::make_unique<xe::vfs::HostPathDevice>("\\CACHE0", "cache0", false);
auto cache0_device = std::make_unique<xe::vfs::HostPathDevice>(
"\\CACHE0", emulator_->storage_root() / "cache0", false);
if (!cache0_device->Initialize()) {
XELOGE("Unable to scan cache0 path");
} else {
@@ -597,8 +597,8 @@ void EmulatorApp::EmulatorThread() {
}
}
auto cache1_device =
std::make_unique<xe::vfs::HostPathDevice>("\\CACHE1", "cache1", false);
auto cache1_device = std::make_unique<xe::vfs::HostPathDevice>(
"\\CACHE1", emulator_->storage_root() / "cache1", false);
if (!cache1_device->Initialize()) {
XELOGE("Unable to scan cache1 path");
} else {
@@ -613,8 +613,8 @@ void EmulatorApp::EmulatorThread() {
// NOTE: this must be registered _after_ the cache0/cache1 devices, due to
// substring/start_with logic inside VirtualFileSystem::ResolvePath, else
// accesses to those devices will go here instead
auto cache_device =
std::make_unique<xe::vfs::HostPathDevice>("\\CACHE", "cache", false);
auto cache_device = std::make_unique<xe::vfs::HostPathDevice>(
"\\CACHE", emulator_->storage_root() / "cache", false);
if (!cache_device->Initialize()) {
XELOGE("Unable to scan cache path");
} else {