home *** CD-ROM | disk | FTP | other *** search
/ Magazyn Amiga 13 / MA_Cover_13.bin / source / c / gbe / jlib.h < prev    next >
Encoding:
C/C++ Source or Header  |  1999-11-12  |  1.7 KB  |  59 lines

  1. /*
  2.  *  gbe - gameboy emulator
  3.  *  Copyright (C) 1999  Chuck Mason, Steven Fuller
  4.  *
  5.  *  This program is free software; you can redistribute it and/or modify
  6.  *  it under the terms of the GNU General Public License as published by
  7.  *  the Free Software Foundation; either version 2 of the License, or
  8.  *  (at your option) any later version.
  9.  *
  10.  *  This program is distributed in the hope that it will be useful,
  11.  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
  12.  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  13.  *  GNU General Public License for more details.
  14.  *
  15.  *  You should have received a copy of the GNU General Public License
  16.  *  along with this program; if not, write to the Free Software
  17.  *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
  18.  *
  19.  *
  20.  *  Chuck Mason <chuckjr@sinclair.net>
  21.  *  Steven Fuller <relnev@atdot.org>
  22.  */
  23. #ifndef __JLIB_H
  24. #define __JLIB_H
  25.  
  26. #define JOYSTICK_LEFT  0x00000001
  27. #define JOYSTICK_RIGHT 0x00000002
  28. #define JOYSTICK_UP    0x00000004
  29. #define JOYSTICK_DOWN  0x00000008
  30. #define JOYSTICK_BUTTON(x) (0x00000010 << x)
  31.  
  32. /* Returns: >=0 on success   <0 on failure */
  33. int jlib_open(int);
  34.  
  35. /* Returns: ==1 on success  ==0 on failure */
  36. int jlib_close(int);
  37.  
  38. /* Returns: >= 0 on success  <0 on failure */
  39. int jlib_update(int);
  40.  
  41. /* Returns: ==1 true ==0 false ==-1 failure */
  42. int jlib_check(int, unsigned long);
  43.  
  44. /* Returns: maxbuttons   ==0 failure */
  45. int jlib_getmaxbuttons(int);
  46.  
  47. /* Returns: maxaxes      ==0 failure */
  48. int jlib_getmaxaxes(int);
  49.  
  50. typedef struct __joystick {
  51.      int joystick_fd;
  52.      int num_buttons;
  53.      int num_axes;
  54.      int total_events;
  55.      unsigned long joystick_data;
  56. } jlib_joystick;
  57.  
  58. #endif
  59.