# MI_CpuFill*

## Syntax

  `#include <nitro/mi.h>`
  `void MI_CpuFill8( void* dest, u8 data, u32 size );`
  `void MI_CpuFill16( void* dest, u16 data, u32 size );`
  `void MI_CpuFill32( void* dest, u32 data, u32 size );`
  `void MI_CpuFillFast( void* dest, u32 data, u32 size );`
  `void MI_CpuFill( void* dest, u8 data, u32 size );`

## Arguments

`dest` | The transfer destination address
`data` | The data that will be transferred
`size` | Transfer size

## Return Values

None.

## Description

This function uses the CPU to fill memory with specified data.

`MI_CpuFill8()` selects the most efficient memory access based on the transfer destination address, and then fills the memory with the specified data in 16-bit and 32-bit units, as appropriate. The alignment of the transfer destination address does not need to be considered.

`MI_CpuFill16()` fills the memory with specified data in 16-bit units. The transfer destination address must be 2-byte aligned.

`MI_CpuFill32()` fills the memory with specified data in 32-bit units. The transfer destination address must be 4-byte aligned.

`MI_CpuFillFast()` quickly fills the memory with the specified data in 32-byte units. The transfer destination address must be 4-byte aligned. The transfer size is an integral multiple of 4 bytes. It does not have to be an integral multiple of 32 bytes.

`MI_CpuFill()`, in the same manner as `MI_CpuFill8()`, selects the most efficient memory access based on the transfer destination address, and fills the memory with the specified data in 16-bit and 32-bit units, as appropriate. The alignment of the transfer destination address does not need to be considered. If the alignment and size are defined, we recommend that you divide calls between `MI_CpuFillFast` and `MI_CpuFill32`, as appropriate.

## Internal Operation

Processing is done by the CPU only and does not use the DMA controller. It does not use a system call. The `MI_CpuFill8` function writes in units of 16 or 32 bits, so accessing VRAM directly will not cause problems.

The `MI_CpuFill` function writes data in 8-bit units for some target addresses, so it should not be used when accessing VRAM directly. (It can be used in TWL mode if extended VRAM has been configured.)

## See Also

`MI_CpuClear*
MI_CpuCopy*
MI_CpuSend*
MI_DmaFill*`

## Revision History

2008/09/01 Added `MI_CpuFill`.
2004/04/29 Added a description of `MI_CpuFill8`.
2004/03/29 Mentioned that system calls are not used.
2003/12/01 Initial version.

CONFIDENTIAL