diff --git a/source/output.c b/source/output.c index 651bb68..7f33795 100644 --- a/source/output.c +++ b/source/output.c @@ -2,6 +2,8 @@ #include #include +#include +#include #include <3ds.h> #include "text.h" @@ -57,3 +59,18 @@ void drawFrame() gfxFlushBuffers(); gfxSwapBuffers(); } + +void print(const char* format, ...) +{ + va_list arguments; + char new_str[512]; + + va_start(arguments, format); + vsprintf(new_str, format, arguments); + va_end(arguments); + + sprintf(&superStr[strlen(superStr)], new_str); + svcOutputDebugString(new_str, strlen(new_str)); + + drawFrame(); +} diff --git a/source/output.h b/source/output.h index cac8598..4b643e2 100644 --- a/source/output.h +++ b/source/output.h @@ -1,9 +1,9 @@ #ifndef OUTPUT_H #define OUTPUT_H -#define print(...) sprintf(&superStr[strlen(superStr)], __VA_ARGS__); drawFrame() - -void drawFrame(); extern char superStr[]; +void drawFrame(); +void print(const char* format, ...); + #endif