libdragon
Loading...
Searching...
No Matches
Data Structures | Macros | Functions
asset_internal.h File Reference

Go to the source code of this file.

Data Structures

struct  asset_header_t
 Header of a compressed asset. More...
 
struct  asset_compression_t
 A decompression algorithm used by the asset library. More...
 

Macros

#define ASSET_MAGIC   "DCA"
 Magic compressed asset header.
 
#define ASSET_FLAG_WINSIZE_MASK   0x0007
 Mask to isolate the window size in the flags.
 
#define ASSET_FLAG_WINSIZE_16K   0x0000
 16 KiB window size
 
#define ASSET_FLAG_WINSIZE_8K   0x0001
 8 KiB window size
 
#define ASSET_FLAG_WINSIZE_4K   0x0002
 4 KiB window size
 
#define ASSET_FLAG_WINSIZE_2K   0x0003
 2 KiB window size
 
#define ASSET_FLAG_WINSIZE_32K   0x0004
 32 KiB window size
 
#define ASSET_FLAG_WINSIZE_64K   0x0005
 64 KiB window size
 
#define ASSET_FLAG_WINSIZE_128K   0x0006
 128 KiB window size
 
#define ASSET_FLAG_WINSIZE_256K   0x0007
 256 KiB window size
 
#define ASSET_FLAG_INPLACE   0x0100
 Decompress in-place.
 
#define ASSET_ALIGNMENT   32
 Aligned to instruction cacheline.
 

Functions

FILE * must_fopen (const char *fn)
 Open a file as FILE* and assert on error.
 
int must_open (const char *fn)
 Open a file and assert on error.
 

Detailed Description

Author
Giovanni Bajo giova.nosp@m.nnib.nosp@m.ajo@g.nosp@m.mail.nosp@m..com

Data Structure Documentation

◆ asset_header_t

struct asset_header_t

Header of a compressed asset.

Data Fields
char magic[3] Magic header.
uint8_t version Version of the asset header.
uint16_t algo Compression algorithm.
uint16_t flags Flags.
uint32_t cmp_size Compressed size in bytes.
uint32_t orig_size Original size in bytes.
uint32_t inplace_margin Margin for in-place decompression.