WPADReadGameData

C Specification

#include <revolution/wpad.h>

#define WPAD_CHAN0                    0
#define WPAD_CHAN1                    1
#define WPAD_CHAN2                    2
#define WPAD_CHAN3                    3

#define WPAD_MEM_GAMEDATA_LEN         3888

s32 WPADReadGameData( s32 chan, void *p_buf, u16 len, u16 offset, WPADCallback callback );

Arguments

chan One of WPAD_CHANn values.
p_buf The leading address for the buffer to which the read data is copied.
len The size of the data to be read.
offset The offset from the game data's leading address to the start of the read.
callback Callback function to notify about the result.

Return Values

Returns one of the following codes:

WPAD_ERR_NONE
WPAD_ERR_NO_CONTROLLER
WPAD_ERR_BUSY
WPAD_ERR_TRANSFER

Description

Reads data from the internal memory of the Wii Remote for the specified channel. This function registers the command used to read data to the library. The WPAD library processes registered commands when other commands are not running.

For saving game data, 4000 bytes are allocated within the internal memory but the first 112 bytes are used by the library to manage file information. Although the application can actually save game data to the 3888 bytes from the 16th to the 4000th byte, this 16th byte has an offset value of 0 within the library, so there is no need to be particularly aware of it.

The set game title and the date and time on which the file was saved are saved in the file information with the WPADSetGameTitle and WPADSetGameTitleWChar functions, respectively. The WPADGetGameTitle and WPADGetGameDataTimeStamp functions, respectively, can also get that data.

See Also

WPAD Functions
WPADWriteGameData
WPADSetGameTitle
WPADSetGameTitleWChar
WPADGetGameTitle
WPADGetGameDataTimeStamp

Revision History

08/15/2006 Initial version.


CONFIDENTIAL