//Class Joystick will install and handle joystick 1 & 2
//Author: Tommy Grandefors
//Date: December 1996

#ifndef JOYSTICK_HH
	#define JOYSTICK_HH

#include "typedef.hh"	//Type defines such as 'unsigned char' means 'UBYTE'

class Joystick
{
	public:
		Joystick(UBYTE joystickNr);
		~Joystick(void);
		UWORD GetXpos(void);
		UWORD GetYpos(void);
		UBYTE IsButtonPressed(UBYTE buttonNr);
		UBYTE IsJoystickAvailable(void);
		void CalibrateLeft(void);
		void CalibrateRight(void);
		void CalibrateUp(void);
		void CalibrateDown(void);
		void CalibrateNeutral(void);
		UBYTE MoveLeft(void);
		UBYTE MoveRight(void);
		UBYTE MoveUp(void);
		UBYTE MoveDown(void);
		void SetSensitivity(UBYTE value);		
	private:
		UBYTE myJoystickNr;
		UBYTE myJoystickX;
		UBYTE myJoystickY;
		UBYTE myButton1;
		UBYTE myButton2;
		UBYTE myButton3;
		UBYTE myButton4;
		UBYTE myButtonState;
		WORD myMaxXpos;
		WORD myMinXpos;
		WORD myMaxYpos;
		WORD myMinYpos;
		UWORD myNeutralXpos;
		UWORD myNeutralYpos;
		WORD deltaX;
		WORD deltaY;
		WORD myCurrentXpos;
		WORD myCurrentYpos;
};

#endif
