1
//============================================================================
5
// SS tttttt eeee ll ll aaaa
6
// SSSS tt ee ee ll ll aa
7
// SS tt eeeeee ll ll aaaaa -- "An Atari 2600 VCS Emulator"
8
// SS SS tt ee ll ll aa aa
9
// SSSS ttt eeeee llll llll aaaaa
11
// Copyright (c) 1995-1998 by Bradford W. Mott
13
// See the file "license" for information on usage and redistribution of
14
// this file, and for a DISCLAIMER OF ALL WARRANTIES.
16
// $Id: Joystick.hxx,v 1.2 1998/07/15 20:51:14 bwmott Exp $
17
//============================================================================
23
#include "Control.hxx"
26
The standard Atari 2600 joystick controller.
28
@author Bradford W. Mott
29
@version $Id: Joystick.hxx,v 1.2 1998/07/15 20:51:14 bwmott Exp $
31
class Joystick : public Controller
35
Create a new joystick controller plugged into the specified jack
37
@param jack The jack the controller is plugged into
38
@param event The event object to use for events
40
Joystick(Jack jack, const Event& event);
49
Read the value of the specified digital pin for this controller.
51
@param pin The pin of the controller jack to read
52
@return The state of the pin
54
virtual bool read(DigitalPin pin);
57
Read the resistance at the specified analog pin for this controller.
58
The returned value is the resistance measured in ohms.
60
@param pin The pin of the controller jack to read
61
@return The resistance at the specified pin
63
virtual Int32 read(AnalogPin pin);
66
Write the given value to the specified digital pin for this
67
controller. Writing is only allowed to the pins associated
68
with the PIA. Therefore you cannot write to pin six.
70
@param pin The pin of the controller jack to write to
71
@param value The value to write to the pin
73
virtual void write(DigitalPin pin, bool value);