diff --git a/src/duskdolphin/log/log.c b/src/duskdolphin/log/log.c index ad35e65c..4ef4ab8f 100644 --- a/src/duskdolphin/log/log.c +++ b/src/duskdolphin/log/log.c @@ -7,22 +7,25 @@ #include "log/log.h" #include "display/display.h" -#include -#include #include #include -#define LOG_DEBUG_PATH "/apps/Dusk/debug.log" -#define LOG_ERROR_PATH "/apps/Dusk/error.log" +#ifdef DUSK_WII + #include + #include -static bool_t fatTried = false; -static bool_t fatReady = false; + #define LOG_DEBUG_PATH "/apps/Dusk/debug.log" + #define LOG_ERROR_PATH "/apps/Dusk/error.log" -static void logInitFAT(void) { - if(fatTried) return; - fatTried = true; - fatReady = fatInitDefault(); -} + static bool_t fatTried = false; + static bool_t fatReady = false; + + static void logInitFAT(void) { + if(fatTried) return; + fatTried = true; + fatReady = fatInitDefault(); + } +#endif void logDebug(const char_t *message, ...) { va_list args; @@ -35,17 +38,19 @@ void logDebug(const char_t *message, ...) { va_end(copy); fflush(stdout); - // Print to file - logInitFAT(); - if(fatReady) { - FILE *file = fopen(LOG_DEBUG_PATH, "a"); - if(file) { - va_copy(copy, args); - vfprintf(file, message, copy); - va_end(copy); - fclose(file); + #ifdef DUSK_WII + // Print to file + logInitFAT(); + if(fatReady) { + FILE *file = fopen(LOG_DEBUG_PATH, "a"); + if(file) { + va_copy(copy, args); + vfprintf(file, message, copy); + va_end(copy); + fclose(file); + } } - } + #endif va_end(args); } @@ -55,17 +60,20 @@ void logError(const char_t *message, ...) { va_start(args, message); // Write to file before displaying on screen - logInitFAT(); - if(fatReady) { - FILE *file = fopen(LOG_ERROR_PATH, "a"); - if(file) { - va_list copy; - va_copy(copy, args); - vfprintf(file, message, copy); - va_end(copy); - fclose(file); + #ifdef DUSK_WII + logInitFAT(); + if(fatReady) { + FILE *file = fopen(LOG_ERROR_PATH, "a"); + if(file) { + va_list copy; + va_copy(copy, args); + vfprintf(file, message, copy); + va_end(copy); + fclose(file); + } } } + #endif // Either create graphics, or hijack the displays' graphics. GXRModeObj *rmode = NULL;