CTRDG_IdentifyAgbBackup

C Specification

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

Arguments

type Represents the type of backup device mounted in the NITRO cartridge.

Return Values

Returns 0 if successful. Returns a non-zero value if it fails.

Description

This function 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. The flash data obtained can be referred to using 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 beforehand because it is created inside the function. The OS_InitTick function must be called before this function because clock ticks are used by this function to measure timeouts.

Note: All interrupts are disabled inside this function and the catridge 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, etc.
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 will be 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 version IS-NITRO-DEBUGGER 1.66 or earlier.

See Also

Revision History

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


CONFIDENTIAL