SGDK
A free and open development kit for the Sega Mega Drive
Loading...
Searching...
No Matches
console.h File Reference

TTY text console. More...

#include "config.h"
Include dependency graph for console.h:

Go to the source code of this file.

Detailed Description

TTY text console.

Author
Andreas Dietrich
Date
09/2022

This unit provides a simple TTY text console. Characters are written as a stream, where lines are automatically wrapped if the horizontal border of the screen is reached. When at the bottom of the screen window, the console content is moved up by one text line and a blank row is inserted.

Per default, the console occupies a standad screen of 40x28 tiles. All text attributes, such as font, palette, plane etc., are taken from SGDK text settings. Screen updates are done using DMA transfer mode (which can be changed with CON_setTransferMethod()).

One of the use cases are assert messages. To this end, the Genesis state can be automatically reset before text is displayed (see assert macro below).