2009-10-01 01:10:58 +02:00
|
|
|
/****************************************************************************
|
|
|
|
* USB Loader GX Team
|
|
|
|
* openingbnr
|
|
|
|
*
|
|
|
|
* Extract opening.bnr/banner.bin/sound.bin/icon.bin
|
|
|
|
***************************************************************************/
|
|
|
|
|
|
|
|
#ifndef _OPENINGBNR_H_
|
|
|
|
#define _OPENINGBNR_H_
|
|
|
|
|
|
|
|
#ifdef __cplusplus
|
2010-02-09 11:59:55 +01:00
|
|
|
extern "C"
|
|
|
|
{
|
2009-10-01 01:10:58 +02:00
|
|
|
#endif
|
|
|
|
|
2010-09-19 01:16:05 +02:00
|
|
|
/***********************************************************
|
|
|
|
* Error description:
|
|
|
|
* 0 Successfully extracted
|
|
|
|
* -1 No U8 tag
|
|
|
|
* -2 Unknown type
|
|
|
|
* -3 Archive inconsistency, too much padding
|
|
|
|
* -4 No IMD5 tag
|
|
|
|
* -5 MD5 mismatch
|
|
|
|
* -6 Size mismatch
|
|
|
|
* -7 Inconsistency in LZ77 encoding
|
|
|
|
************************************************************/
|
2009-10-01 01:10:58 +02:00
|
|
|
|
|
|
|
//! Extract opening.bnr from filepath to destpath
|
|
|
|
//! Files extracted: banner.bin icon.bin and sound.bin
|
2010-09-19 01:16:05 +02:00
|
|
|
int extractbnrfile( const char * filepath, const char * destpath );
|
|
|
|
int unpackBin( const char * filename, const char * outdir );
|
|
|
|
#define UNPACK_BANNER_BIN 1 /* extract banner.bin to outdir/banner/ */
|
|
|
|
#define UNPACK_ICON_BIN 2 /* extract icon.bin to outdir/icon/ */
|
|
|
|
#define UNPACK_SOUND_BIN 4 /* copies sound.bin to outdir/sound.bin */
|
2009-11-10 00:03:13 +01:00
|
|
|
#define UNPACK_ALL (UNPACK_SOUND_BIN | UNPACK_ICON_BIN | UNPACK_BANNER_BIN)
|
2010-09-19 01:16:05 +02:00
|
|
|
int unpackBanner( const u8 * gameid, int what, const char *outdir );
|
2009-10-01 01:10:58 +02:00
|
|
|
//! Extract the lz77 compressed banner, icon and sound .bin
|
2010-09-19 01:16:05 +02:00
|
|
|
u8* decompress_lz77( u8 *data, size_t data_size, size_t* decompressed_size );
|
2009-10-01 01:10:58 +02:00
|
|
|
|
2010-09-19 01:16:05 +02:00
|
|
|
u16 be16( const u8 *p );
|
|
|
|
u32 be32( const u8 *p );
|
2009-10-01 01:10:58 +02:00
|
|
|
|
|
|
|
#ifdef __cplusplus
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#endif
|