PAlib: Bg Modes 0-2

Main Page | Modules | File List | Globals | Search for

# Bg Modes 0-2

## Defines

#define | PA_HideBg(screen, bg_select) _REG16(REG_BGSCREEN(screen)) &= ~(0x100 << (bg_select))
| Hide a screen's background.
#define | PA_ShowBg(screen, bg_select) _REG16(REG_BGSCREEN(screen)) |= (0x100 << (bg_select))
| Show a hidden background.
#define | PA_ResetBg(screen) _REG16(REG_BGSCREEN(screen)) &= ~(0xF00)
| Reinitialize de Bg system of a screen. It only hides all the backgrounds in reality...
#define | PA_LoadBgTiles(screen, bg_select, bg_tiles) PA_LoadBgTilesEx(screen, bg_select, (void*)bg_tiles, SIZEOF_16BIT(bg_tiles))
| Load a tileset into memory
#define | PA_LoadTiledBg(screen, bg_number, bg_name)
| This will never get easier... Loads a background TiledBg converted with PAGfx, with it's tiles, map, and palette. Only 256 color mode available.
#define | PA_LoadSimpleBg(screen, bg_select, bg_tiles, bg_map, bg_size, wraparound, color_mode)
| Simple way to load a Background. Combines PA_InitBg, PA_LoadBgTiles, and PA_LoadBgMap
#define | PA_LoadRotBg(screen, bg_select, bg_tiles, bg_map, bg_size, wraparound)
| Load a background fit for rotating/scaling ! Warning, you must use PA_SetVideoMode to 1 if you want 1 rotating background (Bg3 only !), or 2 for 2 rotating backgrounds (Bg2 and 3). The background MUST be in 256 colors
#define | PA_LoadBg(screen, bg_select, bg_tiles, tile_size, bg_map, bg_size, wraparound, color_mode)
| Simplest way to load a Background. Combines PA_InitBg, PA_LoadBgTiles, and PA_LoadBgMap
#define | PA_BGScrollX(screen, bg_number, x) _REG16(REG_BGSCROLLX + ((screen) * 0x1000) + ((bg_number) << 2)) = (x)&1023
| Scroll horizontaly any background
#define | PA_BGScrollY(screen, bg_number, y) _REG16(REG_BGSCROLLY + ((screen) * 0x1000) + ((bg_number) << 2)) = (y)&1023
| Scroll vertically any background
#define | PA_BGScrollXY(screen, bg_number, x, y) {PA_BGScrollX(screen, bg_number, x); PA_BGScrollY(screen, bg_number, y);}
| Scroll horizontaly and vertically any background
#define | PA_SetMapTileHflip(screen, bg_select, x, y, hflip) {*(u16*)(PA_bgmap[screen][bg_select] + ((x) << 1) + ((y) << 6)) &= ALL_BUT(TILE_HFLIP); *(u16*)(PA_bgmap[screen][bg_select] + ((x) << 1) + ((y) << 6)) |= ((hflip) << 10);}
| Flip a given tile horizontaly
#define | PA_SetMapTileVflip(screen, bg_select, x, y, vflip) {*(u16*)(PA_bgmap[screen][bg_select] + ((x) << 1) + ((y) << 6)) &= ALL_BUT(TILE_VFLIP); *(u16*)(PA_bgmap[screen][bg_select] + ((x) << 1) + ((y) << 6)) |= ((vflip) << 11);}
| Flip a given tile verticaly
#define | PA_SetMapTilePal(screen, bg_select, x, y, palette_number) {*(u16*)(PA_bgmap[screen][bg_select] + ((x) << 1) + ((y) << 6)) &= ALL_BUT(TILE_PAL); *(u16*)(PA_bgmap[screen][bg_select] + ((x) << 1) + ((y) << 6)) |= ((palette_number) << 12);}
| Change the 16 color palette used by a tile. Works only if the Bg is in 16 colors...
#define | PA_LoadTiledBitmap(screen, tiled_bitmap) PA_LoadBg(screen, 0, tiled_bitmap, SCREEN_TILES, bitmap, BG_256X256, 1, 1)
| Load a bitmap converted using gfx2gba, converted like a tileset but without any optimisations. No use to include the map. Carefull, takes the whole tile memory...
#define | PA_LoadPAGfxRotBg(screen, bg_select, bg_name, wraparound)
| Load a background fit for rotating/scaling ! Warning, you must use PA_SetVideoMode to 1 if you want 1 rotating background (Bg3 only !), or 2 for 2 rotating backgrounds (Bg2 and 3). The background MUST be in 256 colors
#define | PA_LoadLargeBg(screen, bg_select, bg_tiles, bg_map, color_mode, lx, ly)
| Completely load and initialise a background with infinite scrolling (usefull if larger or wider than 512 pixels)
#define | PA_LoadPAGfxLargeBg(screen, bg_number, bg_name)
| Completely load and initialise a background with infinite scrolling (usefull if larger or wider than 512 pixels), converted with PAGfx
#define | PA_LoadLargeBgEx(screen, bg_select, bg_tiles, tile_size, bg_map, color_mode, lx, ly)
| Completely load and initialise a background with infinite scrolling (usefull if larger or wider than 512 pixels), but here you can put yourself the tile size...

## Functions

void | PA_ResetBgSys (void)
| Reset the background system
void | PA_InitBg (u8 screen, u8 bg_select, u8 bg_size, u8 wraparound, u8 color_mode)
| Initialise a given background. Do this only after having loaded a tileset and a map.
void | PA_LoadBgTilesEx (u8 screen, u8 bg_select, void *bg_tiles, u16 size)
| Load a tileset into memory with a given size
void | PA_ReLoadBgTiles (u8 screen, u8 bg_select, void *bg_tiles)
| ReLoad a tileset into memory
void | PA_DeleteTiles (u8 screen, u8 bg_select)
| Delete a tilest in memory. Note that loading a tileset automatically deletes the preceding one, so you won't need to use this function often
void | PA_DeleteMap (u8 screen, u8 bg_select)
| Delete a map in memory. Note that loading a map automatically deletes the preceding one, so you won't need to use this function often
void | PA_DeleteBg (u8 screen, u8 bg_select)
| Delete a complete background (tiles + map + hide it...)
void | PA_LoadBgMap (u8 screen, u8 bg_select, void *bg_map, u8 bg_size)
| Load a background's map info
void | PA_SetBgRot (u8 screen, u8 bg_select, s32 x_scroll, s32 y_scroll, s32 x_rotcentre, s32 y_rotcentre, s16 bg_angle, s32 bg_zoom)
void | PA_SetMapTile (u8 screen, u8 bg_select, s16 x, s16 y, s16 tile_number)
| Change the tile gfx used by a given tile in the map
void | PA_SetMapTileAll (u8 screen, u8 bg_select, s16 x, s16 y, u16 tile_info)
| Change the tile info used by a given tile in the map
void | PA_SetLargeMapTile (u8 screen, u8 bg_select, s32 x, s32 y, u32 tile_info)
| Change the tile info used by a given tile in the map, only for big background (512 large or wide)
void | PA_SetMapTileEx (u8 screen, u8 bg_select, s16 x, s16 y, u16 tile_number, u8 hflip, u8 vflip, u8 palette_number)
void | PA_InfLargeScrollX (u8 screen, u8 bg_select, s32 x)
| Scroll a large infinite scrolling background horizontaly. It must have been initialised with PA_LoadLargeBg.
void | PA_InfLargeScrollY (u8 screen, u8 bg_select, s32 y)
| Scroll a large infinite scrolling background vertically. It must have been initialised with PA_LoadLargeBg.
void | PA_InfLargeScrollXY (u8 screen, u8 bg_select, s32 x, s32 y)
| Scroll a large infinite scrolling background horizontaly and vertically. It must have been initialised with PA_LoadLargeBg.
void | PA_LargeScrollX (u8 screen, u8 bg_select, s32 x)
| Scroll a large background horizontaly. It must have been initialised with PA_LoadLargeBg. This function does not wrap around, but is faster than the InfLargeScroll...
void | PA_LargeScrollY (u8 screen, u8 bg_select, s32 y)
| Scroll a large background vertically. It must have been initialised with PA_LoadLargeBg. This function does not wrap around, but is faster than the InfLargeScroll...
void | PA_LargeScrollXY (u8 screen, u8 bg_select, s32 x, s32 y)
| Scroll a large background horizontaly and vertically. It must have been initialised with PA_LoadLargeBg. This function does not wrap around, but is faster than the InfLargeScroll...
void | PA_InitParallaxX (u8 screen, s32 bg0, s32 bg1, s32 bg2, s32 bg3)
| Initialise Parallax Scrolling for multiple backgrounds, horizontaly. Chose the speed at which each background will scroll compared to the others. Then use PA_ParallaxScrollX to scroll...
void | PA_InitParallaxY (u8 screen, s32 bg0, s32 bg1, s32 bg2, s32 bg3)
| Initialise Parallax Scrolling for multiple backgrounds, horizontaly. Chose the speed at which each background will scroll compared to the others. Then use PA_ParallaxScrollX to scroll...
void | PA_ParallaxScrollX (u8 screen, s32 x)
| Scroll the backgrounds
void | PA_ParallaxScrollY (u8 screen, s32 y)
| Scroll the backgrounds
void | PA_ParallaxScrollXY (u8 screen, s32 x, s32 y)
| Scroll the backgrounds
void | PA_SetBgPrio (u8 screen, u8 bg, u8 prio)
| Change a backgrounds priority
void | PA_CreateBgFromTiles (u8 screen, u8 bg_select, u8 bg_tiles, void *bg_map, u8 bg_size)
void | PA_ClearBg (u8 screen, u8 bg_select)
| Erase a given background (just the tilemap)

## Detailed Description

Load tiles, a map, scroll it...

## Define Documentation

#define PA_BGScrollX | ( | screen,
|  | bg_number,
|  | x |  | ) | _REG16(REG_BGSCROLLX + ((screen) * 0x1000) + ((bg_number) << 2)) = (x)&1023

Scroll horizontaly any background

Parameters:

  | screen | Chose de screen (0 or 1)
  | bg_number | Background number (0-3)
  | x | X value to scroll

#define PA_BGScrollXY | ( | screen,
|  | bg_number,
|  | x,
|  | y |  | ) | {PA_BGScrollX(screen, bg_number, x); PA_BGScrollY(screen, bg_number, y);}

Scroll horizontaly and vertically any background

Parameters:

  | screen | Chose de screen (0 or 1)
  | bg_number | Background number (0-3)
  | x | X value to scroll
  | y | Y value to scroll

#define PA_BGScrollY | ( | screen,
|  | bg_number,
|  | y |  | ) | _REG16(REG_BGSCROLLY + ((screen) * 0x1000) + ((bg_number) << 2)) = (y)&1023

Scroll vertically any background

Parameters:

  | screen | Chose de screen (0 or 1)
  | bg_number | Background number (0-3)
  | y | Y value to scroll

#define PA_HideBg | ( | screen,
|  | bg_select |  | ) | _REG16(REG_BGSCREEN(screen)) &= ~(0x100 << (bg_select))

Hide a screen's background.

Parameters:

  | screen | Chose de screen (0 or 1)
  | bg_select | Background number to load (from 0 to 3)

#define PA_LoadBg | ( | screen,
|  | bg_select,
|  | bg_tiles,
|  | tile_size,
|  | bg_map,
|  | bg_size,
|  | wraparound,
|  | color_mode |  | ) |

Value:

    {\
    PA_LoadBgTilesEx(screen, bg_select, (void*)bg_tiles, tile_size); \
    PA_LoadBgMap(screen, bg_select, (void*)bg_map, bg_size); \
    PA_InitBg(screen, bg_select, bg_size, 0, color_mode);\
    PA_BGScrollXY(screen, bg_select, 0, 0);}

Simplest way to load a Background. Combines PA_InitBg, PA_LoadBgTiles, and PA_LoadBgMap

Parameters:

  | screen | Chose de screen (0 or 1)
  | bg_select | Background number to load (from 0 to 3)
  | bg_tiles | Name of the tiles' info (example: ship_Tiles)
  | tile_size | Size of your tileset
  | bg_map | Name of the map's info (example : ship_Map)
  | bg_size | Background size. This is important, because it also determines whether the Bg is rotatable or not. To use a normal background, use the macros BG_256X256, BG_256X512, etc... For a rotatable Bg, use the macros BG_ROT_128X128...
  | wraparound | If the background wraps around or not. More important for rotating backgrounds.
  | color_mode | Color mode : 0 for 16 color mode, 1 for 256...

#define PA_LoadBgTiles | ( | screen,
|  | bg_select,
|  | bg_tiles |  | ) | PA_LoadBgTilesEx(screen, bg_select, (void*)bg_tiles, SIZEOF_16BIT(bg_tiles))

Load a tileset into memory

Parameters:

  | screen | Chose de screen (0 or 1)
  | bg_select | Background number to load (from 0 to 3)
  | bg_tiles | Name of the tiles' info (example: ship_Tiles)

#define PA_LoadLargeBg | ( | screen,
|  | bg_select,
|  | bg_tiles,
|  | bg_map,
|  | color_mode,
|  | lx,
|  | ly |  | ) |

Value:

    {\
    PA_LoadSimpleBg(screen, bg_select, bg_tiles, Blank, BG_512X256, 0, color_mode);\
    PA_InitLargeBg(screen, bg_select, lx, ly, (void*)bg_map);}

Completely load and initialise a background with infinite scrolling (usefull if larger or wider than 512 pixels)

Parameters:

  | screen | Chose de screen (0 or 1)
  | bg_select | Background number to load (from 0 to 3)
  | bg_tiles | Name of the tiles' info (example: ship_Tiles)
  | bg_map | Name of the map's info (example : ship_Map)
  | color_mode | Color mode : 0 for 16 color mode, 1 for 256...
  | lx | Width, in tiles. So a 512 pixel wide map is 64 tiles wide...
  | ly | Height, in tiles. So a 512 pixel high map is 64 tiles high...

#define PA_LoadLargeBgEx | ( | screen,
|  | bg_select,
|  | bg_tiles,
|  | tile_size,
|  | bg_map,
|  | color_mode,
|  | lx,
|  | ly |  | ) |

Value:

    {\
    PA_LoadBg(screen, bg_select, bg_tiles, tile_size, Blank, BG_512X256, 0, color_mode);\
    PA_InitLargeBg(screen, bg_select, lx, ly, (void*)bg_map);}

Completely load and initialise a background with infinite scrolling (usefull if larger or wider than 512 pixels), but here you can put yourself the tile size...

Parameters:

  | screen | Chose de screen (0 or 1)
  | bg_select | Background number to load (from 0 to 3)
  | bg_tiles | Name of the tiles' info (example: ship_Tiles)
  | tile_size | Size of your tileset
  | bg_map | Name of the map's info (example : ship_Map)
  | color_mode | Color mode : 0 for 16 color mode, 1 for 256...
  | lx | Width, in tiles. So a 512 pixel wide map is 64 tiles wide...
  | ly | Height, in tiles. So a 512 pixel high map is 64 tiles high...

#define PA_LoadPAGfxLargeBg | ( | screen,
|  | bg_number,
|  | bg_name |  | ) |

Value:

    {\
           PA_LoadBgPal(screen, bg_number, (void*)bg_name##_Pal); \
           PA_LoadLargeBg(screen, bg_number, bg_name##_Tiles, bg_name##_Map, 1, (bg_name##_Width) >> 3, (bg_name##_Height) >> 3);}

Completely load and initialise a background with infinite scrolling (usefull if larger or wider than 512 pixels), converted with PAGfx

Parameters:

  | screen | Chose de screen (0 or 1)
  | bg_number | Background number to load (from 0 to 3)
  | bg_name | Background name, in PAGfx

#define PA_LoadPAGfxRotBg | ( | screen,
|  | bg_select,
|  | bg_name,
|  | wraparound |  | ) |

Value:

    {\
    PA_LoadNormalBgPal(screen, (void*)bg_name##_Pal);\
    PA_LoadRotBg(screen, bg_select, bg_name##_Tiles, bg_name##_Map, PA_GetPAGfxRotBgSize(bg_name##_Width), wraparound);\
    }

Load a background fit for rotating/scaling ! Warning, you must use PA_SetVideoMode to 1 if you want 1 rotating background (Bg3 only !), or 2 for 2 rotating backgrounds (Bg2 and 3). The background MUST be in 256 colors

Parameters:

  | screen | Chose de screen (0 or 1)
  | bg_select | Background number to load
  | bg_name | Background name, like bg0
  | wraparound | If the background wraps around or not.

#define PA_LoadRotBg | ( | screen,
|  | bg_select,
|  | bg_tiles,
|  | bg_map,
|  | bg_size,
|  | wraparound |  | ) |

Value:

    {\
    PA_DeleteBg(screen, bg_select);\
    PA_LoadBgTiles(screen, bg_select, bg_tiles); \
    PA_LoadRotBgMap(screen, bg_select, (void*)bg_map, bg_size); \
    PA_InitBg(screen, bg_select, bg_size, wraparound, 1);\
    PA_SetBgRot(screen, bg_select, 0, 0, 0, 0, 0, 256);\
    }

Load a background fit for rotating/scaling ! Warning, you must use PA_SetVideoMode to 1 if you want 1 rotating background (Bg3 only !), or 2 for 2 rotating backgrounds (Bg2 and 3). The background MUST be in 256 colors

Parameters:

  | screen | Chose de screen (0 or 1)
  | bg_select | Background number to load
  | bg_tiles | Name of the tiles' info (example: ship_Tiles)
  | bg_map | Name of the map's info (example : ship_Map)
  | bg_size | Background size. Use the following macros : BG_ROT_128X128, or 256X256, 512X512, or 1024X1024
  | wraparound | If the background wraps around or not.

#define PA_LoadSimpleBg | ( | screen,
|  | bg_select,
|  | bg_tiles,
|  | bg_map,
|  | bg_size,
|  | wraparound,
|  | color_mode |  | ) |

Value:

    {\
    PA_DeleteBg(screen, bg_select);\
    PA_LoadBgTiles(screen, bg_select, bg_tiles); \
    PA_LoadBgMap(screen, bg_select, (void*)bg_map, bg_size); \
    PA_InitBg(screen, bg_select, bg_size, 0, color_mode);\
    PA_BGScrollXY(screen, bg_select, 0, 0);}

Simple way to load a Background. Combines PA_InitBg, PA_LoadBgTiles, and PA_LoadBgMap

Parameters:

  | screen | Chose de screen (0 or 1)
  | bg_select | Background number to load (from 0 to 3)
  | bg_tiles | Name of the tiles' info (example: ship_Tiles)
  | bg_map | Name of the map's info (example : ship_Map)
  | bg_size | Background size. To use a normal background, use the macros BG_256X256, BG_256X512, etc...
  | wraparound | If the background wraps around or not. More important for rotating backgrounds.
  | color_mode | Color mode : 0 for 16 color mode, 1 for 256...

#define PA_LoadTiledBg | ( | screen,
|  | bg_number,
|  | bg_name |  | ) |

Value:

    {\
           PA_LoadBgPal(screen, bg_number, (void*)bg_name##_Pal); \
           PA_LoadSimpleBg(screen, bg_number, bg_name##_Tiles, bg_name##_Map, PA_GetPAGfxBgSize(bg_name##_Width, bg_name##_Height), 0, 1);}

This will never get easier... Loads a background TiledBg converted with PAGfx, with it's tiles, map, and palette. Only 256 color mode available.

Parameters:

  | screen | Chose de screen (0 or 1)
  | bg_number | Background number to load (from 0 to 3)
  | bg_name | Background name, like bg0

#define PA_LoadTiledBitmap | ( | screen,
|  | tiled_bitmap |  | ) | PA_LoadBg(screen, 0, tiled_bitmap, SCREEN_TILES, bitmap, BG_256X256, 1, 1)

Load a bitmap converted using gfx2gba, converted like a tileset but without any optimisations. No use to include the map. Carefull, takes the whole tile memory...

Parameters:

  | screen | Chose de screen (0 or 1)
  | tiled_bitmap | Background namegiven by gfx2gba (like splashTiles)

#define PA_ResetBg | ( | screen |  | ) | _REG16(REG_BGSCREEN(screen)) &= ~(0xF00)

Reinitialize de Bg system of a screen. It only hides all the backgrounds in reality...

Parameters:

  | screen | Chose de screen (0 or 1)

#define PA_SetMapTileHflip | ( | screen,
|  | bg_select,
|  | x,
|  | y,
|  | hflip |  | ) | {*(u16*)(PA_bgmap[screen][bg_select] + ((x) << 1) + ((y) << 6)) &= ALL_BUT(TILE_HFLIP); *(u16*)(PA_bgmap[screen][bg_select] + ((x) << 1) + ((y) << 6)) |= ((hflip) << 10);}

Flip a given tile horizontaly

Parameters:

  | screen | Chose de screen (0 or 1)
  | bg_select | Background number (0-3)
  | x | X value of the tile to change
  | y | Y value of the map tile to change
  | hflip | Set the map tile to horizontal flip

#define PA_SetMapTilePal | ( | screen,
|  | bg_select,
|  | x,
|  | y,
|  | palette_number |  | ) | {*(u16*)(PA_bgmap[screen][bg_select] + ((x) << 1) + ((y) << 6)) &= ALL_BUT(TILE_PAL); *(u16*)(PA_bgmap[screen][bg_select] + ((x) << 1) + ((y) << 6)) |= ((palette_number) << 12);}

Change the 16 color palette used by a tile. Works only if the Bg is in 16 colors...

Parameters:

  | screen | Chose de screen (0 or 1)
  | bg_select | Background number (0-3)
  | x | X value of the tile to change
  | y | Y value of the map tile to change
  | palette_number | Palette number (0-15)

#define PA_SetMapTileVflip | ( | screen,
|  | bg_select,
|  | x,
|  | y,
|  | vflip |  | ) | {*(u16*)(PA_bgmap[screen][bg_select] + ((x) << 1) + ((y) << 6)) &= ALL_BUT(TILE_VFLIP); *(u16*)(PA_bgmap[screen][bg_select] + ((x) << 1) + ((y) << 6)) |= ((vflip) << 11);}

Flip a given tile verticaly

Parameters:

  | screen | Chose de screen (0 or 1)
  | bg_select | Background number (0-3)
  | x | X value of the tile to change
  | y | Y value of the map tile to change
  | vflip | Set the map tile to vertical flip

#define PA_ShowBg | ( | screen,
|  | bg_select |  | ) | _REG16(REG_BGSCREEN(screen)) |= (0x100 << (bg_select))

Show a hidden background.

Parameters:

  | screen | Chose de screen (0 or 1)
  | bg_select | Background number to load (from 0 to 3)

## Function Documentation

inline void PA_ClearBg | ( | u8 | screen,
|  | u8 | bg_select
| ) | `[inline]`

Erase a given background (just the tilemap)

Parameters:

  | screen | Choose de screen (0 or 1)
  | bg_select | Background...

inline void PA_DeleteBg | ( | u8 | screen,
|  | u8 | bg_select
| ) | `[inline]`

Delete a complete background (tiles + map + hide it...)

Parameters:

  | screen | Chose de screen (0 or 1)
  | bg_select | Background number to load (from 0 to 3)

void PA_DeleteMap | ( | u8 | screen,
|  | u8 | bg_select
| ) |

Delete a map in memory. Note that loading a map automatically deletes the preceding one, so you won't need to use this function often

Parameters:

  | screen | Chose de screen (0 or 1)
  | bg_select | Background number to load (from 0 to 3)

void PA_DeleteTiles | ( | u8 | screen,
|  | u8 | bg_select
| ) |

Delete a tilest in memory. Note that loading a tileset automatically deletes the preceding one, so you won't need to use this function often

Parameters:

  | screen | Chose de screen (0 or 1)
  | bg_select | Background number to load (from 0 to 3)

void PA_InfLargeScrollX | ( | u8 | screen,
|  | u8 | bg_select,
|  | s32 | x
| ) |

Scroll a large infinite scrolling background horizontaly. It must have been initialised with PA_LoadLargeBg.

Parameters:

  | screen | Chose de screen (0 or 1)
  | bg_select | Background number to load (from 0 to 3)
  | x | X value to scroll

inline void PA_InfLargeScrollXY | ( | u8 | screen,
|  | u8 | bg_select,
|  | s32 | x,
|  | s32 | y
| ) | `[inline]`

Scroll a large infinite scrolling background horizontaly and vertically. It must have been initialised with PA_LoadLargeBg.

Parameters:

  | screen | Chose de screen (0 or 1)
  | bg_select | Background number to load (from 0 to 3)
  | x | X value to scroll
  | y | Y value to scroll

void PA_InfLargeScrollY | ( | u8 | screen,
|  | u8 | bg_select,
|  | s32 | y
| ) |

Scroll a large infinite scrolling background vertically. It must have been initialised with PA_LoadLargeBg.

Parameters:

  | screen | Chose de screen (0 or 1)
  | bg_select | Background number to load (from 0 to 3)
  | y | Y value to scroll

void PA_InitBg | ( | u8 | screen,
|  | u8 | bg_select,
|  | u8 | bg_size,
|  | u8 | wraparound,
|  | u8 | color_mode
| ) |

Initialise a given background. Do this only after having loaded a tileset and a map.

Parameters:

  | screen | Chose de screen (0 or 1)
  | bg_select | Background number to load (from 0 to 3)
  | bg_size | Background size. This is important, because it also determines whether the Bg is rotatable or not. To use a normal background, use the macros BG_256X256, BG_256X512, etc... For a rotatable Bg, use the macros BG_ROT_128X128...
  | wraparound | If the background wraps around or not. More important for rotating backgrounds.
  | color_mode | Color mode : 0 for 16 color mode, 1 for 256...

inline void PA_InitParallaxX | ( | u8 | screen,
|  | s32 | bg0,
|  | s32 | bg1,
|  | s32 | bg2,
|  | s32 | bg3
| ) | `[inline]`

Initialise Parallax Scrolling for multiple backgrounds, horizontaly. Chose the speed at which each background will scroll compared to the others. Then use PA_ParallaxScrollX to scroll...

Parameters:

  | screen | Chose de screen (0 or 1)
  | bg0 | Value for the first background (0). Set to 256 for normal scroll speed, lower for lower speed (128 is half speed...), higher for faster (512 is twice as fast...). You can set negative values. 0 inactivates parallax scrolling for this background
  | bg1 | Same thing for Background 1
  | bg2 | Same thing for Background 2
  | bg3 | Same thing for Background 3

inline void PA_InitParallaxY | ( | u8 | screen,
|  | s32 | bg0,
|  | s32 | bg1,
|  | s32 | bg2,
|  | s32 | bg3
| ) | `[inline]`

Initialise Parallax Scrolling for multiple backgrounds, horizontaly. Chose the speed at which each background will scroll compared to the others. Then use PA_ParallaxScrollX to scroll...

Parameters:

  | screen | Chose de screen (0 or 1)
  | bg0 | Value for the first background (0). Set to 256 for normal scroll speed, lower for lower speed (128 is half speed...), higher for faster (512 is twice as fast...). You can set negative values. 0 inactivates parallax scrolling for this background
  | bg1 | Same thing for Background 1
  | bg2 | Same thing for Background 2
  | bg3 | Same thing for Background 3

void PA_LargeScrollX | ( | u8 | screen,
|  | u8 | bg_select,
|  | s32 | x
| ) |

Scroll a large background horizontaly. It must have been initialised with PA_LoadLargeBg. This function does not wrap around, but is faster than the InfLargeScroll...

Parameters:

  | screen | Chose de screen (0 or 1)
  | bg_select | Background number to load (from 0 to 3)
  | x | X value to scroll

inline void PA_LargeScrollXY | ( | u8 | screen,
|  | u8 | bg_select,
|  | s32 | x,
|  | s32 | y
| ) | `[inline]`

Scroll a large background horizontaly and vertically. It must have been initialised with PA_LoadLargeBg. This function does not wrap around, but is faster than the InfLargeScroll...

Parameters:

  | screen | Chose de screen (0 or 1)
  | bg_select | Background number to load (from 0 to 3)
  | x | X value to scroll
  | y | Y value to scroll

void PA_LargeScrollY | ( | u8 | screen,
|  | u8 | bg_select,
|  | s32 | y
| ) |

Scroll a large background vertically. It must have been initialised with PA_LoadLargeBg. This function does not wrap around, but is faster than the InfLargeScroll...

Parameters:

  | screen | Chose de screen (0 or 1)
  | bg_select | Background number to load (from 0 to 3)
  | y | Y value to scroll

void PA_LoadBgMap | ( | u8 | screen,
|  | u8 | bg_select,
|  | void * | bg_map,
|  | u8 | bg_size
| ) |

Load a background's map info

Parameters:

  | screen | Chose de screen (0 or 1)
  | bg_select | Background number to load (from 0 to 3)
  | bg_map | Name of the map's info (example : (void*)ship_Map) Don't forget the void...
  | bg_size | Background size. This is important, because it also determines whether the Bg is rotatable or not. To use a normal background, use the macros BG_256X256, BG_256X512, etc...

void PA_LoadBgTilesEx | ( | u8 | screen,
|  | u8 | bg_select,
|  | void * | bg_tiles,
|  | u16 | size
| ) |

Load a tileset into memory with a given size

Parameters:

  | screen | Chose de screen (0 or 1)
  | bg_select | Background number to load (from 0 to 3)
  | bg_tiles | Name of the tiles' info (example: ship_Tiles)
  | size | 16 bit size...

inline void PA_ParallaxScrollX | ( | u8 | screen,
|  | s32 | x
| ) | `[inline]`

Scroll the backgrounds

Parameters:

  | screen | Chose de screen (0 or 1)
  | x | X value to scroll

inline void PA_ParallaxScrollXY | ( | u8 | screen,
|  | s32 | x,
|  | s32 | y
| ) | `[inline]`

Scroll the backgrounds

Parameters:

  | screen | Chose de screen (0 or 1)
  | x | X value to scroll
  | y | Y value to scroll

inline void PA_ParallaxScrollY | ( | u8 | screen,
|  | s32 | y
| ) | `[inline]`

Scroll the backgrounds

Parameters:

  | screen | Chose de screen (0 or 1)
  | y | Y value to scroll

void PA_ReLoadBgTiles | ( | u8 | screen,
|  | u8 | bg_select,
|  | void * | bg_tiles
| ) |

ReLoad a tileset into memory

Parameters:

  | screen | Chose de screen (0 or 1)
  | bg_select | Background number to load (from 0 to 3)
  | bg_tiles | Name of the tiles' info (example: ship_Tiles)

inline void PA_SetBgPrio | ( | u8 | screen,
|  | u8 | bg,
|  | u8 | prio
| ) | `[inline]`

Change a backgrounds priority

Parameters:

  | screen | Chose de screen (0 or 1)
  | bg | Background...
  | prio | Priority level (0-3, 0 being the highest)

inline void PA_SetLargeMapTile | ( | u8 | screen,
|  | u8 | bg_select,
|  | s32 | x,
|  | s32 | y,
|  | u32 | tile_info
| ) | `[inline]`

Change the tile info used by a given tile in the map, only for big background (512 large or wide)

Parameters:

  | screen | Chose de screen (0 or 1)
  | bg_select | Background number (0-3)
  | x | X value of the tile to change
  | y | Y value of the map tile to change
  | tile_info | New tile to put (tile + palette + flips...)

inline void PA_SetMapTile | ( | u8 | screen,
|  | u8 | bg_select,
|  | s16 | x,
|  | s16 | y,
|  | s16 | tile_number
| ) | `[inline]`

Change the tile gfx used by a given tile in the map

Parameters:

  | screen | Chose de screen (0 or 1)
  | bg_select | Background number (0-3)
  | x | X value of the tile to change
  | y | Y value of the map tile to change
  | tile_number | New tile number to put

inline void PA_SetMapTileAll | ( | u8 | screen,
|  | u8 | bg_select,
|  | s16 | x,
|  | s16 | y,
|  | u16 | tile_info
| ) | `[inline]`

Change the tile info used by a given tile in the map

Parameters:

  | screen | Chose de screen (0 or 1)
  | bg_select | Background number (0-3)
  | x | X value of the tile to change
  | y | Y value of the map tile to change
  | tile_info | New tile to put (tile + palette + flips...)