void Console_writeLine(char* fmt, ...) { // Counter for writing characters int i = 0; // Temporary buffer to print formatted string to char buffer[CONSOLE_PRINT_BUFFER_SIZE]; // Variable argument list va_list vl; // Init variable arguments va_start(vl, fmt); // Print formatted string to buffer vsprintf(buffer, fmt, vl); // Iterate over the string and print each character until // the end of string is reach, or the buffer size limit. while(buffer[i] != '\0' && i < CONSOLE_PRINT_BUFFER_SIZE) { _putChar(buffer[i]); i++; } // End line _putChar('\n'); // Finalize variable arguments va_end(vl); }
void putChar( char c, int x, int y ) { _putChar( c, x, y, 7 ); }