Welcome! Log In Create A New Profile

Advanced

Best way to view debug messages?

Posted by Riddian 
Best way to view debug messages?
November 29, 2009 02:28PM
I'm working on an Wii app that's currently console only (no-GUI). I have lots of lovely printfs telling me useful things :) However, I'm considering sticking a GUI on top of it and was wondering what is the best way of continuing to view these messages?

I was thinking of these possible solutions:
• Making my Wii app serve a simple webpage with such data on
• Making a debug output area in my app's GUI
• Possibly using software that lets you send console messages back to a PC?

Many thanks!



Edited 1 time(s). Last edit at 11/29/2009 02:38PM by Riddian.
Re: Best way to view debug messages?
November 29, 2009 02:59PM
I just had this problem myself.

I resolved it using a special type of console womdow created be dhewg instead of the normal console window so I could have a console window that overlayed GX.

All of the code I used is in my project here: [code.google.com]

The files log_console.cpp [code.google.com] and log_console.h [code.google.com] contain the code to make the window be able to happen.

I then used the following code in my main to initialize the console:
  static GXRModeObj *rmode = NULL;
  rmode = VIDEO_GetPreferredMode(NULL);
  log_console_init(rmode, 0, 0, 0, windowwidth, windowheight);
  log_console_enable_video(true);

From there on, the console window works like a normal console window.


I'm certainly not saying that this is the best method however. You could alternatively make your GUI and redo your outputs in fonts (libfreetype).

Or you could output your output to your SD Card.

Or you get a USB Gecko and output to that.

The choice is entirely up to you.
Re: Best way to view debug messages?
November 29, 2009 10:42PM
Oh wow! Brilliant solution, thank you very much!

I was aware of the idea of outputting to SD but didn't like the idea of grabbing a log file from the SD card every time I want to see my output. I knew of the USB Gecko option too but didn't really want to buy one ;)

Now... I wonder if it's possible to make it semi-transparent or perhaps show it on some button press like a quake console?
Re: Best way to view debug messages?
November 29, 2009 10:54PM
Quote
Riddian
Now... I wonder if it's possible to make it semi-transparent or perhaps show it on some button press like a quake console?
//Turn off display
if(WPAD_ButtonsDown(WPAD_CHAN_0)&WPAD_BUTTON_1)
log_console_enable_video(false);
//Turn on display
if(WPAD_ButtonsDown(WPAD_CHAN_0)&WPAD_BUTTON_2)
log_console_enable_video(true);

Or you could write out a slightly more complex logic to make one button turn it on and off on a cycle (I'm too lazy to do that right now :p)

I don't know about semi-transparency. You'd have to modify the console window itself (console_log.cpp and console_log.h) Best of luck if you decide to do that.
Re: Best way to view debug messages?
November 30, 2009 12:50AM
Thanks again, you've been a great help! :)
Re: Best way to view debug messages?
November 30, 2009 11:07AM
You know, I've always been interested in getting a hold of some debug versions of programs I enjoy, such as..well.. DOP-IOS or DOP-IOS MOD, or FCEU GX, etc. etc.

I mean, I could buy a USBGecko, but that's $50 I don't have. I also wanna learn C soon, so immersing myself in these versions of programs would probably help me get a better grip. Speaking of which, anybody know any good sites or books to teach me C (ones that deal with XCode and non-Wii programming would be a huge help too)
Re: Best way to view debug messages?
November 30, 2009 01:46PM
Sorry, only registered users may post in this forum.

Click here to login