Console rework: ANSI compliance; visible cursor#73
Console rework: ANSI compliance; visible cursor#73trustytrojan wants to merge 12 commits intodevkitPro:masterfrom
Conversation
remove commented out code for directional cursor movement
|
This is one of the reasons we ask people to contact us before embarking on large changes to the libraries we maintain. We've been doing work on reworking the ansi support code in all the libraries which we've been consolidating, bugfixing and cross porting. See https://github.com/devkitPro/libogc/blob/master/libogc/console.c, https://github.com/switchbrew/libnx/blob/master/nx/source/runtime/devices/console.c and https://github.com/devkitPro/libctru/blob/master/libctru/source/console.c I'm sorry you've put so much work into this but libnds was next for this treatment and your changes unfortunately conflict with that. |
|
That's alright, I got what I wanted out of this anyway. I just hope the result is the same after you guys get to libnds. Though I have to ask, how will you get background colors to work without using a 2nd layer? Unless that was your plan. That's probably the change with the largest effect on users so I'm wondering. I didn't want to deal with custom fonts so a 2nd layer was my solution. Edit: here's something fun I got out of this work: star wars turned into ascii art streamed over telnet streamed over ssh! recording_2025-08-11_16.29.13.mp4Edit 2: I just remembered that there's a |
Changes
console-print.cconsole-esc.cconsole-cursor.cconsole-priv.hwas added as an interface for the three source files to call each other with.Feature additions
truepassed toansiBgColorsinconsoleInitImplementation details
Because the default font cannot have tiles inverted in color (or I just don't know how to do that), I used the next available video background layer (new parameter added in
consoleInitdocumentation) just for rendering the ASCII full block character (decimal 219) using the same palette.By adding a simple boolean parameter to
consoleInit, you can still choose whether a console uses 2 BGs or not.Demo video
recording_2025-08-08_16.55.50.mp4
Demo code