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

« back to all changes in this revision

Viewing changes to src/emucore/Genesis.cxx

  • 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: Genesis.cxx 2405 2012-03-04 19:20:29Z stephena $
 
17
// $Id: Genesis.cxx 2444 2012-04-19 13:00:02Z stephena $
18
18
//============================================================================
19
19
 
20
20
#include "Event.hxx"
105
105
}
106
106
 
107
107
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
108
 
void Genesis::setMouseControl(
109
 
    MouseControl::Axis xaxis, MouseControl::Axis yaxis, int ctrlID)
 
108
bool Genesis::setMouseControl(
 
109
    Controller::Type xtype, int xid, Controller::Type ytype, int yid)
110
110
{
111
 
  // In 'automatic' mode, both axes on the mouse map to a single Genesis
112
 
  if(xaxis == MouseControl::Automatic || yaxis == MouseControl::Automatic)
 
111
  // Currently, the Genesis controller takes full control of the mouse, using
 
112
  // both axes for its two degrees of movement, and the left/right buttons for
 
113
  // 'B' and 'C', respectively
 
114
  if(xtype == Controller::Genesis && ytype == Controller::Genesis && xid == yid)
113
115
  {
114
 
    myControlID = ((myJack == Left && ctrlID == 0) ||
115
 
                   (myJack == Right && ctrlID == 1)
116
 
                  ) ? ctrlID : -1;
 
116
    myControlID = ((myJack == Left && xid == 0) ||
 
117
                   (myJack == Right && xid == 1)
 
118
                  ) ? xid : -1;
117
119
  }
118
 
  else  // Otherwise, Genesis controllers are not used in 'non-auto' mode
 
120
  else
119
121
    myControlID = -1;
 
122
 
 
123
  return true;
120
124
}