homebrewfilter/main/source/xprintf.cpp
Christopher Roy Bratusek 12e50c147f Revert "hide SD Gecko setting in vWii builds"
have I been drunk? I must have mistaken SD Gecko for USB Gecko [lol]

This reverts commit e1a1a3c847.
2016-08-15 09:35:44 +02:00

38 lines
562 B
C++

#include "main.h"
#include "gecko.h"
#include "Network/wifi_gecko.h"
extern "C" void sdprintf(const char * format, ...)
{
char * tmp = NULL;
va_list va;
va_start(va, format);
if((vasprintf(&tmp, format, va) >= 0) && tmp)
{
FILE * file;
file = fopen("sd1:/config/HBF/debug.txt", "a");
if(file)
{
fprintf(file, "%s", tmp);
fclose(file);
}
}
va_end(va);
if(tmp)
free(tmp);
}
extern "C" void xprintf(const char *str, ...)
{
if(Options.sdgecko)
sdprintf(str);
else if(Options.wifigecko)
wifi_printf(str);
else
gprintf(str);
}