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