Bank

Bank managment functions.

Tile_SetBankPage
inline void Tile_SetBankPage(
u8 page
)

Set page number where pattern are located in VRAM. Must be called before load data there.

Parameters
page
u8

VRAM page number (0-3)

Tile_LoadBankEx
void Tile_LoadBankEx(
u8 bank,
const u8* data,
u16 offset,
u16 num
)

Load data to the given bank (in the selected page ; see Tile_SetBankPage).

Parameters
bank
u8

Bank number in current page (number of bank depend of the size of 256 tiles)

data
const u8*

Pointer to source data (format depends on screen mode)

offset
u16

Tiles offset in the bank

num
u16

Number of tiles to load

Tile_LoadBank
inline void Tile_LoadBank(
u8 bank,
const u8* data,
u16 num
)

Load data to the given bank (in the selected page ; see Tile_SetBankPage).

Parameters
bank
u8

Bank number in current page (number of bank depend of the size of 256 tiles)

data
const u8*

Pointer to source data (format depends on screen mode)

num
u16

Number of tiles to load

Tile_FillBank
inline void Tile_FillBank(
u8 bank,
u8 value
)

Fill the whole bank with the given color.

Parameters
bank
u8

Bank number in current page (number of bank depend of the size of 256 tiles)

value
u8

color to fill the whole bank

Draw

Tiles draw functions.

Tile_SelectBank
inline void Tile_SelectBank(
u8 bank
)

Set current pattern bank. Must be called at least once before using drawing functions.

Parameters
bank
u8

Bank number in current page (number of bank depend of the size of 256 tiles)

Tile_SetDrawPage
inline void Tile_SetDrawPage(
u8 page
)

Set page number where to draw in VRAM. Must be called at least once before using drawing functions.

Parameters
page
u8

VRAM page number (0-3)

Tile_DrawTile
inline void Tile_DrawTile(
u8 x,
u8 y,
u8 tile
)

Draw a tile at the given coordinate.

Parameters
x
u8

X coordinate

y
u8

Y coordinate

tile
u8

Tile index to draw

Tile_FillTile
inline void Tile_FillTile(
u8 x,
u8 y,
u8 color
)

Fill a cell at the given position with the given color.

Parameters
x
u8

X coordinate

y
u8

Y coordinate

color
u8

Color to fill

Tile_DrawMapChunk
void Tile_DrawMapChunk(
u8 x,
u8 y,
const u8* map,
u8 width,
u8 height
)

Drawn a chunk of tilemap at a given coordinate.

Parameters
x
u8

Destination X coordinate

y
u8

Destination Y coordinate

map
const u8*

Pointer to source tilemap data

width
u8

Width of the tilemap

height
u8

Height of the tilemap

Tile_DrawBlock
inline void Tile_DrawBlock(
u8 dx,
u8 dy,
u8 sx,
u8 sy,
u8 width,
u8 height
)

Drawn a block of tilemap at a given coordinate.

Parameters
dx
u8

Destination X coordinate

dy
u8

Destination Y coordinate

sx
u8

Source X coordinate

sy
u8

Source Y coordinate

width
u8

Width to draw

height
u8

Height to draw

Tile_DrawScreen
void Tile_DrawScreen(
const u8* map
)

Draw a whole screen with using a tilemap.

Parameters
map
const u8*

Pointer to source tilemap data

Tile_FillScreen
inline void Tile_FillScreen(
u8 color
)

Fill the screen with the given color.

Parameters
color
u8

Color to fill the screen with