# Game Pak (CTRDG) Function List

### Initialization

CTRDG_Init |  | Initializes the Game Pak library.
CTRDG_DummyInit |  | Initializes the Game Pak library in a way that minimizes its size.

### Removal Detection

CTRDG_IsExisting |  | Checks whether a Game Pak is inserted.
CTRDG_IsPulledOut |  | Detects a Game Pak removal.
CTRDG_SetPulledOutCallback |  | Sets the Game Pak removal callback.
CTRDG_TerminateForPulledOut |  | Stops both the ARM9 processor and the ARM7 processor when a Game Pak removal is detected.
CTRDG_IsAgbCartridgePulledOut |  | Detects AGB Game Pak removal.
CTRDG_IsOptionCartridgePulledOut |  | Detects removal of option Game Pak.
CTRDG_CheckPulledOut |  | Immediately carries out Game Pak removal detection from ARM9.

### Types of Game Paks

CTRDG_IsAgbCartridge |  | Returns a Boolean value to indicate if an AGB Game Pak is present.
CTRDG_IsOptionCartridge |  | Returns a Boolean value to indicate if an Option Pak with peripherals is installed.
CTRDG_IsBitID |  | Returns whether the peripheral device identified by the bit ID is mounted in the Game Pak slot.
CTRDG_IsNumberID |  | Returns whether the peripheral device identified by the number ID is mounted in the Game Pak slot.

### AGB Game Pak Information

CTRDG_GetAgbMakerCode |  | Returns the AGB Game Pak's maker code.
CTRDG_GetAgbGameCode |  | Returns the game code (initial code) of AGB Game Pak.
CTRDG_IsEnabled |  | Retrieves whether access to the AGB Game Pak is enabled or disabled.
CTRDG_Enable |  | Enables access to the AGB Game Pak.
CTRDG_CheckEnabled |  | Determines whether access to the AGB Game Pak is enabled.

### Data Transfer

CTRDG_DmaCopy* |  | Transfers data using DMA.
CTRDG_CpuCopy* |  | Transfers data using the CPU.
CTRDG_Read* |  | Reads data from the Game Pak area.
CTRDG_Write* |  | Writes data to the Game Pak area.

### AGB Backup Overview

CTRDG_IdentifyAgbBackup |  | Identifies the backup device and initializes settings.
CTRDG_SetTaskThreadPriority |  | Changes the priority of a task thread.
Correspondence Chart |  | Shows the correspondence between AGB backup access functions for the DS and backup access functions for the AGB.

### FLASH Device

CTRDG_ReadAgbFlash |  | Reads backup device data.
CTRDG_EraseAgbFlashChip |  | Erases backup device data on the flash chip.
CTRDG_EraseAgbFlashSector |  | Erases backup device data in a sector.
CTRDG_WriteAgbFlashSector |  | Writes data in sector units to the backup device.
CTRDG_VerifyAgbFlash |  | Verifies data on the backup device (in bytes).
CTRDG_WriteAndVerifyAgbFlash |  | Writes data to the backup device (in sectors) and verifies that data (in bytes).
CTRDG_ReadAgbFlashAsync |  | Asynchronously reads backup device data.
CTRDG_EraseAgbFlashChipAsync |  | Asynchronously erases backup device data on the flash chip.
CTRDG_EraseAgbFlashSectorAsync |  | Asynchronously erases backup device data in a sector.
CTRDG_WriteAgbFlashSectorAsync |  | Asynchronously writes data (in sectors) to the backup device.
CTRDG_VerifyAgbFlashAsync |  | Asynchronously verifies data on the backup device (in bytes).
CTRDG_WriteAndVerifyAgbFlashAsync |  | Asynchronously writes data to the backup device (in sectors) and verifies that data (in bytes).

### SRAM Device

CTRDG_ReadAgbSram |  | Reads backup device data.
CTRDG_WriteAgbSram |  | Writes data (in sectors) to the backup device.
CTRDG_VerifyAgbSram |  | Verifies data on the backup device (in bytes).
CTRDG_WriteAndVerifyAgbSram |  | Writes data to the backup device (in sectors) and verifies that data (in bytes).
CTRDG_ReadAgbSramAsync |  | Asynchronously reads backup device data.
CTRDG_WriteAgbSramAsync |  | Asynchronously writes data (in sectors) to the backup device.
CTRDG_VerifyAgbSramAsync |  | Asynchronously verifies data on the backup device (in bytes).
CTRDG_WriteAndVerifyAgbSramAsync |  | Asynchronously writes data to the backup device (in sectors) and verifies that data (in bytes).

### PHI Output Terminal

CTRDG_SetPhiClock |  | This function sets the PHI output terminal.
CTRDG_GetPhiClock |  | This function gets PHI output terminal setting values.

CONFIDENTIAL