1 /*---------------------------------------------------------------------------* 2 3 Copyright (C) 2010-2012 Nintendo. All rights reserved. 4 5 These coded instructions, statements, and computer programs contain 6 proprietary information of Nintendo of America Inc. and/or Nintendo 7 Company Ltd., and are protected by Federal copyright law. They may 8 not be disclosed to third parties or copied or duplicated in any form, 9 in whole or in part, without the prior written consent of Nintendo. 10 11 *---------------------------------------------------------------------------*/ 12 // ----------------------------------------------------------------------------- 13 // demoCommon.h 14 // 15 // ----------------------------------------------------------------------------- 16 17 #ifndef __DEMO_COMMON_H__ 18 #define __DEMO_COMMON_H__ 19 20 #include <string.h> 21 22 #include <types.h> 23 #include <private/fsa.h> 24 #include <cafe/os.h> 25 #include <cafe/mem.h> 26 #include <cafe/pad.h> 27 28 #ifdef __cplusplus 29 extern "C" { 30 #endif 31 32 /// @addtogroup demoCommon 33 /// @{ 34 35 // These types should be defined by SDK 36 37 #define DEMO_INLINE static inline 38 39 #define DEMOAssert(expr) ASSERT(expr) 40 #define DEMORoundUp256B(x) (((u32)(x) + 256 - 1) & ~(256 - 1)) 41 #define DEMORoundUp32B(x) (((u32)(x) + 32 - 1) & ~(32 - 1)) 42 #define DEMORoundUp4B(x) (((u32)(x) + 4 - 1) & ~(4 - 1)) 43 44 #define DEMORoundUpForIO(x) (((u32)(x) + PPC_IO_BUFFER_ALIGN - 1) & ~(PPC_IO_BUFFER_ALIGN - 1)) 45 46 /// @} 47 48 #ifdef __cplusplus 49 } 50 #endif 51 52 #endif /// __DEMO_COMMON_H__ 53