kmSetPaletteBankData

Rewrites part of the on-chip palette data.

KMSTATUS KMAPI
kmSetPaletteBankData(
IN KMINT32 PaletteEntry,
IN KMINT32 DataSize,
IN PKMPALETTEDATA pPaletteTable
)

Description:

This function rewrites a specified portion of the on-chip palette used by the palettized texture. See the descriptions of kmSetPaletteData for the structure of the palette.
The values that can be specified by PaletteEntry are 0 to 1,023 for both 4- and 8-bpp palette modes. The values need not be aligned with a bank boundary. They can start at any entry.
Data items in an area pointed to by pPaletteTable are sent to the palette between entries PaletteEntry and PaletteEntry + DataSize sequentially, starting at the beginning of the area. If PaletteEnrty + DataSize > 1,024, data for palette numbers greater than 1,023 is ignored. Put another way, data transfer ends at palette number 1,023.

Caution:

Palette data setting (kmSetPaletteData/kmSetPaletteBank/kmSetPaletteBankData) cannot precede palette mode setting (kmSetPaletteMode). If the palette mode type does not match the palette data type, invalid data will be set in the palette register.

Parameters:

PaletteEntry(input)
This parameter specifies the first entry number of a palette where data is to be written, using a number between 0 and 1,023. A palette portion that begins with the specified entry number will be rewritten.
DataSize(input)
DataSize(input) This parameter specifies the size of the data to be written (number of entries), using a number between 1 and 1,024.
pPaletteTable(input)
This parameter is a pointer to a palette setting array. The array is defined as follows:
KMPALETTEDATA PaletteTable;
The number of elements constituting the palette data must be greater than or equal to the value specified in PaletteEntry + DataSize. If the number of elements is less than that value, normal operation is not guaranteed.

Return values:

Value | Explanation
--- | ---
KMSTATUS_SUCCESS | Success

Example:

kmSetPaletteBankData( 32, 64, pPaletteTable);
This example coding rewrites 64 entries in the palette, starting at entry 32.

kmSetPaletteBankData