1 /*---------------------------------------------------------------------------* 2 Project: Game controller utilities 3 File: cont.h 4 5 Copyright 2000-2001 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 $Log: cont.h,v $ 14 Revision 1.1 02/02/2006 06:11:12 yasuh-to 15 Initial import 16 17 18 4 8/22/02 11:10:00 Shiki 19 Set #pragma warn_padding off. 20 21 3 01/04/11 11:30:00 Shiki 22 Updated the comments. 23 24 2 01/03/06 17:17:00 Shiki 25 Modified InitCont() to support controller recalibration. 26 27 1 11/13/00 6:02p Shiki 28 Initial check-in. 29 $NoKeywords: $ 30 *---------------------------------------------------------------------------*/ 31 #ifndef _CONT_H_ 32 #define _CONT_H_ 33 34 #ifdef __cplusplus 35 extern "C" { 36 #endif 37 38 #ifdef __MWERKS__ 39 #pragma warn_padding off 40 #endif 41 42 typedef struct Cont 43 { 44 // same as PADStatus 45 u16 button; // Or-ed PAD_BUTTON_* bits 46 s8 stickX; // -128 <= stickX <= 127 47 s8 stickY; // -128 <= stickY <= 127 48 s8 substickX; // -128 <= substickX <= 127 49 s8 substickY; // -128 <= substickY <= 127 50 u8 triggerLeft; // 0 <= triggerLeft <= 255 51 u8 triggerRight; // 0 <= triggerRight <= 255 52 u8 analogA; // 0 <= analogA <= 255 53 u8 analogB; // 0 <= analogB <= 255 54 s8 err; // one of PAD_ERR_* number 55 56 u16 buttonLast; // Or-ed PAD_BUTTON_* bits 57 u16 down; // Or-ed PAD_BUTTON_* bits 58 u16 up; // Or-ed PAD_BUTTON_* bits 59 u16 repeat; // Or-ed PAD_BUTTON_* bits 60 61 u32 count; // repeat count (private) 62 } Cont; 63 64 #ifdef __MWERKS__ 65 #pragma warn_padding reset 66 #endif 67 68 void InitCont(u32 connectBits, BOOL recalibrate); 69 void ReadCont(void); 70 71 extern Cont Conts[]; 72 73 #ifdef __cplusplus 74 } 75 #endif 76 77 #endif // _CONT_H_ 78