/*---------------------------------------------------------------------------* Copyright (C) 2010-2011 Nintendo. All rights reserved. These coded instructions, statements, and computer programs contain proprietary information of Nintendo of America Inc. and/or Nintendo Company Ltd., and are protected by Federal copyright law. They may not be disclosed to third parties or copied or duplicated in any form, in whole or in part, without the prior written consent of Nintendo. *---------------------------------------------------------------------------*/ // gfdConstant.h // // Constants for Cafe graphics binary files (for example, .gtx and .gsh). #ifndef _CAFE_GFD_CONSTANT_H_ #define _CAFE_GFD_CONSTANT_H_ #ifdef __cplusplus extern "C" { #endif // __cplusplus #include /// @addtogroup GFDConstantGroup /// @{ #ifdef LITTLEENDIAN_CPU #define _GFD_CREATE_MAGIC(a,b,c,d) ((a<<0) | (b<<8) | (c<<16) | (d<<24)) #else #define _GFD_CREATE_MAGIC(a,b,c,d) ((a<<24) | (b<<16) | (c<<8) | (d<<0)) #endif // // Structure version for gfd.dll structures. // /// \brief GFD ABI version for structures used by gfd.dll. /// The version number is encoded in the bottom nibble. #define GFD_DLL_ABI_VERSION 0x47666400 // "\0dfG" /// \brief GFD ABI magic mask for structures used by gfd.dll. #define GFD_DLL_ABI_TYPE(a) (a & 0xFFFFFF00) /// \brief GFD ABI version mask for structures used by gfd.dll. #define GFD_DLL_ABI_VERSION_NUM(a) (a & 0x000000FF) // // For top header // /// \brief Magic number for the header of a GFD file #define GFD_HEADER_MAGIC _GFD_CREATE_MAGIC('G','f','x','2') /// \brief Size of the GFD file header in bytes #define GFD_HEADER_SIZE sizeof(GFDHeader) /// \brief Major file version for all GFD files. Error if not equal. #define GFD_HEADER_MAJOR 7 /// \brief Minor file version for GFD files. Warning if greater #define GFD_HEADER_MINOR 1 // For block header /// \brief Magic number for the block header of each block in a GFD file #define GFD_BLOCK_HEADER_MAGIC _GFD_CREATE_MAGIC('B','L','K','{') /// \brief Size of the GFD file header in bytes #define GFD_BLOCK_HEADER_SIZE sizeof(GFDBlockHeader) /// \brief Default major version for all block types. #define GFD_BLOCK_HEADER_MAJOR 1 /// \brief Default minor version for all block types #define GFD_BLOCK_HEADER_MINOR 0 // // For relocation header // /// \brief Magic number a the begining of every SerializationTrailer block in a GFD file #define GFD_BLOCK_RELOCATION_HEADER_MAGIC _GFD_CREATE_MAGIC('}','B','L','K') // // For Error checking // /// \brief Magic constant to OR with data offsets. Used to validate file during read #define GFD_TAG_DAT 0xD0600000 /// \brief Magic constant to OR with string table offsets. Used to validate file during read #define GFD_TAG_STR 0xCA700000 /// \brief Mask for our magic offset bits #define GFD_TAG_MASK 0xFFF00000 /// @} #ifdef __cplusplus } #endif // __cplusplus #endif // _CAFE_GFD_CONSTANT_H_