diff --git a/src/platforms/wii.cpp b/src/platforms/wii.cpp index 6f96dbc1..99579688 100644 --- a/src/platforms/wii.cpp +++ b/src/platforms/wii.cpp @@ -18,59 +18,27 @@ #ifdef __wii__ #include -#include -#include -#include #include #include "util.h" #include "io/file.h" -/* USBGecko Debugging */ - -#define SLOT 1 // A: 0, B: 1 -bool usbgecko = false; -mutex_t usbgecko_mutex = 0; - -static ssize_t __usbgecko_write(struct _reent * /* r */, void* /* fd */, const char *ptr, size_t len) { - uint32_t level; - - if (!ptr || !len || !usbgecko) - return 0; - - LWP_MutexLock(usbgecko_mutex); - level = IRQ_Disable(); - usb_sendbuffer(SLOT, ptr, len); - IRQ_Restore(level); - LWP_MutexUnlock(usbgecko_mutex); - - return len; -} - -extern const devoptab_t dotab_stdnull; -const devoptab_t dotab_geckoout = { - "geckoout", 0, NULL, NULL, __usbgecko_write, NULL, NULL, NULL, NULL, NULL, NULL, - NULL, NULL, NULL, 0, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, - NULL, NULL, NULL -}; - void WII_Init() { // enable file system fatInitDefault(); - // set console - LWP_MutexInit(&usbgecko_mutex, false); - usbgecko = usb_isgeckoalive(SLOT); - - if (usbgecko) { + // USBGecko Debugging + constexpr int SLOT = CARD_SLOTB; + if (usb_isgeckoalive(SLOT)) { usb_flush(SLOT); - - devoptab_list[STD_OUT] = &dotab_geckoout; - devoptab_list[STD_ERR] = &dotab_geckoout; - } else { - devoptab_list[STD_OUT] = &dotab_stdnull; - devoptab_list[STD_ERR] = &dotab_stdnull; + CON_EnableGecko(SLOT, false); + } +#ifndef NDEBUG + // Dolphin UART Debugging + else if(!__system_argv->argc) { + SYS_STDIO_Report(true); } +#endif } void WII_AddGamePaths() {