libtonc

Stdio functionality. More...

Macros

#define tte_printf   iprintf
 

Functions

void tte_init_con (void)
 Init stdio capabilities.
 
int tte_cmd_vt100 (const char *text)
 Parse for VT100-sequences.
 
ssize_t tte_con_write (struct _reent *r, void *fd, const char *text, size_t len)
 Internal routine for stdio functionality.
 
ssize_t tte_con_nocash (struct _reent *r, void *fd, const char *text, size_t len)
 

Detailed Description

Stdio functionality.

These functions allow you to use stdio routines for writing, like printf, puts and such. Note that tte_printf is just iprintf ... at least for now.

Macro Definition Documentation

◆ tte_printf

#define tte_printf   iprintf

Wrapper 'function' to hide that we're making iprintf do things it doesn't usually do.

Function Documentation

◆ tte_cmd_vt100()

int tte_cmd_vt100 ( const char *  text)

Parse for VT100-sequences.

Taken librally from libgba.
See here for a full overview.

Parameters
textSequence string, starting at the '['.
Todo:
: check for buffer overflow.

References TFont::cellW, TFont::charH, TTC::cursorX, TTC::cursorY, TTC::font, tte_erase_line(), tte_erase_rect(), tte_erase_screen(), and tte_get_context().

Referenced by tte_con_write().

◆ tte_con_write()

ssize_t tte_con_write ( struct _reent *  r,
void *  fd,
const char *  text,
size_t  len 
)

Internal routine for stdio functionality.

Note
While this function 'works', I am not 100% sure I'm handling everything correctly.

References TFont::charH, TTC::charLut, TFont::charOffset, TFont::charW, TTC::cursorX, TTC::cursorY, TTC::drawgProc, TTC::font, tte_cmd_default(), tte_cmd_vt100(), tte_get_context(), utf8_decode_char(), and TFont::widths.