--- np2/x11/joymng.h 2004/07/26 15:53:26 1.2 +++ np2/x11/joymng.h 2011/12/17 19:55:48 1.6 @@ -1,7 +1,5 @@ -/* $Id: joymng.h,v 1.2 2004/07/26 15:53:26 monaka Exp $ */ - /*- - * Copyright (c) 2004 NONAKA Kimihiro , + * Copyright (c) 2004 NONAKA Kimihiro * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -33,9 +31,7 @@ * joystick manager */ -#ifdef __cplusplus -extern "C" { -#endif +G_BEGIN_DECLS #define JOY_NAXIS 2 #define JOY_NBUTTON 4 @@ -44,7 +40,7 @@ extern "C" { #define JOY_NAXIS_MAX (JOY_AXIS_INVALID-1) #define JOY_NBUTTON_MAX (JOY_BUTTON_INVALID-1) -enum JOYINFO_JOYFLAG { +enum { JOY_UP_BIT = (1 << 0), JOY_DOWN_BIT = (1 << 1), JOY_LEFT_BIT = (1 << 2), @@ -56,42 +52,38 @@ enum JOYINFO_JOYFLAG { }; typedef struct { - int axis[JOY_NAXIS]; - int button[JOY_NBUTTON]; - - int naxis; - int nbutton; - int devindex; char *devname; -} joydrv_handle_common, *joydrv_handle_t; + int naxis; + int axis[JOY_NAXIS]; + + int nbutton; + int button[JOY_NBUTTON]; +} joymng_devinfo_t; #if defined(SUPPORT_JOYSTICK) +REG8 joymng_getstat(void); + +// -- X11 void joymng_initialize(void); void joymng_deinitialize(void); -const joydrv_handle_t *joymng_get_devinfo_list(void); +const joymng_devinfo_t **joymng_get_devinfo_list(void); void joymng_sync(void); -REG8 joymng_getstat(void); -void joymng_update(void); - -REG8 joymng_getstat_with_map(UINT8 *axismap, UINT8 *btnmap); -int joymng_update_task(void *p); #else /* !SUPPORT_JOYSTICK */ +#define joymng_getstat() (REG8)0xff + +// -- X11 #define joymng_initialize() (np2oscfg.JOYPAD1 |= 2) #define joymng_deinitialize() (np2oscfg.JOYPAD1 &= 1) #define joymng_get_devinfo_list() NULL #define joymng_sync() -#define joymng_getstat() (REG8)0xff -#define joymng_update() #endif /* SUPPORT_JOYSTICK */ -#ifdef __cplusplus -} -#endif +G_END_DECLS #endif /* NP2_X11_JOYMNG_H__ */