PAlib
Data Structures | Macros | Enumerations | Functions
Tiled Background Modes

Data Structures

struct  PA_BgStruct
 Background structure. More...
 

Macros

#define _GFX_ALIGN   __attribute__((aligned (4)))
 Graphics align define for PAGfx.
 
#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))
 [DEPRECATED] Load a tileset into memory
 
#define PA_LoadTiledBg(screen, bg_number, bg_name)
 [DEPRECATED] This will never get easier... Loads a background TiledBg converted with PAGfx, with its tiles, map, and palette. Only 256 color mode available.
 
#define PA_LoadSimpleBg(screen, bg_select, bg_tiles, bg_map, bg_size, wraparound, color_mode)
 [DEPRECATED] Simple way to load a Background. Combines PA_InitBg, PA_LoadBgTiles, and PA_LoadBgMap
 
#define PA_LoadBg(screen, bg_select, bg_tiles, tile_size, bg_map, bg_size, wraparound, color_mode)
 [DEPRECATED] Simplest way to load a Background. Combines PA_InitBg, PA_LoadBgTiles, and PA_LoadBgMap
 
#define PA_SetMapTileAll(screen, bg_select, x, y, tile_info)   *(u16*)(PA_BgInfo[screen][bg_select].Map + ((x) << 1) + ((y) << 6)) = (tile_info)
 Change the tile info used by a given tile in the map.
 
#define PA_EasyBgLoad(screen, bg_number, bg_name)
 [DEPRECATED] Easiest way to load a background converted with PAGfx...
 
#define PA_EasyBgLoadPtr(screen, bg_number, bg_name)
 [DEPRECATED] Easiest way to load a background converted with PAGfx... Can take pointers !
 

Enumerations

enum  {
  PA_BgInvalid , PA_BgNormal , PA_BgLarge , PA_BgUnlimited ,
  PA_BgRot , PA_Font1bit , PA_Font4bit , PA_Font8bit
}
 Types of background. More...
 

Functions

void PA_ResetBgSys (void)
 Reset the background system.
 
void PA_ResetBgSysScreen (u8 screen)
 Reset the background system on 1 screen.
 
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, u32 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.
 
static void PA_DeleteBg (u8 screen, u8 bg_select)
 Delete and reset a complete background.
 
void PA_LoadBgMap (u8 screen, u8 bg_select, void *bg_map, u8 bg_size)
 Load a background's map info.
 
void PA_LoadBackground (u8 screen, u8 bg_select, const PA_BgStruct *bg_name)
 Load a background (EasyBg or RotBg).
 
static void PA_BGScrollX (u8 screen, u8 bg_number, s32 x)
 Scroll horizontaly a Tiled background.
 
static void PA_BGScrollY (u8 screen, u8 bg_number, s32 y)
 Scroll vertically a Tiled background.
 
static 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.
 
static 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)
 
static void PA_SetMapTileHflip (u8 screen, u8 bg_select, u8 x, u8 y, u8 hflip)
 Flip a given tile horizontaly.
 
static void PA_SetMapTileVflip (u8 screen, u8 bg_select, u8 x, u8 y, u8 vflip)
 Flip a given tile verticaly.
 
static void PA_SetMapTilePal (u8 screen, u8 bg_select, u8 x, u8 y, u8 palette_number)
 Change the 16 color palette used by a tile. Works only if the Bg is in 16 colors...
 
static void PA_SetBgPrio (u8 screen, u8 bg, u8 prio)
 Change a backgrounds priority.
 
static void PA_SetBgPrioSeq (u8 screen, u8 priority0, u8 priority1, u8 priority2, u8 priority3)
 Change all the background priorities to a given background order.
 
static void PA_ClearBg (u8 screen, u8 bg_select)
 Erase a given background (just the tilemap)
 
void PA_EasyBgScrollX (u8 screen, u8 bg_number, s32 x)
 Scroll horizontaly any background.
 
void PA_EasyBgScrollY (u8 screen, u8 bg_number, s32 y)
 Scroll vertically any background.
 
static void PA_EasyBgScrollXY (u8 screen, u8 bg_number, s32 x, s32 y)
 Scroll horizontaly and vertically any background.
 
static u8 PA_EasyBgGetPixel (u8 screen, u8 bg_number, s32 x, s32 y)
 Returns the color (number in the palette) of the screen pixel...
 
static u16 PA_EasyBgGetPixelCol (u8 screen, u8 bg_number, s32 x, s32 y)
 Returns the color (u16 value) of the screen pixel...
 
static void PA_SetBgWrap (u8 screen, u8 bg, u8 wrap)
 Set on/off the background wrapping (for rotating, 8bit, and 16bit backgrounds)
 
static 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...
 
static 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...
 
static void PA_ParallaxScrollX (u8 screen, s32 x)
 Scroll the backgrounds.
 
static void PA_ParallaxScrollY (u8 screen, s32 y)
 Scroll the backgrounds.
 
static void PA_ParallaxScrollXY (u8 screen, s32 x, s32 y)
 Scroll the backgrounds.
 

Detailed Description

Load a background, scroll it, etc...

Macro Definition Documentation

◆ PA_HideBg

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

Hide a screen's background.

Parameters
screenChoose the screen (0 or 1)
bg_selectBackground number to load (from 0 to 3)

◆ PA_ShowBg

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

Show a hidden background.

Parameters
screenChoose the screen (0 or 1)
bg_selectBackground number to load (from 0 to 3)

◆ PA_ResetBg

#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
screenChoose the screen (0 or 1)

◆ PA_LoadBgTiles

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

[DEPRECATED] Load a tileset into memory

Deprecated:
Parameters
screenChoose the screen (0 or 1)
bg_selectBackground number to load (from 0 to 3)
bg_tilesName of the tiles' info (example: ship_Tiles)

◆ PA_LoadTiledBg

#define PA_LoadTiledBg (   screen,
  bg_number,
  bg_name 
)
Value:
do{\
PA_DEPRECATED_MACRO;\
PA_LoadBgPal(screen, bg_number, (void*)bg_name##_Pal); \
PA_LoadSimpleBg(screen, bg_number, bg_name##_Tiles, bg_name##_Map, PA_GetPAGfxBgSize(bg_name##_Info[1], bg_name##_Info[2]), 0, 1);}while(0)

[DEPRECATED] This will never get easier... Loads a background TiledBg converted with PAGfx, with its tiles, map, and palette. Only 256 color mode available.

Deprecated:
Parameters
screenChoose the screen (0 or 1)
bg_numberBackground number to load (from 0 to 3)
bg_nameBackground name, like bg0

◆ PA_LoadSimpleBg

#define PA_LoadSimpleBg (   screen,
  bg_select,
  bg_tiles,
  bg_map,
  bg_size,
  wraparound,
  color_mode 
)
Value:
do{\
PA_DEPRECATED_MACRO;\
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);}while(0)

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

Deprecated:
Parameters
screenChoose the screen (0 or 1)
bg_selectBackground number to load (from 0 to 3)
bg_tilesName of the tiles' info (example: ship_Tiles)
bg_mapName of the map's info (example : ship_Map)
bg_sizeBackground size. To use a normal background, use the macros BG_256X256, BG_256X512, etc...
wraparoundIf the background wraps around or not. More important for rotating backgrounds.
color_modeColor mode : 0 for 16 color mode, 1 for 256...

◆ PA_LoadBg

#define PA_LoadBg (   screen,
  bg_select,
  bg_tiles,
  tile_size,
  bg_map,
  bg_size,
  wraparound,
  color_mode 
)
Value:
do{\
PA_DEPRECATED_MACRO;\
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);}while(0)

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

Deprecated:
Parameters
screenChoose the screen (0 or 1)
bg_selectBackground number to load (from 0 to 3)
bg_tilesName of the tiles' info (example: ship_Tiles)
tile_sizeSize of your tileset
bg_mapName of the map's info (example : ship_Map)
bg_sizeBackground 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...
wraparoundIf the background wraps around or not. More important for rotating backgrounds.
color_modeColor mode : 0 for 16 color mode, 1 for 256...

◆ PA_SetMapTileAll

#define PA_SetMapTileAll (   screen,
  bg_select,
  x,
  y,
  tile_info 
)    *(u16*)(PA_BgInfo[screen][bg_select].Map + ((x) << 1) + ((y) << 6)) = (tile_info)

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

Parameters
screenChoose the screen (0 or 1)
bg_selectBackground number (0-3)
xX value of the tile to change
yY value of the map tile to change
tile_infoNew tile to put (tile + palette + flips...)

◆ PA_EasyBgLoad

#define PA_EasyBgLoad (   screen,
  bg_number,
  bg_name 
)
Value:
do{PA_BgInfo[screen][bg_number].BgMode = bg_name##_Info[0];\
PA_DEPRECATED_MACRO;\
PA_StoreEasyBgInfos(screen, bg_number, bg_name##_Info[0], bg_name##_Info[1], bg_name##_Info[2], (void*)bg_name##_Tiles, SIZEOF_16BIT(bg_name##_Tiles), (void*)bg_name##_Map, SIZEOF_16BIT(bg_name##_Map), (void*)bg_name##_Pal);\
if(PA_BgInfo[screen][bg_number].BgMode == BG_TILEDBG){ PA_LoadTiledBg(screen, bg_number, bg_name);}\
else{PA_LoadPAGfxLargeBg(screen, bg_number, bg_name);}}while(0)
#define PA_LoadPAGfxLargeBg(screen, bg_number, bg_name)
[DEPRECATED] Completely load and initialise a background with infinite scrolling (usefull if larger o...
Definition PA_BgLargeMap.h:91
#define PA_LoadTiledBg(screen, bg_number, bg_name)
[DEPRECATED] This will never get easier... Loads a background TiledBg converted with PAGfx,...
Definition PA_BgTiles.h:391

[DEPRECATED] Easiest way to load a background converted with PAGfx...

Deprecated:
Parameters
screenChoose de screen (0 or 1)
bg_numberBackground number... (0-3)
bg_nameBackground name

◆ PA_EasyBgLoadPtr

#define PA_EasyBgLoadPtr (   screen,
  bg_number,
  bg_name 
)
Value:
do{\
PA_DEPRECATED_MACRO;\
PA_EasyBgLoadEx(screen, bg_number, (u32*)bg_name->Info, bg_name->Tiles, bg_name->TileSize, bg_name->Map, bg_name->MapSize, bg_name->Palette);\
}while(0)

[DEPRECATED] Easiest way to load a background converted with PAGfx... Can take pointers !

Deprecated:
Parameters
screenChoose de screen (0 or 1)
bg_numberBackground number... (0-3)
bg_nameBackground, like &bg0

Enumeration Type Documentation

◆ anonymous enum

anonymous enum

Types of background.

Enumerator
PA_BgInvalid 

Invalid background.

PA_BgNormal 

Normal tiled background AKA TiledBg.

PA_BgLarge 

Large background AKA LargeMap.

PA_BgUnlimited 

Unlimited background AKA InfiniteMap.

PA_BgRot 

Rotational background.

PA_Font1bit 

1-bit bitmap font

PA_Font4bit 

4-bit bitmap font

PA_Font8bit 

8-bit bitmap font

Function Documentation

◆ PA_ResetBgSysScreen()

void PA_ResetBgSysScreen ( u8  screen)

Reset the background system on 1 screen.

Parameters
screenChoose the screen (0 or 1)

◆ PA_InitBg()

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
screenChoose the screen (0 or 1)
bg_selectBackground number to load (from 0 to 3)
bg_sizeBackground 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...
wraparoundIf the background wraps around or not. More important for rotating backgrounds.
color_modeColor mode : 0 for 16 color mode, 1 for 256...

◆ PA_LoadBgTilesEx()

void PA_LoadBgTilesEx ( u8  screen,
u8  bg_select,
void *  bg_tiles,
u32  size 
)

Load a tileset into memory with a given size.

Parameters
screenChoose the screen (0 or 1)
bg_selectBackground number to load (from 0 to 3)
bg_tilesName of the tiles' info (example: ship_Tiles)
size16 bit size...

◆ PA_ReLoadBgTiles()

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

ReLoad a tileset into memory.

Parameters
screenChoose the screen (0 or 1)
bg_selectBackground number to load (from 0 to 3)
bg_tilesName of the tiles' info (example: ship_Tiles)

◆ PA_DeleteTiles()

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
screenChoose the screen (0 or 1)
bg_selectBackground number to load (from 0 to 3)

◆ PA_DeleteMap()

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
screenChoose the screen (0 or 1)
bg_selectBackground number to load (from 0 to 3)

◆ PA_DeleteBg()

static inline void PA_DeleteBg ( u8  screen,
u8  bg_select 
)
inlinestatic

Delete and reset a complete background.

Parameters
screenChoose the screen (0 or 1)
bg_selectBackground number to load (from 0 to 3)

◆ PA_LoadBgMap()

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

Load a background's map info.

Parameters
screenChoose the screen (0 or 1)
bg_selectBackground number to load (from 0 to 3)
bg_mapName of the map's info (example : (void*)ship_Map) Don't forget the void...
bg_sizeBackground 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...

◆ PA_LoadBackground()

void PA_LoadBackground ( u8  screen,
u8  bg_number,
const PA_BgStruct bg_name 
)

Load a background (EasyBg or RotBg).

Parameters
screenChoose the screen (0 or 1)
bg_numberBackground number... (0-3)
bg_namePointer to the background (struct)
Examples
Backgrounds/Effects/Mode7/source/main.c.

◆ PA_BGScrollX()

static inline void PA_BGScrollX ( u8  screen,
u8  bg_number,
s32  x 
)
inlinestatic

Scroll horizontaly a Tiled background.

Parameters
screenChoose the screen (0 or 1)
bg_numberBackground number (0-3)
xX value to scroll

◆ PA_BGScrollY()

static inline void PA_BGScrollY ( u8  screen,
u8  bg_number,
s32  y 
)
inlinestatic

Scroll vertically a Tiled background.

Parameters
screenChoose the screen (0 or 1)
bg_numberBackground number (0-3)
yY value to scroll

◆ PA_SetMapTile()

static inline void PA_SetMapTile ( u8  screen,
u8  bg_select,
s16  x,
s16  y,
s16  tile_number 
)
inlinestatic

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

Parameters
screenChoose the screen (0 or 1)
bg_selectBackground number (0-3)
xX value of the tile to change
yY value of the map tile to change
tile_numberNew tile number to put

◆ PA_SetLargeMapTile()

static inline void PA_SetLargeMapTile ( u8  screen,
u8  bg_select,
s32  x,
s32  y,
u32  tile_info 
)
inlinestatic

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

Parameters
screenChoose the screen (0 or 1)
bg_selectBackground number (0-3)
xX value of the tile to change
yY value of the map tile to change
tile_infoNew tile to put (tile + palette + flips...)

◆ PA_SetMapTileHflip()

void PA_SetMapTileHflip ( u8  screen,
u8  bg_select,
u8  x,
u8  y,
u8  hflip 
)
inlinestatic

Flip a given tile horizontaly.

Parameters
screenChoose the screen (0 or 1)
bg_selectBackground number (0-3)
xX value of the tile to change
yY value of the map tile to change
hflipSet the map tile to horizontal flip

◆ PA_SetMapTileVflip()

static inline void PA_SetMapTileVflip ( u8  screen,
u8  bg_select,
u8  x,
u8  y,
u8  vflip 
)
inlinestatic

Flip a given tile verticaly.

Parameters
screenChoose the screen (0 or 1)
bg_selectBackground number (0-3)
xX value of the tile to change
yY value of the map tile to change
vflipSet the map tile to vertical flip

◆ PA_SetMapTilePal()

static inline void PA_SetMapTilePal ( u8  screen,
u8  bg_select,
u8  x,
u8  y,
u8  palette_number 
)
inlinestatic

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

Parameters
screenChoose the screen (0 or 1)
bg_selectBackground number (0-3)
xX value of the tile to change
yY value of the map tile to change
palette_numberPalette number (0-15)

◆ PA_SetBgPrio()

static inline void PA_SetBgPrio ( u8  screen,
u8  bg,
u8  prio 
)
inlinestatic

Change a backgrounds priority.

Parameters
screenChoose the screen (0 or 1)
bgBackground...
prioPriority level (0-3, 0 being the highest)

◆ PA_SetBgPrioSeq()

static inline void PA_SetBgPrioSeq ( u8  screen,
u8  priority0,
u8  priority1,
u8  priority2,
u8  priority3 
)
inlinestatic

Change all the background priorities to a given background order.

Parameters
screenChoose the screen (0 or 1)
priority0
Background to show on top
priority1Next one...
priority2Next one...
priority3Last one...

◆ PA_ClearBg()

static inline void PA_ClearBg ( u8  screen,
u8  bg_select 
)
inlinestatic

Erase a given background (just the tilemap)

Parameters
screenChoose de screen (0 or 1)
bg_selectBackground...

◆ PA_EasyBgScrollX()

void PA_EasyBgScrollX ( u8  screen,
u8  bg_number,
s32  x 
)

Scroll horizontaly any background.

Parameters
screenChoose the screen (0 or 1)
bg_numberBackground number (0-3)
xX value to scroll

◆ PA_EasyBgScrollY()

void PA_EasyBgScrollY ( u8  screen,
u8  bg_number,
s32  y 
)

Scroll vertically any background.

Parameters
screenChoose the screen (0 or 1)
bg_numberBackground number (0-3)
yY value to scroll

◆ PA_EasyBgScrollXY()

static inline void PA_EasyBgScrollXY ( u8  screen,
u8  bg_number,
s32  x,
s32  y 
)
inlinestatic

Scroll horizontaly and vertically any background.

Parameters
screenChoose the screen (0 or 1)
bg_numberBackground number (0-3)
xX value to scroll
yY value to scroll

◆ PA_EasyBgGetPixel()

static inline u8 PA_EasyBgGetPixel ( u8  screen,
u8  bg_number,
s32  x,
s32  y 
)
inlinestatic

Returns the color (number in the palette) of the screen pixel...

Parameters
screenChoose the screen (0 or 1)
bg_numberBackground number (0-3)
xX screen pixel position
yY screen pixel position

◆ PA_EasyBgGetPixelCol()

static inline u16 PA_EasyBgGetPixelCol ( u8  screen,
u8  bg_number,
s32  x,
s32  y 
)
inlinestatic

Returns the color (u16 value) of the screen pixel...

Parameters
screenChoose the screen (0 or 1)
bg_numberBackground number (0-3)
xX screen pixel position
yY screen pixel position

◆ PA_SetBgWrap()

static inline void PA_SetBgWrap ( u8  screen,
u8  bg,
u8  wrap 
)
inlinestatic

Set on/off the background wrapping (for rotating, 8bit, and 16bit backgrounds)

Parameters
screenChoose the screen (0 or 1)
bgBackground number (0-3)
wrapWrap around on or off...
Examples
Backgrounds/Effects/Mode7/source/main.c.

◆ PA_InitParallaxX()

static inline void PA_InitParallaxX ( u8  screen,
s32  bg0,
s32  bg1,
s32  bg2,
s32  bg3 
)
inlinestatic

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
screenChose de screen (0 or 1)
bg0Value 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
bg1Same thing for Background 1
bg2Same thing for Background 2
bg3Same thing for Background 3

◆ PA_InitParallaxY()

static inline void PA_InitParallaxY ( u8  screen,
s32  bg0,
s32  bg1,
s32  bg2,
s32  bg3 
)
inlinestatic

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
screenChose de screen (0 or 1)
bg0Value 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
bg1Same thing for Background 1
bg2Same thing for Background 2
bg3Same thing for Background 3

◆ PA_ParallaxScrollX()

static inline void PA_ParallaxScrollX ( u8  screen,
s32  x 
)
inlinestatic

Scroll the backgrounds.

Parameters
screenChose de screen (0 or 1)
xX value to scroll

◆ PA_ParallaxScrollY()

static inline void PA_ParallaxScrollY ( u8  screen,
s32  y 
)
inlinestatic

Scroll the backgrounds.

Parameters
screenChose de screen (0 or 1)
yY value to scroll

◆ PA_ParallaxScrollXY()

static inline void PA_ParallaxScrollXY ( u8  screen,
s32  x,
s32  y 
)
inlinestatic

Scroll the backgrounds.

Parameters
screenChose de screen (0 or 1)
xX value to scroll
yY value to scroll