diff options
author | Gentoo <installgentoo@endianness.com> | 2021-03-27 10:36:05 +1100 |
---|---|---|
committer | Gentoo <installgentoo@endianness.com> | 2021-03-27 10:36:05 +1100 |
commit | 0349c6d6572f59770898d3f40287ebdcd2f8ed30 (patch) | |
tree | 4f55d594e5343a7d4f4e6d4dea34d9c35caa0b99 /source/gecko.c | |
download | YetAnotherModLoader-0349c6d6572f59770898d3f40287ebdcd2f8ed30.tar.gz YetAnotherModLoader-0349c6d6572f59770898d3f40287ebdcd2f8ed30.tar.bz2 YetAnotherModLoader-0349c6d6572f59770898d3f40287ebdcd2f8ed30.zip |
Diffstat (limited to 'source/gecko.c')
-rw-r--r-- | source/gecko.c | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/source/gecko.c b/source/gecko.c new file mode 100644 index 0000000..f089027 --- /dev/null +++ b/source/gecko.c @@ -0,0 +1,31 @@ +#include "gecko.h" + +int geckoFound = 0; + +void checkForGecko() +{ + #ifdef DEBUG + geckoFound = usb_isgeckoalive(EXI_CHANNEL_1); + if(geckoFound){usb_flush(EXI_CHANNEL_1);} + #endif +} + +int gprintf(const char *str, ...) +{ + #ifdef DEBUG + if(!geckoFound){return -1;} + + char astr[2048]; + snprintf(astr, 2048, "%s\r\n", str); + + char nstr[2048]; + va_list ap; + va_start(ap, str); + int size = vsnprintf(nstr, 2047, astr, ap); + va_end(ap); + + usb_sendbuffer(1, nstr, size); + usb_flush(EXI_CHANNEL_1); + #endif + return 0; +} |