21 #include "../../types.h" 23 #define CONSOLE_ESC(x) "\x1b[" #x 24 #define CONSOLE_RESET CONSOLE_ESC(0m) 25 #define CONSOLE_BLACK CONSOLE_ESC(30m) 26 #define CONSOLE_RED CONSOLE_ESC(31;1m) 27 #define CONSOLE_GREEN CONSOLE_ESC(32;1m) 28 #define CONSOLE_YELLOW CONSOLE_ESC(33;1m) 29 #define CONSOLE_BLUE CONSOLE_ESC(34;1m) 30 #define CONSOLE_MAGENTA CONSOLE_ESC(35;1m) 31 #define CONSOLE_CYAN CONSOLE_ESC(36;1m) 32 #define CONSOLE_WHITE CONSOLE_ESC(37;1m) 104 #define CONSOLE_COLOR_BOLD (1<<0) 105 #define CONSOLE_COLOR_FAINT (1<<1)
106 #define CONSOLE_ITALIC (1<<2)
107 #define CONSOLE_UNDERLINE (1<<3)
108 #define CONSOLE_BLINK_SLOW (1<<4)
109 #define CONSOLE_BLINK_FAST (1<<5)
110 #define CONSOLE_COLOR_REVERSE (1<<6)
111 #define CONSOLE_CONCEAL (1<<7)
112 #define CONSOLE_CROSSED_OUT (1<<8)
A font struct for the console.
Definition: console.h:38
PrintConsole * consoleSelect(PrintConsole *console)
Make the specified console the render target.
bool consoleInitialised
True if the console is initialized.
Definition: console.h:101
ConsoleFont font
Font of the console.
Definition: console.h:75
bool(* ConsolePrint)(void *con, int c)
A callback for printing a character.
Definition: console.h:35
uint16_t u16
16-bit unsigned integer.
Definition: types.h:22
int consoleHeight
Height of the console hardware layer in characters.
Definition: console.h:87
int cursorX
Current X location of the cursor (as a tile offset by default)
Definition: console.h:80
int windowWidth
Window width in characters (not implemented)
Definition: console.h:91
u32 * frameBuffer
Framebuffer address.
Definition: console.h:77
int cursorY
Current Y location of the cursor (as a tile offset by default)
Definition: console.h:81
int windowHeight
Window height in characters (not implemented)
Definition: console.h:92
int flags
Reverse/bright flags.
Definition: console.h:97
int windowY
Window Y location in characters (not implemented)
Definition: console.h:90
u16 asciiOffset
Offset to the first valid character in the font table.
Definition: console.h:41
Directs stderr debug statements to Switch console window.
Definition: console.h:118
uint32_t u32
32-bit unsigned integer.
Definition: types.h:23
Outputs stderr debug statements using svcOutputDebugString, which can then be captured by interactive...
Definition: console.h:117
debugDevice
Console debug devices supported by libnx.
Definition: console.h:115
void consoleDebugInit(debugDevice device)
Initializes debug console output on stderr to the specified device.
ConsolePrint PrintChar
Callback for printing a character. Should return true if it has handled rendering the graphics (else ...
Definition: console.h:99
int prevCursorY
Internal state.
Definition: console.h:84
void consoleSetWindow(PrintConsole *console, int x, int y, int width, int height)
Sets the print window.
int windowX
Window X location in characters (not implemented)
Definition: console.h:89
void consoleSetFont(PrintConsole *console, ConsoleFont *font)
Loads the font into the console.
Swallows prints to stderr.
Definition: console.h:116
int fg
Foreground color.
Definition: console.h:95
int prevCursorX
Internal state.
Definition: console.h:83
u16 * gfx
A pointer to the font graphics.
Definition: console.h:40
int consoleWidth
Width of the console hardware layer in characters.
Definition: console.h:86
int tabSize
Size of a tab.
Definition: console.h:94
u16 numChars
Number of characters in the font graphics.
Definition: console.h:42
void consoleClear(void)
Clears the screan by using iprintf("\x1b[2J");.
PrintConsole * consoleGetDefault(void)
Gets a pointer to the console with the default values.
Console structure used to store the state of a console render context.
Definition: console.h:73
PrintConsole * consoleInit(PrintConsole *console)
Initialise the console.
u32 * frameBuffer2
Framebuffer address.
Definition: console.h:78
int bg
Background color.
Definition: console.h:96