~ubuntu-branches/debian/squeeze/stella/squeeze

« back to all changes in this revision

Viewing changes to src/emucore/Joystick.hxx

  • Committer: Bazaar Package Importer
  • Author(s): Tom Lear
  • Date: 1999-11-06 16:41:05 UTC
  • Revision ID: james.westby@ubuntu.com-19991106164105-iygopamo5mpcozvx
Tags: upstream-1.1
ImportĀ upstreamĀ versionĀ 1.1

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
//============================================================================
 
2
//
 
3
//   SSSS    tt          lll  lll       
 
4
//  SS  SS   tt           ll   ll        
 
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
 
10
//
 
11
// Copyright (c) 1995-1998 by Bradford W. Mott
 
12
//
 
13
// See the file "license" for information on usage and redistribution of
 
14
// this file, and for a DISCLAIMER OF ALL WARRANTIES.
 
15
//
 
16
// $Id: Joystick.hxx,v 1.2 1998/07/15 20:51:14 bwmott Exp $
 
17
//============================================================================
 
18
 
 
19
#ifndef JOYSTICK_HXX
 
20
#define JOYSTICK_HXX
 
21
 
 
22
#include "bspf.hxx"
 
23
#include "Control.hxx"
 
24
 
 
25
/**
 
26
  The standard Atari 2600 joystick controller.
 
27
 
 
28
  @author  Bradford W. Mott
 
29
  @version $Id: Joystick.hxx,v 1.2 1998/07/15 20:51:14 bwmott Exp $
 
30
*/
 
31
class Joystick : public Controller
 
32
{
 
33
  public:
 
34
    /**
 
35
      Create a new joystick controller plugged into the specified jack
 
36
 
 
37
      @param jack The jack the controller is plugged into
 
38
      @param event The event object to use for events
 
39
    */
 
40
    Joystick(Jack jack, const Event& event);
 
41
 
 
42
    /**
 
43
      Destructor
 
44
    */
 
45
    virtual ~Joystick();
 
46
 
 
47
  public:
 
48
    /**
 
49
      Read the value of the specified digital pin for this controller.
 
50
 
 
51
      @param pin The pin of the controller jack to read
 
52
      @return The state of the pin
 
53
    */
 
54
    virtual bool read(DigitalPin pin);
 
55
 
 
56
    /**
 
57
      Read the resistance at the specified analog pin for this controller.
 
58
      The returned value is the resistance measured in ohms.
 
59
 
 
60
      @param pin The pin of the controller jack to read
 
61
      @return The resistance at the specified pin
 
62
    */
 
63
    virtual Int32 read(AnalogPin pin);
 
64
 
 
65
    /**
 
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.
 
69
 
 
70
      @param pin The pin of the controller jack to write to
 
71
      @param value The value to write to the pin
 
72
    */
 
73
    virtual void write(DigitalPin pin, bool value);
 
74
};
 
75
#endif
 
76