diff --git a/src/xenia/app/emulator_window.h b/src/xenia/app/emulator_window.h index 1a42a9f0f8..8cdfcb40ba 100644 --- a/src/xenia/app/emulator_window.h +++ b/src/xenia/app/emulator_window.h @@ -226,7 +226,6 @@ class EmulatorWindow { void GamepadHotKeys(); void ToggleGPUSetting(gpu_cvar index); bool IsUseNexusForGameBarEnabled(); - std::string BoolToString(bool value); void DisplayHotKeysConfig(); void RunPreviouslyPlayedTitle(); diff --git a/src/xenia/emulator.cc b/src/xenia/emulator.cc index 0278f8d9ef..1dc790ad0d 100644 --- a/src/xenia/emulator.cc +++ b/src/xenia/emulator.cc @@ -336,7 +336,7 @@ const std::unique_ptr Emulator::CreateVfsDeviceBasedOnPath( xe::ShowSimpleMessageBox( xe::SimpleMessageBoxType::Error, fmt::format( - "Unsupported format!" + "Unsupported format!\n" "Xenia does not support running software in an archived format.")); } return std::make_unique(mount_path, path); @@ -387,15 +387,15 @@ void Emulator::SetPersistentEmulatorFlags(uint64_t new_flags) { X_STATUS Emulator::MountPath(const std::filesystem::path& path, const std::string_view mount_path) { auto device = CreateVfsDeviceBasedOnPath(path, mount_path); - if (!device->Initialize()) { - xe::FatalError( + if (!device || !device->Initialize()) { + XELOGE( "Unable to mount the selected file, it is an unsupported format or " "corrupted."); return X_STATUS_NO_SUCH_FILE; } if (!file_system_->RegisterDevice(std::move(device))) { - xe::FatalError(fmt::format("Unable to register the input file to {}.", - xe::path_to_utf8(mount_path))); + XELOGE("Unable to register the input file to {}.", + xe::path_to_utf8(mount_path)); return X_STATUS_NO_SUCH_FILE; } @@ -413,24 +413,27 @@ X_STATUS Emulator::MountPath(const std::filesystem::path& path, X_STATUS Emulator::LaunchPath(const std::filesystem::path& path) { // Launch based on file type. // This is a silly guess based on file extension. + + X_STATUS mount_result = X_STATUS_SUCCESS; + if (!path.has_extension()) { // Likely an STFS container. - MountPath(path, "\\Device\\Cdrom0"); - return LaunchStfsContainer(path); + mount_result = MountPath(path, "\\Device\\Cdrom0"); + return mount_result ? mount_result : LaunchStfsContainer(path); }; auto extension = xe::utf8::lower_ascii(xe::path_to_utf8(path.extension())); if (extension == ".xex" || extension == ".elf" || extension == ".exe") { // Treat as a naked xex file. - MountPath(path, "\\Device\\Harddisk0\\Partition1"); - return LaunchXexFile(path); + mount_result = MountPath(path, "\\Device\\Harddisk0\\Partition1"); + return mount_result ? mount_result : LaunchXexFile(path); } else if (extension == ".zar") { // Assume a disc image. - MountPath(path, "\\Device\\Cdrom0"); - return LaunchDiscArchive(path); + mount_result = MountPath(path, "\\Device\\Cdrom0"); + return mount_result ? mount_result : LaunchDiscArchive(path); } else { // Assume a disc image. - MountPath(path, "\\Device\\Cdrom0"); - return LaunchDiscImage(path); + mount_result = MountPath(path, "\\Device\\Cdrom0"); + return mount_result ? mount_result : LaunchDiscImage(path); } } @@ -495,7 +498,7 @@ X_STATUS Emulator::LaunchDefaultModule(const std::filesystem::path& path) { X_STATUS Emulator::InstallContentPackage(const std::filesystem::path& path) { std::unique_ptr device = vfs::XContentContainerDevice::CreateContentDevice("", path); - if (!device->Initialize()) { + if (!device || !device->Initialize()) { XELOGE("Failed to initialize device"); return X_STATUS_INVALID_PARAMETER; } diff --git a/src/xenia/patcher/plugin_loader.cc b/src/xenia/patcher/plugin_loader.cc index 08c19c2107..bdc7926425 100644 --- a/src/xenia/patcher/plugin_loader.cc +++ b/src/xenia/patcher/plugin_loader.cc @@ -17,8 +17,8 @@ DEFINE_bool( allow_plugins, false, - "Allows loading of plugins/trainers from plugins\\title_id\\plugin.xex." - "Plugin are homebrew xex modules which can be used for making mods " + "Allows loading of plugins/trainers from plugins\\title_id\\plugin.xex. " + "Plugin are homebrew xex modules which can be used for making mods. " "This feature is experimental.", "General");