00001 /*--------------------------------------------------------------------------------- 00002 00003 Copyright (C) 2005 00004 Jason Rogers (dovoto) 00005 00006 This software is provided 'as-is', without any express or implied 00007 warranty. In no event will the authors be held liable for any 00008 damages arising from the use of this software. 00009 00010 Permission is granted to anyone to use this software for any 00011 purpose, including commercial applications, and to alter it and 00012 redistribute it freely, subject to the following restrictions: 00013 00014 1. The origin of this software must not be misrepresented; you 00015 must not claim that you wrote the original software. If you use 00016 this software in a product, an acknowledgment in the product 00017 documentation would be appreciated but is not required. 00018 00019 2. Altered source versions must be plainly marked as such, and 00020 must not be misrepresented as being the original software. 00021 00022 3. This notice may not be removed or altered from any source 00023 distribution. 00024 00025 00026 ---------------------------------------------------------------------------------*/ 00034 #ifndef NDS_DECOMPRESS 00035 #define NDS_DECOMPRESS 00036 00037 #include <nds/ndstypes.h> 00038 00039 typedef u8 (*getByteCallback)(u8 *source); 00040 typedef int (*getHeaderCallback)(u8 *source, u16 *dest, u32 arg); 00041 00043 typedef enum 00044 { 00045 LZ77, 00046 LZ77Vram, 00047 HUFF, 00048 RLE, 00049 RLEVram 00050 }DecompressType; 00051 00052 #ifdef __cplusplus 00053 extern "C" { 00054 #endif 00055 00062 void decompress(const void* data, void* dst, DecompressType type); 00063 00072 void decompressStream(const void* data, void* dst, DecompressType type, getByteCallback readCB, getHeaderCallback getHeaderCB); 00073 00074 #ifdef __cplusplus 00075 } 00076 #endif 00077 00078 #endif 00079