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 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 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 * Tracking Hiscores
* Improve frontend by adding snapshots, labels, manuals, etc. * Add support for uncommon controllers (KidVid, Lightgun, Amiga/ST mouse).
Like KStella for Linux. (Suggestion from Brian Luttrull)

View File

@ -13,7 +13,7 @@
// See the file "license" for information on usage and redistribution of // See the file "license" for information on usage and redistribution of
// this file, and for a DISCLAIMER OF ALL WARRANTIES. // 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> #include <cassert>
@ -223,6 +223,12 @@ Console::Console(OSystem* osystem, Cartridge* cart, const Properties& props)
// Reset, the system to its power-on state // Reset, the system to its power-on state
mySystem->reset(); 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(); myAboutString = buf.str();
} }

File diff suppressed because it is too large Load Diff

View File

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

View File

@ -13,7 +13,7 @@
// See the file "license" for information on usage and redistribution of // See the file "license" for information on usage and redistribution of
// this file, and for a DISCLAIMER OF ALL WARRANTIES. // 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 #ifndef EVENTHANDLER_HXX
@ -62,7 +62,7 @@ enum EventMode {
mapping can take place. mapping can take place.
@author Stephen Anthony @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 class EventHandler
{ {
@ -352,6 +352,14 @@ class EventHandler
*/ */
void setDefaultMapping(EventMode mode); 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: private:
/** /**
Send a mouse motion event to the handler. Send a mouse motion event to the handler.
@ -543,8 +551,8 @@ class EventHandler
// Indicates whether to use launcher mode when exiting a game // Indicates whether to use launcher mode when exiting a game
bool myUseLauncherFlag; bool myUseLauncherFlag;
// Indicates whether the joystick emulates the mouse in GUI mode // Indicates whether the joystick emulates 'impossible' directions
bool myEmulateMouseFlag; bool myAllowAllDirectionsFlag;
// Indicates whether or not we're in frying mode // Indicates whether or not we're in frying mode
bool myFryingFlag; bool myFryingFlag;

File diff suppressed because it is too large Load Diff