I have updated pspautotests. In the end I have decided that a good way to have psp-compatible executables in usermode and allow to output to a simple hookable file is doing the following:
You can see the implementation here:
http://code.google.com/p/pspautotests/so...n/common.c
http://code.google.com/p/pspemu/source/detail?r=303
- Try to open "emulator:/Kprintf" file. If the file was able to open, that means that we are running the program in a compatible emulator. If not, we are on a psp.
- Hook the stdout FILE handle.
- If we are in a compatible emulator, we will send printf output to the "emulator:/Kprintf" stream.
- If we are on the PSP, we will output the contents to 'ms0:/__testoutput.txt'.
- Also we will output all the stuff using pspDebugScreenPrintf. So if we have a display, we will be able to see the output directly.
- If we are on the PSP, the program will wait until the user press X button, so we can see the output on the display.
You can see the implementation here:
http://code.google.com/p/pspautotests/so...n/common.c
http://code.google.com/p/pspemu/source/detail?r=303