examples for consoleNew, consoleInit, etc?

User avatar
PypeBros
Posts: 40
Joined: Thu Nov 25, 2010 12:00 pm
Location: In a galaxy far, far away
Contact:

examples for consoleNew, consoleInit, etc?

Post by PypeBros » Thu Nov 25, 2010 12:08 pm

Hello.

I'm porting old code (libnds dating back from october 2007) that still used consoleInitDefault() in various subtle ways -- like calling twice to have the font available on both screens or changing which screen hosts the console at run time to the latest release ( 1.4.8 ) of libnds. Yet I'm missing some examples of how things work, and it looks like I don't even have the consoleNew that the doxygen documentation talks about >_<

Any hint ?
NDS is the neatest piece of hardware since the C=64! Thanks for making it programmable ^_^

zeromus
Posts: 212
Joined: Wed Mar 31, 2010 6:05 pm

Re: examples for consoleNew, consoleInit, etc?

Post by zeromus » Sat Nov 27, 2010 6:33 pm

which doxygen docs? you sure theyre not old ones?

why dont you just read console.h for documentation--then you wont have a mismatch between sources and docs.

WinterMute
Site Admin
Posts: 2003
Joined: Tue Aug 09, 2005 3:21 am
Location: UK
Contact:

Re: examples for consoleNew, consoleInit, etc?

Post by WinterMute » Sat Nov 27, 2010 9:33 pm

Sounds like you're using random doxygen docs from somewhere other than http://libnds.devkitpro.org

http://libnds.devkitpro.org/a00107.html
Help keep devkitPro toolchains free, Donate today

Personal Blog

User avatar
PypeBros
Posts: 40
Joined: Thu Nov 25, 2010 12:00 pm
Location: In a galaxy far, far away
Contact:

Re: examples for consoleNew, consoleInit, etc?

Post by PypeBros » Sat Nov 27, 2010 9:43 pm

Actually, I was refering to doxygen-compatible comments found in the code itself. And the link http://libnds.devkitpro.org/a00107.html says:
PrintConsole * consoleGetDefault (void)
Gets a pointer to the default console (this should only be used when using a single console, other wise use consoleNew(PrintsConsole* console).
Thanks for the official online dox, btw. For some reason, my package (libnds-1.4.8 for Linux) was complaining about a missing libnds.dox file.
NDS is the neatest piece of hardware since the C=64! Thanks for making it programmable ^_^

zeromus
Posts: 212
Joined: Wed Mar 31, 2010 6:05 pm

Re: examples for consoleNew, consoleInit, etc?

Post by zeromus » Sun Nov 28, 2010 8:23 am

thats interesting. documentation is out of date as soon as it is written. it doesnt seem like a very large logical leap to get from consoleNew to consoleInit. the answers are still in that header file.

User avatar
PypeBros
Posts: 40
Joined: Thu Nov 25, 2010 12:00 pm
Location: In a galaxy far, far away
Contact:

Re: examples for consoleNew, consoleInit, etc?

Post by PypeBros » Sun Nov 28, 2010 2:06 pm

i sure can write

Code: Select all

PrintConsole SecondConsole = * getDefaultConsole();
ConsoleInit(&SecondConsole, ...);
if that's the intent. That doesn't make the current documentation less confusing.
NDS is the neatest piece of hardware since the C=64! Thanks for making it programmable ^_^

zeromus
Posts: 212
Joined: Wed Mar 31, 2010 6:05 pm

Re: examples for consoleNew, consoleInit, etc?

Post by zeromus » Mon Nov 29, 2010 2:10 am

I just patted my head and rubbed my tummy and it didnt make the current documentation any less confusing, also.

It's interesting. Its almost like you would have to edit the documentation to make it less confusing, or something like that. Am I crazy?

But I also think there is another way. It depends on how you parse things. You could say that the documentation is less confusing if it confuses you less, right? And it would confuse you less if you ignored it (which you should do because documentation is out of date as soon as it is written). I thought maybe you would experience a little bit of that thrill when you typed in code in clear contradiction to the guidance in the documentation, but I guess not. Well, it works for me anyway. I never get confused by docs (and I never read them) and thats all I can say for sure.

You could also try reading the docs but assuming theyre maliciously modified to cause trouble for you by sneaking in inaccuracies of all sizes. That way you can get guided in the right direction without tripping too hard on traps. Sort of like holding your arms out while stumbling through dark woods following a ghostly voice. It's only common sense.

User avatar
PypeBros
Posts: 40
Joined: Thu Nov 25, 2010 12:00 pm
Location: In a galaxy far, far away
Contact:

Re: examples for consoleNew, consoleInit, etc?

Post by PypeBros » Mon Nov 29, 2010 10:50 am

zeromus wrote: But I also think there is another way. It depends on how you parse things. You could say that the documentation is less confusing if it confuses you less, right? And it would confuse you less if you ignored it (which you should do because documentation is out of date as soon as it is written). I thought maybe you would experience a little bit of that thrill when you typed in code in clear contradiction to the guidance in the documentation, but I guess not. Well, it works for me anyway. I never get confused by docs (and I never read them) and thats all I can say for sure.

You could also try reading the docs but assuming theyre maliciously modified to cause trouble for you by sneaking in inaccuracies of all sizes. That way you can get guided in the right direction without tripping too hard on traps. Sort of like holding your arms out while stumbling through dark woods following a ghostly voice. It's only common sense.
That quite sounds like an answer from a character in "Alice in Wonderland" :lol:

Well, I guess the best I have to do is to print out console.c and console.h and reverse-engineer that to figure out what the dudes that modified the interface had in their mind at that time.
NDS is the neatest piece of hardware since the C=64! Thanks for making it programmable ^_^

WinterMute
Site Admin
Posts: 2003
Joined: Tue Aug 09, 2005 3:21 am
Location: UK
Contact:

Re: examples for consoleNew, consoleInit, etc?

Post by WinterMute » Tue Nov 30, 2010 5:33 pm

The other approach is to realise that writing libraries for machines we have no documentation for is doomed to always be a work in progress and, despite our best intentions, things will change, better ways to do things will be found & old code is unlikely to compile or work with the latest set of tools and libraries.

It looks like Dovoto either didn't get around to implementing consoleNew or intended to use consoleInit instead, I'll update the doxygen stuff at some point when I have more time to look properly. Of course patches to fix problems like this are always appreciated :wink:

There are also numerous examples which go some way towards illustrating intended use of various libnds features. examples/nds/Graphics/Printing/print_both_screens is probably a good place to look.
Help keep devkitPro toolchains free, Donate today

Personal Blog

User avatar
PypeBros
Posts: 40
Joined: Thu Nov 25, 2010 12:00 pm
Location: In a galaxy far, far away
Contact:

Re: examples for consoleNew, consoleInit, etc?

Post by PypeBros » Thu Dec 09, 2010 11:44 am

I'll have a look at that print_double_screen example, thanks.
NDS is the neatest piece of hardware since the C=64! Thanks for making it programmable ^_^

Post Reply

Who is online

Users browsing this forum: Ahrefs [Bot] and 2 guests