# NNS_GfdAllocLnkPlttVram

## Syntax

      #include <nnsys/gfd.h>

      NNSGfdPlttKey NNS_GfdAllocLnkPlttVram( u32 szByte, BOOL b4Pltt, u32 opt );

## Arguments

`szByte` | Size of the region to allocate (8 to 524280 bytes).
`b4Pltt` | Determines whether it is a 4-color palette. `TRUE` if it is a 4-color palette.
`opt` | Option. Not currently used.

## Return Values

Returns a palette key that shows the allocated VRAM region. If the allocation fails, the function returns `NNS_GFD_ALLOC_ERROR_PLTTKEY`, a key that shows an error.

## Description

Allocates the VRAM region used as the texture palette and obtains a palette key. When `b4Pltt` is `TRUE`, the function allocates memory for a 4-color palette.
(Note that a 4-color palette has certain unique restrictions: It must have 8-byte alignment, and it is not possible to reference regions above `0x10000`.)
The empty region that results from the alignment process is registered as an empty region block.
If the new management information block is insufficient, allocation fails.
To avoid unnecessary alignment adjustments, we recommend allocating memory for the 4-color palette separately from memory for other palette formats that do not require 8-byte alignment.

If an allocation request is made for a size below the minimum that can be expressed for the key, the request size is rounded up to the minimum. If an allocation request is made for a size above the maximum that can be expressed for the key, the allocation process will not be performed and an error key will be returned.

## See Also

2005/01/31 Added a warning about the size range.

`NNS_GfdFreeLnkPlttVram`

## Revision History

2004/10/12 Initial version.

CONFIDENTIAL