#include <revolution/os/OSLog.h> #define OS_REPORT_SERIAL 0x00000001 #define OS_REPORT_NAND 0x00000002 s32 OSReportDestination( u32 dest );
| dest | Port used for as the output destination for OSReport. Output destination ports are given in the table below. |
|---|
| Output Destination Port | Macro Name | Description | Comments |
| 1 | OS_REPORT_SERIAL | Sets the output destination to serial output (standard OSReport output destination) | |
|---|---|---|---|
| 2 | OS_REPORT_NAND | Sets the output destination to Wii console NAND memory |
Returns 0 if successful or one of the following codes if unsuccessful.
NAND_RESULT_ACCESS
NAND_RESULT_ALLOC_FAILED
NAND_RESULT_BUSY
NAND_RESULT_CORRUPT
NAND_RESULT_EXISTS
NAND_RESULT_INVALID
NAND_RESULT_MAXFILES
NAND_RESULT_NOEXISTS
NAND_RESULT_UNKNOWN
NAND_RESULT_FATAL_ERROR
Changes the output destination of the character string output when the OSReport function is called.
Developers can choose either serial output or Wii console NAND memory as the output destination.
The OSReportDestination function is effective in cases such as when debugging on hardware that cannot use serial output.
Note: The oslog library is linked when using OSReportDestination. Memory for writing to NAND must be allocated using OSReportViewer. Before using OSReportDestination, we recommend that you take a look at OSLog Overview first.
OS_REPORT_SERIALOutputs the results of OSReport to the serial port of development hardware in the conventional way.
OS_REPORT_NANDUses Wii console NAND memory as the output destination for OSReport.
OSReport logs that have been written are temporarily stored in Wii console main memory. When OSReportFlush is called, these logs are written to Wii console NAND memory all at once.
When flushing a large amount of text, we recommend that you call OSReportFlush periodically.
Example:
OSReportDestination( OS_REPORT_NAND );
OSReport("Clear blue sky today\n");
OSReport("Will skies be clear blue tomorrow, too?\n");
......................
OSReport("Come to think of it, we might have written a large number of characters already");
OSReportDestination( OS_REPORT_SERIAL ); // All strings are written temporarily to Wii console NAND memory
OSReportDestination( OS_REPORT_NAND ); // Resume writing to Wii console NAND memory
The save data region of the Wii is used when writing to NAND. Pay attention to the remaining available capacity.
OS_REPORT_NAND | OS_REPORT_NANDPerforms simultaneous output to both the serial port and Wii console NAND memory.
OSLog Overview
Function for Saving Debug Output
OSReportFlush
OSReport
2008/11/19 Initial version.
CONFIDENTIAL