Building a new Console vs the existing libctru console #58
Replies: 2 comments 5 replies
-
I thought we could pass in a framebuffer format?
I think it's 2d pixel arrays for each character (from when I looked at it last). Overall, I think we can have a separate from-scratch console, just not in ctru itself. We can definitely look into using some existing libraries. GPU rendering would be cool, though sounds like a lot of work to integrate with the 3DS GPU (we'll have to do this eventually I think). |
Beta Was this translation helpful? Give feedback.
-
Based on this discussion, I tried to implement my own console and see if I could get it to work. I've managed to hack a proof of concept together over at https://github.com/ian-h-chamberlain/console_3ds – take a look at let me know what you think! Some notes about the implementation
|
Beta Was this translation helpful? Give feedback.
-
Based on the discussion from #57 I wanted to open more of a conversation about
Console
, and see if we could come to some kind of consensus on how we should handle this.As I see it, the default console has several drawbacks / missing features:
\n
or\r
, or when clearingIt has some nice things too, though:
PrintChar
callback to override print behaviorSo, with all that said, I think we have a few different options for a better console:
Use the existing one with some hacks to override behavior, like in Write a console that does not flush gfx buffers #57
Keep using the existing console, but fully implement a
PrintChar
callbackextern "C"
, i.e. global state or stateless (other than the state already found inPrintConsole
)Write a new console from scratch in Rust
consoleInit
does this with some calls tosetvbuf
anddevoptab_list
, which I suppose we might be able to do in our custom implementation?Try to find some external library? Maybe the above option but with less work... there are certainly some font libs out there and things like that so we can probably use them to reduce the workload.
I guess based on all that, writing one from scratch seems like a good option. It probably can be a separate crate that depends on
ctru
(orctru-sys
). For this to work, I think the main issue is figuring out how to hook it up to std output streams, and then obviously just the implementation work.Another decision would be whether to use GPU rendering (citro2d?) or render directly to the framebuffer like libctru. Or possibly two separate implementations at the user's choice?
Thoughts @Meziu @AzureMarker ?
Beta Was this translation helpful? Give feedback.
All reactions