git.y1.nz

gbdk-2020

GameBoy Development Kit
download: https://git.y1.nz/archives/gbdk.tar.gz
README | Files | Log | Refs | LICENSE

gbdk-lib/include/gb/gbdecompress.h

      1 /** @file gb/gbdecompress.h
      2 
      3     GB-Compress decompressor
      4     Compatible with the compression used in GBTD
      5     @see utility_gbcompress "gbcompress"
      6 */
      7 
      8 #ifndef __GBDECOMPRESS_H_INCLUDE
      9 #define __GBDECOMPRESS_H_INCLUDE
     10 
     11 #include <types.h>
     12 #include <stdint.h>
     13 
     14 /** gb-decompress data from sour into dest
     15 
     16     @param sour   Pointer to source gb-compressed data
     17     @param dest   Pointer to destination buffer/address
     18 
     19     Will decompress __all__ of it's data to destination without
     20     stopping until the end of compressed data is reached. It is
     21     not possible to set a limit, so ensure the destination buffer
     22     has sufficient space to avoid an overflow.
     23 
     24     @see gb_decompress_bkg_data, gb_decompress_win_data, gb_decompress_sprite_data, rle_decompress
     25  */
     26 uint16_t gb_decompress(const uint8_t * sour, uint8_t * dest);
     27 
     28 
     29 /** gb-decompress background tiles into VRAM
     30 
     31     @param first_tile  Index of the first tile to write
     32     @param sour        Pointer to (gb-compressed 2 bpp) source Tile Pattern data.
     33 
     34     Note: This function avoids writes during modes 2 & 3
     35 
     36     Will decompress __all__ of it's data to destination without
     37     stopping until the end of compressed data is reached. It is
     38     not possible to set a limit, so ensure the destination buffer
     39     has sufficient space to avoid an overflow.
     40 
     41     @see gb_decompress_bkg_data, gb_decompress_win_data, gb_decompress_sprite_data
     42 */
     43 void gb_decompress_bkg_data(uint8_t first_tile, const uint8_t * sour);
     44 
     45 
     46 /** gb-decompress window tiles into VRAM
     47 
     48     @param first_tile  Index of the first tile to write
     49     @param sour        Pointer to (gb-compressed 2 bpp) source Tile Pattern data.
     50 
     51     This is the same as @ref gb_decompress_bkg_data, since the Window Layer and
     52     Background Layer share the same Tile pattern data.
     53 
     54     Note: This function avoids writes during modes 2 & 3
     55 
     56     Will decompress __all__ of it's data to destination without
     57     stopping until the end of compressed data is reached. It is
     58     not possible to set a limit, so ensure the destination buffer
     59     has sufficient space to avoid an overflow.
     60 
     61     @see gb_decompress, gb_decompress_bkg_data, gb_decompress_sprite_data
     62  */
     63 void gb_decompress_win_data(uint8_t first_tile, const uint8_t * sour);
     64 
     65 
     66 /** gb-decompress sprite tiles into VRAM
     67 
     68     @param first_tile  Index of the first tile to write
     69     @param sour        Pointer to source compressed data
     70 
     71     Note: This function avoids writes during modes 2 & 3
     72 
     73     Will decompress __all__ of it's data to destination without
     74     stopping until the end of compressed data is reached. It is
     75     not possible to set a limit, so ensure the destination buffer
     76     has sufficient space to avoid an overflow.
     77 
     78     @see gb_decompress, gb_decompress_bkg_data, gb_decompress_win_data
     79  */
     80 void gb_decompress_sprite_data(uint8_t first_tile, const uint8_t * sour);
     81 
     82 #endif

This webpage is intended to be an accessible preview of this repository. To get a fuller picture, clone it and use the git CLI.