#ifndef CORE_DS2KEY_COMPAT_H #define CORE_DS2KEY_COMPAT_H #include "CORE_network.h" /* Bit masks */ #define DS_A 0x01 #define DS_B 0x02 #define DS_X 0x04 #define DS_Y 0x08 #define DS_L 0x10 #define DS_R 0x20 #define DS_START 0x40 #define DS_SELECT 0x80 #define DS_UP 0x01 #define DS_DOWN 0x02 #define DS_LEFT 0x04 #define DS_RIGHT 0x08 /* Describe Device */ typedef struct ds2key_s{ unsigned char buttons_pressed; /* Pressed buttons */ unsigned char buttons_released; unsigned char dpad_pressed; /* Ressed directions */ unsigned char dpad_released; unsigned char stylus_pressed:1; /* Stylus */ unsigned char stylus_released:1; unsigned char X; unsigned char Y; } __attribute__((packed)) ds2key_t; /* Store buttons info into console type.. */ extern void ds2key_process_input(ds2key_t* c); /* Init console variables */ extern void ds2key_init(ds2key_t* c); /* send ds2key profile */ extern void ds2key_send_profile(network_t* n, unsigned char p); /* Send infos to the server */ extern void ds2key_send_msg(network_t* n, ds2key_t* d); #endif /* CORE_CONSOLE_H */