mirror of https://github.com/stella-emu/stella.git
Relaxed recent equate changes to allow all symbols to be used from a .sym
file. This will have to do for now, until we find a better way of differentiating between constants and addresses. Made the ROM disassembly area take advantage of a wide debugger window by spacing out the label and disassembly areas. Finalized location of the AVox and SaveKey EEPROM files; they're now located in the basedir (the actual location depends on the OS). Made deadzone for analog joysticks configurable from the commandline and UI. Added '-joydeadzone' commandline argument, which accepts a value from 0 - 29, specifying a deadzone of '3200 + DEADZONE * 1000'. Also added UI to InputDialog to set this from dynamically from the UI. Added code to only save the AVox and SaveKey EEPROM data file when necessary. This is for those systems based on flash storage, where unnecessary writes will wear down the drive. Added SaveKey as a full-fledged controller to GameInfoDialog. git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@1501 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba
This commit is contained in:
parent
694d175f36
commit
19be269077
|
@ -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: EquateList.cxx,v 1.32 2008-05-06 16:39:10 stephena Exp $
|
// $Id: EquateList.cxx,v 1.33 2008-05-11 21:18:34 stephena Exp $
|
||||||
//============================================================================
|
//============================================================================
|
||||||
|
|
||||||
#include <fstream>
|
#include <fstream>
|
||||||
|
@ -66,14 +66,21 @@ void EquateList::addEquate(const string& label, int address)
|
||||||
// as well, and we don't yet have an infrastructure to determine that,
|
// as well, and we don't yet have an infrastructure to determine that,
|
||||||
// so the entire region is marked as read-write
|
// so the entire region is marked as read-write
|
||||||
equate_t flags = EQF_READ;
|
equate_t flags = EQF_READ;
|
||||||
|
#if 0
|
||||||
if(address >= 0x80 && address <= 0xff)
|
if(address >= 0x80 && address <= 0xff)
|
||||||
flags = EQF_RW;
|
flags = EQF_RW;
|
||||||
else if((address & 0x1000) == 0x1000)
|
else if((address & 0x1000) == 0x1000)
|
||||||
flags = EQF_RW;
|
flags = EQF_RW;
|
||||||
else
|
else
|
||||||
//{ cerr << "label = " << label << ", address = " << hex << address << " discarded\n";
|
{
|
||||||
|
cerr << "label = " << label << ", address = " << hex << address << " discarded\n";
|
||||||
return; // don't know what else to do for now
|
return; // don't know what else to do for now
|
||||||
//}
|
}
|
||||||
|
#else
|
||||||
|
// The above section of code is deactivated until a better means of
|
||||||
|
// determining constants vs. addresses is found
|
||||||
|
flags = EQF_RW;
|
||||||
|
#endif
|
||||||
|
|
||||||
removeEquate(label);
|
removeEquate(label);
|
||||||
|
|
||||||
|
|
|
@ -13,12 +13,13 @@
|
||||||
// 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: RomListWidget.cxx,v 1.11 2008-02-06 13:45:20 stephena Exp $
|
// $Id: RomListWidget.cxx,v 1.12 2008-05-11 21:18:34 stephena Exp $
|
||||||
//
|
//
|
||||||
// Based on code from ScummVM - Scumm Interpreter
|
// Based on code from ScummVM - Scumm Interpreter
|
||||||
// Copyright (C) 2002-2004 The ScummVM project
|
// Copyright (C) 2002-2004 The ScummVM project
|
||||||
//============================================================================
|
//============================================================================
|
||||||
|
|
||||||
|
#include "bspf.hxx"
|
||||||
#include "ContextMenu.hxx"
|
#include "ContextMenu.hxx"
|
||||||
#include "RomListWidget.hxx"
|
#include "RomListWidget.hxx"
|
||||||
|
|
||||||
|
@ -40,8 +41,12 @@ RomListWidget::RomListWidget(GuiObject* boss, const GUI::Font& font,
|
||||||
|
|
||||||
myMenu->setList(l);
|
myMenu->setList(l);
|
||||||
|
|
||||||
myLabelWidth = font.getMaxCharWidth() * 16;
|
// Take advantage of a wide debugger window when possible
|
||||||
myBytesWidth = font.getMaxCharWidth() * 12;
|
const int fontWidth = font.getMaxCharWidth(),
|
||||||
|
numchars = w / fontWidth;
|
||||||
|
|
||||||
|
myLabelWidth = BSPF_max(20, int(0.35 * (numchars - 12))) * fontWidth;
|
||||||
|
myBytesWidth = 12 * fontWidth;
|
||||||
}
|
}
|
||||||
|
|
||||||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||||
|
|
|
@ -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.139 2008-05-08 20:23:31 stephena Exp $
|
// $Id: Console.cxx,v 1.140 2008-05-11 21:18:35 stephena Exp $
|
||||||
//============================================================================
|
//============================================================================
|
||||||
|
|
||||||
#include <cassert>
|
#include <cassert>
|
||||||
|
@ -634,7 +634,7 @@ void Console::setControllers()
|
||||||
}
|
}
|
||||||
else if(right == "ATARIVOX")
|
else if(right == "ATARIVOX")
|
||||||
{
|
{
|
||||||
string eepromfile = // fixme myOSystem->baseDir() + BSPF_PATH_SEPARATOR +
|
string eepromfile = myOSystem->baseDir() + BSPF_PATH_SEPARATOR +
|
||||||
"atarivox_eeprom.dat";
|
"atarivox_eeprom.dat";
|
||||||
myControllers[rightPort] = myAVox =
|
myControllers[rightPort] = myAVox =
|
||||||
new AtariVox(Controller::Right, *myEvent, *mySystem, myOSystem->serialPort(),
|
new AtariVox(Controller::Right, *myEvent, *mySystem, myOSystem->serialPort(),
|
||||||
|
@ -642,7 +642,7 @@ void Console::setControllers()
|
||||||
}
|
}
|
||||||
else if(right == "SAVEKEY")
|
else if(right == "SAVEKEY")
|
||||||
{
|
{
|
||||||
string eepromfile = // fixme myOSystem->baseDir() + BSPF_PATH_SEPARATOR +
|
string eepromfile = myOSystem->baseDir() + BSPF_PATH_SEPARATOR +
|
||||||
"savekey_eeprom.dat";
|
"savekey_eeprom.dat";
|
||||||
myControllers[rightPort] = new SaveKey(Controller::Right, *myEvent, *mySystem,
|
myControllers[rightPort] = new SaveKey(Controller::Right, *myEvent, *mySystem,
|
||||||
eepromfile);
|
eepromfile);
|
||||||
|
|
|
@ -1,4 +1,3 @@
|
||||||
|
|
||||||
//============================================================================
|
//============================================================================
|
||||||
//
|
//
|
||||||
// SSSS tt lll lll
|
// SSSS tt lll lll
|
||||||
|
@ -14,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.cxx,v 1.221 2008-03-30 15:01:38 stephena Exp $
|
// $Id: EventHandler.cxx,v 1.222 2008-05-11 21:18:35 stephena Exp $
|
||||||
//============================================================================
|
//============================================================================
|
||||||
|
|
||||||
#include <sstream>
|
#include <sstream>
|
||||||
|
@ -31,6 +30,7 @@
|
||||||
#include "Launcher.hxx"
|
#include "Launcher.hxx"
|
||||||
#include "Menu.hxx"
|
#include "Menu.hxx"
|
||||||
#include "OSystem.hxx"
|
#include "OSystem.hxx"
|
||||||
|
#include "Joystick.hxx"
|
||||||
#include "Paddles.hxx"
|
#include "Paddles.hxx"
|
||||||
#include "PropsSet.hxx"
|
#include "PropsSet.hxx"
|
||||||
#include "ScrollBarWidget.hxx"
|
#include "ScrollBarWidget.hxx"
|
||||||
|
@ -55,8 +55,6 @@
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#define JOY_DEADZONE 3200
|
|
||||||
|
|
||||||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||||
EventHandler::EventHandler(OSystem* osystem)
|
EventHandler::EventHandler(OSystem* osystem)
|
||||||
: myOSystem(osystem),
|
: myOSystem(osystem),
|
||||||
|
@ -144,6 +142,7 @@ void EventHandler::initialize()
|
||||||
|
|
||||||
myGrabMouseFlag = myOSystem->settings().getBool("grabmouse");
|
myGrabMouseFlag = myOSystem->settings().getBool("grabmouse");
|
||||||
|
|
||||||
|
Joystick::setDeadZone(myOSystem->settings().getInt("joydeadzone"));
|
||||||
Paddles::setDigitalSpeed(myOSystem->settings().getInt("pspeed"));
|
Paddles::setDigitalSpeed(myOSystem->settings().getInt("pspeed"));
|
||||||
|
|
||||||
// Set number of lines a mousewheel will scroll
|
// Set number of lines a mousewheel will scroll
|
||||||
|
@ -849,8 +848,10 @@ void EventHandler::handleJoyAxisEvent(int stick, int axis, int value)
|
||||||
myEvent->set(Event::SARightAxis1Value, value);
|
myEvent->set(Event::SARightAxis1Value, value);
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
|
{
|
||||||
// Otherwise, we know the event is digital
|
// Otherwise, we know the event is digital
|
||||||
if(value > -JOY_DEADZONE && value < JOY_DEADZONE)
|
int deadzone = Joystick::deadzone();
|
||||||
|
if(value > -deadzone && value < deadzone)
|
||||||
{
|
{
|
||||||
// Turn off both events, since we don't know exactly which one
|
// Turn off both events, since we don't know exactly which one
|
||||||
// was previously activated.
|
// was previously activated.
|
||||||
|
@ -861,6 +862,7 @@ void EventHandler::handleJoyAxisEvent(int stick, int axis, int value)
|
||||||
handleEvent(value < 0 ? eventAxisNeg : eventAxisPos, 1);
|
handleEvent(value < 0 ? eventAxisNeg : eventAxisPos, 1);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -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: Joystick.cxx,v 1.12 2008-04-13 23:43:14 stephena Exp $
|
// $Id: Joystick.cxx,v 1.13 2008-05-11 21:18:35 stephena Exp $
|
||||||
//============================================================================
|
//============================================================================
|
||||||
|
|
||||||
#include "Event.hxx"
|
#include "Event.hxx"
|
||||||
|
@ -85,3 +85,15 @@ void Joystick::update()
|
||||||
if(yaxis < -16384)
|
if(yaxis < -16384)
|
||||||
myDigitalPinState[One] = false;
|
myDigitalPinState[One] = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||||
|
void Joystick::setDeadZone(int deadzone)
|
||||||
|
{
|
||||||
|
if(deadzone < 0) deadzone = 0;
|
||||||
|
if(deadzone > 29) deadzone = 29;
|
||||||
|
|
||||||
|
_DEAD_ZONE = 3200 + deadzone * 1000;
|
||||||
|
}
|
||||||
|
|
||||||
|
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||||
|
int Joystick::_DEAD_ZONE = 3200;
|
||||||
|
|
|
@ -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: Joystick.hxx,v 1.10 2008-04-13 23:43:14 stephena Exp $
|
// $Id: Joystick.hxx,v 1.11 2008-05-11 21:18:35 stephena Exp $
|
||||||
//============================================================================
|
//============================================================================
|
||||||
|
|
||||||
#ifndef JOYSTICK_HXX
|
#ifndef JOYSTICK_HXX
|
||||||
|
@ -27,7 +27,7 @@
|
||||||
The standard Atari 2600 joystick controller.
|
The standard Atari 2600 joystick controller.
|
||||||
|
|
||||||
@author Bradford W. Mott
|
@author Bradford W. Mott
|
||||||
@version $Id: Joystick.hxx,v 1.10 2008-04-13 23:43:14 stephena Exp $
|
@version $Id: Joystick.hxx,v 1.11 2008-05-11 21:18:35 stephena Exp $
|
||||||
*/
|
*/
|
||||||
class Joystick : public Controller
|
class Joystick : public Controller
|
||||||
{
|
{
|
||||||
|
@ -53,12 +53,22 @@ class Joystick : public Controller
|
||||||
*/
|
*/
|
||||||
virtual void update();
|
virtual void update();
|
||||||
|
|
||||||
|
/**
|
||||||
|
Sets the deadzone amount for real analog joysticks.
|
||||||
|
Technically, this isn't really used by the Joystick class at all,
|
||||||
|
but it seemed like the best place to put it.
|
||||||
|
*/
|
||||||
|
static void setDeadZone(int deadzone);
|
||||||
|
inline static int deadzone() { return _DEAD_ZONE; }
|
||||||
|
|
||||||
private:
|
private:
|
||||||
// Pre-compute the events we care about based on given port
|
// Pre-compute the events we care about based on given port
|
||||||
// This will eliminate test for left or right port in update()
|
// This will eliminate test for left or right port in update()
|
||||||
Event::Type myUpEvent, myDownEvent, myLeftEvent, myRightEvent,
|
Event::Type myUpEvent, myDownEvent, myLeftEvent, myRightEvent,
|
||||||
myXAxisValue, myYAxisValue, myFireEvent;
|
myXAxisValue, myYAxisValue, myFireEvent;
|
||||||
|
|
||||||
|
|
||||||
|
static int _DEAD_ZONE;
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -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: MT24LC256.cxx,v 1.9 2008-05-10 22:21:09 stephena Exp $
|
// $Id: MT24LC256.cxx,v 1.10 2008-05-11 21:18:35 stephena Exp $
|
||||||
//============================================================================
|
//============================================================================
|
||||||
|
|
||||||
#include <cassert>
|
#include <cassert>
|
||||||
|
@ -54,7 +54,9 @@ MT24LC256::MT24LC256(const string& filename, const System& system)
|
||||||
myCyclesWhenTimerSet(0),
|
myCyclesWhenTimerSet(0),
|
||||||
myCyclesWhenSDASet(0),
|
myCyclesWhenSDASet(0),
|
||||||
myCyclesWhenSCLSet(0),
|
myCyclesWhenSCLSet(0),
|
||||||
myDataFile(filename)
|
myDataFile(filename),
|
||||||
|
myDataFileExists(false),
|
||||||
|
myDataChanged(false)
|
||||||
{
|
{
|
||||||
// First initialize the I2C state
|
// First initialize the I2C state
|
||||||
jpee_init();
|
jpee_init();
|
||||||
|
@ -70,15 +72,20 @@ MT24LC256::MT24LC256(const string& filename, const System& system)
|
||||||
{
|
{
|
||||||
in.seekg(0, ios::beg);
|
in.seekg(0, ios::beg);
|
||||||
in.read((char*)myData, 32768);
|
in.read((char*)myData, 32768);
|
||||||
|
myDataFileExists = true;
|
||||||
}
|
}
|
||||||
in.close();
|
in.close();
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
myDataFileExists = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||||
MT24LC256::~MT24LC256()
|
MT24LC256::~MT24LC256()
|
||||||
{
|
{
|
||||||
// Save EEPROM data to external file
|
// Save EEPROM data to external file only when necessary
|
||||||
|
if(!myDataFileExists || myDataChanged)
|
||||||
|
{
|
||||||
ofstream out;
|
ofstream out;
|
||||||
out.open(myDataFile.c_str(), ios_base::binary);
|
out.open(myDataFile.c_str(), ios_base::binary);
|
||||||
if(out.is_open())
|
if(out.is_open())
|
||||||
|
@ -87,6 +94,7 @@ MT24LC256::~MT24LC256()
|
||||||
out.close();
|
out.close();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||||
bool MT24LC256::readSDA()
|
bool MT24LC256::readSDA()
|
||||||
|
@ -208,6 +216,7 @@ void MT24LC256::jpee_data_stop()
|
||||||
}
|
}
|
||||||
for (i=3; i<jpee_pptr; i++)
|
for (i=3; i<jpee_pptr; i++)
|
||||||
{
|
{
|
||||||
|
myDataChanged = true;
|
||||||
myData[(jpee_address++) & jpee_sizemask] = jpee_packet[i];
|
myData[(jpee_address++) & jpee_sizemask] = jpee_packet[i];
|
||||||
if (!(jpee_address & jpee_pagemask))
|
if (!(jpee_address & jpee_pagemask))
|
||||||
break; /* Writes can't cross page boundary! */
|
break; /* Writes can't cross page boundary! */
|
||||||
|
|
|
@ -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: MT24LC256.hxx,v 1.4 2008-05-10 22:21:09 stephena Exp $
|
// $Id: MT24LC256.hxx,v 1.5 2008-05-11 21:18:35 stephena Exp $
|
||||||
//============================================================================
|
//============================================================================
|
||||||
|
|
||||||
#ifndef MT24LC256_HXX
|
#ifndef MT24LC256_HXX
|
||||||
|
@ -30,7 +30,7 @@ class System;
|
||||||
(aka Supercat) for the bulk of this code.
|
(aka Supercat) for the bulk of this code.
|
||||||
|
|
||||||
@author Stephen Anthony & J. Payson
|
@author Stephen Anthony & J. Payson
|
||||||
@version $Id: MT24LC256.hxx,v 1.4 2008-05-10 22:21:09 stephena Exp $
|
@version $Id: MT24LC256.hxx,v 1.5 2008-05-11 21:18:35 stephena Exp $
|
||||||
*/
|
*/
|
||||||
class MT24LC256
|
class MT24LC256
|
||||||
{
|
{
|
||||||
|
@ -89,6 +89,12 @@ class MT24LC256
|
||||||
// The file containing the EEPROM data
|
// The file containing the EEPROM data
|
||||||
string myDataFile;
|
string myDataFile;
|
||||||
|
|
||||||
|
// Indicates if a valid EEPROM data file exists/was successfully loaded
|
||||||
|
bool myDataFileExists;
|
||||||
|
|
||||||
|
// Indicates if the EEPROM has changed since class invocation
|
||||||
|
bool myDataChanged;
|
||||||
|
|
||||||
// Required for I2C functionality
|
// Required for I2C functionality
|
||||||
int jpee_mdat, jpee_sdat, jpee_mclk;
|
int jpee_mdat, jpee_sdat, jpee_mclk;
|
||||||
int jpee_sizemask, jpee_pagemask, jpee_smallmode, jpee_logmode;
|
int jpee_sizemask, jpee_pagemask, jpee_smallmode, jpee_logmode;
|
||||||
|
|
|
@ -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: Settings.cxx,v 1.142 2008-04-11 17:56:34 stephena Exp $
|
// $Id: Settings.cxx,v 1.143 2008-05-11 21:18:35 stephena Exp $
|
||||||
//============================================================================
|
//============================================================================
|
||||||
|
|
||||||
#include <cassert>
|
#include <cassert>
|
||||||
|
@ -69,6 +69,7 @@ Settings::Settings(OSystem* osystem)
|
||||||
setInternal("joymap", "");
|
setInternal("joymap", "");
|
||||||
setInternal("joyaxismap", "");
|
setInternal("joyaxismap", "");
|
||||||
setInternal("joyhatmap", "");
|
setInternal("joyhatmap", "");
|
||||||
|
setInternal("joydeadzone", "0");
|
||||||
setInternal("pspeed", "6");
|
setInternal("pspeed", "6");
|
||||||
setInternal("sa1", "left");
|
setInternal("sa1", "left");
|
||||||
setInternal("sa2", "right");
|
setInternal("sa2", "right");
|
||||||
|
@ -246,6 +247,12 @@ void Settings::validate()
|
||||||
if(i < 1 || i > 10)
|
if(i < 1 || i > 10)
|
||||||
setInternal("zoom_tia", "2");
|
setInternal("zoom_tia", "2");
|
||||||
|
|
||||||
|
i = getInt("joydeadzone");
|
||||||
|
if(i < 0)
|
||||||
|
setInternal("joydeadzone", "0");
|
||||||
|
else if(i > 29)
|
||||||
|
setInternal("joydeadzone", "29");
|
||||||
|
|
||||||
i = getInt("pspeed");
|
i = getInt("pspeed");
|
||||||
if(i < 1)
|
if(i < 1)
|
||||||
setInternal("pspeed", "1");
|
setInternal("pspeed", "1");
|
||||||
|
@ -312,6 +319,7 @@ void Settings::usage()
|
||||||
#endif
|
#endif
|
||||||
<< " -cheat <code> Use the specified cheatcode (see manual for description)\n"
|
<< " -cheat <code> Use the specified cheatcode (see manual for description)\n"
|
||||||
<< " -showinfo <1|0> Shows some game info\n"
|
<< " -showinfo <1|0> Shows some game info\n"
|
||||||
|
<< " -joydeadzone <number> Sets 'deadzone' area for analog joysticks (0-29)\n"
|
||||||
<< " -pspeed <number> Speed of digital emulated paddle movement (1-15)\n"
|
<< " -pspeed <number> Speed of digital emulated paddle movement (1-15)\n"
|
||||||
<< " -sa1 <left|right> Stelladaptor 1 emulates specified joystick port\n"
|
<< " -sa1 <left|right> Stelladaptor 1 emulates specified joystick port\n"
|
||||||
<< " -sa2 <left|right> Stelladaptor 2 emulates specified joystick port\n"
|
<< " -sa2 <left|right> Stelladaptor 2 emulates specified joystick port\n"
|
||||||
|
|
|
@ -13,18 +13,17 @@
|
||||||
// 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: DialogContainer.cxx,v 1.41 2008-03-13 22:58:06 stephena Exp $
|
// $Id: DialogContainer.cxx,v 1.42 2008-05-11 21:18:35 stephena Exp $
|
||||||
//============================================================================
|
//============================================================================
|
||||||
|
|
||||||
#include "OSystem.hxx"
|
#include "OSystem.hxx"
|
||||||
#include "Dialog.hxx"
|
#include "Dialog.hxx"
|
||||||
#include "Stack.hxx"
|
#include "Stack.hxx"
|
||||||
#include "EventHandler.hxx"
|
#include "EventHandler.hxx"
|
||||||
|
#include "Joystick.hxx"
|
||||||
#include "bspf.hxx"
|
#include "bspf.hxx"
|
||||||
#include "DialogContainer.hxx"
|
#include "DialogContainer.hxx"
|
||||||
|
|
||||||
#define JOY_DEADZONE 3200
|
|
||||||
|
|
||||||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||||
DialogContainer::DialogContainer(OSystem* osystem)
|
DialogContainer::DialogContainer(OSystem* osystem)
|
||||||
: myOSystem(osystem),
|
: myOSystem(osystem),
|
||||||
|
@ -290,10 +289,11 @@ void DialogContainer::handleJoyAxisEvent(int stick, int axis, int value)
|
||||||
// Send the event to the dialog box on the top of the stack
|
// Send the event to the dialog box on the top of the stack
|
||||||
Dialog* activeDialog = myDialogStack.top();
|
Dialog* activeDialog = myDialogStack.top();
|
||||||
|
|
||||||
if(value > JOY_DEADZONE)
|
int deadzone = Joystick::deadzone();
|
||||||
value -= JOY_DEADZONE;
|
if(value > deadzone)
|
||||||
else if(value < -JOY_DEADZONE )
|
value -= deadzone;
|
||||||
value += JOY_DEADZONE;
|
else if(value < -deadzone )
|
||||||
|
value += deadzone;
|
||||||
else
|
else
|
||||||
value = 0;
|
value = 0;
|
||||||
|
|
||||||
|
|
|
@ -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: GameInfoDialog.cxx,v 1.53 2008-04-11 17:56:34 stephena Exp $
|
// $Id: GameInfoDialog.cxx,v 1.54 2008-05-11 21:18:35 stephena Exp $
|
||||||
//
|
//
|
||||||
// Based on code from ScummVM - Scumm Interpreter
|
// Based on code from ScummVM - Scumm Interpreter
|
||||||
// Copyright (C) 2002-2004 The ScummVM project
|
// Copyright (C) 2002-2004 The ScummVM project
|
||||||
|
@ -552,7 +552,7 @@ void GameInfoDialog::saveConfig()
|
||||||
|
|
||||||
// Controller properties
|
// Controller properties
|
||||||
tag = myP0Controller->getSelectedTag();
|
tag = myP0Controller->getSelectedTag();
|
||||||
for(i = 0; i < 5; ++i)
|
for(i = 0; i < kNumControllerTypes; ++i)
|
||||||
{
|
{
|
||||||
if(i == tag-1)
|
if(i == tag-1)
|
||||||
{
|
{
|
||||||
|
@ -562,7 +562,7 @@ void GameInfoDialog::saveConfig()
|
||||||
}
|
}
|
||||||
|
|
||||||
tag = myP1Controller->getSelectedTag();
|
tag = myP1Controller->getSelectedTag();
|
||||||
for(i = 0; i < 5; ++i)
|
for(i = 0; i < kNumControllerTypes; ++i)
|
||||||
{
|
{
|
||||||
if(i == tag-1)
|
if(i == tag-1)
|
||||||
{
|
{
|
||||||
|
@ -672,12 +672,13 @@ void GameInfoDialog::handleCommand(CommandSender* sender, int cmd,
|
||||||
|
|
||||||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||||
const char* GameInfoDialog::ourControllerList[kNumControllerTypes][2] = {
|
const char* GameInfoDialog::ourControllerList[kNumControllerTypes][2] = {
|
||||||
{ "AtariVox", "ATARIVOX" },
|
{ "Joystick", "JOYSTICK" },
|
||||||
|
{ "Paddles", "PADDLES" },
|
||||||
{ "Booster-Grip", "BOOSTER-GRIP" },
|
{ "Booster-Grip", "BOOSTER-GRIP" },
|
||||||
{ "Driving", "DRIVING" },
|
{ "Driving", "DRIVING" },
|
||||||
{ "Keyboard", "KEYBOARD" },
|
{ "Keyboard", "KEYBOARD" },
|
||||||
{ "Paddles", "PADDLES" },
|
{ "AtariVox", "ATARIVOX" },
|
||||||
{ "Joystick", "JOYSTICK" }
|
{ "SaveKey", "SAVEKEY" }
|
||||||
};
|
};
|
||||||
|
|
||||||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||||
|
|
|
@ -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: GameInfoDialog.hxx,v 1.31 2008-04-11 17:56:34 stephena Exp $
|
// $Id: GameInfoDialog.hxx,v 1.32 2008-05-11 21:18:35 stephena Exp $
|
||||||
//
|
//
|
||||||
// Based on code from ScummVM - Scumm Interpreter
|
// Based on code from ScummVM - Scumm Interpreter
|
||||||
// Copyright (C) 2002-2004 The ScummVM project
|
// Copyright (C) 2002-2004 The ScummVM project
|
||||||
|
@ -99,7 +99,7 @@ class GameInfoDialog : public Dialog, public CommandSender
|
||||||
kPhosphorChanged = 'PPch',
|
kPhosphorChanged = 'PPch',
|
||||||
kPPBlendChanged = 'PBch',
|
kPPBlendChanged = 'PBch',
|
||||||
kNumCartTypes = 25,
|
kNumCartTypes = 25,
|
||||||
kNumControllerTypes = 6
|
kNumControllerTypes = 7
|
||||||
};
|
};
|
||||||
|
|
||||||
/** Game properties for currently loaded ROM */
|
/** Game properties for currently loaded ROM */
|
||||||
|
|
|
@ -13,13 +13,14 @@
|
||||||
// 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: InputDialog.cxx,v 1.31 2008-04-11 17:56:34 stephena Exp $
|
// $Id: InputDialog.cxx,v 1.32 2008-05-11 21:18:35 stephena Exp $
|
||||||
//============================================================================
|
//============================================================================
|
||||||
|
|
||||||
#include "bspf.hxx"
|
#include "bspf.hxx"
|
||||||
|
|
||||||
#include "Array.hxx"
|
#include "Array.hxx"
|
||||||
#include "OSystem.hxx"
|
#include "OSystem.hxx"
|
||||||
|
#include "Joystick.hxx"
|
||||||
#include "Paddles.hxx"
|
#include "Paddles.hxx"
|
||||||
#include "Settings.hxx"
|
#include "Settings.hxx"
|
||||||
#include "EventMappingWidget.hxx"
|
#include "EventMappingWidget.hxx"
|
||||||
|
@ -119,10 +120,22 @@ void InputDialog::addVDeviceTab(const GUI::Font& font)
|
||||||
myRightPort->appendEntry("right virtual port", 2);
|
myRightPort->appendEntry("right virtual port", 2);
|
||||||
wid.push_back(myRightPort);
|
wid.push_back(myRightPort);
|
||||||
|
|
||||||
// Add 'mouse to paddle' mapping
|
|
||||||
ypos += 2*lineHeight;
|
|
||||||
lwidth = font.getStringWidth("Paddle threshold: ");
|
lwidth = font.getStringWidth("Paddle threshold: ");
|
||||||
pwidth = font.getMaxCharWidth() * 5;
|
pwidth = font.getMaxCharWidth() * 5;
|
||||||
|
|
||||||
|
// Add joystick deadzone setting
|
||||||
|
ypos += 2*lineHeight;
|
||||||
|
myDeadzone = new SliderWidget(myTab, font, xpos, ypos, pwidth, lineHeight,
|
||||||
|
"Joy deadzone: ", lwidth, kDeadzoneChanged);
|
||||||
|
myDeadzone->setMinValue(0); myDeadzone->setMaxValue(29);
|
||||||
|
xpos += myDeadzone->getWidth() + 5;
|
||||||
|
myDeadzoneLabel = new StaticTextWidget(myTab, font, xpos, ypos+1, 24, lineHeight,
|
||||||
|
"", kTextAlignLeft);
|
||||||
|
myDeadzoneLabel->setFlags(WIDGET_CLEARBG);
|
||||||
|
wid.push_back(myDeadzone);
|
||||||
|
|
||||||
|
// Add 'mouse to paddle' mapping
|
||||||
|
xpos = 5; ypos += lineHeight + 3;
|
||||||
myPaddleMode = new SliderWidget(myTab, font, xpos, ypos, pwidth, lineHeight,
|
myPaddleMode = new SliderWidget(myTab, font, xpos, ypos, pwidth, lineHeight,
|
||||||
"Mouse is paddle: ", lwidth, kPaddleChanged);
|
"Mouse is paddle: ", lwidth, kPaddleChanged);
|
||||||
myPaddleMode->setMinValue(0); myPaddleMode->setMaxValue(3);
|
myPaddleMode->setMinValue(0); myPaddleMode->setMaxValue(3);
|
||||||
|
@ -168,6 +181,10 @@ void InputDialog::loadConfig()
|
||||||
int rport = sa2 == "right" ? 2 : 1;
|
int rport = sa2 == "right" ? 2 : 1;
|
||||||
myRightPort->setSelectedTag(rport);
|
myRightPort->setSelectedTag(rport);
|
||||||
|
|
||||||
|
// Joystick deadzone
|
||||||
|
myDeadzone->setValue(instance()->settings().getInt("joydeadzone"));
|
||||||
|
myDeadzoneLabel->setLabel(instance()->settings().getString("joydeadzone"));
|
||||||
|
|
||||||
// Paddle mode
|
// Paddle mode
|
||||||
myPaddleMode->setValue(0);
|
myPaddleMode->setValue(0);
|
||||||
myPaddleModeLabel->setLabel("0");
|
myPaddleModeLabel->setLabel("0");
|
||||||
|
@ -190,6 +207,11 @@ void InputDialog::saveConfig()
|
||||||
const string& sa2 = myRightPort->getSelectedTag() == 2 ? "right" : "left";
|
const string& sa2 = myRightPort->getSelectedTag() == 2 ? "right" : "left";
|
||||||
instance()->eventHandler().mapStelladaptors(sa1, sa2);
|
instance()->eventHandler().mapStelladaptors(sa1, sa2);
|
||||||
|
|
||||||
|
// Joystick deadzone
|
||||||
|
int deadzone = myDeadzone->getValue();
|
||||||
|
instance()->settings().setInt("joydeadzone", deadzone);
|
||||||
|
Joystick::setDeadZone(deadzone);
|
||||||
|
|
||||||
// Paddle mode
|
// Paddle mode
|
||||||
Paddles::setMouseIsPaddle(myPaddleMode->getValue());
|
Paddles::setMouseIsPaddle(myPaddleMode->getValue());
|
||||||
|
|
||||||
|
@ -276,6 +298,10 @@ void InputDialog::handleCommand(CommandSender* sender, int cmd,
|
||||||
myRightPort->getSelectedTag() == 2 ? 1 : 2);
|
myRightPort->getSelectedTag() == 2 ? 1 : 2);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
case kDeadzoneChanged:
|
||||||
|
myDeadzoneLabel->setValue(myDeadzone->getValue());
|
||||||
|
break;
|
||||||
|
|
||||||
case kPaddleChanged:
|
case kPaddleChanged:
|
||||||
myPaddleModeLabel->setValue(myPaddleMode->getValue());
|
myPaddleModeLabel->setValue(myPaddleMode->getValue());
|
||||||
break;
|
break;
|
||||||
|
|
|
@ -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: InputDialog.hxx,v 1.17 2008-04-11 17:56:34 stephena Exp $
|
// $Id: InputDialog.hxx,v 1.18 2008-05-11 21:18:35 stephena Exp $
|
||||||
//============================================================================
|
//============================================================================
|
||||||
|
|
||||||
#ifndef INPUT_DIALOG_HXX
|
#ifndef INPUT_DIALOG_HXX
|
||||||
|
@ -56,6 +56,7 @@ class InputDialog : public Dialog
|
||||||
enum {
|
enum {
|
||||||
kLeftChanged = 'LCch',
|
kLeftChanged = 'LCch',
|
||||||
kRightChanged = 'RCch',
|
kRightChanged = 'RCch',
|
||||||
|
kDeadzoneChanged = 'DZch',
|
||||||
kPaddleChanged = 'PDch',
|
kPaddleChanged = 'PDch',
|
||||||
kPSpeedChanged = 'PSch'
|
kPSpeedChanged = 'PSch'
|
||||||
};
|
};
|
||||||
|
@ -68,6 +69,8 @@ class InputDialog : public Dialog
|
||||||
PopUpWidget* myLeftPort;
|
PopUpWidget* myLeftPort;
|
||||||
PopUpWidget* myRightPort;
|
PopUpWidget* myRightPort;
|
||||||
|
|
||||||
|
SliderWidget* myDeadzone;
|
||||||
|
StaticTextWidget* myDeadzoneLabel;
|
||||||
SliderWidget* myPaddleMode;
|
SliderWidget* myPaddleMode;
|
||||||
StaticTextWidget* myPaddleModeLabel;
|
StaticTextWidget* myPaddleModeLabel;
|
||||||
SliderWidget* myPaddleSpeed;
|
SliderWidget* myPaddleSpeed;
|
||||||
|
|
|
@ -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: Widget.hxx,v 1.60 2008-04-29 15:13:16 stephena Exp $
|
// $Id: Widget.hxx,v 1.61 2008-05-11 21:18:35 stephena Exp $
|
||||||
//
|
//
|
||||||
// Based on code from ScummVM - Scumm Interpreter
|
// Based on code from ScummVM - Scumm Interpreter
|
||||||
// Copyright (C) 2002-2004 The ScummVM project
|
// Copyright (C) 2002-2004 The ScummVM project
|
||||||
|
@ -88,7 +88,7 @@ enum {
|
||||||
This is the base class for all widgets.
|
This is the base class for all widgets.
|
||||||
|
|
||||||
@author Stephen Anthony
|
@author Stephen Anthony
|
||||||
@version $Id: Widget.hxx,v 1.60 2008-04-29 15:13:16 stephena Exp $
|
@version $Id: Widget.hxx,v 1.61 2008-05-11 21:18:35 stephena Exp $
|
||||||
*/
|
*/
|
||||||
class Widget : public GuiObject
|
class Widget : public GuiObject
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in New Issue