libnds icon indicating copy to clipboard operation
libnds copied to clipboard

Feature Request: Ability to map file descriptors to consoles

Open trustytrojan opened this issue 5 months ago • 1 comments

Feature Request

What feature are you suggesting?

Overview:

  • Add the ability to map file descriptors to PrintConsole objects, so that an application can print to several and display any of them as needed (either on the top or bottom screen, or switching between consoles like Linux's TTYs for example).

Smaller Details:

  • Involves figuring out what newlib passes to the devoptab_t's write_r callback
  • Add a table in console.c to map FDs to consoles, and a function to create mappings
  • In con_write use the passed fd to select the console to render to

Why would this feature be useful?

  • This can make debugging better by separating streams into different consoles for different components of an application
  • In the case of console-only apps, this can add the ability to have separate windows for tasks/sub-applications

trustytrojan avatar Aug 02 '25 19:08 trustytrojan

A working libnds with this feature is complete! https://github.com/trustytrojan/libnds/tree/consoles-per-fd

trustytrojan avatar Aug 03 '25 14:08 trustytrojan