# GXS_LoadBGExtPltt

## Syntax

      #include <nitro/gx/gx_load.h>

      void GXS_LoadBGExtPltt(const void *pSrc, u32 destSlotAddr, u32 szByte);

## Arguments

pSrc | Pointer to transfer origin
destSlotAddr | Address to inside of the transfer source BG expanded palette slot
szByte | Transfer size (in bytes)

## Return Values

None.

## Description

This function uses DMA to transfer BG palette data to the sub-2D Engine BG Extended palette. The transfer destination address (in the BG Extended palette) can be specified. Use the `GX_DMAID` DMA channel (defined in `gxcommon.h`). Both `destSlotAddr` and `szByte` must be 4-byte aligned. Call this function between the `GXS_BeginLoadBGExtPltt` and `GXS_EndLoadBGExtPltt` functions.
Notes: Because the DMA transfer is carried out internally, the transfer source data must be written to main memory in advance using a function such as `DC_FlushRange`.
If the regions for transfer source and transfer destination overlap, the operation result is undefined. Do not call `GX_SetBankForSubBGExtPltt`, `GX_ResetBankForSubBGExtPltt`, or `GX_DisableBankForSubBGExtPltt` between `GXS_BeginLoadBGExtPltt` and `GXS_EndLoadBGExtPltt`.
The memory space that you can use for palettes varies according to the BG surface. For a BG2 palette you must place palette data in 0x4000-0x6000 (slot 2). For a BG3 palette you must place palette data in 0x6000-0x8000 (slot 3). You can use the `G2S_SetBG0Control` function to select either `0x0000-0x2000` (slot 0) or `0x4000-6000` (slot 2) for BG0, and the `G2S_SetBG1Control` function to select either `0x2000-0x4000` (slot 1) or `0x6000-8000` (slot 3) for BG1.

## See Also

`GXS_BeginLoadBGExtPltt`
`GXS_EndLoadBGExtPltt`

## Revision History

2004/03/01

- Added caution about restrictions on placing palette data.

2004/02/09 Initial version.

CONFIDENTIAL