sgdk
tools.h
Go to the documentation of this file.
00001 
00010 #ifndef _TOOLS_H_
00011 #define _TOOLS_H_
00012 
00013 #include "bmp.h"
00014 #include "vdp_tile.h"
00015 #include "vdp_bg.h"
00016 
00017 
00022 #define COMPRESSION_NONE        0
00023 
00027 #define COMPRESSION_APLIB       1
00028 
00032 #define COMPRESSION_LZ4W        2
00033 
00034 
00045 typedef s16 _comparatorCallback(void* o1, void* o2);
00046 
00047 
00052 void setRandomSeed(u16 seed);
00057 u16 random();
00058 
00063 u32 getFPS();
00068 fix32 getFPS_f();
00069 
00070 
00075 void KLog(char* text);
00076 void KLog_U1(char* t1, u32 v1);
00077 void KLog_U2(char* t1, u32 v1, char* t2, u32 v2);
00078 void KLog_U3(char* t1, u32 v1, char* t2, u32 v2, char* t3, u32 v3);
00079 void KLog_U4(char* t1, u32 v1, char* t2, u32 v2, char* t3, u32 v3, char* t4, u32 v4);
00080 void KLog_U1_(char* t1, u32 v1, char* t2);
00081 void KLog_U2_(char* t1, u32 v1, char* t2, u32 v2, char* t3);
00082 void KLog_U3_(char* t1, u32 v1, char* t2, u32 v2, char* t3, u32 v3, char* t4);
00083 void KLog_U4_(char* t1, u32 v1, char* t2, u32 v2, char* t3, u32 v3, char* t4, u32 v4, char* t5);
00084 void KLog_U1x(u16 minSize, char* t1, u32 v1);
00085 void KLog_U2x(u16 minSize, char* t1, u32 v1, char* t2, u32 v2);
00086 void KLog_U3x(u16 minSize, char* t1, u32 v1, char* t2, u32 v2, char* t3, u32 v3);
00087 void KLog_U4x(u16 minSize, char* t1, u32 v1, char* t2, u32 v2, char* t3, u32 v3, char* t4, u32 v4);
00088 void KLog_U1x_(u16 minSize, char* t1, u32 v1, char* t2);
00089 void KLog_U2x_(u16 minSize, char* t1, u32 v1, char* t2, u32 v2, char* t3);
00090 void KLog_U3x_(u16 minSize, char* t1, u32 v1, char* t2, u32 v2, char* t3, u32 v3, char* t4);
00091 void KLog_U4x_(u16 minSize, char* t1, u32 v1, char* t2, u32 v2, char* t3, u32 v3, char* t4, u32 v4, char* t5);
00092 void KLog_S1(char* t1, s32 v1);
00093 void KLog_S2(char* t1, s32 v1, char* t2, s32 v2);
00094 void KLog_S3(char* t1, s32 v1, char* t2, s32 v2, char* t3, s32 v3);
00095 void KLog_S4(char* t1, s32 v1, char* t2, s32 v2, char* t3, s32 v3, char* t4, s32 v4);
00096 void KLog_S1_(char* t1, s32 v1, char* t2);
00097 void KLog_S2_(char* t1, s32 v1, char* t2, s32 v2, char* t3);
00098 void KLog_S3_(char* t1, s32 v1, char* t2, s32 v2, char* t3, s32 v3, char* t4);
00099 void KLog_S4_(char* t1, s32 v1, char* t2, s32 v2, char* t3, s32 v3, char* t4, s32 v4, char* t5);
00100 void KLog_S1x(u16 minSize, char* t1, s32 v1);
00101 void KLog_S2x(u16 minSize, char* t1, s32 v1, char* t2, s32 v2);
00102 void KLog_S3x(u16 minSize, char* t1, s32 v1, char* t2, s32 v2, char* t3, s32 v3);
00103 void KLog_S4x(u16 minSize, char* t1, s32 v1, char* t2, s32 v2, char* t3, s32 v3, char* t4, s32 v4);
00104 void KLog_f1(char* t1, fix16 v1);
00105 void KLog_f2(char* t1, fix16 v1, char* t2, fix16 v2);
00106 void KLog_f3(char* t1, fix16 v1, char* t2, fix16 v2, char* t3, fix16 v3);
00107 void KLog_f4(char* t1, fix16 v1, char* t2, fix16 v2, char* t3, fix16 v3, char* t4, fix16 v4);
00108 void KLog_f1x(s16 numDec, char* t1, fix16 v1);
00109 void KLog_f2x(s16 numDec, char* t1, fix16 v1, char* t2, fix16 v2);
00110 void KLog_f3x(s16 numDec, char* t1, fix16 v1, char* t2, fix16 v2, char* t3, fix16 v3);
00111 void KLog_f4x(s16 numDec, char* t1, fix16 v1, char* t2, fix16 v2, char* t3, fix16 v3, char* t4, fix16 v4);
00112 void KLog_F1(char* t1, fix32 v1);
00113 void KLog_F2(char* t1, fix32 v1, char* t2, fix32 v2);
00114 void KLog_F3(char* t1, fix32 v1, char* t2, fix32 v2, char* t3, fix32 v3);
00115 void KLog_F4(char* t1, fix32 v1, char* t2, fix32 v2, char* t3, fix32 v3, char* t4, fix32 v4);
00116 void KLog_F1x(s16 numDec, char* t1, fix32 v1);
00117 void KLog_F2x(s16 numDec, char* t1, fix32 v1, char* t2, fix32 v2);
00118 void KLog_F3x(s16 numDec, char* t1, fix32 v1, char* t2, fix32 v2, char* t3, fix32 v3);
00119 void KLog_F4x(s16 numDec, char* t1, fix32 v1, char* t2, fix32 v2, char* t3, fix32 v3, char* t4, fix32 v4);
00120 
00121 
00134 Bitmap *allocateBitmap(const Bitmap *bitmap);
00149 Bitmap *allocateBitmapEx(u16 width, u16 heigth);
00161 TileSet *allocateTileSet(const TileSet *tileset);
00173 TileSet *allocateTileSetEx(u16 numTile);
00185 TileMap *allocateTileMap(const TileMap *tilemap);
00199 TileMap *allocateTileMapEx(u16 width, u16 heigth);
00212 Image *allocateImage(const Image *image);
00213 
00228 Bitmap *unpackBitmap(const Bitmap *src, Bitmap *dest);
00243 TileSet *unpackTileSet(const TileSet *src, TileSet *dest);
00258 TileMap *unpackTileMap(const TileMap *src, TileMap *dest);
00273 Image *unpackImage(const Image *src, Image *dest);
00274 
00291 u32 unpack(u16 compression, u8 *src, u8 *dest);
00292 
00304 u32 aplib_unpack(u8 *src, u8 *dest);
00317 u32 lz4w_unpack(const u8 *src, u8 *dest);
00318 
00319 
00331 void qsort_u8(u8 *data, u16 left, u16 right);
00343 void qsort_s8(s8 *data, u16 left, u16 right);
00355 void qsort_u16(u16 *data, u16 left, u16 right);
00367 void qsort_s16(s16 *data, u16 left, u16 right);
00379 void qsort_u32(u32 *data, u16 left, u16 right);
00391 void qsort_s32(s32 *data, u16 left, u16 right);
00392 
00404 void qsort(void** data, u16 len, _comparatorCallback* cb);
00405 
00406 
00407 
00408 #endif // _TOOLS_H_
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Defines