1<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> 2<HTML> 3<HEAD> 4<META http-equiv="Content-Type" content="text/html; charset=windows-1252"> 5<META name="GENERATOR" content="IBM WebSphere Studio Homepage Builder Version 7.0.1.0 for Windows"> 6<META http-equiv="Content-Style-Type" content="text/css"> 7<TITLE>CTRDG_Init</TITLE> 8<LINK rel="stylesheet" href="../css/nitro.css" type="text/css"> 9</HEAD> 10<BODY> 11<H1 align="left">CTRDG_Init <IMG src="../image/NTR.gif" align="middle"><IMG src="../image/TWL.gif" align="middle"></H1> 12<H2>Syntax</H2> 13<DL> 14 <DD> 15 <PRE><CODE>#include <nitro/ctrdg.h></CODE></PRE> 16 <PRE><CODE>void CTRDG_Init( void ); 17 </CODE></PRE> 18</DL> 19<H2>Arguments</H2> 20<P>None.</P> 21<H2>Return Values</H2> 22<P>None.</P> 23<H2>Description</H2> 24<P>Initializes the Game Pak library.</P> 25<P>This function only needs to be called once before any of the Game Pak functions. It is called internally when the <A href="../os/init/OS_Init.html"><CODE>OS_Init</CODE></A> function is called, so in such cases it does not need to be called from the application.</P> 26<P>The <CODE>CTRDG_Init</CODE> function is a weak function, so if the application will not be using a Game Pak, you can redefine the function in the application. The purpose of redefining the function is to reduce the amount of memory occupied by the Game Pak library. When you redefine the function, make sure you only define a call to the <A href="CTRDG_DummyInit.html"><CODE>CTRDG_DummyInit</CODE></A> function. For more information, see the <A href="CTRDG_DummyInit.html"><CODE>CTRDG_DummyInit</CODE></A> function. Note that the function is a weak function only for NITRO and NITRO/TWL hybrid builds. The function is an inline function in TWL limited builds, and this method cannot be used there,</P> 27<P>This function exists in TWL limited builds, but because the TWL hardware does not have a Game Pak slot, it is initialized in only a minimal form.</P> 28<H2>Note</H2> 29<P>The following explanation pertains to NITRO-only and NITRO/TWL hybrid ROMs.</P> 30<P><font color="#800000">During the initialization process of this function, the library firsts determine if there is a Game Pak and get information associated with it. These values will be used later for validation purposes in the <a href="CTRDG_GetAgbMakerCode.html"><CODE>CTRDG_GetAgbMakerCode</CODE></a> and <a href="CTRDG_GetAgbMakerCode.html"><CODE>CTRDG_GetAgbGameCode</CODE></a> functions. When using the Game Pak, before calling this function, be sure to put the Game Pak into a valid state.</font></P> 31<P><font color="#800000">A "valid state" means that the Game Pak power is turned on for IS-NITRO-DEBUGGER or other development tools.</font></P> 32<P><font color="#800000">The <A href="../os/thread/OS_InitThread.html"><CODE>OS_InitThread</CODE></A> function must be called in advance because a thread will be created for running asynchronous AGB backup access functions when this function is called.</font> 33</P> 34 35<H2>See Also</H2> 36<P><A href="CTRDG_SetPulledOutCallback.html"><CODE>CTRDG_SetPulledOutCallback</CODE></A><BR> <A href="CTRDG_TerminateForPulledOut.html"><CODE>CTRDG_TerminateForPulledOut</CODE></A><BR> <A href="CTRDG_DummyInit.html"><CODE>CTRDG_DummyInit</CODE></A></P> 37<H2>Revision History</H2> 38<P>2008/01/28 Added the <CODE>CTRDG_DummyInit</CODE> function to <B>See Also</B>.<BR> 2006/04/05 Added mention that the <CODE>OS_InitThread</CODE> function must be called beforehand.<br> 2005/04/12 Revised the description of the relationship between the first information obtained and the <CODE>CTRDG_GetAgbMakerCode</CODE> and <CODE>CTRDG_GetAgbGameCode</CODE> functions.<br> 2005/03/03 Added note that determining whether there is a Game Card is done only at time of initialization.<br> 2004/09/15 Initial version. 39</P> 40<hr><p>CONFIDENTIAL</p></body> 41</HTML> 42