|
83 | 83 | #define WIIU_VOL_CONTENT_PATH "fs:/vol/content/"
|
84 | 84 | #define WIIU_SD_FAT_PATH "sd:/"
|
85 | 85 | #define WIIU_USB_FAT_PATH "usb:/"
|
| 86 | +#define WIIU_USB_WFS_PATH "storage_usb:/" |
86 | 87 |
|
87 | 88 | /**
|
88 | 89 | * The Wii U frontend driver, along with the main() method.
|
|
92 | 93 | static enum frontend_fork wiiu_fork_mode = FRONTEND_FORK_NONE;
|
93 | 94 | static bool have_libfat_usb = false;
|
94 | 95 | static bool have_libfat_sdcard = false;
|
| 96 | +static bool have_wfs_usb = false; |
95 | 97 | #endif
|
96 | 98 | static bool in_exec = false;
|
97 | 99 |
|
@@ -244,6 +246,12 @@ static int frontend_wiiu_parse_drive_list(void *data, bool load_content)
|
244 | 246 | enum_idx,
|
245 | 247 | FILE_TYPE_DIRECTORY, 0, 0, NULL);
|
246 | 248 |
|
| 249 | + if (have_wfs_usb) |
| 250 | + menu_entries_append(list, WIIU_USB_WFS_PATH, |
| 251 | + msg_hash_to_str(MENU_ENUM_LABEL_FILE_DETECT_CORE_LIST_PUSH_DIR), |
| 252 | + enum_idx, |
| 253 | + FILE_TYPE_DIRECTORY, 0, 0, NULL); |
| 254 | + |
247 | 255 | #endif
|
248 | 256 | return 0;
|
249 | 257 | }
|
@@ -672,27 +680,42 @@ static void main_loop(void)
|
672 | 680 |
|
673 | 681 | static void init_filesystems(void)
|
674 | 682 | {
|
675 |
| -#if defined(HAVE_LIBMOCHA) && defined(HAVE_LIBFAT) |
| 683 | +#if defined(HAVE_LIBMOCHA) |
676 | 684 | if (Mocha_InitLibrary() == MOCHA_RESULT_SUCCESS)
|
677 | 685 | {
|
| 686 | + if (Mocha_MountFS("storage_usb", NULL, "/vol/storage_usb01") == MOCHA_RESULT_SUCCESS) { |
| 687 | + if (exists(WIIU_USB_WFS_PATH)) |
| 688 | + have_wfs_usb = true; |
| 689 | + else /* Liar! */ |
| 690 | + Mocha_UnmountFS("storage_usb"); |
| 691 | + } |
| 692 | + |
| 693 | + |
| 694 | +#if defined(HAVE_LIBFAT) |
678 | 695 | have_libfat_usb = fatMount("usb", &Mocha_usb_disc_interface, 0, 512, 128);
|
679 | 696 | /* Mounting SD card with libfat is unsafe under Aroma */
|
680 | 697 | if (!in_aroma)
|
681 | 698 | have_libfat_sdcard = fatMount("sd", &Mocha_sdio_disc_interface, 0, 512, 128);
|
| 699 | +#endif /* HAVE_LIBFAT */ |
682 | 700 | }
|
683 |
| -#endif |
| 701 | +#endif /* HAVE_LIBMOCHA */ |
684 | 702 | }
|
685 | 703 |
|
686 | 704 | static void deinit_filesystems(void)
|
687 | 705 | {
|
688 |
| -#if defined(HAVE_LIBMOCHA) && defined(HAVE_LIBFAT) |
| 706 | +#if defined(HAVE_LIBMOCHA) |
| 707 | + if (have_wfs_usb) |
| 708 | + Mocha_UnmountFS("storage_usb"); |
| 709 | + |
| 710 | +#if defined(HAVE_LIBFAT) |
689 | 711 | if (have_libfat_usb)
|
690 | 712 | fatUnmount("usb");
|
691 | 713 | if (have_libfat_sdcard)
|
692 | 714 | fatUnmount("sd");
|
| 715 | +#endif /* HAVE_LIBFAT */ |
693 | 716 |
|
694 | 717 | Mocha_DeInitLibrary();
|
695 |
| -#endif |
| 718 | +#endif /* HAVE_LIBMOCHA */ |
696 | 719 | }
|
697 | 720 |
|
698 | 721 | static devoptab_t dotab_stdout =
|
|
0 commit comments