Fixed gamecube building.

This commit is contained in:
2026-06-06 16:47:07 -05:00
parent bbe0e48d23
commit 6204e745ba
+16 -8
View File
@@ -7,22 +7,25 @@
#include "log/log.h" #include "log/log.h"
#include "display/display.h" #include "display/display.h"
#include <debug.h>
#include <fat.h>
#include <stdio.h> #include <stdio.h>
#include <stdlib.h> #include <stdlib.h>
#define LOG_DEBUG_PATH "/apps/Dusk/debug.log" #ifdef DUSK_WII
#define LOG_ERROR_PATH "/apps/Dusk/error.log" #include <debug.h>
#include <fat.h>
static bool_t fatTried = false; #define LOG_DEBUG_PATH "/apps/Dusk/debug.log"
static bool_t fatReady = false; #define LOG_ERROR_PATH "/apps/Dusk/error.log"
static void logInitFAT(void) { static bool_t fatTried = false;
static bool_t fatReady = false;
static void logInitFAT(void) {
if(fatTried) return; if(fatTried) return;
fatTried = true; fatTried = true;
fatReady = fatInitDefault(); fatReady = fatInitDefault();
} }
#endif
void logDebug(const char_t *message, ...) { void logDebug(const char_t *message, ...) {
va_list args; va_list args;
@@ -35,6 +38,7 @@ void logDebug(const char_t *message, ...) {
va_end(copy); va_end(copy);
fflush(stdout); fflush(stdout);
#ifdef DUSK_WII
// Print to file // Print to file
logInitFAT(); logInitFAT();
if(fatReady) { if(fatReady) {
@@ -46,6 +50,7 @@ void logDebug(const char_t *message, ...) {
fclose(file); fclose(file);
} }
} }
#endif
va_end(args); va_end(args);
} }
@@ -55,6 +60,7 @@ void logError(const char_t *message, ...) {
va_start(args, message); va_start(args, message);
// Write to file before displaying on screen // Write to file before displaying on screen
#ifdef DUSK_WII
logInitFAT(); logInitFAT();
if(fatReady) { if(fatReady) {
FILE *file = fopen(LOG_ERROR_PATH, "a"); FILE *file = fopen(LOG_ERROR_PATH, "a");
@@ -66,6 +72,8 @@ void logError(const char_t *message, ...) {
fclose(file); fclose(file);
} }
} }
}
#endif
// Either create graphics, or hijack the displays' graphics. // Either create graphics, or hijack the displays' graphics.
GXRModeObj *rmode = NULL; GXRModeObj *rmode = NULL;