GBDK 2020 Docs  4.3.0
API Documentation for GBDK 2020
gbdecompress.h File Reference
#include <types.h>
#include <stdint.h>

Go to the source code of this file.

Functions

uint16_t gb_decompress (const uint8_t *sour, uint8_t *dest)
 
void gb_decompress_bkg_data (uint8_t first_tile, const uint8_t *sour)
 
void gb_decompress_win_data (uint8_t first_tile, const uint8_t *sour)
 
void gb_decompress_sprite_data (uint8_t first_tile, const uint8_t *sour)
 

Detailed Description

GB-Compress decompressor Compatible with the compression used in GBTD

See also
utility_gbcompress "gbcompress"

GB-Compress decompressor Compatible with the compression used in GBTD

Function Documentation

◆ gb_decompress()

uint16_t gb_decompress ( const uint8_t sour,
uint8_t dest 
)

gb-decompress data from sour into dest

Parameters
sourPointer to source gb-compressed data
destPointer to destination buffer/address

Will decompress all of it's data to destination without stopping until the end of compressed data is reached. It is not possible to set a limit, so ensure the destination buffer has sufficient space to avoid an overflow.

See also
gb_decompress_bkg_data, gb_decompress_win_data, gb_decompress_sprite_data, rle_decompress

gb-decompress data from sour into dest

Parameters
sourPointer to source gb-compressed data
destPointer to destination buffer/address
Returns
Return value is number of bytes decompressed
See also
gb_decompress_bkg_data, gb_decompress_win_data, gb_decompress_sprite_data

◆ gb_decompress_bkg_data()

void gb_decompress_bkg_data ( uint8_t  first_tile,
const uint8_t sour 
)

gb-decompress background tiles into VRAM

Parameters
first_tileIndex of the first tile to write
sourPointer to (gb-compressed 2 bpp) source Tile Pattern data.

Note: This function avoids writes during modes 2 & 3

Will decompress all of it's data to destination without stopping until the end of compressed data is reached. It is not possible to set a limit, so ensure the destination buffer has sufficient space to avoid an overflow.

See also
gb_decompress_bkg_data, gb_decompress_win_data, gb_decompress_sprite_data

◆ gb_decompress_win_data()

void gb_decompress_win_data ( uint8_t  first_tile,
const uint8_t sour 
)

gb-decompress window tiles into VRAM

Parameters
first_tileIndex of the first tile to write
sourPointer to (gb-compressed 2 bpp) source Tile Pattern data.

This is the same as gb_decompress_bkg_data, since the Window Layer and Background Layer share the same Tile pattern data.

Note: This function avoids writes during modes 2 & 3

Will decompress all of it's data to destination without stopping until the end of compressed data is reached. It is not possible to set a limit, so ensure the destination buffer has sufficient space to avoid an overflow.

See also
gb_decompress, gb_decompress_bkg_data, gb_decompress_sprite_data

◆ gb_decompress_sprite_data()

void gb_decompress_sprite_data ( uint8_t  first_tile,
const uint8_t sour 
)

gb-decompress sprite tiles into VRAM

Parameters
first_tileIndex of the first tile to write
sourPointer to source compressed data

Note: This function avoids writes during modes 2 & 3

Will decompress all of it's data to destination without stopping until the end of compressed data is reached. It is not possible to set a limit, so ensure the destination buffer has sufficient space to avoid an overflow.

See also
gb_decompress, gb_decompress_bkg_data, gb_decompress_win_data