[App] Move NullDevice mounting code back into emulator.cc
Fixes Xenia not being able to locate unpacked XEXs.. Ideally this should be inside xenia_main.cc though, need to figure out some way to get it working there.
This commit is contained in:
parent
55f98d3770
commit
183ff64551
|
@ -20,7 +20,6 @@
|
||||||
#include "xenia/emulator.h"
|
#include "xenia/emulator.h"
|
||||||
#include "xenia/ui/file_picker.h"
|
#include "xenia/ui/file_picker.h"
|
||||||
#include "xenia/vfs/devices/host_path_device.h"
|
#include "xenia/vfs/devices/host_path_device.h"
|
||||||
#include "xenia/vfs/devices/null_device.h"
|
|
||||||
|
|
||||||
// Available audio systems:
|
// Available audio systems:
|
||||||
#include "xenia/apu/nop/nop_audio_system.h"
|
#include "xenia/apu/nop/nop_audio_system.h"
|
||||||
|
@ -291,17 +290,6 @@ int xenia_main(const std::vector<std::wstring>& args) {
|
||||||
emulator->file_system()->RegisterSymbolicLink("cache1:", "\\CACHE1");
|
emulator->file_system()->RegisterSymbolicLink("cache1:", "\\CACHE1");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Below are accessed directly by STFC/cache code baked into the game
|
|
||||||
// By using a NullDevice that just returns success to all IO requests, the
|
|
||||||
// cache code should hopefully progress without erroring out
|
|
||||||
auto null_files = {std::string("\\Partition0"), std::string("\\Cache0"),
|
|
||||||
std::string("\\Cache1")};
|
|
||||||
auto null_device = std::make_unique<vfs::NullDevice>(
|
|
||||||
"\\Device\\Harddisk0", null_files, emulator->file_system());
|
|
||||||
if (null_device->Initialize()) {
|
|
||||||
emulator->file_system()->RegisterDevice(std::move(null_device));
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Set a debug handler.
|
// Set a debug handler.
|
||||||
|
|
|
@ -41,6 +41,7 @@
|
||||||
#include "xenia/ui/imgui_dialog.h"
|
#include "xenia/ui/imgui_dialog.h"
|
||||||
#include "xenia/vfs/devices/disc_image_device.h"
|
#include "xenia/vfs/devices/disc_image_device.h"
|
||||||
#include "xenia/vfs/devices/host_path_device.h"
|
#include "xenia/vfs/devices/host_path_device.h"
|
||||||
|
#include "xenia/vfs/devices/null_device.h"
|
||||||
#include "xenia/vfs/devices/stfs_container_device.h"
|
#include "xenia/vfs/devices/stfs_container_device.h"
|
||||||
#include "xenia/vfs/virtual_file_system.h"
|
#include "xenia/vfs/virtual_file_system.h"
|
||||||
|
|
||||||
|
@ -655,6 +656,19 @@ std::string Emulator::FindLaunchModule() {
|
||||||
|
|
||||||
X_STATUS Emulator::CompleteLaunch(const std::wstring& path,
|
X_STATUS Emulator::CompleteLaunch(const std::wstring& path,
|
||||||
const std::string& module_path) {
|
const std::string& module_path) {
|
||||||
|
if (cvars::mount_cache) {
|
||||||
|
// Below are accessed directly by STFC/cache code baked into the game
|
||||||
|
// By using a NullDevice that just returns success to all IO requests, the
|
||||||
|
// cache code should hopefully progress without erroring out
|
||||||
|
auto null_files = {std::string("\\Partition0"), std::string("\\Cache0"),
|
||||||
|
std::string("\\Cache1")};
|
||||||
|
auto null_device = std::make_unique<vfs::NullDevice>(
|
||||||
|
"\\Device\\Harddisk0", null_files, file_system());
|
||||||
|
if (null_device->Initialize()) {
|
||||||
|
file_system_->RegisterDevice(std::move(null_device));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// Reset state.
|
// Reset state.
|
||||||
title_id_ = 0;
|
title_id_ = 0;
|
||||||
game_title_ = L"";
|
game_title_ = L"";
|
||||||
|
|
Loading…
Reference in New Issue