diff --git a/src/xenia/app/xenia_main.cc b/src/xenia/app/xenia_main.cc index be2f3d34b..def29b7c5 100644 --- a/src/xenia/app/xenia_main.cc +++ b/src/xenia/app/xenia_main.cc @@ -18,6 +18,7 @@ #include "xenia/debug/ui/debug_window.h" #include "xenia/emulator.h" #include "xenia/ui/file_picker.h" +#include "xenia/vfs/devices/host_path_device.h" // Available audio systems: #include "xenia/apu/nop/nop_audio_system.h" @@ -43,6 +44,9 @@ DEFINE_string(hid, "any", "Input system. Use: [any, nop, winkey, xinput]"); DEFINE_string(target, "", "Specifies the target .xex or .iso to execute."); DEFINE_bool(fullscreen, false, "Toggles fullscreen"); +DEFINE_bool(mount_scratch, false, "Enable scratch mount"); +DEFINE_bool(mount_cache, false, "Enable cache mount"); + namespace xe { namespace app { @@ -141,6 +145,46 @@ int xenia_main(const std::vector& args) { return 1; } + if (FLAGS_mount_scratch) { + auto scratch_device = std::make_unique( + "\\SCRATCH", L"scratch", false); + if (!scratch_device->Initialize()) { + XELOGE("Unable to scan scratch path"); + } else { + if (!emulator->file_system()->RegisterDevice(std::move(scratch_device))) { + XELOGE("Unable to register scratch path"); + } else { + emulator->file_system()->RegisterSymbolicLink("scratch:", "\\SCRATCH"); + } + } + } + + if (FLAGS_mount_cache) { + auto cache0_device = + std::make_unique("\\CACHE0", L"cache0", false); + if (!cache0_device->Initialize()) { + XELOGE("Unable to scan cache0 path"); + } else { + if (!emulator->file_system()->RegisterDevice(std::move(cache0_device))) { + XELOGE("Unable to register cache0 path"); + } else { + emulator->file_system()->RegisterSymbolicLink("cache0:", "\\CACHE0"); + } + } + + auto cache1_device = + std::make_unique("\\CACHE1", L"cache1", false); + if (!cache1_device->Initialize()) { + XELOGE("Unable to scan cache1 path"); + } else { + if (!emulator->file_system()->RegisterDevice(std::move(cache1_device))) { + XELOGE("Unable to register cache1 path"); + } else { + emulator->file_system()->RegisterSymbolicLink("cache1:", "\\CACHE1"); + } + } + } + // Set a debug handler. // This will respond to debugging requests so we can open the debug UI. std::unique_ptr debug_window;