OSReport

Syntax

#include <revolution/os.h>

void OSReport(const char* msg, ...);

void OSVReport(const char* msg, va_list list);

Arguments

msg Pointer to a null-terminated string including format specification (equivalent to C's standard output function).
... Optional argument (OSReport).
list Additional argument (OSVReport).

Return Values

None.

Description

Prints formatted output data to the output port. The OSVReport function is the same as the OSReport function, except that it takes a variable argument list as an additional argument.

Note: When the OSGetConsoleType function is OS_CONSOLE_RETAILn, the OS[V]Report function does not output messages on production game consoles.

Note: When devices are connected to Memory Card slot A, the output process may be canceled and the specified message may not be shown in the debugging output.

Tips: By default, the OSReport function outputs to the serial port of the development hardware. In the final phase of game development, output to the TV screen rather than to the serial port may be more desirable. Because it is difficult to implement a generic print function for the TV screen due to various graphics configurations, you are free to implement a game-specific version of the OSReport function and use it to replace the one implemented in os[D].a. Because the OSReport function is weakly defined in os[D].a, the game-specific OSReport function will take precedence over the default OSReport function in os[D].a. The following code is the implementation of OSReport in os[D].a.

Tips: Debug output to Wii console NAND memory and to SD Cards can be added by using the OSReportDestination and OSReportFlush functions from the OSLog Library.

/*---------------------------------------------------------------------------*
  Name:         OSReport()

  Description:  Outputs a formatted message into the output port

  Arguments:    msg         pointer to a null-terminated string that contains
                            the format specifications
                ...         optional arguments

  Returns:      None.
 *---------------------------------------------------------------------------*/
__declspec(weak) void OSReport(const char* msg, ...)
{
    va_list marker;

    va_start(marker, msg);
    vprintf(msg, marker);
    va_end(marker);
}

__declspec(weak) void OSVReport(const char* msg, va_list list)
{
    vprintf(msg, list);
}

See Also

Error Functions
ASSERT
ASSERTMSG
OSGetConsoleType
OSHalt
OSLog Overview
Functions for Saving Debug Output
OSReportDestination
OSReportFlush

Revision History

2009/01/30 Added a tip regarding OSLog.
2008/07/25 Removed Serial Port 1 from a note.
2006/03/01 Initial version.


CONFIDENTIAL