# GX_SetBankForBGEx

## C Specification

  `#include <nitro/gx/gx_vramcnt.h>`
  `void GX_SetBankForBGEx(GXVRamBG bg1, GXVRamBG bg2);`

## Arguments

bg1 | Specifies the VRAM banks allocated to the BG-VRAM addresses 0x6000000-0x6017FFF in the main 2D engine. Only combinations of VRAM-E, F, and G can be set.
bg2 | Specifies the VRAM banks allocated to the BG-VRAM addresses 0x6020000-0x607FFFF in the main 2D engine. Only combinations of VRAM-A, B, C, and D can be set, and the maximum size is 512 KB.

## Return Values

None.

## Description

This function sets combinations of banks that cannot be mapped to concatenated addresses in BG-VRAM.

When you use this function to set VRAM banks, you can map VRAM-E, F, and G to the concatenated addresses starting from 0x6000000 in BG-VRAM, and you can map VRAM-A, B, C, and D to the concatenated addresses starting from 0x6020000.

Parameters that can be specified for the first argument:
`GX_VRAM_BG_16_F` | 16 kilobytes are reserved in BG. VRAM-F is allocated.
`GX_VRAM_BG_16_G` | 16 kilobytes are reserved in BG. VRAM-G is allocated.
`GX_VRAM_BG_32_FG` | 32 kilobytes are reserved in BG. VRAM-F and -G are allocated.
`GX_VRAM_BG_64_E` | 64 kilobytes are reserved in BG. VRAM-E is allocated.
`GX_VRAM_BG_80_EF` | 80 kilobytes are reserved in BG. VRAM-E and -F are allocated.
`GX_VRAM_BG_96_EFG` | 96 kilobytes are reserved in BG. VRAM-E, -F, and -G are allocated.
`GX_VRAM_BG_80_EG` | 80 kilobytes are reserved in BG. VRAM-E and -G are allocated.
Parameters that can be specified for the second argument:
`GX_VRAM_BG_128_A` | 128 kilobytes are reserved in BG. VRAM-A is allocated.
`GX_VRAM_BG_128_B` | 128 kilobytes are reserved in BG. VRAM-B is allocated.
`GX_VRAM_BG_128_C` | 128 kilobytes are reserved in BG. VRAM-C is allocated.
`GX_VRAM_BG_128_D` | 128 kilobytes are reserved in BG. VRAM-D is allocated.
`GX_VRAM_BG_256_AB` | 256 kilobytes are reserved in BG. VRAM-A and -B are allocated.
`GX_VRAM_BG_256_BC` | 256 kilobytes are reserved in BG. VRAM-B and -C are allocated.
`GX_VRAM_BG_256_CD` | 256 kilobytes are reserved in BG. VRAM-C and -D are allocated.
`GX_VRAM_BG_384_ABC` | 384 kilobytes are reserved in BG. VRAM-A, -B, and -C are allocated.
`GX_VRAM_BG_384_BCD` | 384 kilobytes are reserved in BG. VRAM-B, -C, and -D are allocated.
`GX_VRAM_BG_256_AC` | 256 kilobytes are reserved in BG. VRAM-A and -C are allocated.
`GX_VRAM_BG_256_AD` | 256 kilobytes are reserved in BG. VRAM-A and -D are allocated.
`GX_VRAM_BG_256_BD` | 256 kilobytes are reserved in BG. VRAM-B and -D are allocated.
`GX_VRAM_BG_384_ABD` | 384 kilobytes are reserved in BG. VRAM-A, -B, and -D are allocated.
`GX_VRAM_BG_384_ACD` | 384 kilobytes are reserved in BG. VRAM-A, -C, and -D are allocated.

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

    typedef enum
    {
    GX_VRAM_BG_NONE     = 0x0000,
    GX_VRAM_BG_16_F     = GX_VRAM_F,                                     // ARM9: HW_BG_VRAM   -->   HW_BG_VRAM + HW_VRAM_F_SIZE
    GX_VRAM_BG_16_G     = GX_VRAM_G,                                     // ARM9: HW_BG_VRAM   -->   HW_BG_VRAM + HW_VRAM_G_SIZE
    GX_VRAM_BG_32_FG    = GX_VRAM_F | GX_VRAM_G,                         // ARM9: HW_BG_VRAM   -->   HW_BG_VRAM + HW_VRAM_F_SIZE + HW_VRAM_G_SIZE
    GX_VRAM_BG_64_E     = GX_VRAM_E,                                     // ARM9: HW_BG_VRAM   -->   HW_BG_VRAM + HW_VRAM_E_SIZE
    GX_VRAM_BG_80_EF    = GX_VRAM_E | GX_VRAM_F,                         // ARM9: HW_BG_VRAM   -->   HW_BG_VRAM + HW_VRAM_E_SIZE + HW_VRAM_F_SIZE
    GX_VRAM_BG_96_EFG   = GX_VRAM_E | GX_VRAM_F | GX_VRAM_G,             // ARM9: HW_BG_VRAM   -->   HW_BG_VRAM + HW_VRAM_E_SIZE + HW_VRAM_F_SIZE + HW_VRAM_G_SIZE
    GX_VRAM_BG_128_A    = GX_VRAM_A,                                     // ARM9: HW_BG_VRAM   -->   HW_BG_VRAM + HW_VRAM_A_SIZE
    GX_VRAM_BG_128_B    = GX_VRAM_B,                                     // ARM9: HW_BG_VRAM   -->   HW_BG_VRAM + HW_VRAM_B_SIZE
    GX_VRAM_BG_128_C    = GX_VRAM_C,                                     // ARM9: HW_BG_VRAM   -->   HW_BG_VRAM + HW_VRAM_C_SIZE
    GX_VRAM_BG_128_D    = GX_VRAM_D,                                     // ARM9: HW_BG_VRAM   -->   HW_BG_VRAM + HW_VRAM_D_SIZE
    GX_VRAM_BG_256_AB   = GX_VRAM_A | GX_VRAM_B,                         // ARM9: HW_BG_VRAM   -->   HW_BG_VRAM + HW_VRAM_A_SIZE + HW_VRAM_B_SIZE
    GX_VRAM_BG_256_BC   = GX_VRAM_B | GX_VRAM_C,                         // ARM9: HW_BG_VRAM   -->   HW_BG_VRAM + HW_VRAM_B_SIZE + HW_VRAM_C_SIZE
    GX_VRAM_BG_256_CD   = GX_VRAM_C | GX_VRAM_D,                         // ARM9: HW_BG_VRAM   -->   HW_BG_VRAM + HW_VRAM_C_SIZE + HW_VRAM_D_SIZE
    GX_VRAM_BG_384_ABC  = GX_VRAM_A | GX_VRAM_B | GX_VRAM_C,             // ARM9: HW_BG_VRAM   -->   HW_BG_VRAM + HW_VRAM_A_SIZE + HW_VRAM_B_SIZE + HW_VRAM_C_SIZE
    GX_VRAM_BG_384_BCD  = GX_VRAM_B | GX_VRAM_C | GX_VRAM_D,             // ARM9: HW_BG_VRAM   -->   HW_BG_VRAM + HW_VRAM_B_SIZE + HW_VRAM_C_SIZE + HW_VRAM_D_SIZE
    GX_VRAM_BG_512_ABCD = GX_VRAM_A | GX_VRAM_B | GX_VRAM_C | GX_VRAM_D, // ARM9: HW_BG_VRAM   -->   HW_BG_VRAM + HW_VRAM_A_SIZE + HW_VRAM_B_SIZE + HW_VRAM_C_SIZE + HW_VRAM_D_SIZE

    // discontinuous on LCDC memory
    GX_VRAM_BG_80_EG    = GX_VRAM_E | GX_VRAM_G,                         // ARM9: HW_BG_VRAM   -->   HW_BG_VRAM + HW_VRAM_E_SIZE + HW_VRAM_G_SIZE
    GX_VRAM_BG_256_AC   = GX_VRAM_A | GX_VRAM_C,                         // ARM9: HW_BG_VRAM   -->   HW_BG_VRAM + HW_VRAM_A_SIZE + HW_VRAM_C_SIZE
    GX_VRAM_BG_256_AD   = GX_VRAM_A | GX_VRAM_D,                         // ARM9: HW_BG_VRAM   -->   HW_BG_VRAM + HW_VRAM_A_SIZE + HW_VRAM_D_SIZE
    GX_VRAM_BG_256_BD   = GX_VRAM_B | GX_VRAM_D,                         // ARM9: HW_BG_VRAM   -->   HW_BG_VRAM + HW_VRAM_B_SIZE + HW_VRAM_D_SIZE
    GX_VRAM_BG_384_ABD  = GX_VRAM_A | GX_VRAM_B | GX_VRAM_D,             // ARM9: HW_BG_VRAM   -->   HW_BG_VRAM + HW_VRAM_A_SIZE + HW_VRAM_B_SIZE + HW_VRAM_D_SIZE
    GX_VRAM_BG_384_ACD  = GX_VRAM_A | GX_VRAM_C | GX_VRAM_D              // ARM9: HW_BG_VRAM   -->   HW_BG_VRAM + HW_VRAM_A_SIZE + HW_VRAM_C_SIZE + HW_VRAM_D_SIZE
    }
    GXVRamBG;

## See Also

`GX_GetBankForBG`, `GX_ResetBankForBG`, `GX_DisableBankForBG`, `GX_GetSizeOfBG`

## Revision History

05/12/2005 Deleted `GX_VRAM_BG_512_ABCD` from the list of enumerated values that can be specified. Fixed excerpt of `GXVRamBG`.
11/25/2004 Initial version.