1 /*---------------------------------------------------------------------------*
2   Project:  TwlSDK - WVR - demos - with_mb
3   File:     common.h
4 
5   Copyright 2003-2008 Nintendo. All rights reserved.
6 
7   These coded instructions, statements, and computer programs contain
8   proprietary information of Nintendo of America Inc. and/or Nintendo
9   Company Ltd., and are protected by Federal copyright law. They may
10   not be disclosed to third parties or copied or duplicated in any form,
11   in whole or in part, without the prior written consent of Nintendo.
12 
13   $Date:: 2008-09-17#$
14   $Rev: 8556 $
15   $Author: okubata_ryoma $
16  *---------------------------------------------------------------------------*/
17 
18 #ifndef MB_DEMO_COMMON_H_
19 #define MB_DEMO_COMMON_H_
20 
21 #ifdef __cplusplus
22 extern "C" {
23 #endif
24 
25 #include <nitro.h>
26 
27 //============================================================================
28 //  Function Declarations
29 //============================================================================
30 
31 void    CommonInit();
32 void    ReadKey(void);
33 u16     GetPressKey(void);
34 u16     GetTrigKey(void);
35 void    InitAllocateSystem(void);
36 
37 /*---------------------------------------------------------------------------*
38   Name:         IS_PAD_PRESS
39 
40   Description:  Determines key.
41 
42   Arguments:    Key flag to determine
43 
44   Returns:      TRUE if specified key is pressed
45                 Otherwise, FALSE
46  *---------------------------------------------------------------------------*/
IS_PAD_PRESS(u16 flag)47 static inline BOOL IS_PAD_PRESS(u16 flag)
48 {
49     return (GetPressKey() & flag) == flag;
50 }
51 
52 /*---------------------------------------------------------------------------*
53   Name:         IS_PAD_TRIGGER
54 
55   Description:  Determines key trigger.
56 
57   Arguments:    Key flag to determine
58 
59   Returns:      If specified key trigger is enabled, TRUE
60                 Otherwise, FALSE
61  *---------------------------------------------------------------------------*/
IS_PAD_TRIGGER(u16 flag)62 static inline BOOL IS_PAD_TRIGGER(u16 flag)
63 {
64     return (GetTrigKey() & flag) == flag;
65 }
66 
67 
68 #ifdef __cplusplus
69 }   /* extern "C" */
70 #endif
71 
72 #endif  /* MB_DEMO_COMMON_H_ */
73