#include <nitro/gx/gx_load.h>
void GXS_LoadBGExtPltt(const void *pSrc, u32 destSlotAddr, u32 szByte);
pSrc | Pointer to transfer origin |
destSlotAddr | Address to inside of the transfer source BG expanded palette slot |
szByte | Transfer size (in bytes) |
None.
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. The DMA channel that is used is GX_DMAID
(defined in gxcommon.h
). Both destSlotAddr
and szByte
must be 4-byte aligned. Call between GXS_BeginLoadBGExtPltt
and GXS_EndLoadBGExtPltt
.
Notes: Because the DMA transfer is carried out internally, the transfer source data must be flushed to the main memory using a function such as DC_FlushRange
prior to the process. If the regions for transfer source and transfer destination overlap, the operation result is undefined. Do not call GX_SetBankForBGExtPltt
, GX_ResetBankForBGExtPltt
, or GX_DisableBankForBGExtPltt
between GX_BeginLoadBGExtPltt
and GX_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). For BG0 you can select 0x0000-0x2000 (slot 0) or 0x4000-0x6000 (slot 2) with G2_SetBG0Control
. For BG1 you can select 0x2000-0x4000 (slot 1) or 0x6000-0x8000 (slot 3) with G2_SetBG1Control
.
GXS_BeginLoadBGExtPltt
, GXS_EndLoadBGExtPltt
03/01/2004
02/09/2004 Initial version.