mirror of
https://github.com/libretro/RetroArch
synced 2025-03-30 07:20:36 +00:00
wiiu: Make libfat/libiosuhax optional
This commit is contained in:
parent
26d3c3634c
commit
f6e4361fc9
@ -1922,7 +1922,7 @@ ifeq ($(HAVE_STATIC_VIDEO_FILTERS), 1)
|
|||||||
endif
|
endif
|
||||||
|
|
||||||
ifeq ($(WANT_IOSUHAX), 1)
|
ifeq ($(WANT_IOSUHAX), 1)
|
||||||
DEFINES += -I$(DEPS_DIR)/libiosuhax
|
DEFINES += -DHAVE_IOSUHAX
|
||||||
DEF_FLAGS += -I$(DEPS_DIR)/libiosuhax
|
DEF_FLAGS += -I$(DEPS_DIR)/libiosuhax
|
||||||
OBJ += $(DEPS_DIR)/libiosuhax/iosuhax.o \
|
OBJ += $(DEPS_DIR)/libiosuhax/iosuhax.o \
|
||||||
$(DEPS_DIR)/libiosuhax/iosuhax_devoptab.o \
|
$(DEPS_DIR)/libiosuhax/iosuhax_devoptab.o \
|
||||||
@ -1930,7 +1930,7 @@ ifeq ($(WANT_IOSUHAX), 1)
|
|||||||
endif
|
endif
|
||||||
|
|
||||||
ifeq ($(WANT_LIBFAT), 1)
|
ifeq ($(WANT_LIBFAT), 1)
|
||||||
DEFINES += -I$(DEPS_DIR)/libfat/include
|
DEFINES += -DHAVE_LIBFAT
|
||||||
DEF_FLAGS += -I$(DEPS_DIR)/libfat/include
|
DEF_FLAGS += -I$(DEPS_DIR)/libfat/include
|
||||||
OBJ += $(DEPS_DIR)/libfat/cache.o \
|
OBJ += $(DEPS_DIR)/libfat/cache.o \
|
||||||
$(DEPS_DIR)/libfat/directory.o \
|
$(DEPS_DIR)/libfat/directory.o \
|
||||||
|
41
wiiu/main.c
41
wiiu/main.c
@ -18,9 +18,12 @@
|
|||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
|
|
||||||
|
#if defined(HAVE_IOSUHAX) && defined(HAVE_LIBFAT)
|
||||||
#include <fat.h>
|
#include <fat.h>
|
||||||
#include <iosuhax.h>
|
#include <iosuhax.h>
|
||||||
#include <sys/iosupport.h>
|
#include <sys/iosupport.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
#include "hbl.h"
|
#include "hbl.h"
|
||||||
|
|
||||||
@ -129,6 +132,7 @@ void someFunc(void *arg)
|
|||||||
(void)arg;
|
(void)arg;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifdef HAVE_IOSUHAX
|
||||||
int MCPHookOpen(void)
|
int MCPHookOpen(void)
|
||||||
{
|
{
|
||||||
//take over mcp thread
|
//take over mcp thread
|
||||||
@ -163,27 +167,34 @@ void MCPHookClose(void)
|
|||||||
IOS_Close(mcp_hook_fd);
|
IOS_Close(mcp_hook_fd);
|
||||||
mcp_hook_fd = -1;
|
mcp_hook_fd = -1;
|
||||||
}
|
}
|
||||||
|
#endif //HAVE_IOSUHAX
|
||||||
|
|
||||||
static bool try_init_iosuhax(void)
|
static bool try_init_iosuhax(void)
|
||||||
{
|
{
|
||||||
|
#ifdef HAVE_IOSUHAX
|
||||||
int result = IOSUHAX_Open(NULL);
|
int result = IOSUHAX_Open(NULL);
|
||||||
if(result < 0)
|
if(result < 0)
|
||||||
result = MCPHookOpen();
|
result = MCPHookOpen();
|
||||||
|
|
||||||
return (result < 0) ? false : true;
|
return (result < 0) ? false : true;
|
||||||
|
#else //don't HAVE_IOSUHAX
|
||||||
|
return false;
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
static void try_shutdown_iosuhax(void)
|
static void try_shutdown_iosuhax(void)
|
||||||
{
|
{
|
||||||
if(!iosuhaxMount)
|
#ifdef HAVE_IOSUHAX
|
||||||
|
if(!iosuhaxMount)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (mcp_hook_fd >= 0)
|
if (mcp_hook_fd >= 0)
|
||||||
MCPHookClose();
|
MCPHookClose();
|
||||||
else
|
else
|
||||||
IOSUHAX_Close();
|
IOSUHAX_Close();
|
||||||
|
#endif //HAVE_IOSUHAX
|
||||||
|
|
||||||
iosuhaxMount = false;
|
iosuhaxMount = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -196,10 +207,14 @@ static void try_shutdown_iosuhax(void)
|
|||||||
__attribute__((weak))
|
__attribute__((weak))
|
||||||
void __mount_filesystems(void)
|
void __mount_filesystems(void)
|
||||||
{
|
{
|
||||||
|
#ifdef HAVE_LIBFAT
|
||||||
if(iosuhaxMount)
|
if(iosuhaxMount)
|
||||||
fatInitDefault();
|
fatInitDefault();
|
||||||
else
|
else
|
||||||
mount_sd_fat("sd");
|
mount_sd_fat("sd");
|
||||||
|
#else
|
||||||
|
mount_sd_fat("sd");
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -209,13 +224,17 @@ void __mount_filesystems(void)
|
|||||||
__attribute__((weak))
|
__attribute__((weak))
|
||||||
void __unmount_filesystems(void)
|
void __unmount_filesystems(void)
|
||||||
{
|
{
|
||||||
if (iosuhaxMount)
|
#ifdef HAVE_LIBFAT
|
||||||
{
|
if (iosuhaxMount)
|
||||||
fatUnmount("sd:");
|
{
|
||||||
fatUnmount("usb:");
|
fatUnmount("sd:");
|
||||||
}
|
fatUnmount("usb:");
|
||||||
else
|
}
|
||||||
unmount_sd_fat("sd");
|
else
|
||||||
|
unmount_sd_fat("sd");
|
||||||
|
#else
|
||||||
|
unmount_sd_fat("sd");
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
static void fsdev_init(void)
|
static void fsdev_init(void)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user