18 #include "../../types.h"
20 #define CONSOLE_ESC(x) "\x1b[" #x
21 #define CONSOLE_RESET CONSOLE_ESC(0m)
22 #define CONSOLE_BLACK CONSOLE_ESC(30m)
23 #define CONSOLE_RED CONSOLE_ESC(31;1m)
24 #define CONSOLE_GREEN CONSOLE_ESC(32;1m)
25 #define CONSOLE_YELLOW CONSOLE_ESC(33;1m)
26 #define CONSOLE_BLUE CONSOLE_ESC(34;1m)
27 #define CONSOLE_MAGENTA CONSOLE_ESC(35;1m)
28 #define CONSOLE_CYAN CONSOLE_ESC(36;1m)
29 #define CONSOLE_WHITE CONSOLE_ESC(37;1m)
39 void (*drawChar)(
PrintConsole* con,
int x,
int y,
int c);
113 #define CONSOLE_COLOR_BOLD (1<<0)
114 #define CONSOLE_COLOR_FAINT (1<<1)
115 #define CONSOLE_ITALIC (1<<2)
116 #define CONSOLE_UNDERLINE (1<<3)
117 #define CONSOLE_BLINK_SLOW (1<<4)
118 #define CONSOLE_BLINK_FAST (1<<5)
119 #define CONSOLE_COLOR_REVERSE (1<<6)
120 #define CONSOLE_CONCEAL (1<<7)
121 #define CONSOLE_CROSSED_OUT (1<<8)
122 #define CONSOLE_FG_CUSTOM (1<<9)
123 #define CONSOLE_BG_CUSTOM (1<<10)
void consoleExit(PrintConsole *console)
Deinitialise the console.
PrintConsole * consoleGetDefault(void)
Gets a pointer to the console with the default values.
void consoleSetWindow(PrintConsole *console, int x, int y, int width, int height)
Sets the print window.
void consoleSetFont(PrintConsole *console, ConsoleFont *font)
Loads the font into the console.
void consoleUpdate(PrintConsole *console)
Updates the console, submitting a new frame to the display.
debugDevice
Console debug devices supported by libnx.
Definition: console.h:126
@ debugDevice_SVC
Outputs stderr debug statements using svcOutputDebugString, which can then be captured by interactive...
Definition: console.h:128
@ debugDevice_CONSOLE
Directs stderr debug statements to Switch console window.
Definition: console.h:129
@ debugDevice_NULL
Swallows prints to stderr.
Definition: console.h:127
PrintConsole * consoleSelect(PrintConsole *console)
Make the specified console the render target.
void consoleDebugInit(debugDevice device)
Initializes debug console output on stderr to the specified device.
void consoleClear(void)
Clears the screan by using printf("\x1b[2J");.
PrintConsole * consoleInit(PrintConsole *console)
Initialise the console.
A font struct for the console.
Definition: console.h:46
const void * gfx
A pointer to the font graphics.
Definition: console.h:47
u16 asciiOffset
Offset to the first valid character in the font table.
Definition: console.h:48
u16 numChars
Number of characters in the font graphics.
Definition: console.h:49
Renderer interface for the console.
Definition: console.h:36
Console structure used to store the state of a console render context.
Definition: console.h:87
int cursorX
Current X location of the cursor (as a tile offset by default)
Definition: console.h:91
int consoleWidth
Width of the console hardware layer in characters.
Definition: console.h:97
int flags
Reverse/bright flags.
Definition: console.h:108
int windowX
Window X location in characters.
Definition: console.h:100
u16 bg
Background color.
Definition: console.h:107
int tabSize
Size of a tab.
Definition: console.h:105
int cursorY
Current Y location of the cursor (as a tile offset by default)
Definition: console.h:92
int prevCursorX
Internal state.
Definition: console.h:94
int prevCursorY
Internal state.
Definition: console.h:95
int consoleHeight
Height of the console hardware layer in characters.
Definition: console.h:98
ConsoleRenderer * renderer
Renderer of the console.
Definition: console.h:89
int windowWidth
Window width in characters.
Definition: console.h:102
int windowHeight
Window height in characters.
Definition: console.h:103
bool consoleInitialised
True if the console is initialized.
Definition: console.h:110
u16 fg
Foreground color.
Definition: console.h:106
ConsoleFont font
Font of the console.
Definition: console.h:88
int windowY
Window Y location in characters.
Definition: console.h:101
uint16_t u16
16-bit unsigned integer.
Definition: types.h:20