]> Chaos Git - corbenik/ctrulib.git/commitdiff
allow console on either screen
authorDave Murphy <davem@devkitpro.org>
Fri, 12 Dec 2014 13:43:40 +0000 (13:43 +0000)
committerDave Murphy <davem@devkitpro.org>
Fri, 12 Dec 2014 13:43:40 +0000 (13:43 +0000)
libctru/include/3ds/console.h
libctru/source/console.c

index fe694bff73bbdb04579105fb212d0c0d072d221b..f8bcde6669dbbab538073eeafa031695fc7921df 100644 (file)
@@ -123,10 +123,11 @@ PrintConsole* consoleGetDefault(void);
 PrintConsole *consoleSelect(PrintConsole* console);\r
 \r
 /*!    \brief Initialise the console.\r
+       \param screen The screen to use for the console\r
        \param console A pointer to the console data to initialze (if it's NULL, the default console will be used)\r
        \return A pointer to the current console.\r
 */\r
-PrintConsole* consoleInit(PrintConsole* console);\r
+PrintConsole* consoleInit(gfxScreen_t screen, PrintConsole* console);\r
 \r
 //! Clears the screan by using iprintf("\x1b[2J");\r
 void consoleClear(void);\r
index 040955b27c54495344636891ec489be8fbd9aab6..087bce7572b973d559fd3bb0e3c4038c8b9faf10 100644 (file)
@@ -342,7 +342,7 @@ static const devoptab_t dotab_null = {
 };\r
 \r
 //---------------------------------------------------------------------------------\r
-PrintConsole* consoleInit(PrintConsole* console) {\r
+PrintConsole* consoleInit(gfxScreen_t screen, PrintConsole* console) {\r
 //---------------------------------------------------------------------------------\r
 \r
        static bool firstConsoleInit = true;\r
@@ -367,9 +367,14 @@ PrintConsole* consoleInit(PrintConsole* console) {
 \r
        console->consoleInitialised = 1;\r
 \r
-       gfxSetScreenFormat(GFX_BOTTOM,GSP_RGB565_OES);\r
-       gfxSetDoubleBuffering(GFX_BOTTOM,false);\r
-       console->frameBuffer = (u16*)gfxGetFramebuffer(GFX_BOTTOM, GFX_LEFT, NULL, NULL);\r
+       gfxSetScreenFormat(screen,GSP_RGB565_OES);\r
+       gfxSetDoubleBuffering(screen,false);\r
+       console->frameBuffer = (u16*)gfxGetFramebuffer(screen, GFX_LEFT, NULL, NULL);\r
+\r
+       if(screen==GFX_TOP) {\r
+               console->consoleWidth = 50;\r
+               console->windowWidth = 50;\r
+       }\r
 \r
 \r
        consoleCls('2');\r