# GX_TrySetBankForOBJ

## C Specification

  `#include <nitro/gx/gx_vramcnt.h>`
  `BOOL GX_TrySetBankForOBJ(GXVRamOBJ obj);`

## Arguments

`obj` | Specifies a VRAM bank to allocate to the main 2D Engine's OBJ

## Return Values

Returns TRUE if the VRAM bank is allocated as normal. Returns FALSE if the VRAM bank to be allocated is locked by another library.

## Description

Attempts to allocate a VRAM bank to the main 2D engine OBJ. If the specified VRAM bank is either disabled or allocated to LCDC, that VRAM bank is allocated to the Main 2D Engine OBJ. The allocation will fail if the designated VRAM bank is exclusion-locked by another library.

`GX_VRAM_OBJ_NONE` | VRAM is not allocated to OBJ.
`GX_VRAM_OBJ_16_F` | 16 kilobytes of OBJ are reserved. VRAM-F is allocated.
`GX_VRAM_OBJ_16_G` | 16 kilobytes of OBJ are reserved. VRAM-G is allocated.
`GX_VRAM_OBJ_32_FG` | 32 kilobytes of OBJ are reserved. VRAM-F and -G are allocated.
`GX_VRAM_OBJ_64_E` | 64 kilobytes of OBJ are reserved. VRAM-E is allocated.
`GX_VRAM_OBJ_80_EF` | 80 kilobytes of OBJ are reserved. VRAM-E and -F are allocated.
`GX_VRAM_OBJ_80_EG` | 80 kilobytes of OBJ are reserved. VRAM-E and -G are allocated.
`GX_VRAM_OBJ_96_EFG` | 96 kilobytes of OBJ are reserved. VRAM-E, -F, and -G are allocated.
`GX_VRAM_OBJ_128_A` | 128 kilobytes of OBJ are reserved. VRAM-A is allocated.
`GX_VRAM_OBJ_128_B` | 128 kilobytes of OBJ are reserved. VRAM-B is allocated.
`GX_VRAM_OBJ_256_AB` | 256 kilobytes of OBJ are reserved. VRAM-A and -B are allocated.

The following is the type definition for `GXVRamOBJ` types.

    typedef enum
    {
    GX_VRAM_OBJ_NONE   = 0x0000,
    GX_VRAM_OBJ_16_F   = GX_VRAM_F,                      // ARM9: HW_OBJ_VRAM  -->   HW_OBJ_VRAM + HW_VRAM_F_SIZE
    GX_VRAM_OBJ_16_G   = GX_VRAM_G,                      // ARM9: HW_OBJ_VRAM  -->   HW_OBJ_VRAM + HW_VRAM_G_SIZE
    GX_VRAM_OBJ_32_FG  = GX_VRAM_F | GX_VRAM_G,          // ARM9: HW_OBJ_VRAM  -->   HW_OBJ_VRAM + HW_VRAM_F_SIZE + HW_VRAM_G_SIZE
    GX_VRAM_OBJ_64_E   = GX_VRAM_E,                      // ARM9: HW_OBJ_VRAM  -->   HW_OBJ_VRAM + HW_VRAM_E_SIZE
    GX_VRAM_OBJ_80_EF  = GX_VRAM_E | GX_VRAM_F,          // ARM9: HW_OBJ_VRAM  -->   HW_OBJ_VRAM + HW_VRAM_E_SIZE + HW_VRAM_F_SIZE
    GX_VRAM_OBJ_80_EG  = GX_VRAM_E | GX_VRAM_G,          // ARM9: HW_OBJ_VRAM  -->   HW_OBJ_VRAM + HW_VRAM_E_SIZE + HW_VRAM_G_SIZE
    GX_VRAM_OBJ_96_EFG = GX_VRAM_E | GX_VRAM_F | GX_VRAM_G, // ARM9: HW_OBJ_VRAM  -->   HW_OBJ_VRAM + HW_VRAM_E_SIZE + HW_VRAM_F_SIZE + HW_VRAM_G_SIZE
    GX_VRAM_OBJ_128_A  = GX_VRAM_A,                      // ARM9: HW_OBJ_VRAM  -->   HW_OBJ_VRAM + HW_VRAM_A_SIZE
    GX_VRAM_OBJ_128_B  = GX_VRAM_B,                      // ARM9: HW_OBJ_VRAM  -->   HW_OBJ_VRAM + HW_VRAM_B_SIZE
    GX_VRAM_OBJ_256_AB = GX_VRAM_A | GX_VRAM_B           // ARM9: HW_OBJ_VRAM  -->   HW_OBJ_VRAM + HW_VRAM_A_SIZE + HW_VRAM_B_SIZE
    }
    GXVRamOBJ;

## See Also

`GX_SetBankForOBJ, GX_GetBankForOBJ, GX_ResetBankForOBJ, GX_DisableBankForOBJ, GX_GetSizeOfOBJ`

## Revision History

02/15/2005 Initial version.