[APP] Added force_mount_devkit to config

This commit is contained in:
Adrian
2025-09-19 21:13:40 +01:00
committed by Radosław Gliński
parent 8d03766d03
commit e05b934eca
2 changed files with 34 additions and 9 deletions

View File

@@ -91,6 +91,8 @@ DEFINE_bool(mount_scratch, false, "Enable scratch mount", "Storage");
DEFINE_bool(mount_cache, true, "Enable cache mount", "Storage");
UPDATE_from_bool(mount_cache, 2024, 8, 31, 20, false);
DEFINE_bool(force_mount_devkit, false, "Force devkit mount", "Storage");
DEFINE_transient_path(target, "",
"Specifies the target .xex or .iso to execute.",
"General");
@@ -566,17 +568,18 @@ void EmulatorApp::EmulatorThread() {
app_context().CallInUIThread(
[this]() { emulator_window_->SetupGraphicsSystemPresenterPainting(); });
const auto fs = emulator_->file_system();
if (cvars::mount_scratch) {
auto scratch_device = std::make_unique<xe::vfs::HostPathDevice>(
"\\SCRATCH", "scratch", false);
if (!scratch_device->Initialize()) {
XELOGE("Unable to scan scratch path");
} else {
if (!emulator_->file_system()->RegisterDevice(
std::move(scratch_device))) {
if (!fs->RegisterDevice(std::move(scratch_device))) {
XELOGE("Unable to register scratch path");
} else {
emulator_->file_system()->RegisterSymbolicLink("scratch:", "\\SCRATCH");
fs->RegisterSymbolicLink("scratch:", "\\SCRATCH");
}
}
}
@@ -587,10 +590,10 @@ void EmulatorApp::EmulatorThread() {
if (!cache0_device->Initialize()) {
XELOGE("Unable to scan cache0 path");
} else {
if (!emulator_->file_system()->RegisterDevice(std::move(cache0_device))) {
if (!fs->RegisterDevice(std::move(cache0_device))) {
XELOGE("Unable to register cache0 path");
} else {
emulator_->file_system()->RegisterSymbolicLink("cache0:", "\\CACHE0");
fs->RegisterSymbolicLink("cache0:", "\\CACHE0");
}
}
@@ -599,10 +602,10 @@ void EmulatorApp::EmulatorThread() {
if (!cache1_device->Initialize()) {
XELOGE("Unable to scan cache1 path");
} else {
if (!emulator_->file_system()->RegisterDevice(std::move(cache1_device))) {
if (!fs->RegisterDevice(std::move(cache1_device))) {
XELOGE("Unable to register cache1 path");
} else {
emulator_->file_system()->RegisterSymbolicLink("cache1:", "\\CACHE1");
fs->RegisterSymbolicLink("cache1:", "\\CACHE1");
}
}
@@ -615,14 +618,30 @@ void EmulatorApp::EmulatorThread() {
if (!cache_device->Initialize()) {
XELOGE("Unable to scan cache path");
} else {
if (!emulator_->file_system()->RegisterDevice(std::move(cache_device))) {
if (!fs->RegisterDevice(std::move(cache_device))) {
XELOGE("Unable to register cache path");
} else {
emulator_->file_system()->RegisterSymbolicLink("cache:", "\\CACHE");
fs->RegisterSymbolicLink("cache:", "\\CACHE");
}
}
}
if (cvars::force_mount_devkit) {
auto devkit_device =
std::make_unique<xe::vfs::HostPathDevice>("\\DEVKIT", "devkit", false);
if (!devkit_device->Initialize()) {
XELOGE("Unable to scan devkit path");
}
if (!fs->RegisterDevice(std::move(devkit_device))) {
XELOGE("Unable to register devkit path");
}
fs->RegisterSymbolicLink("DEVKIT:", "\\DEVKIT");
fs->RegisterSymbolicLink("e:", "\\DEVKIT");
}
// Set a debug handler.
// This will respond to debugging requests so we can open the debug UI.
if (cvars::debug) {

View File

@@ -19,6 +19,8 @@
DECLARE_bool(debug);
DECLARE_bool(force_mount_devkit);
namespace xe {
namespace kernel {
namespace xbdm {
@@ -130,6 +132,10 @@ dword_result_t DmCloseLoadedModules_entry(lpdword_t walk_modules_ptr) {
DECLARE_XBDM_EXPORT1(DmCloseLoadedModules, kDebug, kStub);
dword_result_t DmMapDevkitDrive_entry(const ppc_context_t& ctx) {
if (cvars::force_mount_devkit) {
return 0;
}
auto devkit_device =
std::make_unique<xe::vfs::HostPathDevice>("\\DEVKIT", "devkit", false);