diff --git a/Makefile.wiiu b/Makefile.wiiu
index 68ecd41953..62b9c2665a 100644
--- a/Makefile.wiiu
+++ b/Makefile.wiiu
@@ -30,9 +30,9 @@ endif
OBJ :=
OBJ += wiiu/main.o
-OBJ += wiiu/input/wpad_driver.o
-OBJ += wiiu/input/kpad_driver.o
-OBJ += wiiu/input/pad_functions.o
+OBJ += input/drivers_joypad/wiiu/wpad_driver.o
+OBJ += input/drivers_joypad/wiiu/kpad_driver.o
+OBJ += input/drivers_joypad/wiiu/pad_functions.o
OBJ += wiiu/system/memory.o
OBJ += wiiu/system/atomic.o
OBJ += wiiu/system/exception_handler.o
@@ -48,8 +48,8 @@ endif
ifeq ($(WIIU_HID),1)
DEFINES += -DWIIU_HID
- OBJ += wiiu/input/hidpad_driver.o
- OBJ += wiiu/input/wiiu_hid.o
+ OBJ += input/drivers_joypad/wiiu/hidpad_driver.o
+ OBJ += input/drivers_hid/wiiu_hid.o
OBJ += input/connect/joypad_connection.o \
input/common/hid/hid_device_driver.o \
input/common/hid/device_wiiu_gca.o \
@@ -198,7 +198,16 @@ else
ELF2RPL := $(ELF2RPL).exe
endif
-INCDIRS := -I. -Ideps -Ideps/stb -Ideps/libz -Ideps/7zip -Ilibretro-common/include -Iwiiu -Iwiiu/include -I$(DEVKITPRO)/portlibs/ppc/include
+INCDIRS := -I.
+INCDIRS += -Ideps
+INCDIRS += -Ideps/stb
+INCDIRS += -Ideps/libz
+INCDIRS += -Ideps/7zip
+INCDIRS += -Ilibretro-common/include
+INCDIRS += -Iinput/include
+INCDIRS += -Iwiiu
+INCDIRS += -Iwiiu/include
+INCDIRS += -I$(DEVKITPRO)/portlibs/ppc/include
LIBDIRS := -L. -L$(DEVKITPRO)/portlibs/ppc/lib
CFLAGS := -mwup -mcpu=750 -meabi -mhard-float
diff --git a/frontend/drivers/platform_wiiu.c b/frontend/drivers/platform_wiiu.c
index ee45f31c73..1f997633fe 100644
--- a/frontend/drivers/platform_wiiu.c
+++ b/frontend/drivers/platform_wiiu.c
@@ -14,6 +14,14 @@
* If not, see .
*/
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+
#include
#include
@@ -23,15 +31,27 @@
#include
+#include
+#include
+#include
+#include
+#include
+#include
+
#include "file_path_special.h"
+#include "../frontend.h"
#include "../frontend_driver.h"
#include "../../defaults.h"
#include "../../paths.h"
#include "../../verbosity.h"
+#include "../../retroarch.h"
+#include "../../gfx/video_driver.h"
+
#include "hbl.h"
#include "wiiu_dbg.h"
+#include "system/exception_handler.h"
#include "tasks/tasks_internal.h"
#ifndef IS_SALAMANDER
@@ -44,10 +64,7 @@
#define WIIU_USB_PATH "usb:/"
/**
- * The Wii U frontend driver.
- *
- * If you're looking for main() and friends, they've been moved to
- * wiiu/main.c
+ * The Wii U frontend driver, along with the main() method.
*/
static enum frontend_fork wiiu_fork_mode = FRONTEND_FORK_NONE;
@@ -287,3 +304,272 @@ frontend_ctx_driver_t frontend_ctx_wiiu =
"wiiu",
NULL, /* get_video_driver */
};
+
+/* main() and its supporting functions */
+
+static void main_setup(void);
+static void get_arguments(int *argc, char ***argv);
+static void do_rarch_main(int argc, char **argv);
+static void main_loop(void);
+static void main_teardown(void);
+
+static void init_network(void);
+static void init_logging(void);
+static void deinit_logging(void);
+static void wiiu_log_init(const char *ipString, int port);
+static void wiiu_log_deinit(void);
+static ssize_t wiiu_log_write(struct _reent *r, void *fd, const char *ptr, size_t len);
+static void init_pad_libraries(void);
+static void deinit_pad_libraries(void);
+static void SaveCallback(void);
+static bool swap_is_pending(void *start_time);
+
+static int wiiu_log_socket = -1;
+static volatile int wiiu_log_lock = 0;
+
+#if defined(PC_DEVELOPMENT_IP_ADDRESS) && defined(PC_DEVELOPMENT_TCP_PORT)
+static devoptab_t dotab_stdout =
+{
+ "stdout_net", /* device name */
+ 0, /* size of file structure */
+ NULL, /* device open */
+ NULL, /* device close */
+ wiiu_log_write, /* device write */
+ NULL, /* ... */
+};
+#endif /* defined(PC_DEVELOPMENT_IP_ADDRESS) && defined(PC_DEVELOPMENT_TCP_PORT) */
+
+int main(int argc, char **argv)
+{
+ main_setup();
+ get_arguments(&argc, &argv);
+
+#ifdef IS_SALAMANDER
+ int salamander_main(argc, argv);
+ salamander_main(argc, argv);
+#else
+ do_rarch_main(argc, argv);
+ main_loop();
+ main_exit(NULL);
+#endif /* IS_SALAMANDER */
+ main_teardown();
+
+ /* We always return 0 because if we don't, it can prevent loading a
+ * different RPX/ELF in HBL. */
+ return 0;
+}
+
+static void get_arguments(int *argc, char ***argv)
+{
+ DEBUG_VAR(ARGV_PTR);
+ if(ARGV_PTR && ((u32)ARGV_PTR < 0x01000000))
+ {
+ struct
+ {
+ u32 magic;
+ u32 argc;
+ char *argv[3];
+ } *param = ARGV_PTR;
+ if(param->magic == ARGV_MAGIC)
+ {
+ *argc = param->argc;
+ *argv = param->argv;
+ }
+ ARGV_PTR = NULL;
+ }
+
+ DEBUG_VAR(argc);
+ DEBUG_VAR(argv[0]);
+ DEBUG_VAR(argv[1]);
+ fflush(stdout);
+}
+
+static void main_setup(void)
+{
+ setup_os_exceptions();
+ ProcUIInit(&SaveCallback);
+ init_network();
+ init_logging();
+ init_pad_libraries();
+ verbosity_enable();
+ fflush(stdout);
+}
+
+static void main_teardown(void)
+{
+ deinit_pad_libraries();
+ ProcUIShutdown();
+ deinit_logging();
+}
+
+static void main_loop(void)
+{
+ unsigned sleep_ms = 0;
+ OSTime start_time;
+ int status;
+
+ do
+ {
+ if(video_driver_get_ptr(false))
+ {
+ start_time = OSGetSystemTime();
+ task_queue_wait(swap_is_pending, &start_time);
+ }
+ else
+ task_queue_wait(NULL, NULL);
+
+ status = runloop_iterate(&sleep_ms);
+
+ if(status == 1 && sleep_ms > 0)
+ usleep(sleep_ms);
+
+ if(status == -1)
+ break;
+ } while(true);
+}
+
+static void do_rarch_main(int argc, char **argv)
+{
+#if 0
+ int argc_ = 2;
+ char *argv_[] = { WIIU_SD_PATH "retroarch/retroarch.elf",
+ WIIU_SD_PATH "rom.sfc",
+ NULL };
+ rarch_main(argc_, argv_, NULL);
+#else
+ rarch_main(argc, argv, NULL);
+#endif /* if 0 */
+}
+
+static void SaveCallback(void)
+{
+ OSSavesDone_ReadyToRelease();
+}
+
+static bool swap_is_pending(void *start_time)
+{
+ uint32_t swap_count, flip_count;
+ OSTime last_flip, last_vsync;
+
+ GX2GetSwapStatus(&swap_count, &flip_count, &last_flip, &last_vsync);
+ return last_vsync < *(OSTime *)start_time;
+}
+
+static void init_network(void)
+{
+#ifdef IS_SALAMANDER
+ socket_lib_init();
+#else
+ network_init();
+#endif /* IS_SALAMANDER */
+}
+
+static void init_logging(void)
+{
+#if defined(PC_DEVELOPMENT_IP_ADDRESS) && defined(PC_DEVELOPMENT_TCP_PORT)
+ wiiu_log_init(PC_DEVELOPMENT_IP_ADDRESS, PC_DEVELOPMENT_TCP_PORT);
+ devoptab_list[STD_OUT] = &dotab_stdout;
+ devoptab_list[STD_ERR] = &dotab_stdout;
+#endif /* defined(PC_DEVELOPMENT_IP_ADDRESS) && defined(PC_DEVELOPMENT_TCP_PORT) */
+}
+
+static void deinit_logging(void)
+{
+ fflush(stdout);
+ fflush(stderr);
+
+#if defined(PC_DEVELOPMENT_IP_ADDRESS) && defined(PC_DEVELOPMENT_TCP_PORT)
+ wiiu_log_deinit();
+#endif /* defined(PC_DEVELOPMENT_IP_ADDRESS) && defined(PC_DEVELOPMENT_TCP_PORT) */
+}
+
+
+static void wiiu_log_init(const char *ipString, int port)
+{
+ wiiu_log_lock = 0;
+ wiiu_log_socket = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP);
+
+ if(wiiu_log_socket < 0)
+ return;
+
+ struct sockaddr_in connect_addr;
+ memset(&connect_addr, 0, sizeof(connect_addr));
+ connect_addr.sin_family = AF_INET;
+ connect_addr.sin_port = port;
+ inet_aton(ipString, &connect_addr.sin_addr);
+
+ if(connect(wiiu_log_socket,
+ (struct sockaddr *)&connect_addr,
+ sizeof(connect_addr)) < 0)
+ {
+ socketclose(wiiu_log_socket);
+ wiiu_log_socket = -1;
+ }
+}
+
+static void wiiu_log_deinit(void)
+{
+ if(wiiu_log_socket >= 0)
+ {
+ socketclose(wiiu_log_socket);
+ wiiu_log_socket = -1;
+ }
+}
+
+static void init_pad_libraries(void)
+{
+#ifndef IS_SALAMANDER
+ KPADInit();
+ WPADEnableURCC(true);
+ WPADEnableWiiRemote(true);
+#endif /* IS_SALAMANDER */
+}
+
+static void deinit_pad_libraries(void)
+{
+#ifndef IS_SALAMANDER
+ KPADShutdown();
+#endif /* IS_SALAMANDER */
+}
+
+/* logging routines */
+
+void net_print(const char *str)
+{
+ wiiu_log_write(NULL, 0, str, strlen(str));
+}
+
+void net_print_exp(const char *str)
+{
+ send(wiiu_log_socket, str, strlen(str), 0);
+}
+
+static ssize_t wiiu_log_write(struct _reent *r, void *fd, const char *ptr, size_t len)
+{
+ if( wiiu_log_socket < 0)
+ return len;
+
+ while(wiiu_log_lock)
+ OSSleepTicks(((248625000 / 4)) / 1000);
+
+ wiiu_log_lock = 1;
+
+ int ret;
+ int remaining = len;
+
+ while(remaining > 0)
+ {
+ int block = remaining < 1400 ? remaining : 1400;
+ ret = send(wiiu_log_socket, ptr, block, 0);
+
+ if(ret < 0)
+ break;
+
+ remaining -= ret;
+ ptr += ret;
+ }
+
+ wiiu_log_lock = 0;
+
+ return len;
+}
diff --git a/wiiu/input/wiiu_hid.c b/input/drivers_hid/wiiu_hid.c
similarity index 99%
rename from wiiu/input/wiiu_hid.c
rename to input/drivers_hid/wiiu_hid.c
index 962e9323d8..221aea7e69 100644
--- a/wiiu/input/wiiu_hid.c
+++ b/input/drivers_hid/wiiu_hid.c
@@ -14,7 +14,7 @@
* If not, see .
*/
-#include "wiiu_hid.h"
+#include
#include
static wiiu_event_list events;
diff --git a/wiiu/input/hidpad_driver.c b/input/drivers_joypad/wiiu/hidpad_driver.c
similarity index 98%
rename from wiiu/input/hidpad_driver.c
rename to input/drivers_joypad/wiiu/hidpad_driver.c
index 03efe64d5c..e698757e8d 100644
--- a/wiiu/input/hidpad_driver.c
+++ b/input/drivers_joypad/wiiu/hidpad_driver.c
@@ -14,8 +14,7 @@
* If not, see .
*/
-#include "wiiu_input.h"
-#include "wiiu_hid.h"
+#include
static bool hidpad_init(void *data);
static bool hidpad_query_pad(unsigned pad);
diff --git a/wiiu/input/kpad_driver.c b/input/drivers_joypad/wiiu/kpad_driver.c
similarity index 99%
rename from wiiu/input/kpad_driver.c
rename to input/drivers_joypad/wiiu/kpad_driver.c
index a3c7078357..b222eb7c20 100644
--- a/wiiu/input/kpad_driver.c
+++ b/input/drivers_joypad/wiiu/kpad_driver.c
@@ -20,7 +20,7 @@
* controllers.
*/
-#include "wiiu_input.h"
+#include
static bool kpad_init(void *data);
static bool kpad_query_pad(unsigned pad);
diff --git a/wiiu/input/pad_functions.c b/input/drivers_joypad/wiiu/pad_functions.c
similarity index 99%
rename from wiiu/input/pad_functions.c
rename to input/drivers_joypad/wiiu/pad_functions.c
index 5aefbaf23c..449f8037c1 100644
--- a/wiiu/input/pad_functions.c
+++ b/input/drivers_joypad/wiiu/pad_functions.c
@@ -14,7 +14,7 @@
* If not, see .
*/
-#include "wiiu_input.h"
+#include
enum wiiu_pad_axes {
AXIS_LEFT_ANALOG_X,
diff --git a/wiiu/input/wpad_driver.c b/input/drivers_joypad/wiiu/wpad_driver.c
similarity index 99%
rename from wiiu/input/wpad_driver.c
rename to input/drivers_joypad/wiiu/wpad_driver.c
index 4933a2dc3e..0bda8177bd 100644
--- a/wiiu/input/wpad_driver.c
+++ b/input/drivers_joypad/wiiu/wpad_driver.c
@@ -21,7 +21,7 @@
* - For HID controllers, see hid_driver.c
*/
-#include "wiiu_input.h"
+#include
#define PANIC_BUTTON_MASK (VPAD_BUTTON_R | VPAD_BUTTON_L | VPAD_BUTTON_STICK_R | VPAD_BUTTON_STICK_L)
diff --git a/input/drivers_joypad/wiiu_joypad.c b/input/drivers_joypad/wiiu_joypad.c
index 5728a90c6d..5553721cf1 100644
--- a/input/drivers_joypad/wiiu_joypad.c
+++ b/input/drivers_joypad/wiiu_joypad.c
@@ -14,7 +14,7 @@
* If not, see .
*/
-#include "../../wiiu/input/wiiu_input.h"
+#include
#include "wiiu_dbg.h"
diff --git a/wiiu/input/wiiu_hid.h b/input/include/wiiu/hid.h
similarity index 98%
rename from wiiu/input/wiiu_hid.h
rename to input/include/wiiu/hid.h
index 0c96c9599c..8e2ffc47e0 100644
--- a/wiiu/input/wiiu_hid.h
+++ b/input/include/wiiu/hid.h
@@ -17,9 +17,8 @@
#ifndef __WIIU_HID__H
#define __WIIU_HID__H
-#include "wiiu_hid_types.h"
-
-#include "wiiu_input.h"
+#include
+#include
#define DEVICE_UNUSED 0
#define DEVICE_USED 1
diff --git a/wiiu/input/wiiu_hid_types.h b/input/include/wiiu/hid_types.h
similarity index 100%
rename from wiiu/input/wiiu_hid_types.h
rename to input/include/wiiu/hid_types.h
diff --git a/wiiu/input/wiiu_input.h b/input/include/wiiu/input.h
similarity index 82%
rename from wiiu/input/wiiu_input.h
rename to input/include/wiiu/input.h
index 37416bc7e6..f10be960b9 100644
--- a/wiiu/input/wiiu_input.h
+++ b/input/include/wiiu/input.h
@@ -17,8 +17,8 @@
#ifndef __WIIU_INPUT__H
#define __WIIU_INPUT__H
-#include "wiiu_hid_types.h"
-#include "../../input/include/gamepad.h"
+#include
+#include
#ifdef HAVE_CONFIG_H
#include "../../config.h"
@@ -33,15 +33,15 @@
#include
#include
-#include "../../input/input_driver.h"
-#include "../../input/common/hid/hid_device_driver.h"
-#include "../../tasks/tasks_internal.h"
-#include "../../input/connect/joypad_connection.h"
-#include "../../retroarch.h"
-#include "../../verbosity.h"
-#include "../../command.h"
-#include "../../gfx/video_driver.h"
-#include "wiiu_hid.h"
+#include
+#include "../../common/hid/hid_device_driver.h"
+#include
+#include
+#include
+#include
+#include
+#include
+#include
#define WIIMOTE_TYPE_WIIPLUS 0x00
#define WIIMOTE_TYPE_NUNCHUK 0x01
diff --git a/wiiu/main.c b/wiiu/main.c
index 3e80bcb4ef..4a7c74ccc1 100644
--- a/wiiu/main.c
+++ b/wiiu/main.c
@@ -17,15 +17,11 @@
#include
#include
#include
-#include
-#include
-#include
-
-#include
#include
#include
#include
+#include
#include
#include
#include
@@ -36,17 +32,15 @@
#include "main.h"
/**
- * This file contains the main entrypoints for the Wii U executable.
+ * This file contains the main entrypoints for the Wii U executable that
+ * set up the call to main().
*/
static void fsdev_init(void);
static void fsdev_exit(void);
-#define WIIU_SD_PATH "sd:/"
-#define WIIU_USB_PATH "usb:/"
-
-static int wiiu_log_socket = -1;
-static volatile int wiiu_log_lock = 0;
+static int iosuhaxMount = 0;
+static int mcp_hook_fd = -1;
/* HBL elf entry point */
int __entry_menu(int argc, char **argv)
@@ -86,251 +80,6 @@ void _start(int argc, char **argv)
exit(0);
}
-void wiiu_log_init(const char *ipString, int port)
-{
- wiiu_log_lock = 0;
-
- wiiu_log_socket = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP);
-
- if (wiiu_log_socket < 0)
- return;
-
- struct sockaddr_in connect_addr;
- memset(&connect_addr, 0, sizeof(connect_addr));
- connect_addr.sin_family = AF_INET;
- connect_addr.sin_port = port;
- inet_aton(ipString, &connect_addr.sin_addr);
-
- if (connect(wiiu_log_socket, (struct sockaddr *)&connect_addr, sizeof(connect_addr)) < 0)
- {
- socketclose(wiiu_log_socket);
- wiiu_log_socket = -1;
- }
-}
-
-void wiiu_log_deinit(void)
-{
- if (wiiu_log_socket >= 0)
- {
- socketclose(wiiu_log_socket);
- wiiu_log_socket = -1;
- }
-}
-static ssize_t wiiu_log_write(struct _reent *r, void *fd, const char *ptr, size_t len)
-{
- if (wiiu_log_socket < 0)
- return len;
-
- while (wiiu_log_lock)
- OSSleepTicks(((248625000 / 4)) / 1000);
-
- wiiu_log_lock = 1;
-
- int ret;
- int remaining = len;
-
- while (remaining > 0)
- {
- int block = remaining < 1400 ? remaining : 1400; // take max 1400 bytes per UDP packet
- ret = send(wiiu_log_socket, ptr, block, 0);
-
- if (ret < 0)
- break;
-
- remaining -= ret;
- ptr += ret;
- }
-
- wiiu_log_lock = 0;
-
- return len;
-}
-void net_print(const char *str)
-{
- wiiu_log_write(NULL, 0, str, strlen(str));
-}
-
-void net_print_exp(const char *str)
-{
- send(wiiu_log_socket, str, strlen(str), 0);
-}
-
-#if defined(PC_DEVELOPMENT_IP_ADDRESS) && defined(PC_DEVELOPMENT_TCP_PORT)
-static devoptab_t dotab_stdout =
-{
- "stdout_net", // device name
- 0, // size of file structure
- NULL, // device open
- NULL, // device close
- wiiu_log_write, // device write
- NULL,
- /* ... */
-};
-#endif
-
-void SaveCallback(void)
-{
- OSSavesDone_ReadyToRelease();
-}
-
-static bool swap_is_pending(void* start_time)
-{
- uint32_t swap_count, flip_count;
- OSTime last_flip , last_vsync;
-
- GX2GetSwapStatus(&swap_count, &flip_count, &last_flip, &last_vsync);
-
- return last_vsync < *(OSTime*)start_time;
-}
-
-static void do_network_init(void)
-{
-#ifdef IS_SALAMANDER
- socket_lib_init();
-#else
- network_init();
-#endif
-}
-
-static void init_pad_libraries(void)
-{
-#ifndef IS_SALAMANDER
- KPADInit();
- WPADEnableURCC(true);
- WPADEnableWiiRemote(true);
-#endif
-}
-
-static void deinit_pad_libraries(void)
-{
-#ifndef IS_SALAMANDER
- KPADShutdown();
-#endif
-}
-
-static void do_logging_init(void)
-{
-#if defined(PC_DEVELOPMENT_IP_ADDRESS) && defined(PC_DEVELOPMENT_TCP_PORT)
- wiiu_log_init(PC_DEVELOPMENT_IP_ADDRESS, PC_DEVELOPMENT_TCP_PORT);
- devoptab_list[STD_OUT] = &dotab_stdout;
- devoptab_list[STD_ERR] = &dotab_stdout;
-#endif
-}
-
-static void do_logging_deinit(void)
-{
- fflush(stdout);
- fflush(stderr);
-
-#if defined(PC_DEVELOPMENT_IP_ADDRESS) && defined(PC_DEVELOPMENT_TCP_PORT)
- wiiu_log_deinit();
-#endif
-}
-
-static void do_rarch_main(int argc, char **argv)
-{
-#if 0
- int argc_ = 2;
-// char* argv_[] = {WIIU_SD_PATH "retroarch/retroarch.elf", WIIU_SD_PATH "rom.nes", NULL};
- char *argv_[] = {WIIU_SD_PATH "retroarch/retroarch.elf", WIIU_SD_PATH "rom.sfc", NULL};
-
- rarch_main(argc_, argv_, NULL);
-#else /* #if 0 */
- rarch_main(argc, argv, NULL);
-#endif /* #if 0 */
-}
-
-static void main_loop(void)
-{
- unsigned sleep_ms = 0;
- OSTime start_time;
- int status;
-
- do
- {
- if(video_driver_get_ptr(false))
- {
- start_time = OSGetSystemTime();
- task_queue_wait(swap_is_pending, &start_time);
- }
- else
- task_queue_wait(NULL, NULL);
-
- status = runloop_iterate(&sleep_ms);
-
- if (status == 1 && sleep_ms > 0)
- retro_sleep(sleep_ms);
-
- if (status == -1)
- break;
- }
- while (1);
-}
-
-static void main_init(void)
-{
- setup_os_exceptions();
- ProcUIInit(&SaveCallback);
- do_network_init();
- do_logging_init();
- init_pad_libraries();
- verbosity_enable();
- fflush(stdout);
-}
-
-static void main_deinit(void)
-{
- deinit_pad_libraries();
- ProcUIShutdown();
-
- do_logging_deinit();
-}
-
-static void read_argc_argv(int *argc, char ***argv)
-{
- DEBUG_VAR(ARGV_PTR);
- if(ARGV_PTR && ((u32)ARGV_PTR < 0x01000000))
- {
- struct
- {
- u32 magic;
- u32 argc;
- char * argv[3];
- }*param = ARGV_PTR;
- if(param->magic == ARGV_MAGIC)
- {
- *argc = param->argc;
- *argv = param->argv;
- }
- ARGV_PTR = NULL;
- }
-
- DEBUG_VAR(argc);
- DEBUG_STR(argv[0]);
- DEBUG_STR(argv[1]);
- fflush(stdout);
-}
-
-int main(int argc, char **argv)
-{
- main_init();
- read_argc_argv(&argc, &argv);
-
-#ifdef IS_SALAMANDER
- int salamander_main(int, char **);
- salamander_main(argc, argv);
-#else
- do_rarch_main(argc, argv);
- main_loop();
- main_exit(NULL);
-#endif /* IS_SALAMANDER */
- main_deinit();
-
- /* returning non 0 here can prevent loading a different rpx/elf in the HBL
- environment */
- return 0;
-}
-
void __eabi(void)
{
@@ -368,8 +117,6 @@ void someFunc(void *arg)
(void)arg;
}
-static int mcp_hook_fd = -1;
-
int MCPHookOpen(void)
{
//take over mcp thread
@@ -380,7 +127,7 @@ int MCPHookOpen(void)
IOS_IoctlAsync(mcp_hook_fd, 0x62, (void *)0, 0, (void *)0, 0, someFunc, (void *)0);
//let wupserver start up
- retro_sleep(1000);
+ usleep(1000);
if (IOSUHAX_Open("/dev/mcp") < 0)
{
@@ -400,14 +147,11 @@ void MCPHookClose(void)
//close down wupserver, return control to mcp
IOSUHAX_Close();
//wait for mcp to return
- retro_sleep(1000);
+ usleep(1000);
IOS_Close(mcp_hook_fd);
mcp_hook_fd = -1;
}
-
-static int iosuhaxMount = 0;
-
static void fsdev_init(void)
{
iosuhaxMount = 0;
@@ -424,6 +168,7 @@ static void fsdev_init(void)
fatInitDefault();
}
}
+
static void fsdev_exit(void)
{
if (iosuhaxMount)
@@ -438,6 +183,4 @@ static void fsdev_exit(void)
}
else
unmount_sd_fat("sd");
-
}
-
diff --git a/wiiu/main.h b/wiiu/main.h
index 0c2cbcf916..482d056abb 100644
--- a/wiiu/main.h
+++ b/wiiu/main.h
@@ -10,14 +10,9 @@
#include "system/memory.h"
#include "system/exception_handler.h"
-#include "../retroarch.h"
-#include "../verbosity.h"
-#include "../frontend/frontend.h"
-#include "../gfx/video_driver.h"
-#include "../tasks/tasks_internal.h"
-
void __init(void);
void __fini(void);
+
int main(int argc, char **argv);
#endif /* WIIU_MAIN_H */