CTRDG_IdentifyAgbBackup

Syntax

#include <nitro/ctrdg.h>
u16 CTRDG_IdentifyAgbBackup(CTRDGBackupType type);
  
Corresponding AGB function: u16 IdentifyFlash_512K() Corresponding AGB function: u16 IdentifyFlash_1M()

Arguments

type Type of backup device mounted in the NITRO cartridge.

Return Values

Returns zero if successful. Returns a nonzero value if it fails.

Description

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 CTRDGFlashType *AgbFlash. 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.

The access cycle setting does not need to be set in advance because it is created inside the function. The OS_InitTick function must be called in advance because clock ticks are used by this function to measure timeouts.

Note: 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.
In addition, if CTRDG_BACKUP_TYPE_FLASH_512K or CTRDG_BACKUP_TYPE_FLASH_1M 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.

Note that the AGB backup device cannot be accessed normally with IS-NITRO-DEBUGGER version 1.66 or earlier.

See Also

Revision History

2006/05/25 Added a description that the AGB backup device cannot be accessed normally with IS-NITRO-DEBUGGER version 1.66 or earlier.
2006/04/07 Initial version.


CONFIDENTIAL