Dolphin, the GameCube and Wii emulator - Forums

Full Version: Seeing the printf output in my homebrew
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hi all!
  As I understand from the source code, Dolphin has support for intercepting calls to printf() and similar APIs, and redirects them to the log. This feature would be very helpful to me while developing my homebrew game, yet I cannot seem to make use of it: my printfs never appear on Dolphin's log.

I building my homebrew with devkitpro, and I suspect that the reason why I don't see the output from any of these calls, is that maybe they are handled internally: with `nm` I see that the symbol is defined inside my binary:
Code:
nm WickedSliders.elf | grep print
8013eb30 T fiprintf
801345ac T fprintf
800808dc T kprintf
80080054 T kvsprintf
801288e4 T printf
...


But as far as I know, there's no other way to build stuff with devkitpro: everything is linked in statically. So, I'm not sure what I can do...

Any hints?
Dolphin is designed to detect statically linked functions like these. But you may need to enable Dolphin's built-in debugger and go to the Symbols menu to get Dolphin to detect that this statically linked function of yours is in fact printf. (I don't know which steps are needed exactly.)

Also make sure you've enabled the OSREPORT log category.
Thanks JosJuice!
  Why didn't I try that before? It would have saved me lots of time :-)

Anyway, enabling the debugging-ui and activating the OSReport item in the log configuration was enough to get the debug output, I didn't need to play with the Symbols menu (which, by the way, in my dolphin is not even clickable: it appears as a menu, but it doesn't respond to click -- I'm using the flatpak build on Ubuntu).
@JosJuice :

Mardy reported this to libogc (https://github.com/devkitPro/libogc/issu...1872550557), and after some looking we have no idea why a gamecube elf makes it act weird.
with the attached project, i ran it in dolphin ( commit 2241aaf168dcf60050f01fa74e15ae1ae434f9d2 ) and the first printf comes in nicely, but second does not.
However, on the screen it looks perfectly so i can only assume the libogc code works nicely, but the dolphin patch is not?

i tried looking at it, but from what i gather the data coming in HLE_GeneralDebugPrint is already wrong so idk?
mind looking into it?

the attached code can be build to make a gamecube dol & elf, and `make PLATFORM=WII` will create the wii version (which works)