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

« back to all changes in this revision

Viewing changes to src/emucore/Keyboard.hxx

  • Committer: Bazaar Package Importer
  • Author(s): Luca Falavigna, Franczen Attila, Luca Falavigna
  • Date: 2008-11-08 12:04:12 UTC
  • mfrom: (1.1.3 upstream)
  • Revision ID: james.westby@ubuntu.com-20081108120412-w6xq87vzgokstfey
Tags: 2.6.1-0ubuntu1
[ Franczen Attila ]
* New upstream release (LP: #183571).
* Updated policy to 3.8.0.

[ Luca Falavigna ]
* debian/patches/gcc-4.3: fix FTBFS with gcc-4.3 compiler.

Show diffs side-by-side

added added

removed removed

Lines of Context:
8
8
//  SS  SS   tt   ee      ll   ll  aa  aa
9
9
//   SSSS     ttt  eeeee llll llll  aaaaa
10
10
//
11
 
// Copyright (c) 1995-2005 by Bradford W. Mott and the Stella team
 
11
// Copyright (c) 1995-2008 by Bradford W. Mott and the Stella team
12
12
//
13
13
// See the file "license" for information on usage and redistribution of
14
14
// this file, and for a DISCLAIMER OF ALL WARRANTIES.
15
15
//
16
 
// $Id: Keyboard.hxx,v 1.4 2005/11/12 22:59:20 stephena Exp $
 
16
// $Id: Keyboard.hxx,v 1.9 2008/04/13 23:43:14 stephena Exp $
17
17
//============================================================================
18
18
 
19
19
#ifndef KEYBOARD_HXX
21
21
 
22
22
#include "bspf.hxx"
23
23
#include "Control.hxx"
 
24
#include "Event.hxx"
24
25
 
25
26
/**
26
27
  The standard Atari 2600 keyboard controller
27
28
 
28
29
  @author  Bradford W. Mott
29
 
  @version $Id: Keyboard.hxx,v 1.4 2005/11/12 22:59:20 stephena Exp $
 
30
  @version $Id: Keyboard.hxx,v 1.9 2008/04/13 23:43:14 stephena Exp $
30
31
*/
31
32
class Keyboard : public Controller
32
33
{
34
35
    /**
35
36
      Create a new keyboard controller plugged into the specified jack
36
37
 
37
 
      @param jack The jack the controller is plugged into
38
 
      @param event The event object to use for events
 
38
      @param jack   The jack the controller is plugged into
 
39
      @param event  The event object to use for events
 
40
      @param system The system using this controller
39
41
    */
40
 
    Keyboard(Jack jack, const Event& event);
 
42
    Keyboard(Jack jack, const Event& event, const System& system);
41
43
 
42
44
    /**
43
45
      Destructor
46
48
 
47
49
  public:
48
50
    /**
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
51
      Write the given value to the specified digital pin for this
67
52
      controller.  Writing is only allowed to the pins associated
68
53
      with the PIA.  Therefore you cannot write to pin six.
72
57
    */
73
58
    virtual void write(DigitalPin pin, bool value);
74
59
 
 
60
    /**
 
61
      Update the entire digital and analog pin state according to the
 
62
      events currently set.
 
63
    */
 
64
    virtual void update();
 
65
 
75
66
  private:
76
67
    // State of the output pins
77
68
    uInt8 myPinState;
 
69
 
 
70
    // Pre-compute the events we care about based on given port
 
71
    // This will eliminate test for left or right port in update()
 
72
    Event::Type myOneEvent, myTwoEvent, myThreeEvent,
 
73
                myFourEvent, myFiveEvent, mySixEvent,
 
74
                mySevenEvent, myEightEvent, myNineEvent,
 
75
                myStarEvent, myZeroEvent, myPoundEvent;
78
76
};
79
77
 
80
78
#endif