MCPcopy Create free account
hub / github.com/devkitPro/libctru / consoleInit

Function consoleInit

libctru/source/console.c:658–702  ·  view source on GitHub ↗

---------------------------------------------------------------------------------

Source from the content-addressed store, hash-verified

656
657//---------------------------------------------------------------------------------
658PrintConsole* consoleInit(gfxScreen_t screen, PrintConsole* console) {
659//---------------------------------------------------------------------------------
660
661 static bool firstConsoleInit = true;
662
663 if(firstConsoleInit) {
664 devoptab_list[STD_OUT] = &dotab_stdout;
665 devoptab_list[STD_ERR] = &dotab_stdout;
666
667 setvbuf(stdout, NULL , _IONBF, 0);
668 setvbuf(stderr, NULL , _IONBF, 0);
669
670 memset(&escapeSeq, 0, sizeof(escapeSeq));
671
672 firstConsoleInit = false;
673 }
674
675 if(console) {
676 currentConsole = console;
677 } else {
678 console = currentConsole;
679 }
680
681 *currentConsole = defaultConsole;
682
683 console->consoleInitialised = 1;
684
685 gfxSetScreenFormat(screen,GSP_RGB565_OES);
686 gfxSetDoubleBuffering(screen,false);
687 gfxSwapBuffersGpu();
688 gspWaitForVBlank();
689
690 console->frameBuffer = (u16*)gfxGetFramebuffer(screen, GFX_LEFT, NULL, NULL);
691
692 if(screen==GFX_TOP) {
693 bool isWide = gfxIsWide();
694 console->consoleWidth = isWide ? 100 : 50;
695 console->windowWidth = isWide ? 100 : 50;
696 }
697
698 consoleCls(2);
699
700 return currentConsole;
701
702}
703
704//---------------------------------------------------------------------------------
705void consoleDebugInit(debugDevice device){

Callers

nothing calls this directly

Calls 6

gfxSetScreenFormatFunction · 0.85
gfxSetDoubleBufferingFunction · 0.85
gfxSwapBuffersGpuFunction · 0.85
gfxGetFramebufferFunction · 0.85
gfxIsWideFunction · 0.85
consoleClsFunction · 0.85

Tested by

no test coverage detected