1<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> 2<html> 3 4<head> 5<META http-equiv="Content-Type" content="text/html; charset=windows-1252"> 6<META name="GENERATOR" content="IBM WebSphere Studio Homepage Builder Version 8.0.0.0 for Windows"> 7<META http-equiv="Content-Style-Type" content="text/css"> 8<TITLE>MB_Init</TITLE> 9<LINK rel="stylesheet" href="../../css/nitro.css" type="text/css"> 10</head> 11 12<body> 13 14<h1 align="left">MB_Init <IMG src="../../image/NTR.gif" width="24" height="12" border="0" align=middle><IMG src="../../image/TWL.gif" width="24" height="12" border="0" align=middle></h1> 15<h2>Syntax</h2> 16 17<dl> 18 <dd> 19<CODE>#include <nitro/mb.h></CODE><BR> <BR> <CODE>int MB_Init(void *work, const MBUserInfo *user, u32 ggid, u32 tgid, u32 dma);</CODE><br> <br> 20 </dd> 21</dl> 22<h2>Arguments</h2> 23<TABLE border="1" width="100%"> 24 <TBODY> 25 <TR> 26<TD width="13%"><EM><STRONG>work</STRONG></EM></TD> 27<TD width="87%">Pointer to memory allocated for the internal state management of the MB library.<br />It must be at least <CODE>MB_SYSTEM_BUF_SIZE</CODE> bytes in size. The allocated memory is used internally until the <A href="MB_End.html"><CODE>MB_End</CODE></A> function is called. If you can ensure that the <a href="../parent/MB_StartParentFromIdle.html"><CODE>MB_StartParentFromIdle</CODE></a> function is called after the <code>MB_Init</code> function, you can reduce the size by <code>WM_SYSTEM_BUF_SIZE</code> bytes.</TD> 28 </TR> 29 <TR> 30<TD width="13%"><EM><STRONG>user</STRONG></EM></TD> 31<TD width="87%">Pointer to the structure in which user data is saved.<br />The content specified by this pointer is referenced only in the <code>MB_Init</code> function.</TD> 32 </TR> 33 <TR> 34<TD width="13%"><EM><STRONG>ggid</STRONG></EM></TD> 35<TD width="87%">A 4-byte game group ID.</TD> 36 </TR> 37 <TR> 38<TD width="13%"><EM><STRONG>tgid</STRONG></EM></TD> 39<TD width="87%">A 16-bit value from <CODE>0x0000</CODE> to <CODE>0xFFFF</CODE> that indicates the TGID value. When specified as <a href="../mb_tgid_auto_const.html"><CODE>MB_TGID_AUTO</CODE></a>, the TGID is obtained automatically by calling the <a href="../../wm/wm/WM_GetNextTgid.html"><CODE>WM_GetNextTgid</CODE></a> function internally. At the initial program launch (IPL), the display information is not updated when the <code>tgid</code>, <code>ggid</code>, and MAC address are the same (a single parent is assumed). After a parent terminates, the user information displayed in the child IPL may not be updated if the user name was updated and restarted as an MB parent.<br>If <a href="../mb_tgid_auto_const.html"><CODE>MB_TGID_AUTO</CODE></a> is not specified, use the <A href="../../os/irq/OS_GetVBlankCount.html"><CODE>OS_GetVBlankCount</CODE></A> function or the RTC to set a different value for each startup whenever possible.</TD> 40 </TR> 41 <TR> 42<TD width="13%"><EM><STRONG>dma</STRONG></EM></TD> 43<TD width="87%">The DMA channel allocated for MB internal processing.<br /> The DMA channel is used internally until the <a href="MB_End.html"><CODE>MB_End</CODE></a> function is called.</TD> 44 </TR> 45 </TBODY> 46</TABLE> 47<h2>Return Values</h2> 48<p>Returns <CODE>MB_SUCCESS</CODE> if the initialization completes successfully.</p> 49 50<H2>Description</H2> 51<P>Initializes the multiboot (MB) library. The <code>MB_Init</code> function must be called once before any MB function is called. However, if you call <code>MB_Init</code> more than once, nothing happens. <BR>After calling this function, use the <A href="../parent/MB_SetParentCommParam.html"><CODE>MB_SetParentCommParam</CODE></A> function to set the maximum number of connected children. Do this before the <A href="../parent/MB_StartParent.html"><CODE>MB_StartParent</CODE></A> function is called.<BR> 52</p> 53<h2>See Also</h2> 54<p><a href="../mb_user_info_type.html"><CODE>MBUserInfo</CODE></a><BR> <a href="../parent/MB_StartParent.html"><CODE>MB_StartParent</CODE></a><BR> <a href="../parent/MB_StartParentFromIdle.html"><CODE>MB_StartParentFromIdle</CODE></a><BR> <a href="../parent/MB_SetParentCommParam.html"><CODE>MB_SetParentCommParam</CODE></a><BR> <a href="MB_End.html"><CODE>MB_End</CODE></a><BR> <a href="../../os/irq/OS_GetVBlankCount.html"><CODE>OS_GetVBlankCount</CODE></a></P> 55<H2>Revision History</H2> 56<P> 572005/04/11 Expanded the type of the <SPAN class="argument">tgid</SPAN> argument to <CODE>u32</CODE> and added a description for <code>MB_TGID_AUTO</code>. <br>2004/11/24 Renamed <CODE>MB_StartParentEx</CODE> to <CODE>MB_StartParentFromIdle</CODE>. <BR>2004/10/18 Added a description for the <CODE>MB_StartParentEx</CODE> function. <BR>2004/10/05 Corrected an error in the description of internal operations. <BR>2004/09/30 Added an argument. <BR>2004/08/09 Initial version. 58</P> 59<hr><p>CONFIDENTIAL</p></body> 60</html> 61