shithub: cstory

Download patch

ref: 10c48311601295c684b1d481943bc28ca9f34866
parent: f5b3b2e0d08ccbcf62aa04e836307142230ada59
author: Clownacy <Clownacy@users.noreply.github.com>
date: Sun Oct 11 10:24:57 EDT 2020

Better 3DS debug logging and fix console output

Was using the wrong screen

--- a/src/Backends/Platform/3DS.cpp
+++ b/src/Backends/Platform/3DS.cpp
@@ -15,8 +15,12 @@
 	hidInit();
 
 	gfxInitDefault();
-	consoleInit(GFX_TOP, NULL);
+	consoleInit(GFX_BOTTOM, NULL);
 
+//	gspLcdInit();
+
+//	GSPLCD_PowerOffBacklight(GSPLCD_SCREEN_BOTTOM);
+
 	Result rc = romfsInit();
 
 	if (rc == 0)
@@ -35,6 +39,8 @@
 {
 	romfsExit();
 
+//	gspLcdExit();
+
 	gfxExit();
 
 	hidExit();
@@ -111,28 +117,22 @@
 
 ATTRIBUTE_FORMAT_PRINTF(1, 2) void Backend_PrintError(const char *format, ...)
 {
-	char message_buffer[0x100];
-
-	va_list argument_list;
-	va_start(argument_list, format);
-	vsnprintf(message_buffer, sizeof(message_buffer), format, argument_list);
-	va_end(argument_list);
-
-	printf("ERROR:");
-	printf(message_buffer);
+	va_list argumentList;
+	va_start(argumentList, format);
+	fputs("ERROR: ", stderr);
+	vfprintf(stderr, format, argumentList);
+	fputc('\n', stderr);
+	va_end(argumentList);
 }
 
 ATTRIBUTE_FORMAT_PRINTF(1, 2) void Backend_PrintInfo(const char *format, ...)
 {
-	char message_buffer[0x100];
-
-	va_list argument_list;
-	va_start(argument_list, format);
-	vsnprintf(message_buffer, sizeof(message_buffer), format, argument_list);
-	va_end(argument_list);
-
-	printf("INFO:");
-	printf(message_buffer);
+	va_list argumentList;
+	va_start(argumentList, format);
+	fputs("INFO: ", stderr);
+	vfprintf(stderr, format, argumentList);
+	fputc('\n', stderr);
+	va_end(argumentList);
 }
 
 unsigned long Backend_GetTicks(void)