Reactivated 'mouse is paddle X' functionality by integrating it directly

into the Paddles class.

Removed '-paddles' commandline argument.  You can still change the paddle
that the mouse is emulating from the UI or with Ctrl 0..3, but its no
longer a setting that can be saved.

Added message to LauncherDialog when a ROM is invalid and can't be loaded.

Reworked the GameInfoDialog a little wrt swapping console ports.  Behind
the scenes, the Console.SwapPorts property is still being used, but the
UI is now more consistent (you no longer select the left and right
controller, but the controllers for players 0 and 1, and which port
they'll be plugged into).


git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@1435 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba
This commit is contained in:
stephena 2008-03-22 17:35:03 +00:00
parent 767f29d337
commit 328d15e83c
12 changed files with 151 additions and 120 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: Console.cxx,v 1.132 2008-02-06 13:45:21 stephena Exp $
// $Id: Console.cxx,v 1.133 2008-03-22 17:35:02 stephena Exp $
//============================================================================
#include <cassert>
@ -97,6 +97,7 @@ Console::Console(OSystem* osystem, Cartridge* cart, const Properties& props)
// Also check if we should swap the paddles plugged into a jack
bool swapPaddles = myProperties.get(Controller_SwapPaddles) == "YES";
Paddles::setMouseIsPaddle(-1); // Reset to defaults
// Construct left controller
if(left == "BOOSTER-GRIP")

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: Event.hxx,v 1.33 2008-03-02 19:20:50 stephena Exp $
// $Id: Event.hxx,v 1.34 2008-03-22 17:35:02 stephena Exp $
//============================================================================
#ifndef EVENT_HXX
@ -25,7 +25,7 @@ class Event;
/**
@author Bradford W. Mott
@version $Id: Event.hxx,v 1.33 2008-03-02 19:20:50 stephena Exp $
@version $Id: Event.hxx,v 1.34 2008-03-22 17:35:02 stephena Exp $
*/
class Event
{
@ -66,7 +66,7 @@ class Event
SALeftAxis0Value, SALeftAxis1Value,
SARightAxis0Value, SARightAxis1Value,
MouseAxisXValue, MouseAxisYValue,
MouseAxisXValue, MouseAxisYValue, MouseButtonValue,
ChangeState, LoadState, SaveState, TakeSnapshot, Quit,
PauseMode, MenuMode, CmdMenuMode, DebuggerMode, LauncherMode,

View File

@ -14,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.218 2008-03-13 22:58:06 stephena Exp $
// $Id: EventHandler.cxx,v 1.219 2008-03-22 17:35:02 stephena Exp $
//============================================================================
#include <sstream>
@ -66,8 +66,7 @@ EventHandler::EventHandler(OSystem* osystem)
myGrabMouseFlag(false),
myUseLauncherFlag(false),
myAllowAllDirectionsFlag(false),
myFryingFlag(false),
myPaddleMode(0)
myFryingFlag(false)
{
// Create the event object which will be used for this handler
myEvent = new Event();
@ -146,7 +145,6 @@ void EventHandler::initialize()
myGrabMouseFlag = myOSystem->settings().getBool("grabmouse");
setPaddleMode(myOSystem->settings().getInt("paddle"), false);
Paddles::setDigitalSpeed(myOSystem->settings().getInt("pspeed"));
// Set number of lines a mousewheel will scroll
@ -756,8 +754,8 @@ void EventHandler::poll(uInt32 time)
myOverlay->updateTime(time);
}
// Turn off relative events; we assume they've been taken care of
// in at least one of the ::update() methods above
// Turn off all mouse-related items; if they haven't been taken care of
// in the previous ::update() methods, they're now invalid
myEvent->set(Event::MouseAxisXValue, 0);
myEvent->set(Event::MouseAxisYValue, 0);
}
@ -785,7 +783,7 @@ void EventHandler::handleMouseButtonEvent(SDL_Event& event, int state)
{
// Determine which mode we're in, then send the event to the appropriate place
if(myState == S_EMULATE)
myEvent->set(Paddle_Button[myPaddleMode], state);
myEvent->set(Event::MouseButtonValue, state);
else if(myOverlay)
{
// Take window zooming into account
@ -1835,20 +1833,16 @@ void EventHandler::takeSnapshot()
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
void EventHandler::setPaddleMode(int num, bool showmessage)
{
// FIXME - communicate with Paddles class
if(num < 0 || num > 3)
return;
myPaddleMode = num;
if(showmessage)
if(num >= 0 && num <= 3)
{
ostringstream buf;
buf << "Mouse is paddle " << num;
myOSystem->frameBuffer().showMessage(buf.str());
Paddles::setMouseIsPaddle(num);
if(showmessage)
{
ostringstream buf;
buf << "Mouse is paddle " << num;
myOSystem->frameBuffer().showMessage(buf.str());
}
}
myOSystem->settings().setInt("paddle", myPaddleMode);
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
@ -2309,12 +2303,6 @@ EventHandler::ActionList EventHandler::ourMenuActionList[kMenuActionListSize] =
{ Event::UINavNext, "Next object", 0 }
};
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
const Event::Type EventHandler::Paddle_Button[4] = {
Event::PaddleZeroFire, Event::PaddleOneFire,
Event::PaddleTwoFire, Event::PaddleThreeFire
};
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
// Used by the Stelladaptor to send absolute axis values
const Event::Type EventHandler::SA_Axis[2][2] = {

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.108 2008-03-02 20:48:51 stephena Exp $
// $Id: EventHandler.hxx,v 1.109 2008-03-22 17:35:02 stephena Exp $
//============================================================================
#ifndef EVENTHANDLER_HXX
@ -61,7 +61,7 @@ enum EventMode {
mapping can take place.
@author Stephen Anthony
@version $Id: EventHandler.hxx,v 1.108 2008-03-02 20:48:51 stephena Exp $
@version $Id: EventHandler.hxx,v 1.109 2008-03-22 17:35:02 stephena Exp $
*/
class EventHandler
{
@ -516,9 +516,6 @@ class EventHandler
static ActionList ourEmulActionList[kEmulActionListSize];
static ActionList ourMenuActionList[kMenuActionListSize];
// Lookup table for paddle button events
static const Event::Type Paddle_Button[4];
// Static lookup tables for Stelladaptor axis/button support
static const Event::Type SA_Axis[2][2];
static const Event::Type SA_Button[2][2];

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: Paddles.cxx,v 1.13 2008-03-02 20:48:51 stephena Exp $
// $Id: Paddles.cxx,v 1.14 2008-03-22 17:35:02 stephena Exp $
//============================================================================
#define TRIGMAX 240
@ -24,9 +24,7 @@
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Paddles::Paddles(Jack jack, const Event& event, bool swap)
: Controller(jack, event, Controller::Paddles),
myMouseBaseX(-1),
myMouseBaseY(-1)
: Controller(jack, event, Controller::Paddles)
{
// Swap the paddle events, from paddle 0 <=> 1 and paddle 2 <=> 3
// Also consider whether this is the left or right port
@ -50,7 +48,7 @@ Paddles::Paddles(Jack jack, const Event& event, bool swap)
myP1FireEvent1 = Event::PaddleOneFire;
myP1FireEvent2 = Event::JoystickZeroFire3;
myMouseBaseX = 0;
if(_MOUSEX_PADDLE < 0) _MOUSEX_PADDLE = 0;
}
else
{
@ -70,7 +68,7 @@ Paddles::Paddles(Jack jack, const Event& event, bool swap)
myP1FireEvent1 = Event::PaddleZeroFire;
myP1FireEvent2 = Event::JoystickZeroFire1;
myMouseBaseX = 1;
if(_MOUSEX_PADDLE < 0) _MOUSEX_PADDLE = 1;
}
}
else
@ -93,7 +91,7 @@ Paddles::Paddles(Jack jack, const Event& event, bool swap)
myP1FireEvent1 = Event::PaddleThreeFire;
myP1FireEvent2 = Event::JoystickOneFire3;
myMouseBaseX = 2;
if(_MOUSEX_PADDLE < 0) _MOUSEX_PADDLE = 0;
}
else
{
@ -113,7 +111,7 @@ Paddles::Paddles(Jack jack, const Event& event, bool swap)
myP1FireEvent1 = Event::PaddleTwoFire;
myP1FireEvent2 = Event::JoystickOneFire1;
myMouseBaseX = 3;
if(_MOUSEX_PADDLE < 0) _MOUSEX_PADDLE = 1;
}
}
@ -126,7 +124,7 @@ Paddles::Paddles(Jack jack, const Event& event, bool swap)
myKeyRepeat0 = myPaddleRepeat0 = myKeyRepeat1 = myPaddleRepeat1 = 0;
myCharge[0] = myCharge[1] =
myLastCharge[0] = myLastCharge[1] = 120; // half of maximum paddle charge
myLastCharge[0] = myLastCharge[1] = TRIGMAX/2; // half of maximum paddle charge
myLeftMotion[0] = myLeftMotion[1] = 0;
}
@ -138,6 +136,8 @@ Paddles::~Paddles()
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
void Paddles::update()
{
myDigitalPinState[Three] = myDigitalPinState[Four] = true;
// Digital events (from keyboard or joystick hats & buttons)
myDigitalPinState[Three] =
(myEvent.get(myP1FireEvent1) == 0 && myEvent.get(myP1FireEvent2) == 0);
@ -184,16 +184,23 @@ void Paddles::update()
}
// Mouse events
if(myMouseBaseX == 0 || myMouseBaseX == 1)
if(myJack == Left && (_MOUSEX_PADDLE == 0 || _MOUSEX_PADDLE == 1))
{
/* FIXME
if (MPdirection & 0x01) Charge[MouseBaseX] = Charge[MouseBaseX] + srv_micky_x;
else Charge [MouseBaseX] = Charge[MouseBaseX] - srv_micky_x;
*/
myCharge[myMouseBaseX] =
myCharge[myMouseBaseX] - myEvent.get(Event::MouseAxisXValue);
if(myCharge[myMouseBaseX] < TRIGMIN) myCharge[myMouseBaseX] = TRIGMIN;
if(myCharge[myMouseBaseX] > TRIGMAX) myCharge[myMouseBaseX] = TRIGMAX;
// TODO - add infrastructure to map mouse direction to increase or decrease charge
myCharge[_MOUSEX_PADDLE] -= myEvent.get(Event::MouseAxisXValue);
if(myCharge[_MOUSEX_PADDLE] < TRIGMIN) myCharge[_MOUSEX_PADDLE] = TRIGMIN;
if(myCharge[_MOUSEX_PADDLE] > TRIGMAX) myCharge[_MOUSEX_PADDLE] = TRIGMAX;
if(myEvent.get(Event::MouseButtonValue))
myDigitalPinState[ourButtonPin[_MOUSEX_PADDLE]] = false;
}
else if(myJack == Right && (_MOUSEX_PADDLE == 2 || _MOUSEX_PADDLE == 3))
{
// TODO - add infrastructure to map mouse direction to increase or decrease charge
myCharge[_MOUSEX_PADDLE-2] -= myEvent.get(Event::MouseAxisXValue);
if(myCharge[_MOUSEX_PADDLE-2] < TRIGMIN) myCharge[_MOUSEX_PADDLE-2] = TRIGMIN;
if(myCharge[_MOUSEX_PADDLE-2] > TRIGMAX) myCharge[_MOUSEX_PADDLE-2] = TRIGMAX;
if(myEvent.get(Event::MouseButtonValue))
myDigitalPinState[ourButtonPin[_MOUSEX_PADDLE-2]] = false;
}
// Axis events (possibly use analog values)
@ -291,18 +298,25 @@ void Paddles::update()
myLastCharge[1] = charge1;
}
}
/* FIXME
if(PaddleAdjust)
{
myCharge[0] = (myCharge[0] >> 1) + PaddleAdjust;
myCharge[1] = (myCharge[1] >> 1) + PaddleAdjust;
}
*/
myAnalogPinValue[Five] = (Int32)(1000000 * (myCharge[1] / 255.0));
myAnalogPinValue[Nine] = (Int32)(1000000 * (myCharge[0] / 255.0));
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
void Paddles::setMouseIsPaddle(int number, int dir)
{
// TODO - make mouse Y axis be actually used in the code above
if(dir == 0)
_MOUSEX_PADDLE = number;
else
_MOUSEY_PADDLE = number;
}
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
int Paddles::_PADDLE_SPEED = 6;
int Paddles::_MOUSEX_PADDLE = -1;
int Paddles::_MOUSEY_PADDLE = -1;
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
const Controller::DigitalPin Paddles::ourButtonPin[2] = { Four, Three };

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: Paddles.hxx,v 1.12 2008-03-02 20:48:51 stephena Exp $
// $Id: Paddles.hxx,v 1.13 2008-03-22 17:35:02 stephena Exp $
//============================================================================
#ifndef PADDLES_HXX
@ -27,7 +27,7 @@
The standard Atari 2600 pair of paddle controllers.
@author Bradford W. Mott
@version $Id: Paddles.hxx,v 1.12 2008-03-02 20:48:51 stephena Exp $
@version $Id: Paddles.hxx,v 1.13 2008-03-22 17:35:02 stephena Exp $
*/
class Paddles : public Controller
{
@ -61,6 +61,12 @@ class Paddles : public Controller
*/
static void setDigitalSpeed(int speed) { _PADDLE_SPEED = speed; }
/**
Sets the mouse to emulate the paddle 'number' in the X or Y
axis. X -> dir 0, Y -> dir 1
*/
static void setMouseIsPaddle(int number, int dir = 0);
private:
// Pre-compute the events we care about based on given port
// This will eliminate test for left or right port in update()
@ -78,9 +84,13 @@ class Paddles : public Controller
int myLastCharge[2];
int myLeftMotion[2];
int myMouseBaseX, myMouseBaseY;
static int _PADDLE_SPEED;
static int _MOUSEX_PADDLE;
static int _MOUSEY_PADDLE;
// Lookup table for associating paddle buttons with controller pins
// Yes, this is hideously complex
static const Controller::DigitalPin ourButtonPin[2];
};
#endif

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.134 2008-03-12 19:42:36 stephena Exp $
// $Id: Settings.cxx,v 1.135 2008-03-22 17:35:02 stephena Exp $
//============================================================================
#include <cassert>
@ -244,10 +244,6 @@ void Settings::validate()
if(i < 1 || i > 10)
setInternal("zoom_tia", "2");
i = getInt("paddle");
if(i < 0 || i > 3)
setInternal("paddle", "0");
i = getInt("pspeed");
if(i < 1)
setInternal("pspeed", "1");
@ -310,7 +306,6 @@ void Settings::usage()
#endif
<< " -cheat <code> Use the specified cheatcode (see manual for description)\n"
<< " -showinfo <1|0> Shows some game info\n"
<< " -paddle <0|1|2|3> Indicates which paddle the mouse should emulate\n"
<< " -pspeed <number> Speed of digital emulated paddle movement (1-15)\n"
<< " -sa1 <left|right> Stelladaptor 1 emulates specified joystick port\n"
<< " -sa2 <left|right> Stelladaptor 2 emulates specified joystick port\n"

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: GameInfoDialog.cxx,v 1.50 2008-03-12 22:04:51 stephena Exp $
// $Id: GameInfoDialog.cxx,v 1.51 2008-03-22 17:35:03 stephena Exp $
//
// Based on code from ScummVM - Scumm Interpreter
// Copyright (C) 2002-2004 The ScummVM project
@ -160,15 +160,6 @@ GameInfoDialog::GameInfoDialog(
myTVType->appendEntry("B & W", 2);
wid.push_back(myTVType);
ypos += lineHeight + 5;
new StaticTextWidget(myTab, font, xpos, ypos+1, lwidth, fontHeight,
"Swap ports:", kTextAlignLeft);
mySwapPorts = new PopUpWidget(myTab, font, xpos+lwidth, ypos,
pwidth, lineHeight, "", 0, 0);
mySwapPorts->appendEntry("Yes", 1);
mySwapPorts->appendEntry("No", 2);
wid.push_back(mySwapPorts);
// Add items for tab 1
addToFocusList(wid, tabID);
@ -178,24 +169,40 @@ GameInfoDialog::GameInfoDialog(
tabID = myTab->addTab("Controller");
xpos = 10; ypos = vBorder;
lwidth = font.getStringWidth("Right Controller: ");
lwidth = font.getStringWidth("P0 Controller: ");
pwidth = font.getStringWidth("Booster-Grip");
new StaticTextWidget(myTab, font, xpos, ypos+1, lwidth, fontHeight,
"Left Controller:", kTextAlignLeft);
myLeftController = new PopUpWidget(myTab, font, xpos+lwidth, ypos,
pwidth, lineHeight, "", 0, 0);
"P0 Controller:", kTextAlignLeft);
myP0Controller = new PopUpWidget(myTab, font, xpos+lwidth, ypos,
pwidth, lineHeight, "", 0, 0);
for(i = 0; i < 5; ++i)
myLeftController->appendEntry(ourControllerList[i][0], i+1);
wid.push_back(myLeftController);
myP0Controller->appendEntry(ourControllerList[i][0], i+1);
wid.push_back(myP0Controller);
myLeftPort =
new PopUpWidget(myTab, font, xpos+lwidth+myP0Controller->getWidth()+4, ypos,
pwidth, lineHeight, "in ", font.getStringWidth("in "),
kLeftCChanged);
myLeftPort->appendEntry("left port", 1);
myLeftPort->appendEntry("right port", 2);
wid.push_back(myLeftPort);
ypos += lineHeight + 5;
new StaticTextWidget(myTab, font, xpos, ypos+1, lwidth, fontHeight,
"Right Controller:", kTextAlignLeft);
myRightController = new PopUpWidget(myTab, font, xpos+lwidth, ypos,
pwidth, lineHeight, "", 0, 0);
"P1 Controller:", kTextAlignLeft);
myP1Controller = new PopUpWidget(myTab, font, xpos+lwidth, ypos,
pwidth, lineHeight, "", 0, 0);
for(i = 0; i < 5; ++i)
myRightController->appendEntry(ourControllerList[i][0], i+1);
wid.push_back(myRightController);
myP1Controller->appendEntry(ourControllerList[i][0], i+1);
wid.push_back(myP1Controller);
myRightPort =
new PopUpWidget(myTab, font, xpos+lwidth+myP1Controller->getWidth()+4, ypos,
pwidth, lineHeight, "in ", font.getStringWidth("in "),
kRightCChanged);
myRightPort->appendEntry("left port", 1);
myRightPort->appendEntry("right port", 2);
wid.push_back(myRightPort);
ypos += lineHeight + 5;
pwidth = font.getStringWidth("Yes");
@ -417,12 +424,8 @@ void GameInfoDialog::loadView()
myTVType->setSelectedTag(0);
s = myGameProperties.get(Console_SwapPorts);
if(s == "YES")
mySwapPorts->setSelectedTag(1);
else if(s == "NO")
mySwapPorts->setSelectedTag(2);
else
mySwapPorts->setSelectedTag(0);
myLeftPort->setSelectedTag(s == "NO" ? 1 : 2);
myRightPort->setSelectedTag(s == "NO" ? 2 : 1);
// Controller properties
s = myGameProperties.get(Controller_Left);
@ -432,7 +435,7 @@ void GameInfoDialog::loadView()
break;
}
i = (i == 5) ? 0: i + 1;
myLeftController->setSelectedTag(i);
myP0Controller->setSelectedTag(i);
s = myGameProperties.get(Controller_Right);
for(i = 0; i < 5; ++i)
@ -441,7 +444,7 @@ void GameInfoDialog::loadView()
break;
}
i = (i == 5) ? 0: i + 1;
myRightController->setSelectedTag(i);
myP1Controller->setSelectedTag(i);
s = myGameProperties.get(Controller_SwapPaddles);
if(s == "YES")
@ -557,12 +560,8 @@ void GameInfoDialog::saveConfig()
s = (tag == 1) ? "Color" : "BlackAndWhite";
myGameProperties.set(Console_TelevisionType, s);
tag = mySwapPorts->getSelectedTag();
s = (tag == 1) ? "Yes" : "No";
myGameProperties.set(Console_SwapPorts, s);
// Controller properties
tag = myLeftController->getSelectedTag();
tag = myP0Controller->getSelectedTag();
for(i = 0; i < 5; ++i)
{
if(i == tag-1)
@ -572,7 +571,7 @@ void GameInfoDialog::saveConfig()
}
}
tag = myRightController->getSelectedTag();
tag = myP1Controller->getSelectedTag();
for(i = 0; i < 5; ++i)
{
if(i == tag-1)
@ -582,6 +581,10 @@ void GameInfoDialog::saveConfig()
}
}
tag = myLeftPort->getSelectedTag();
s = (tag == 1) ? "No" : "Yes";
myGameProperties.set(Console_SwapPorts, s);
tag = mySwapPaddles->getSelectedTag();
s = (tag == 1) ? "Yes" : "No";
myGameProperties.set(Controller_SwapPaddles, s);
@ -649,6 +652,16 @@ void GameInfoDialog::handleCommand(CommandSender* sender, int cmd,
setDefaults();
break;
case kLeftCChanged:
myRightPort->setSelectedTag(
myLeftPort->getSelectedTag() == 2 ? 1 : 2);
break;
case kRightCChanged:
myLeftPort->setSelectedTag(
myRightPort->getSelectedTag() == 2 ? 1 : 2);
break;
case kPhosphorChanged:
{
bool status = myPhosphor->getSelectedTag() == 1 ? true : false;

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: GameInfoDialog.hxx,v 1.29 2008-02-27 20:13:55 stephena Exp $
// $Id: GameInfoDialog.hxx,v 1.30 2008-03-22 17:35:03 stephena Exp $
//
// Based on code from ScummVM - Scumm Interpreter
// Copyright (C) 2002-2004 The ScummVM project
@ -70,12 +70,13 @@ class GameInfoDialog : public Dialog, public CommandSender
PopUpWidget* myLeftDiff;
PopUpWidget* myRightDiff;
PopUpWidget* myTVType;
PopUpWidget* mySwapPorts;
// Controller properties
PopUpWidget* myLeftController;
PopUpWidget* myRightController;
PopUpWidget* myP0Controller;
PopUpWidget* myP1Controller;
PopUpWidget* mySwapPaddles;
PopUpWidget* myLeftPort;
PopUpWidget* myRightPort;
// Display properties
PopUpWidget* myFormat;
@ -93,6 +94,8 @@ class GameInfoDialog : public Dialog, public CommandSender
};
enum {
kLeftCChanged = 'LCch',
kRightCChanged = 'RCch',
kPhosphorChanged = 'PPch',
kPPBlendChanged = 'PBch',
kNumCartTypes = 25,

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: InputDialog.cxx,v 1.28 2008-03-02 20:48:51 stephena Exp $
// $Id: InputDialog.cxx,v 1.29 2008-03-22 17:35:03 stephena Exp $
//============================================================================
#include "bspf.hxx"
@ -115,14 +115,14 @@ void InputDialog::addVDeviceTab(const GUI::Font& font)
pwidth = font.getStringWidth("right virtual port");
myLeftPort = new PopUpWidget(myTab, font, xpos, ypos, pwidth, lineHeight,
"Stelladaptor 1 is: ", lwidth);
"Stelladaptor 1 is: ", lwidth, kLeftChanged);
myLeftPort->appendEntry("left virtual port", 1);
myLeftPort->appendEntry("right virtual port", 2);
wid.push_back(myLeftPort);
ypos += lineHeight + 5;
myRightPort = new PopUpWidget(myTab, font, xpos, ypos, pwidth, lineHeight,
"Stelladaptor 2 is: ", lwidth);
"Stelladaptor 2 is: ", lwidth, kRightChanged);
myRightPort->appendEntry("left virtual port", 1);
myRightPort->appendEntry("right virtual port", 2);
wid.push_back(myRightPort);
@ -168,8 +168,8 @@ void InputDialog::loadConfig()
myRightPort->setSelectedTag(rport);
// Paddle mode
myPaddleMode->setValue(instance()->settings().getInt("paddle"));
myPaddleModeLabel->setLabel(instance()->settings().getString("paddle"));
myPaddleMode->setValue(0);
myPaddleModeLabel->setLabel("0");
// Paddle speed
myPaddleSpeed->setValue(instance()->settings().getInt("pspeed"));
@ -187,8 +187,7 @@ void InputDialog::saveConfig()
instance()->eventHandler().mapStelladaptors(sa1, sa2);
// Paddle mode
int mode = myPaddleMode->getValue();
instance()->eventHandler().setPaddleMode(mode);
Paddles::setMouseIsPaddle(myPaddleMode->getValue());
// Paddle speed
int speed = myPaddleSpeed->getValue();
@ -260,6 +259,16 @@ void InputDialog::handleCommand(CommandSender* sender, int cmd,
close();
break;
case kLeftChanged:
myRightPort->setSelectedTag(
myLeftPort->getSelectedTag() == 2 ? 1 : 2);
break;
case kRightChanged:
myLeftPort->setSelectedTag(
myRightPort->getSelectedTag() == 2 ? 1 : 2);
break;
case kPaddleChanged:
myPaddleModeLabel->setValue(myPaddleMode->getValue());
break;

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: InputDialog.hxx,v 1.15 2008-03-02 20:48:51 stephena Exp $
// $Id: InputDialog.hxx,v 1.16 2008-03-22 17:35:03 stephena Exp $
//============================================================================
#ifndef INPUT_DIALOG_HXX
@ -53,6 +53,8 @@ class InputDialog : public Dialog
private:
enum {
kLeftChanged = 'LCch',
kRightChanged = 'RCch',
kPaddleChanged = 'PDch',
kPSpeedChanged = 'PSch'
};

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: LauncherDialog.cxx,v 1.82 2008-03-15 19:10:57 stephena Exp $
// $Id: LauncherDialog.cxx,v 1.83 2008-03-22 17:35:03 stephena Exp $
//
// Based on code from ScummVM - Scumm Interpreter
// Copyright (C) 2002-2004 The ScummVM project
@ -328,8 +328,7 @@ void LauncherDialog::handleCommand(CommandSender* sender, int cmd,
else if(!instance()->isValidRomName(rom, extension) ||
!instance()->createConsole(rom, md5))
{
// TODO - show messagebox that ROM couldn't be started
cerr << "Error: invalid ROM (name or file)\n";
instance()->frameBuffer().showMessage("Not a valid ROM file", kMiddleCenter);
}
}
break;