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

« back to all changes in this revision

Viewing changes to src/emucore/Control.hxx

  • Committer: Package Import Robot
  • Author(s): Stephen Kitt
  • Date: 2012-06-02 07:33:16 UTC
  • mfrom: (1.1.15)
  • Revision ID: package-import@ubuntu.com-20120602073316-20r4hr32t4oj36u9
Tags: 3.7-1
* New upstream version.
* Update description and documentation with new features in 3.7, notably
  Blargg TV filters (replacing the filters available in versions 3.4.1
  and earlier).
* Switch to debhelper compatibility level 9.

Show diffs side-by-side

added added

removed removed

Lines of Context:
14
14
// See the file "License.txt" for information on usage and redistribution of
15
15
// this file, and for a DISCLAIMER OF ALL WARRANTIES.
16
16
//
17
 
// $Id: Control.hxx 2412 2012-03-14 01:19:23Z stephena $
 
17
// $Id: Control.hxx 2444 2012-04-19 13:00:02Z stephena $
18
18
//============================================================================
19
19
 
20
20
#ifndef CONTROLLER_HXX
26
26
 
27
27
#include "Serializable.hxx"
28
28
#include "bspf.hxx"
29
 
#include "MouseControl.hxx"
30
29
 
31
30
/**
32
31
  A controller is a device that plugs into either the left or right 
59
58
  of the controller from the perspective of the controller's jack.
60
59
 
61
60
  @author  Bradford W. Mott
62
 
  @version $Id: Control.hxx 2412 2012-03-14 01:19:23Z stephena $
 
61
  @version $Id: Control.hxx 2444 2012-04-19 13:00:02Z stephena $
63
62
*/
64
63
class Controller : public Serializable
65
64
{
160
159
    /**
161
160
      Called after *all* digital pins have been written on Port A.
162
161
      Most controllers don't do anything in this case.
 
162
 
 
163
      @param value  The entire contents of the SWCHA register
163
164
    */
164
 
    virtual void controlWrite() { };
 
165
    virtual void controlWrite(uInt8 value) { };
165
166
 
166
167
    /**
167
168
      Update the entire digital and analog pin state according to the
179
180
    /**
180
181
      Determines how this controller will treat values received from the
181
182
      X/Y axis and left/right buttons of the mouse.  Since not all controllers
182
 
      use the mouse, it's up to the specific class to decide how to use this data.
183
 
 
184
 
      If either of the axis is set to 'Automatic', then we automatically
185
 
      use the ctrlID for the control type.
 
183
      use the mouse the same way (or at all), it's up to the specific class to
 
184
      decide how to use this data.
186
185
 
187
186
      In the current implementation, the left button is tied to the X axis,
188
187
      and the right one tied to the Y axis.
189
188
 
190
 
      @param xaxis   How the controller should use x-axis data
191
 
      @param yaxis   How the controller should use y-axis data
192
 
      @param ctrlID  The controller ID to use axis 'auto' mode
 
189
      @param xtype  The controller to use for x-axis data
 
190
      @param xid    The controller ID to use for x-axis data (-1 for no id)
 
191
      @param ytype  The controller to use for y-axis data
 
192
      @param yid    The controller ID to use for y-axis data (-1 for no id)
 
193
 
 
194
      @return  Whether the controller supports using the mouse
193
195
    */
194
 
    virtual void setMouseControl(
195
 
        MouseControl::Axis xaxis, MouseControl::Axis yaxis, int ctrlID = -1) { };
 
196
    virtual bool setMouseControl(
 
197
      Controller::Type xtype, int xid, Controller::Type ytype, int yid)
 
198
    { return false; }
196
199
 
197
200
    /**
198
201
      Returns the name of this controller.