~ubuntu-branches/debian/sid/stella/sid

« back to all changes in this revision

Viewing changes to src/emucore/MindLink.hxx

  • Committer: Package Import Robot
  • Author(s): Stephen Kitt
  • Date: 2012-02-05 08:09:05 UTC
  • mfrom: (1.1.12)
  • Revision ID: package-import@ubuntu.com-20120205080905-9ej05rmkibowsm7j
Tags: 3.5.5-1
* New upstream version.
* Rewrite debian/copyright, using DEP-5 and updating for 2012.
* Update manpage.

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-2012 by Bradford W. Mott, Stephen Anthony
 
12
// and the Stella Team
 
13
//
 
14
// See the file "License.txt" for information on usage and redistribution of
 
15
// this file, and for a DISCLAIMER OF ALL WARRANTIES.
 
16
//
 
17
// $Id: MindLink.hxx 2322 2012-01-02 16:37:17Z stephena $
 
18
//============================================================================
 
19
 
 
20
#ifndef MINDLINK_HXX
 
21
#define MINDLINK_HXX
 
22
 
 
23
#include "bspf.hxx"
 
24
#include "Control.hxx"
 
25
 
 
26
/**
 
27
  The Atari Mindlink was an unreleased video game controller intended for
 
28
  release in 1984.  The Mindlink was unique in that one had to move the
 
29
  muscles in one's head to control the game. These movements would be read by
 
30
  infrared sensors and transferred as movement in the game.  For more
 
31
  information, see the following link:
 
32
 
 
33
    http://www.atarimuseum.com/videogames/consoles/2600/mindlink.html
 
34
 
 
35
  This code was heavily borrowed from z26, and uses conventions defined
 
36
  there.  Specifically, IOPortA is treated as a complete uInt8, whereas
 
37
  the Stella core actually stores this information in boolean arrays
 
38
  addressable by DigitalPin number.
 
39
 
 
40
  @author  Stephen Anthony & z26 team
 
41
  @version $Id: MindLink.hxx 2322 2012-01-02 16:37:17Z stephena $
 
42
*/
 
43
class MindLink : public Controller
 
44
{
 
45
  public:
 
46
    /**
 
47
      Create a new MindLink controller plugged into the specified jack
 
48
 
 
49
      @param jack   The jack the controller is plugged into
 
50
      @param event  The event object to use for events
 
51
      @param system The system using this controller
 
52
    */
 
53
    MindLink(Jack jack, const Event& event, const System& system);
 
54
 
 
55
    /**
 
56
      Destructor
 
57
    */
 
58
    virtual ~MindLink();
 
59
 
 
60
  public:
 
61
    /**
 
62
      Called after *all* digital pins have been written on Port A.
 
63
    */
 
64
    void controlWrite() { nextMindlinkBit(); }
 
65
 
 
66
    /**
 
67
      Update the entire digital and analog pin state according to the
 
68
      events currently set.
 
69
    */
 
70
    void update();
 
71
 
 
72
  private:
 
73
    void nextMindlinkBit();
 
74
 
 
75
  private:
 
76
    uInt8 myMask1, myMask2, myMask3;
 
77
 
 
78
    // Internal state of the port pins
 
79
    uInt8 myIOPort;
 
80
 
 
81
    // Position value in Mindlink controller
 
82
    // Gets transferred bitwise (16 bits) 
 
83
    int myMindlinkPos;
 
84
 
 
85
    // Position for player 1 (0x2800-0x3800)
 
86
    int myMindlinkPos1;
 
87
 
 
88
    // Position for player 2 (0x1000-0x2000)
 
89
    int myMindlinkPos2;
 
90
 
 
91
    // Which bit to transfer next
 
92
    int myMindlinkShift;
 
93
};
 
94
 
 
95
#endif