# Memory Interface (MI) Function List

### Initialization

MI_Init |  | Initializes the MI library.

### CPU Memory Operations

MI_CpuCopy* |  | Copies data.
MI_CpuMove* |  | Moves data.
MI_CpuFill* |  | Fills memory with specified data.
MI_CpuClear* |  | Zero-clears memory.
MI_CpuSend* |  | Sends data with fixed address.
MI_CpuRecv* |  | Reads data from a fixed address.
MI_CpuPipe* |  | Sends data from a fixed address to a fixed address.
MI_CpuFind* |  | Searches through memory for the specified data.
MI_CpuComp* |  | Compares data.

### DMA Memory Operations

MI_DmaCopy* |  | Copies data.
MI_NDmaCopy* |  | Copies data.
MI_DmaFill* |  | Fills memory with specified data.
MI_NDmaFill* |  | Fills memory with specified data.
MI_DmaClear* |  | Zero-clears memory.
MI_NDmaClear* |  | Zero-clears memory.
MI_DmaSend* |  | Sends data with fixed address.
MI_NDmaSend* |  | Sends data with fixed address.
MI_DmaRecv* |  | Reads data from a fixed address.
MI_NDmaRecv* |  | Reads data from a fixed address.
MI_DmaPipe* |  | Sends data from a fixed address to a fixed address.
MI_NDmaPipe* |  | Sends data from a fixed address to a fixed address.
MI_DmaRestart |  | Starts DMA once it has been configured.
MI_NDmaRestart |  | Starts DMA once it has been configured.
MI_HBlankDmaCopy* |  | Uses H-Blank DMA to copy data.
MI_HBlankNDmaCopy* |  | Uses H-Blank DMA to copy data.
MI_VBlankDmaCopy* |  | Uses V-Blank DMA to copy data.
MI_VBlankNDmaCopy* |  | Uses V-Blank DMA to copy data.
MI_DispMemDmaCopy |  | Sets main memory display DMA copies.
MI_SendGXCommand* |  | Uses DMA to send geometry commands to command FIFO.
MI_SendNDmaGXCommand* |  | Uses DMA to send geometry commands to command FIFO.
MI_TimerNDmaCopy |  | Sets up a DMA copy based on a timer startup.
MI_Card_NDmaCopy |  | Sets up a DMA copy based on memory card transfer startup.
MI_IsDmaBusy |  | Checks whether the specified DMA channel is being used.
MI_IsNDmaBusy |  | Checks whether the specified DMA channel is being used.
MI_WaitDma |  | Waits for the specified end of DMA.
MI_WaitNDma |  | Waits for the specified end of DMA.
MI_StopDma |  | Stops specified DMA.
MI_StopNDma |  | Stops specified DMA.
MI_StopAllDma |  | Stops all DMA channels. (Legacy DMA)
MI_StopAllNDma |  | Stops all DMA channels. (New DMA)
MI_SetNDmaArbitrament |  | Sets the arbitration method for the new DMA.
MI_GetNDmaArbitramentMode |  | Gets the arbitration method for the new DMA.
MI_GetNDmaArbitramentRoundRobinCycle |  | Gets the number of cycles that can be run on the ARM7 when the arbitration method for the new DMA is set to round-robin.
MI_InitNDmaConfig |  | Initializes the config structure that controls the behavior of the new DMA.
MI_GetNDmaConfig |  | Gets the config structure for the new DMA.
MI_SetNDmaConfig |  | Sets the config structure for the new DMA.
MI_SetNDmaInterval |  | Sets the Interval information for the specified config structure.
MI_GetNDmaIntervalTimer |  | Gets the IntervalTimer information for the specified config structure.
MI_GetNDmaIntervalPrescaler |  | Gets the IntervalPrescaler information for the specified config structure.
MI_SetNDmaBlockWord |  | Gets the BlockWord information for the specified config structure.
MI_GetNDmaBlockWord |  | Gets the BlockWord information for the specified config structure.
MI_SetNDmaWordCount |  | Sets the WordCount information for the specified config structure.
MI_GetNDmaWordCount |  | Gets the WordCount information for the specified config structure.

### External Memory Control

MI_SetMainMemoryPriority |  | Sets access priority to main memory.
MI_GetMainMemoryPriority |  | Gets settings for access priority to main memory.
MI_GetCardProcessor |  | Gets settings for access rights to card.
MI_GetCartridgeProcessor |  | Gets settings for access rights to Game Pak.
MI_SetCartridgeRomCycle1st |  | Sets the first access cycle to the Game Pak ROM region.
MI_GetCartridgeRomCycle1st |  | Gets the settings for the first access cycle to the Game Pak ROM region.
MI_SetCartridgeRomCycle2nd |  | Sets the second access cycle to the Game Pak ROM region.
MI_GetCartridgeRomCycle2nd |  | Gets the setting for the second access cycle to access the Game Pak's ROM region.
MI_SetCartridgeRamCycle |  | Sets the access cycle to the Game Pak RAM region.
MI_GetCartridgeRamCycle |  | Gets the settings for the access cycle to the Game Pak RAM region.
MI_SetAgbCartridgeFastestRomCycle |  | Sets the high-speed access cycle to the AGB Game Pak ROM region.

### Work RAM Settings

MI_SetWramBank |  | This function is only used by the system.
MI_GetWramBankMaster* |  | Gets the master processor assigned to the shared WRAM (256 KB x 3).
MI_GetWramBankOffset* |  | Gets the offset position of the shared WRAM (256 KB x 3) banks.
MI_GetWramBankEnable* |  | Gets whether the banks in the shared WRAM (256 KB x 3) can be used.
MI_GetWramMapStart* |  | Gets the starting address of the shared WRAM (256 KB x 3).
MI_GetWramMapEnd* |  | Gets the ending address of the shared WRAM (256 KB x 3).
MI_GetWramMapImage* |  | Gets the image occurrence setting of the shared WRAM (256 KB x 3).
MI_IsWramSlotLocked* |  | Determines whether the shared WRAM (256 KB x 3) slots are locked.
MI_GetAllocatableWramSlot* |  | Gets which slots in the shared WRAM (256 KB x 3) can be allocated by the specified processor.
MI_GetFreeWramSlot* |  | Gets which slots in the shared WRAM (256 KB x 3) are neither reserved nor assigned.
MI_GetUsedWramSlot* |  | Gets which slots in the shared WRAM (256 KB x 3) are assigned.
MI_GetWramReservation* |  | Gets the processor that has reserved the shared WRAM (256 KB x 3) slot.
MI_IsWramSlotUsed* |  | Gets whether the shared WRAM (256 KB x 3) slots are assigned.
MI_InitWramManager |  | Initializes the shared WRAM (256 KB x 3) manager.
MI_AllocWram* |  | Makes a request for WRAM assignment to the shared WRAM (256 KB x 3) manager.
MI_FreeWram* |  | Sends a request to the shared WRAM (256 KB x 3) manager to free some WRAM.
MI_SwitchWram* |  | Notifies the shared WRAM (256 KB x 3) manager of changes to the assigned WRAM master.
MI_ReserveWram* |  | Notifies the shared WRAM manager (256 KB x 3) of a reservation of WRAM by a processor.
MI_CancelWram* |  | Notifies the shared WRAM manager (256 KB x 3) of a cancelled reservation of WRAM by a processor.
MI_DumpWramList* |  | Displays the WRAM assignment status maintained by the WRAM (256 KB x 3) manager for a given WRAM region.
MI_DumpWramListAll |  | Displays the WRAM assignment status maintained by the WRAM (256 KB x 3) manager for all WRAM regions.

### Memory Swap

MI_SwapByte |  | Swaps specified byte data and memory data.
MI_SwapWord |  | Swaps specified word data and memory data.

### Expanding Compressed Data

MI_UnpackBits |  | Expands the data filled with fixed 0.
MI_UncompressLZ8 |  | Expands the LZ77-compressed data in 8-bit units.
MI_UncompressLZ16 |  | Expands the LZ77-compressed data in 16-bit units.
MI_UncompressHuffman |  | Expands Huffman-compressed data in 32-bit units.
MI_UncompressRL8 |  | Expands run-length compressed data in 8-bit units.
MI_UncompressRL16 |  | Expands run-length compressed data in 16-bit units.
MI_UncompressRL32 |  | Expands run-length compressed data in 32-bit units.
MI_UnfilterDiff8 |  | Expands the data that the difference filter was applied to in 8-bit units.
MI_UnfilterDiff16 |  | Expands the data that the difference filter was applied to in 16-bit units.
MI_UnfilterDiff32 |  | Expands the data that the difference filter was applied to in 32-bit units.
MI_SecureUncompressAny |  | Detects the compression format from the data header and executes the appropriate decompression process. (Includes buffer overrun check.)
MI_SecureUncompressRL |  | Decompresses run-length compressed data once. (Includes buffer overrun check.)
MI_SecureUncompressLZ |  | Decompresses LZ77-compressed data once. (Includes buffer overrun check.)
MI_SecureUncompressBLZ |  | Decompresses BLZ-compressed data once. (Includes buffer overrun check.)
MI_SecureUncompressHuffman |  | Decompresses Huffman-compressed data once. (Includes buffer overrun check.)
MI_SecureUnfilterDiff |  | Decompresses data that a difference filter has been applied to. (Includes buffer overrun check.)
MI_GetUncompressedSize |  | Gets the size of the expanded data.
MI_GetCompressionType |  | Gets the compression format of the compressed data.
MI_InitUncompContextRL |  | Initializes run-length compression streaming decode context.
MI_InitUncompContextLZ |  | Initializes LZ77 compression streaming decode context.
MI_InitUncompContextHuffman |  | Initializes the Huffman compression streaming decode context.
MI_ReadUncompRL* |  | Runs run-length compression streaming decoding.
MI_ReadUncompLZ* |  | Runs LZ77-compression streaming decoding.
MI_ReadUncompHuffman |  | Runs Huffman compression streaming decoding.
MI_CompressRL |  | Performs run-length compression on the data.
MI_CompressLZ |  | Performs LZ77 compression on the data.
MI_CompressLZFast |  | Performs LZ77 compression on the data. Processing is performed rather quickly in exchange for requiring a work buffer.
MI_CompressHuffman |  | Performs Huffman compression on the data.
MI_FilterDiff* |  | Creates data that a difference filter has been applied to.

### Byte Access

MI_ReadByte |  | Reads the byte data from the memory. This function has been kept for compatibility. Do not use it.
MI_WriteByte |  | Writes the byte data to the memory. This function has been kept for compatibility. Do not use it.

### Endian-Aware Memory Access

MI_SwapEndian8 |  | Reverses the endian of a 8-bit value. These 8-bit versions do not actually perform any conversions, but they have been included for uniform source code visibility.
MI_SwapEndian16 |  | Reverses the endian of a 16-bit value.
MI_SwapEndian32 |  | Reverses the endian of a 32-bit value.
MI_SwapEndian64 |  | Reverses the endian of a 64-bit value.
MI_HToLE8 |  | Converts a 8-bit value from the current environment to little-endian. These 8-bit versions do not actually perform any conversions, but they have been included for uniform source code visibility.
MI_HToLE16 |  | Converts a 16-bit value from the current environment to little-endian.
MI_HToLE32 |  | Converts a 32-bit value from the current environment to little-endian.
MI_HToLE64 |  | Converts a 64-bit value from the current environment to little-endian.
MI_HToBE8 |  | Converts a 8-bit value from the current environment to big-endian. These 8-bit versions do not actually perform any conversions, but they have been included for uniform source code visibility.
MI_HToBE16 |  | Converts a 16-bit value from the current environment to big-endian.
MI_HToBE32 |  | Converts a 32-bit value from the current environment to big-endian.
MI_HToBE64 |  | Converts a 64-bit value from the current environment to big-endian.
MI_LEToH8 |  | Converts a 8-bit value from little-endian to the current environment. These 8-bit versions do not actually perform any conversions, but they have been included for uniform source code visibility.
MI_LEToH16 |  | Converts a 16-bit value from little-endian to the current environment.
MI_LEToH32 |  | Converts a 32-bit value from little-endian to the current environment.
MI_LEToH64 |  | Converts a 64-bit value from little-endian to the current environment.
MI_BEToH8 |  | Converts a 8-bit value from big-endian to the current environment. These 8-bit versions do not actually perform any conversions, but they have been included for uniform source code visibility.
MI_BEToH16 |  | Converts a 16-bit value from big-endian to the current environment.
MI_BEToH32 |  | Converts a 32-bit value from big-endian to the current environment.
MI_BEToH64 |  | Converts a 64-bit value from big-endian to the current environment.
MI_LoadLE8 |  | Reads a 8-bit value from the specified address as little-endian.
MI_LoadLE16 |  | Reads a 16-bit value from the specified address as little-endian.
MI_LoadLE32 |  | Reads a 32-bit value from the specified address as little-endian.
MI_LoadLE64 |  | Reads a 64-bit value from the specified address as little-endian.
MI_LoadBE8 |  | Reads a 8-bit value from the specified address as big-endian.
MI_LoadBE16 |  | Reads a 16-bit value from the specified address as big-endian.
MI_LoadBE32 |  | Reads a 32-bit value from the specified address as big-endian.
MI_LoadBE64 |  | Reads a 64-bit value from the specified address as big-endian.
MI_StoreLE8 |  | Writes a 8-bit value to the specified address as little-endian.
MI_StoreLE16 |  | Writes a 16-bit value to the specified address as little-endian.
MI_StoreLE32 |  | Writes a 32-bit value to the specified address as little-endian.
MI_StoreLE64 |  | Writes a 64-bit value to the specified address as little-endian.
MI_StoreBE8 |  | Writes a 8-bit value to the specified address as big-endian.
MI_StoreBE16 |  | Writes a 16-bit value to the specified address as big-endian.
MI_StoreBE32 |  | Writes a 32-bit value to the specified address as big-endian.
MI_StoreBE64 |  | Writes a 64-bit value to the specified address as big-endian.

### Utilities

MI_InitAllocator |  | Initializes the memory allocator structure.
MI_CallAlloc |  | Allocates memory from the allocator.
MI_CallFree |  | Deallocates memory back to the allocator.
MI_InitDevice |  | Initializes the device interface structure.
MI_ReadDevice |  | Reads data from the device.
MI_WriteDevice |  | Writes data to the device.
MI_InitCache |  | Initializes the cache structure.
MI_ReadCache |  | Reads data from the cache page list.
MI_LoadCache |  | Loads all pages that are in the load-wait state.
MI_IsCacheLoading |  | Determines whether there are any pages in the load-wait state.

### Types and Structures

MICompressionHeader |  | Compression data header information structure.
MIUncompContextRL |  | Context structure when using run-length compression streaming decoding.
MIUncompContextLZ |  | Context structure when using LZ77 compression streaming decoding.
MIUncompContextHuffman |  | Context structure when using Huffman compression streaming decoding.
MIAllocator |  | Initializes the memory allocator interface.
MIAllocatorAllocFunction |  | Function prototype for the memory allocation callback.
MIAllocatorFreeFunction |  | Function prototype for the memory deallocation callback.
MIDevice |  | The interface structure for wrapping device control.
MIDeviceReadFunction |  | The function prototype for the callback for reading from the device.
MIDeviceWriteFunction |  | The function prototype for the callback for writing to the device.
MICache |  | The structure used to implement the memory cache.
MINDmaConfig |  | The structure used to specify the new DMA operation.

CONFIDENTIAL