/*---------------------------------------------------------------------------*
  Project:  NitroSDK - MB - include
  File:     mb_gameinfo.h

  Copyright 2003-2004 Nintendo.  All rights reserved.

  These coded instructions, statements, and computer programs contain
  proprietary information of Nintendo of America Inc. and/or Nintendo
  Company Ltd., and are protected by Federal copyright law.  They may
  not be disclosed to third parties or copied or duplicated in any form,
  in whole or in part, without the prior written consent of Nintendo.

  $Log: mb_gameinfo.h,v $
  Revision 1.1  2004/11/22 12:57:34  takano_makoto
  Initial update.

  $NoKeywords: $
 *---------------------------------------------------------------------------*/


#ifndef NITRO_MB_MB_GAMEINFO_H_
#define NITRO_MB_MB_GAMEINFO_H_

#ifdef __cplusplus
extern "C" {
#endif

#include <nitro/types.h>
#include <nitro/mb/mb.h>

/*
 * Parent game information that does not change.
 * Receive again if seqNo changes. However, normally remains fixed.
 */
typedef struct  MBGameInfoFixed
{
    MBIconInfo  icon;                                       // 544B     Icon data
    MBUserInfo  parent;                                     //  22B     Parent user information
    u8          maxPlayerNum;                               //   1B     Maximum number of players
    u8          pad[1];
    u16         gameName[ MB_GAME_NAME_LENGTH ];            //  96B     Game title
    u16         gameIntroduction[ MB_GAME_INTRO_LENGTH ];   // 192B     Description of game content
} MBGameInfoFixed, MbGameInfoFixed;


/*
 * Volatile parent game information
 * Receive again if seqNo changes.
 */
typedef struct  MBGameInfoVolatile
{
    u8          nowPlayerNum;                               //   1B     Current number of players
    u8          pad[1];
    u16         nowPlayerFlag;                              //   2B     Indicates, in bits, the player numbers of all current players.
    u16         changePlayerFlag;                           //   2B     Indicates, with a flag, the player information number that was changed in this change.
    MBUserInfo  member[ MB_MEMBER_MAX_NUM ];                // 330B     Member information
} MBGameInfoVolatile, MbGameInfoVolatile;


/* Beacon attributes */
typedef enum MbBeaconDataAttr
{
    MB_BEACON_DATA_ATTR_FIXED_NORMAL = 0,   /* Fixed data that has icon data */
    MB_BEACON_DATA_ATTR_FIXED_NO_ICON,      /* Fixed data that has no icon data */
    MB_BEACON_DATA_ATTR_VOLAT               /* Member information and other volatile data */
} MBBeaconDataAttr, MbBeaconDataAttr;

/* When dataAttr = FIXED_NORMAL, starting from the front this partitions MbGameInfoFixed data into MB_BEACON_DATA_SIZE units, and sends it.
    When dataAttr = FIXED_NO_ICON         "   from MBUserInfo       "                                (Icon data omitted)
    When dataAttr = VOLATILED, sends as "Current number of senders x user information"
*/

/*
 * Parent game information beacon
 */
typedef struct  MBGameInfo
{
    MBGameInfoFixed     fixed;                  //           Fixed data
    MBGameInfoVolatile  volat;                  //           Volatile data
    u16                 broadcastedPlayerFlag;  // Indicates    "    distributed player information in bits.
    u8                  dataAttr;               // Data attributes
    u8                  seqNoFixed;             // Fixed region's sequence number
    u8                  seqNoVolat;             // Volatile region's sequence number
    u8                  fileNo;                 // File No.
    u8                  pad[2];
    u32                 ggid;                   // GGID
    struct MBGameInfo   *nextp;                 // Pointer to next GameInfo (unidirectional list)
} MBGameInfo, MbGameInfo;


#ifdef __cplusplus
}
#endif


#endif      // NITRO_MB_MB_GAMEINFO_H_

