---------------------------------------------------------------------------------
| 656 | |
| 657 | //--------------------------------------------------------------------------------- |
| 658 | PrintConsole* 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 | //--------------------------------------------------------------------------------- |
| 705 | void consoleDebugInit(debugDevice device){ |
nothing calls this directly
no test coverage detected