Debugging functions.

This commit is contained in:
2026-02-04 18:32:20 -06:00
parent dd910a31aa
commit d955fb6430
8 changed files with 107 additions and 3 deletions

View File

@@ -6,6 +6,9 @@
*/
#include "debug.h"
#if DOLPHIN
#include "display/display.h"
#endif
void debugPrint(const char_t *message, ...) {
va_list args;
@@ -22,5 +25,32 @@ void debugPrint(const char_t *message, ...) {
va_end(args);
fclose(file);
}
#elif DOLPHIN
if(!DISPLAY.frameBuffer) return;
console_init(
DISPLAY.frameBuffer,
20,
20,
DISPLAY.screenMode->fbWidth,
DISPLAY.screenMode->xfbHeight,
DISPLAY.screenMode->fbWidth * VI_DISPLAY_PIX_SZ
);
// Printf
va_start(args, message);
vprintf(message, args);
va_end(args);
printf("\nPress START to exit...");
while(SYS_MainLoop()) {
VIDEO_WaitVSync();
PAD_ScanPads();
int buttonsDown = PAD_ButtonsDown(0);
if (buttonsDown & PAD_BUTTON_START) {
exit(0);
}
}
#endif
}