# MI_SetAgbCartridgeFastestRomCycle

## C Specification

  `#include <nitro/mi.h>`
  `void MI_SetAgbCartridgeFastestRomCycle(`
  `MICartridgeRomCycle1st *prev1st,`
  `MICartridgeRomCycle2nd *prev2nd );`

## Arguments

prev1st | Pointer to the region that stores the previous ROM first access cycle settings value.
prev2nd | Pointer to the region that stores the previous ROM second access cycle settings value.

## Return Values

None. However, the previous settings values are stored where prev1st and prev2nd are shown.

## Description

Configures the first and second access cycles to the cartridge ROM region. Configures the high-speed ROM access cycle for the AGB cartridge ROM.

The first access cycle is set to 8, while the second access cycle is set to 4. This configuration is equivalent to performing the following:

> `MI_SetCartridgeRomCycle1st( MI_CTRDG_ROMCYCLE1_8 );
> MI_SetCartridgeRomCycle2nd( MI_CTRDG_ROMCYCLE2_4 );`

If `prev1st` is not NULL, the previous first access cycle settings value will be stored ahead of the pointer shown in `prev1st`. If `prev2nd` is not NULL, the previous second access cycle settings value will be stored ahead of the pointer shown in `prev2nd`.

> Note:
> The system clock of the DS is double that of the AGB, so the method for calculating the access cycle is as follows:

> > (Number of AGB wait cycles + 1 <actual access>) x 2

> Therefore, a 3-1 wait on the AGB will be an 8-4 access notation on the DS. Converting this to a wait cycle will result in an entirely odd-numbered expression such as 7-3.

> Fast settings can be performed on all AGB mask ROMs up to 3-1 wait (8-4 access notation on the DS), but the slower sections will not cause any problems. Only setting the first access to 6 is forbidden.

> However, since there is the possibility that there is a device on board the cartridge that cannot access at the same speed as the AGB mask ROM, and since there is only one address space where access speeds different from that of the AGB can be configured, it is recommended that the slowest access configurations possible be used.Be careful not to access a slow device with high-speed mask ROM configured.

> Also, use functions such as `CTRDG_GetAgbGameCode()` / `CTRDG_IsBitID()` / `CTRDG_IsNumberID()` before the access, and perform the access after comfirming that that cartridge is in fact the correct one.

## Internal Operation

Accesses the `EXMEMCNT` I/O register `(0x4000204)`.

## See Also

`MI_SetCartridgeRomCycle1st, MI_SetCartridgeRomCycle2nd, CTRDG_GetAgbGameCode, CTRDG_IsBitID, CTRDG_IsNumberID`

## Revision History

02/08/2005 Initial version.

CONFIDENTIAL