Subversion Repositories pentevo

Rev

Rev 1023 | Blame | Compare with Previous | Last modification | View Log | Download | RSS feed | ?url?

  1. #ifndef __JOYSTICK_H__
  2. #define __JOYSTICK_H__
  3.  
  4. /**
  5.  * @file
  6.  * @brief Kempstone joystick support.
  7.  * @author http://www.nedopc.com
  8.  *
  9.  * Kempston joystick support for ZX Evolution.
  10.  *
  11.  * Kempston joystick port bits (if bit set - button pressed):
  12.  * - 0: right;
  13.  * - 1: left;
  14.  * - 2: down;
  15.  * - 3: up;
  16.  * - 4: fire;
  17.  * - 5-7: 0.
  18.  */
  19.  
  20. #define JOY_SWITCHS             0b00000000
  21. #define JOY_SEGA_8KEY   0b00000001
  22. #define JOY_SEGA_12KEY  0b00000010
  23. #define JOY_WITH_KBD    0b00000100
  24. #define JOY_NEED_DETECT 0b10000000
  25.  
  26. #define SEGA_SYNC_UP() PORTA = 0b11111111
  27. #define SEGA_SYNC_DOWN() PORTA = 0b11111011
  28.  
  29. extern volatile unsigned char gamepad_type;
  30. extern volatile UWORD jkey_state;
  31.  
  32. /** Kempstone joystick task. */
  33. void joystick_task(void);
  34.  
  35. void joystick_init(void);
  36.  
  37. void sega_parsing(void);
  38.  
  39. #endif //__JOYSTICK_H__
  40.