Added joystick logic to enable all 4 directions at once, needed for

Bumper Bash ROM.

Updated ROM properties for some keypad games.  It seems 'Alpha Beam' and
'Oscars Trash Race' still don't work, though.


git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@1277 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba
This commit is contained in:
stephena 2007-01-13 15:55:14 +00:00
parent 8e6d3e4ce6
commit e02603ec02
6 changed files with 3049 additions and 3051 deletions

View File

@ -9,7 +9,7 @@
SSSS ttt eeeee llll llll aaaaa
===============================================================================
To Do List - October 16, 2005
To Do List - January 2007
===============================================================================
If you would like to contribute to Stella's development then find something
@ -39,5 +39,4 @@ Stephen Anthony at stephena@users.sourceforge.net.
* Tracking Hiscores
* Improve frontend by adding snapshots, labels, manuals, etc.
Like KStella for Linux. (Suggestion from Brian Luttrull)
* Add support for uncommon controllers (KidVid, Lightgun, Amiga/ST mouse).

View File

@ -13,7 +13,7 @@
// See the file "license" for information on usage and redistribution of
// this file, and for a DISCLAIMER OF ALL WARRANTIES.
//
// $Id: Console.cxx,v 1.122 2007-01-07 01:26:52 stephena Exp $
// $Id: Console.cxx,v 1.123 2007-01-13 15:55:12 stephena Exp $
//============================================================================
#include <cassert>
@ -223,6 +223,12 @@ Console::Console(OSystem* osystem, Cartridge* cart, const Properties& props)
// Reset, the system to its power-on state
mySystem->reset();
// Bumper Bash requires all 4 directions
const string& md5 = myProperties.get(Cartridge_MD5);
bool allow = (md5 == "aa1c41f86ec44c0a44eb64c332ce08af" ||
md5 == "1bf503c724001b09be79c515ecfcbd03");
myOSystem->eventHandler().allowAllDirections(allow);
myAboutString = buf.str();
}

File diff suppressed because it is too large Load Diff

View File

@ -1,3 +1,4 @@
//============================================================================
//
// SSSS tt lll lll
@ -13,7 +14,7 @@
// See the file "license" for information on usage and redistribution of
// this file, and for a DISCLAIMER OF ALL WARRANTIES.
//
// $Id: EventHandler.cxx,v 1.195 2007-01-03 12:59:22 stephena Exp $
// $Id: EventHandler.cxx,v 1.196 2007-01-13 15:55:14 stephena Exp $
//============================================================================
#include <sstream>
@ -64,6 +65,7 @@ EventHandler::EventHandler(OSystem* osystem)
myLSState(0),
myGrabMouseFlag(false),
myUseLauncherFlag(false),
myAllowAllDirectionsFlag(false),
myFryingFlag(false),
myPaddleMode(0),
myPaddleThreshold(0)
@ -1011,17 +1013,20 @@ void EventHandler::handleEvent(Event::Type event, int state)
// for almost all types of input.
// Yes, this is messy, but it's also as fast as possible ...
case Event::JoystickZeroUp:
if(state) myEvent->set(Event::JoystickZeroDown, 0);
if(!myAllowAllDirectionsFlag && state)
myEvent->set(Event::JoystickZeroDown, 0);
break;
case Event::JoystickZeroDown:
if(state) myEvent->set(Event::JoystickZeroUp, 0);
if(!myAllowAllDirectionsFlag && state)
myEvent->set(Event::JoystickZeroUp, 0);
break;
case Event::JoystickZeroLeft:
switch((int)myController[0])
{
case Controller::Joystick:
case Controller::BoosterGrip:
if(state) myEvent->set(Event::JoystickZeroRight, 0);
if(!myAllowAllDirectionsFlag && state)
myEvent->set(Event::JoystickZeroRight, 0);
myEvent->set(Event::JoystickZeroLeft, state);
return;
case Controller::Paddles:
@ -1037,7 +1042,8 @@ void EventHandler::handleEvent(Event::Type event, int state)
{
case Controller::Joystick:
case Controller::BoosterGrip:
if(state) myEvent->set(Event::JoystickZeroLeft, 0);
if(!myAllowAllDirectionsFlag && state)
myEvent->set(Event::JoystickZeroLeft, 0);
myEvent->set(Event::JoystickZeroRight, state);
return;
case Controller::Paddles:
@ -1063,17 +1069,20 @@ void EventHandler::handleEvent(Event::Type event, int state)
}
break;
case Event::JoystickOneUp:
if(state) myEvent->set(Event::JoystickOneDown, 0);
if(!myAllowAllDirectionsFlag && state)
myEvent->set(Event::JoystickOneDown, 0);
break;
case Event::JoystickOneDown:
if(state) myEvent->set(Event::JoystickOneUp, 0);
if(!myAllowAllDirectionsFlag && state)
myEvent->set(Event::JoystickOneUp, 0);
break;
case Event::JoystickOneLeft:
switch((int)myController[1])
{
case Controller::Joystick:
case Controller::BoosterGrip:
if(state) myEvent->set(Event::JoystickOneRight, 0);
if(!myAllowAllDirectionsFlag && state)
myEvent->set(Event::JoystickOneRight, 0);
myEvent->set(Event::JoystickOneLeft, state);
return;
case Controller::Paddles:
@ -1089,7 +1098,8 @@ void EventHandler::handleEvent(Event::Type event, int state)
{
case Controller::Joystick:
case Controller::BoosterGrip:
if(state) myEvent->set(Event::JoystickOneLeft, 0);
if(!myAllowAllDirectionsFlag && state)
myEvent->set(Event::JoystickOneLeft, 0);
myEvent->set(Event::JoystickOneRight, state);
return;
case Controller::Paddles:

View File

@ -13,7 +13,7 @@
// See the file "license" for information on usage and redistribution of
// this file, and for a DISCLAIMER OF ALL WARRANTIES.
//
// $Id: EventHandler.hxx,v 1.98 2007-01-01 18:04:48 stephena Exp $
// $Id: EventHandler.hxx,v 1.99 2007-01-13 15:55:14 stephena Exp $
//============================================================================
#ifndef EVENTHANDLER_HXX
@ -62,7 +62,7 @@ enum EventMode {
mapping can take place.
@author Stephen Anthony
@version $Id: EventHandler.hxx,v 1.98 2007-01-01 18:04:48 stephena Exp $
@version $Id: EventHandler.hxx,v 1.99 2007-01-13 15:55:14 stephena Exp $
*/
class EventHandler
{
@ -352,6 +352,14 @@ class EventHandler
*/
void setDefaultMapping(EventMode mode);
/**
Joystick emulates 'impossible' directions (ie, left & right
at the same time)
@param allow Whether or not to allow impossible directions
*/
void allowAllDirections(bool allow) { myAllowAllDirectionsFlag = allow; }
private:
/**
Send a mouse motion event to the handler.
@ -543,8 +551,8 @@ class EventHandler
// Indicates whether to use launcher mode when exiting a game
bool myUseLauncherFlag;
// Indicates whether the joystick emulates the mouse in GUI mode
bool myEmulateMouseFlag;
// Indicates whether the joystick emulates 'impossible' directions
bool myAllowAllDirectionsFlag;
// Indicates whether or not we're in frying mode
bool myFryingFlag;

File diff suppressed because it is too large Load Diff