Added -holdstart, -holdreset, -holdbutton0 command line options. These

should also be selectable from the GUI. They might also need to include
more controls, but these seems to be the ones that cause interesting
effects: -holdreset gives you double shots in space invaders,
-holdbutton0 gives you "the dot" in carnival.


git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@576 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba
This commit is contained in:
urchlay 2005-06-28 04:40:21 +00:00
parent b500522dda
commit 7366c31b3d
3 changed files with 35 additions and 5 deletions

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: mainSDL.cxx,v 1.47 2005-06-19 16:53:57 urchlay Exp $
// $Id: mainSDL.cxx,v 1.48 2005-06-28 04:40:21 urchlay Exp $
//============================================================================
#include <fstream>
@ -180,6 +180,16 @@ int main(int argc, char* argv[])
else
{
theOSystem->createConsole(romfile);
if(theOSystem->settings().getBool("holdreset"))
theOSystem->eventHandler().handleEvent(Event::ConsoleReset, 1);
if(theOSystem->settings().getBool("holdselect"))
theOSystem->eventHandler().handleEvent(Event::ConsoleSelect, 1);
if(theOSystem->settings().getBool("holdbutton0"))
theOSystem->eventHandler().handleEvent(Event::JoystickZeroFire, 1);
if(theOSystem->settings().getBool("debug"))
handler.enterDebugMode();
}

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.41 2005-06-28 03:34:41 urchlay Exp $
// $Id: EventHandler.hxx,v 1.42 2005-06-28 04:40:21 urchlay Exp $
//============================================================================
#ifndef EVENTHANDLER_HXX
@ -74,7 +74,7 @@ struct Stella_Joystick {
mapping can take place.
@author Stephen Anthony
@version $Id: EventHandler.hxx,v 1.41 2005-06-28 03:34:41 urchlay Exp $
@version $Id: EventHandler.hxx,v 1.42 2005-06-28 04:40:21 urchlay Exp $
*/
class EventHandler
{
@ -231,7 +231,6 @@ class EventHandler
static const Event::Type SA_Axis[2][2][3];
static const Event::Type SA_DrivingValue[2];
private:
/**
Send an event directly to the event handler.
These events cannot be remapped.
@ -241,6 +240,7 @@ class EventHandler
*/
void handleEvent(Event::Type type, Int32 value);
private:
/**
Send a keyboard event to the handler.

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: Settings.cxx,v 1.51 2005-06-20 18:32:12 stephena Exp $
// $Id: Settings.cxx,v 1.52 2005-06-28 04:40:21 urchlay Exp $
//============================================================================
#include <cassert>
@ -152,6 +152,21 @@ bool Settings::loadCommandLine(int argc, char** argv)
set(key, "true", false); // don't save this to the config file either
return true;
}
else if(key == "holdreset") // this doesn't make Stella exit
{
set(key, "true", false); // don't save this to the config file either
return true;
}
else if(key == "holdselect") // this doesn't make Stella exit
{
set(key, "true", false); // don't save this to the config file either
return true;
}
else if(key == "holdbutton0") // this doesn't make Stella exit
{
set(key, "true", false); // don't save this to the config file either
return true;
}
if(++i >= argc)
{
@ -253,6 +268,11 @@ void Settings::usage()
<< " standard|\n"
<< " z26>\n"
<< " -framerate <number> Display the given number of frames per second\n"
<< " -debug <1|0> Start in the debugger\n"
<< " -debugheight <number> Set height of debugger in lines of text (NOT pixels)\n"
<< " -holdreset Start the emulator with the Game Reset switch held down\n"
<< " -holdselect Start the emulator with the Game Select switch held down\n"
<< " -holdbutton0 Start the emulator with the left joystick button held down\n"
#ifdef SOUND_SUPPORT
<< " -sound <1|0> Enable sound generation\n"
<< " -fragsize <number> The size of sound fragments (must be a power of two)\n"