26 #define CONSOLE_ESC(x) "\x1b[" #x
27 #define CONSOLE_RESET CONSOLE_ESC(0m)
28 #define CONSOLE_BLACK CONSOLE_ESC(30m)
29 #define CONSOLE_RED CONSOLE_ESC(31;1m)
30 #define CONSOLE_GREEN CONSOLE_ESC(32;1m)
31 #define CONSOLE_YELLOW CONSOLE_ESC(33;1m)
32 #define CONSOLE_BLUE CONSOLE_ESC(34;1m)
33 #define CONSOLE_MAGENTA CONSOLE_ESC(35;1m)
34 #define CONSOLE_CYAN CONSOLE_ESC(36;1m)
35 #define CONSOLE_WHITE CONSOLE_ESC(37;1m)
106 #define CONSOLE_COLOR_BOLD (1<<0)
107 #define CONSOLE_COLOR_FAINT (1<<1)
108 #define CONSOLE_ITALIC (1<<2)
109 #define CONSOLE_UNDERLINE (1<<3)
110 #define CONSOLE_BLINK_SLOW (1<<4)
111 #define CONSOLE_BLINK_FAST (1<<5)
112 #define CONSOLE_COLOR_REVERSE (1<<6)
113 #define CONSOLE_CONCEAL (1<<7)
114 #define CONSOLE_CROSSED_OUT (1<<8)
115 #define CONSOLE_FG_CUSTOM (1<<9)
116 #define CONSOLE_BG_CUSTOM (1<<10)
bool(* ConsolePrint)(void *con, int c)
A callback for printing a character.
Definition: console.h:38
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.
PrintConsole * consoleInit(gfxScreen_t screen, PrintConsole *console)
Initialise the console.
debugDevice
Console debug devices supported by libnds.
Definition: console.h:119
@ debugDevice_SVC
Outputs stderr debug statements using svcOutputDebugString, which can then be captured by interactive...
Definition: console.h:121
@ debugDevice_CONSOLE
Directs stderr debug statements to 3DS console window.
Definition: console.h:122
@ debugDevice_NULL
Swallows prints to stderr.
Definition: console.h:120
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 screen by using iprintf("\x1b[2J");.
gfxScreen_t
Screen IDs.
Definition: gfx.h:25
A font struct for the console.
Definition: console.h:42
u16 asciiOffset
Offset to the first valid character in the font table.
Definition: console.h:44
u8 * gfx
A pointer to the font graphics.
Definition: console.h:43
u16 numChars
Number of characters in the font graphics.
Definition: console.h:45
Console structure used to store the state of a console render context.
Definition: console.h:77
int cursorX
Current X location of the cursor (as a tile offset by default)
Definition: console.h:82
int consoleWidth
Width of the console hardware layer in characters.
Definition: console.h:88
int flags
Reverse/bright flags.
Definition: console.h:99
int windowX
Window X location in characters (not implemented)
Definition: console.h:91
u16 bg
Background color.
Definition: console.h:98
int tabSize
Size of a tab.
Definition: console.h:96
int cursorY
Current Y location of the cursor (as a tile offset by default)
Definition: console.h:83
int prevCursorX
Internal state.
Definition: console.h:85
int prevCursorY
Internal state.
Definition: console.h:86
int consoleHeight
Height of the console hardware layer in characters.
Definition: console.h:89
int windowWidth
Window width in characters (not implemented)
Definition: console.h:93
int windowHeight
Window height in characters (not implemented)
Definition: console.h:94
u16 * frameBuffer
Framebuffer address.
Definition: console.h:80
bool consoleInitialised
True if the console is initialized.
Definition: console.h:103
ConsolePrint PrintChar
Callback for printing a character. Should return true if it has handled rendering the graphics (else ...
Definition: console.h:101
u16 fg
Foreground color.
Definition: console.h:97
ConsoleFont font
Font of the console.
Definition: console.h:78
int windowY
Window Y location in characters (not implemented)
Definition: console.h:92
uint8_t u8
would be nice if newlib had this already
Definition: types.h:21
uint16_t u16
16-bit unsigned integer
Definition: types.h:22