|
2 | 2 | ****************************************************************************** |
3 | 3 | * Xenia : Xbox 360 Emulator Research Project * |
4 | 4 | ****************************************************************************** |
5 | | - * Copyright 2021 Ben Vanik. All rights reserved. * |
| 5 | + * Copyright 2022 Ben Vanik. All rights reserved. * |
6 | 6 | * Released under the BSD license - see LICENSE in the root for more details. * |
7 | 7 | ****************************************************************************** |
8 | 8 | */ |
|
45 | 45 | #include "xenia/ui/imgui_drawer.h" |
46 | 46 | #include "xenia/ui/window.h" |
47 | 47 | #include "xenia/ui/windowed_app_context.h" |
| 48 | +#include "xenia/vfs/device.h" |
48 | 49 | #include "xenia/vfs/devices/disc_image_device.h" |
49 | 50 | #include "xenia/vfs/devices/host_path_device.h" |
50 | 51 | #include "xenia/vfs/devices/null_device.h" |
51 | | -#include "xenia/vfs/devices/stfs_container_device.h" |
52 | 52 | #include "xenia/vfs/virtual_file_system.h" |
| 53 | +#include "xenia/vfs/devices/xcontent_container_device.h" |
53 | 54 |
|
54 | 55 | #if XE_ARCH_AMD64 |
55 | 56 | #include "xenia/cpu/backend/x64/x64_backend.h" |
@@ -351,16 +352,21 @@ X_STATUS Emulator::LaunchDiscImage(const std::filesystem::path& path) { |
351 | 352 |
|
352 | 353 | X_STATUS Emulator::LaunchStfsContainer(const std::filesystem::path& path) { |
353 | 354 | auto mount_path = "\\Device\\Cdrom0"; |
| 355 | + auto device = |
| 356 | + vfs::XContentContainerDevice::CreateContentDevice(mount_path, path); |
354 | 357 |
|
| 358 | + if (!device) { |
| 359 | + xe::FatalError("Cannot create XContent (STFS, SVOD) device."); |
| 360 | + return X_STATUS_NO_SUCH_FILE; |
| 361 | + } |
355 | 362 | // Register the container in the virtual filesystem. |
356 | | - auto device = std::make_unique<vfs::StfsContainerDevice>(mount_path, path); |
357 | 363 | if (!device->Initialize()) { |
358 | 364 | xe::FatalError( |
359 | | - "Unable to mount STFS container; file not found or corrupt."); |
| 365 | + "Unable to initialize XContent container; file not found or corrupt."); |
360 | 366 | return X_STATUS_NO_SUCH_FILE; |
361 | 367 | } |
362 | 368 | if (!file_system_->RegisterDevice(std::move(device))) { |
363 | | - xe::FatalError("Unable to register STFS container."); |
| 369 | + xe::FatalError("Unable to register XContent container."); |
364 | 370 | return X_STATUS_NO_SUCH_FILE; |
365 | 371 | } |
366 | 372 |
|
|
0 commit comments