Debugging functions.
This commit is contained in:
@@ -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
|
||||
}
|
||||
Reference in New Issue
Block a user