kmSetPaletteBank

Changes entry of palette, in banks.


KMSTATUS KMAPI
kmSetPaletteBank(
IN KMINT32 Bank,
IN KMPALETTE_ENTRY_SIZE DataSize,
IN PKMDWORD pPaletteData
)

Description:

This function rewrites a specified portion of the on-chip palette used by the palettized texture.

The value of DataSize determines the number of entries to update.
If DataSize is set to KM_PALETTE_ENTRY_16, 16 entries will be updated. 16 * 4 bytes of data from top of pPaletteData are set to specified bank. In this case, pPaletteData requires data for the 16 entries.
If DataSize is set to KM_PALETTE_ENTRY_256, 256 entries will be updated. 256 * 4 bytes of data from top of pPaletteData are set to specified bank. In this case, pPaletteData requires data for the 256 entries.

See the descriptions of kmSetPaletteData for the structure of the palette.

Caution:

Palette data setting (kmSetPaletteBank/kmSetPaletteData/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:

Bank(input)
This parameter specifies the bank number to update. The range is from 0 to 63.
If DataSize is set to KM_PALETTE_ENTRY_256, the number can be 0, 16, 32, or 48. For other values, the lower 4 bits will be masked and it will be converted to 0, 16, 32, or 48 for use.

DataSize(input)
This parameter specifies the data size to update. One of the following can be selected.
KM_PALETTE_ENTRY_16Handled as 4BPP palette. Data of 16 entries will be updated.
KM_PALETTE_ENTRY_256Handled as 8BPP palette. Data of 256 entries will be updated.


pPaletteData(input)
This parameter is a pointer to a DWORD array. The number of elements constituting the palette data must be greater than or equal to the value specified in DataSize. If the number of elements is less than that value, normal operation is not guaranteed.

Return values:

ValueExplanation
KMSTATUS_SUCCESS Success

  kmSetPaletteBank