#ifndef __PADCON_H__ #define __PADCON_H__ /***************************************************************************** ノーマルパッド用マクロ群 *****************************************************************************/ #define PADLup (1<<12) #define PADLdown (1<<14) #define PADLleft (1<<15) #define PADLright (1<<13) #define PADRup (1<< 4) #define PADRdown (1<< 6) #define PADRleft (1<< 7) #define PADRright (1<< 5) #define PADi (1<< 9) #define PADj (1<<10) #define PADk (1<< 8) #define PADl (1<< 3) #define PADm (1<< 1) #define PADn (1<< 2) #define PADo (1<< 0) #define PADh (1<<11) #define PADL1 PADn #define PADL2 PADo #define PADR1 PADl #define PADR2 PADm #define PADstart PADh #define PADselect PADk #define isPADLup(p) (PADLup&(p)) #define isPADLdown(p) (PADLdown&(p)) #define isPADLleft(p) (PADLleft&(p)) #define isPADLright(p) (PADLright&(p)) #define isPADRup(p) (PADRup&(p)) #define isPADRdown(p) (PADRdown&(p)) #define isPADRleft(p) (PADRleft&(p)) #define isPADRright(p) (PADRright&(p)) #define isPADi(p) (PADi&(p)) #define isPADj(p) (PADj&(p)) #define isPADk(p) (PADk&(p)) #define isPADl(p) (PADl&(p)) #define isPADm(p) (PADm&(p)) #define isPADn(p) (PADn&(p)) #define isPADo(p) (PADo&(p)) #define isPADh(p) (PADh&(p)) #define isPADL1(p) (PADn&(p)) #define isPADL2(p) (PADo&(p)) #define isPADR1(p) (PADl&(p)) #define isPADR2(p) (PADm&(p)) #define isPADstart(p) (PADh&(p)) #define isPADselect(p) (PADk&(p)) /***************************************************************************** ネジコン用マクロ群 *****************************************************************************/ #define NEGCONA (1<< 5) #define NEGCONB (1<< 4) #define NEGCONLup (1<<12) #define NEGCONLdown (1<<14) #define NEGCONLleft (1<<15) #define NEGCONLright (1<<13) #define NEGCONstart (1<<11) #define NEGCONR (1<< 2) #define isNEGCONA(p) (NEGCONA&(p)) #define isNEGCONB(p) (NEGCONB&(p)) #define isNEGCONLup(p) (NEGCONLup&(p)) #define isNEGCONLdown(p) (NEGCONLdown&(p)) #define isNEGCONLleft(p) (NEGCONLleft&(p)) #define isNEGCONLright(p) (NEGCONLright&(p)) #define isNEGCONstart(p) (NEGCONstart&(p)) #define isNEGCONR(p) (NEGCONR&(p)) /***************************************************************************** マウス用マクロ群 *****************************************************************************/ #define MOUSER (1<< 2) #define MOUSEL (1<< 3) #define isMOUSER(p) (MOUSER&(p)) #define isMOUSEL(p) (MOUSEL&(p)) /***************************************************************************** PadClass 関数の判別したコントローラ種別 *****************************************************************************/ #define PAD_CLASS_MOUSE 1 #define PAD_CLASS_NEGCON 2 #define PAD_CLASS_NORMAL 4 #define PAD_CLASS_JOYSTICK 5 /***************************************************************************** *****************************************************************************/ void PadInit( long mode ); long PadRead( int ch ); void PadReadMouse( int ch, int *dx, int *dy, int *dz ); void PadReadNegcon( int ch, int *ac1, int *ac2, int *ac3, int *ac4 ); int PadExist( int ch ); int PadClass( int ch ); int PadReceiveDataBytes( int ch ); void PadStop( void ); #endif