The Socrates Gameboy Advance Development Engine
The SGADE is a development library for the Nintendo Gameboy
Advance. It's free for all uses and is distributed without guarantees.
For more information visit
the SGADE page.
00001 // ---------------------------------------------------------------------------- 00013 // ---------------------------------------------------------------------------- 00014 00015 #ifndef SO_TILESET_H 00016 #define SO_TILESET_H 00017 00018 #ifdef __cplusplus 00019 extern "C" { 00020 #endif 00021 00022 00023 // ---------------------------------------------------------------------------- //! @{ 00034 // ---------------------------------------------------------------------------- 00035 00036 00037 // ---------------------------------------------------------------------------- 00038 // Includes 00039 // ---------------------------------------------------------------------------- 00040 #include "SoSystem.h" 00041 00042 // ---------------------------------------------------------------------------- 00043 // Typedefs 00044 // ---------------------------------------------------------------------------- 00045 00054 typedef struct 00055 { 00056 bool m_16Colors; 00057 u16 m_NumTiles; 00058 u8* m_Data; 00059 } SoTileSet; 00060 00061 // ---------------------------------------------------------------------------- 00062 // Public methods; 00063 // ---------------------------------------------------------------------------- 00064 00065 u32 SoTileSetGetSize( const SoTileSet* a_This ); 00066 // u32 SoTileSetGetNumTiles( const SoTileSet* a_This ); 00067 // bool SoTileSetIs16Colors( const SoTileSet* a_This ); 00068 // u16* SoTileSetGetData( const SoTileSet* a_This ); 00069 00070 //#define SoTileSetGetSize(a_This) (a_This->m_NumTiles << (a_This->m_16Colors ? 5 : 6)) 00071 00073 #define SoTileSetGetNumTiles(a_This) ((const u16)((a_This)->m_NumTiles)) 00074 00076 #define SoTileSetIs16Colors(a_This) ((const bool)((a_This)->m_16Colors)) 00077 00079 #define SoTileSetGetData(a_This) ((u16*)((a_This)->m_Data)) 00080 00081 void SoTileSetBkgLoad(const SoTileSet* a_This, u32 a_CharBase, u32 a_BaseIdx); 00082 00083 // ---------------------------------------------------------------------------- 00084 // Functions implemented in asm; 00085 // Sadly, these need to be documented in here, cause Doxygen can't handle 00086 // .s files very well. 00087 // ---------------------------------------------------------------------------- 00106 // ---------------------------------------------------------------------------- 00107 void SoTileSetCopyFromLinearBuffer( u32* source, u32* dest, u32 width, u32 height ); 00108 00109 00110 // ---------------------------------------------------------------------------- 00111 // EOF 00112 // ---------------------------------------------------------------------------- 00113 00115 00116 #ifdef __cplusplus 00117 } // extern "C" 00118 #endif 00119 00120 #endif