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_IdentifyAgbBackup</TITLE> 8<LINK rel="stylesheet" href="../css/nitro.css" type="text/css"> 9</HEAD> 10<BODY> 11<H1 align="left">CTRDG_IdentifyAgbBackup <IMG src="../image/NTR.gif" align="middle"></H1> 12<H2>Syntax</H2> 13<DL> 14 <DD> 15 <PRE><CODE>#include <nitro/ctrdg.h></CODE></PRE> 16 <PRE><CODE>u16 CTRDG_IdentifyAgbBackup(CTRDGBackupType type); 17 </CODE></PRE> 18 Corresponding AGB function: <A href="coordinate.html"><CODE>u16 IdentifyFlash_512K()</CODE></A> 19Corresponding AGB function: <A href="coordinate.html"><CODE>u16 IdentifyFlash_1M()</CODE></A> 20</DL> 21<H2>Arguments</H2> 22<TABLE border="1"> 23 <TBODY> 24 <TR> 25<TD><SPAN class="argument">type</SPAN></TD> 26<TD>Type of backup device mounted in the NITRO cartridge.</TD> 27 </TR> 28 </TBODY> 29</TABLE> 30<H2>Return Values</H2> 31<P>Returns zero if successful. Returns a nonzero value if it fails.</P> 32<H2>Description</H2> 33<P>Specifies the backup device that is mounted in the NITRO cartridge. If the backup device is a flash memory, the flash ID is read, the type of flash mounted in the cartridge is identified, the flash capacity and sector size is obtained, the access speed is set, and each access function for the corresponding flash is set. To refer to the flash data obtained, use the global variable <CODE>CTRDGFlashType *AgbFlash</CODE>. This function must be called once before accessing the backup device (including read access). This function returns an error if the device could not be identified and disables all access functions.</P> 34<P>The access cycle setting does not need to be set in advance because it is created inside the function. The <A href="../os/time/OS_InitTick.html"><CODE>OS_InitTick</CODE></A> function must be called in advance because clock ticks are used by this function to measure timeouts.</P> 35<P><B>Note:</B> All interrupts are disabled inside this function, and the cartridge bus is locked for a set period. In particular, when this function is called, do not use DMA that starts automatically during direct sound and V/H blank synchronization, display synchronization, cartridge request, and so on.<br><FONT color="#ff0033">In addition, if <CODE>CTRDG_BACKUP_TYPE_FLASH_512K</CODE> or <CODE>CTRDG_BACKUP_TYPE_FLASH_1M</CODE> is specified as the argument, a write operation to the device is executed. Note that backup data may be damaged if a different type of device from the given argument is installed in the NITRO cartridge.</FONT></P> 36<P>Note that the AGB backup device cannot be accessed normally with IS-NITRO-DEBUGGER version 1.66 or earlier.</P> 37<H2>See Also</H2> 38 39<H2>Revision History</H2> 40<P>2006/05/25 Added a description that the AGB backup device cannot be accessed normally with IS-NITRO-DEBUGGER version 1.66 or earlier.<BR> 2006/04/07 Initial version.</P> 41<hr><p>CONFIDENTIAL</p></body> 42</HTML> 43