From ad34f4845b12564f096bcec2e093e178a968bccb Mon Sep 17 00:00:00 2001 From: Roet-Ivar Date: Thu, 7 May 2020 00:28:12 +0200 Subject: [PATCH] Added access to WiiU-formated storage to be browsed by RetroArch --- frontend/drivers/platform_wiiu.c | 5 +++++ wiiu/main.c | 18 +++++++++++++++++- 2 files changed, 22 insertions(+), 1 deletion(-) diff --git a/frontend/drivers/platform_wiiu.c b/frontend/drivers/platform_wiiu.c index 57c5a8d430..970d275077 100644 --- a/frontend/drivers/platform_wiiu.c +++ b/frontend/drivers/platform_wiiu.c @@ -61,6 +61,7 @@ #define WIIU_SD_PATH "sd:/" #define WIIU_USB_PATH "usb:/" +#define WIIU_STORAGE_USB_PATH "storage_usb:/" /** * The Wii U frontend driver, along with the main() method. @@ -188,6 +189,10 @@ static int frontend_wiiu_parse_drive_list(void *data, bool load_content) msg_hash_to_str(MENU_ENUM_LABEL_FILE_DETECT_CORE_LIST_PUSH_DIR), enum_idx, FILE_TYPE_DIRECTORY, 0, 0); + menu_entries_append_enum(list, WIIU_STORAGE_USB_PATH, + msg_hash_to_str(MENU_ENUM_LABEL_FILE_DETECT_CORE_LIST_PUSH_DIR), + enum_idx, + FILE_TYPE_DIRECTORY, 0, 0); #endif return 0; } diff --git a/wiiu/main.c b/wiiu/main.c index 1740460613..9a4039f5a1 100644 --- a/wiiu/main.c +++ b/wiiu/main.c @@ -22,6 +22,7 @@ #if defined(HAVE_IOSUHAX) && defined(HAVE_LIBFAT) #include #include +#include #include #endif @@ -54,7 +55,7 @@ static void fsdev_init(void); static void fsdev_exit(void); bool iosuhaxMount = 0; - +int fsaFd = -1; static int mcp_hook_fd = -1; /* HBL elf entry point */ @@ -204,7 +205,11 @@ void __mount_filesystems(void) { #ifdef HAVE_LIBFAT if(iosuhaxMount) + { fatInitDefault(); + fsaFd = IOSUHAX_FSA_Open(); + mount_fs("storage_usb", fsaFd, NULL, "/vol/storage_usb01"); + } else mount_sd_fat("sd"); #else @@ -224,6 +229,17 @@ void __unmount_filesystems(void) { fatUnmount("sd:"); fatUnmount("usb:"); + + IOSUHAX_sdio_disc_interface.shutdown(); + IOSUHAX_usb_disc_interface.shutdown(); + + unmount_fs("storage_usb"); + IOSUHAX_FSA_Close(fsaFd); + + if(mcp_hook_fd >= 0) + MCPHookClose(); + else + IOSUHAX_Close(); } else unmount_sd_fat("sd");