mirror of https://github.com/stella-emu/stella.git
Merge branch 'master' into refactor/cart
This commit is contained in:
commit
b52251da6e
|
@ -14,11 +14,15 @@
|
||||||
|
|
||||||
6.1 to 6.2: (??? ??, 2020)
|
6.1 to 6.2: (??? ??, 2020)
|
||||||
|
|
||||||
* Added that paddle centering and sensitivity can be adjusted now (TOOD: Doc)
|
* Added that paddle centering and sensitivity can be adjusted (TODO: Doc)
|
||||||
|
|
||||||
|
* Added that Driving controller sensitivity can be adjusted (TODO: Doc)
|
||||||
|
|
||||||
* Added high scores: Score addresses, game variation etc. can be defined for
|
* Added high scores: Score addresses, game variation etc. can be defined for
|
||||||
a game. This allows the user to save high scores for these games. For each
|
a game. This allows the user to save high scores for these games. For each
|
||||||
game and variation, the top 10 scores can be saved. (TOOD: Doc)
|
game and variation, the top 10 scores can be saved. (TODO: Doc)
|
||||||
|
|
||||||
|
* Add option which lets default ROM path follow launcher navigation (TODO: Doc)
|
||||||
|
|
||||||
* Added displaying last write address in the debugger.
|
* Added displaying last write address in the debugger.
|
||||||
|
|
||||||
|
|
|
@ -49,10 +49,6 @@ Driving::Driving(Jack jack, const Event& event, const System& system)
|
||||||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||||
void Driving::update()
|
void Driving::update()
|
||||||
{
|
{
|
||||||
// Make sure direct gray codes from Stelladaptor stay in sync with
|
|
||||||
// simulated gray codes generated by PC keyboard or PC joystick
|
|
||||||
myCounter = (myGrayIndex << 2) | (myCounter & 3);
|
|
||||||
|
|
||||||
// Digital events (from keyboard or joystick hats & buttons)
|
// Digital events (from keyboard or joystick hats & buttons)
|
||||||
setPin(DigitalPin::Six, myEvent.get(myFireEvent) == 0);
|
setPin(DigitalPin::Six, myEvent.get(myFireEvent) == 0);
|
||||||
int d_axis = myEvent.get(myXAxisValue);
|
int d_axis = myEvent.get(myXAxisValue);
|
||||||
|
@ -92,8 +88,7 @@ void Driving::update()
|
||||||
}
|
}
|
||||||
|
|
||||||
// Only consider the lower-most bits (corresponding to pins 1 & 2)
|
// Only consider the lower-most bits (corresponding to pins 1 & 2)
|
||||||
myCounter &= 0x0f;
|
myGrayIndex = Int32(myCounter * SENSITIVITY / 4.0F) & 0b11;
|
||||||
myGrayIndex = myCounter >> 2;
|
|
||||||
|
|
||||||
// Stelladaptor is the only controller that should set this
|
// Stelladaptor is the only controller that should set this
|
||||||
int yaxis = myEvent.get(myYAxisValue);
|
int yaxis = myEvent.get(myYAxisValue);
|
||||||
|
@ -111,6 +106,10 @@ void Driving::update()
|
||||||
myGrayIndex = 2; // up + down
|
myGrayIndex = 2; // up + down
|
||||||
else /* if(yaxis < 16384-4096) */
|
else /* if(yaxis < 16384-4096) */
|
||||||
myGrayIndex = 0; // no movement
|
myGrayIndex = 0; // no movement
|
||||||
|
|
||||||
|
// Make sure direct gray codes from Stelladaptor stay in sync with
|
||||||
|
// simulated gray codes generated by PC keyboard or PC joystick
|
||||||
|
myCounter = myGrayIndex / SENSITIVITY * 4.0F;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Gray codes for rotation
|
// Gray codes for rotation
|
||||||
|
@ -154,3 +153,13 @@ bool Driving::setMouseControl(
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||||
|
void Driving::setSensitivity(int sensitivity)
|
||||||
|
{
|
||||||
|
BSPF::clamp(sensitivity, 1, 20, 10);
|
||||||
|
SENSITIVITY = sensitivity / 10.0F;
|
||||||
|
}
|
||||||
|
|
||||||
|
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||||
|
float Driving::SENSITIVITY = 1.0;
|
||||||
|
|
|
@ -76,9 +76,18 @@ class Driving : public Controller
|
||||||
bool setMouseControl(
|
bool setMouseControl(
|
||||||
Controller::Type xtype, int xid, Controller::Type ytype, int yid) override;
|
Controller::Type xtype, int xid, Controller::Type ytype, int yid) override;
|
||||||
|
|
||||||
|
/**
|
||||||
|
Sets the sensitivity for digital emulation of driving controlle movement
|
||||||
|
using a keyboard.
|
||||||
|
|
||||||
|
@param sensitivity Value from 1 to 20, with larger values causing
|
||||||
|
more movement (10 represents the baseline)
|
||||||
|
*/
|
||||||
|
static void setSensitivity(int sensitivity);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
// Counter to iterate through the gray codes
|
// Counter to iterate through the gray codes
|
||||||
uInt32 myCounter{0};
|
Int32 myCounter{0};
|
||||||
|
|
||||||
// Index into the gray code table
|
// Index into the gray code table
|
||||||
uInt32 myGrayIndex{0};
|
uInt32 myGrayIndex{0};
|
||||||
|
@ -98,6 +107,10 @@ class Driving : public Controller
|
||||||
// Controllers to emulate in 'specific' mouse axis mode
|
// Controllers to emulate in 'specific' mouse axis mode
|
||||||
int myControlIDX{-1}, myControlIDY{-1};
|
int myControlIDX{-1}, myControlIDY{-1};
|
||||||
|
|
||||||
|
// User-defined sensitivity; adjustable since end-users may prefer different
|
||||||
|
// speeds
|
||||||
|
static float SENSITIVITY;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
// Following constructors and assignment operators not supported
|
// Following constructors and assignment operators not supported
|
||||||
Driving() = delete;
|
Driving() = delete;
|
||||||
|
|
|
@ -29,6 +29,7 @@
|
||||||
#include "Paddles.hxx"
|
#include "Paddles.hxx"
|
||||||
#include "Lightgun.hxx"
|
#include "Lightgun.hxx"
|
||||||
#include "PointingDevice.hxx"
|
#include "PointingDevice.hxx"
|
||||||
|
#include "Driving.hxx"
|
||||||
#include "PropsSet.hxx"
|
#include "PropsSet.hxx"
|
||||||
#include "Settings.hxx"
|
#include "Settings.hxx"
|
||||||
#include "Sound.hxx"
|
#include "Sound.hxx"
|
||||||
|
@ -97,6 +98,7 @@ void EventHandler::initialize()
|
||||||
Paddles::setDigitalSensitivity(myOSystem.settings().getInt("dsense"));
|
Paddles::setDigitalSensitivity(myOSystem.settings().getInt("dsense"));
|
||||||
Paddles::setMouseSensitivity(myOSystem.settings().getInt("msense"));
|
Paddles::setMouseSensitivity(myOSystem.settings().getInt("msense"));
|
||||||
PointingDevice::setSensitivity(myOSystem.settings().getInt("tsense"));
|
PointingDevice::setSensitivity(myOSystem.settings().getInt("tsense"));
|
||||||
|
Driving::setSensitivity(myOSystem.settings().getInt("dcsense"));
|
||||||
|
|
||||||
#ifdef GUI_SUPPORT
|
#ifdef GUI_SUPPORT
|
||||||
// Set quick select delay when typing characters in listwidgets
|
// Set quick select delay when typing characters in listwidgets
|
||||||
|
|
|
@ -106,6 +106,7 @@ Settings::Settings()
|
||||||
setPermanent("psense", "20");
|
setPermanent("psense", "20");
|
||||||
setPermanent("msense", "10");
|
setPermanent("msense", "10");
|
||||||
setPermanent("tsense", "10");
|
setPermanent("tsense", "10");
|
||||||
|
setPermanent("dcsense", "10");
|
||||||
setPermanent("saport", "lr");
|
setPermanent("saport", "lr");
|
||||||
setPermanent("modcombo", "true");
|
setPermanent("modcombo", "true");
|
||||||
|
|
||||||
|
@ -124,6 +125,7 @@ Settings::Settings()
|
||||||
|
|
||||||
// ROM browser options
|
// ROM browser options
|
||||||
setPermanent("exitlauncher", "false");
|
setPermanent("exitlauncher", "false");
|
||||||
|
setPermanent("followlauncher", "false");
|
||||||
setPermanent("launcherres", Common::Size(900, 600));
|
setPermanent("launcherres", Common::Size(900, 600));
|
||||||
setPermanent("launcherfont", "medium");
|
setPermanent("launcherfont", "medium");
|
||||||
setPermanent("launcherroms", "true");
|
setPermanent("launcherroms", "true");
|
||||||
|
@ -339,6 +341,10 @@ void Settings::validate()
|
||||||
if(i < 1 || i > 20)
|
if(i < 1 || i > 20)
|
||||||
setValue("tsense", "10");
|
setValue("tsense", "10");
|
||||||
|
|
||||||
|
i = getInt("dcsense");
|
||||||
|
if(i < 1 || i > 20)
|
||||||
|
setValue("dcsense", "10");
|
||||||
|
|
||||||
i = getInt("ssinterval");
|
i = getInt("ssinterval");
|
||||||
if(i < 1) setValue("ssinterval", "2");
|
if(i < 1) setValue("ssinterval", "2");
|
||||||
else if(i > 10) setValue("ssinterval", "10");
|
else if(i > 10) setValue("ssinterval", "10");
|
||||||
|
@ -457,6 +463,8 @@ void Settings::usage() const
|
||||||
<< " -dsense <1-20> Sensitivity of digital emulated paddle movement\n"
|
<< " -dsense <1-20> Sensitivity of digital emulated paddle movement\n"
|
||||||
<< " -msense <1-20> Sensitivity of mouse emulated paddle movement\n"
|
<< " -msense <1-20> Sensitivity of mouse emulated paddle movement\n"
|
||||||
<< " -tsense <1-20> Sensitivity of mouse emulated trackball movement\n"
|
<< " -tsense <1-20> Sensitivity of mouse emulated trackball movement\n"
|
||||||
|
<< " -dcsense <1-20> Sensitivity of digital emulated driving controller\n"
|
||||||
|
<< " movement\n"
|
||||||
<< " -saport <lr|rl> How to assign virtual ports to multiple\n"
|
<< " -saport <lr|rl> How to assign virtual ports to multiple\n"
|
||||||
<< " Stelladaptor/2600-daptors\n"
|
<< " Stelladaptor/2600-daptors\n"
|
||||||
<< " -modcombo <1|0> Enable modifer key combos\n"
|
<< " -modcombo <1|0> Enable modifer key combos\n"
|
||||||
|
@ -493,6 +501,7 @@ void Settings::usage() const
|
||||||
<< " -launcherroms <1|0> Show only ROMs in the launcher (vs. all files)\n"
|
<< " -launcherroms <1|0> Show only ROMs in the launcher (vs. all files)\n"
|
||||||
<< " -romviewer <float> Show ROM info viewer at given zoom level in ROM\n"
|
<< " -romviewer <float> Show ROM info viewer at given zoom level in ROM\n"
|
||||||
<< " launcher (use 0 for off)\n"
|
<< " launcher (use 0 for off)\n"
|
||||||
|
<< " -followlauncher <0|1> Default ROM path follows launcher navigation\n"
|
||||||
<< " -lastrom <name> Last played ROM, automatically selected in\n"
|
<< " -lastrom <name> Last played ROM, automatically selected in\n"
|
||||||
<< " launcher\n"
|
<< " launcher\n"
|
||||||
<< " -romloadcount <number> Number of ROM to load next from multicard\n"
|
<< " -romloadcount <number> Number of ROM to load next from multicard\n"
|
||||||
|
|
|
@ -22,6 +22,7 @@
|
||||||
#include "Joystick.hxx"
|
#include "Joystick.hxx"
|
||||||
#include "Paddles.hxx"
|
#include "Paddles.hxx"
|
||||||
#include "PointingDevice.hxx"
|
#include "PointingDevice.hxx"
|
||||||
|
#include "Driving.hxx"
|
||||||
#include "SaveKey.hxx"
|
#include "SaveKey.hxx"
|
||||||
#include "AtariVox.hxx"
|
#include "AtariVox.hxx"
|
||||||
#include "Settings.hxx"
|
#include "Settings.hxx"
|
||||||
|
@ -156,7 +157,7 @@ void InputDialog::addDevicePortTab()
|
||||||
wid.push_back(myDejitterDiff);
|
wid.push_back(myDejitterDiff);
|
||||||
|
|
||||||
// Add paddle speed (digital emulation)
|
// Add paddle speed (digital emulation)
|
||||||
ypos += lineHeight + VGAP * 4;
|
ypos += lineHeight + VGAP * 3;
|
||||||
myDPaddleSpeed = new SliderWidget(myTab, _font, HBORDER, ypos - 1, 13 * fontWidth, lineHeight,
|
myDPaddleSpeed = new SliderWidget(myTab, _font, HBORDER, ypos - 1, 13 * fontWidth, lineHeight,
|
||||||
"Digital paddle sensitivity",
|
"Digital paddle sensitivity",
|
||||||
lwidth, kDPSpeedChanged, 4 * fontWidth, "%");
|
lwidth, kDPSpeedChanged, 4 * fontWidth, "%");
|
||||||
|
@ -165,7 +166,7 @@ void InputDialog::addDevicePortTab()
|
||||||
wid.push_back(myDPaddleSpeed);
|
wid.push_back(myDPaddleSpeed);
|
||||||
|
|
||||||
// Add trackball speed
|
// Add trackball speed
|
||||||
ypos += lineHeight + VGAP * 2;
|
ypos += lineHeight + VGAP;
|
||||||
myTrackBallSpeed = new SliderWidget(myTab, _font, HBORDER, ypos - 1, 13 * fontWidth, lineHeight,
|
myTrackBallSpeed = new SliderWidget(myTab, _font, HBORDER, ypos - 1, 13 * fontWidth, lineHeight,
|
||||||
"Trackball sensitivity",
|
"Trackball sensitivity",
|
||||||
lwidth, kTBSpeedChanged, 4 * fontWidth, "%");
|
lwidth, kTBSpeedChanged, 4 * fontWidth, "%");
|
||||||
|
@ -173,8 +174,17 @@ void InputDialog::addDevicePortTab()
|
||||||
myTrackBallSpeed->setTickmarkIntervals(4);
|
myTrackBallSpeed->setTickmarkIntervals(4);
|
||||||
wid.push_back(myTrackBallSpeed);
|
wid.push_back(myTrackBallSpeed);
|
||||||
|
|
||||||
|
// Add driving controller speed
|
||||||
|
ypos += lineHeight + VGAP;
|
||||||
|
myDrivingSpeed = new SliderWidget(myTab, _font, HBORDER, ypos - 1, 13 * fontWidth, lineHeight,
|
||||||
|
"Driving contr. sensitivity",
|
||||||
|
lwidth, kDCSpeedChanged, 4 * fontWidth, "%");
|
||||||
|
myDrivingSpeed->setMinValue(1); myDrivingSpeed->setMaxValue(20);
|
||||||
|
myDrivingSpeed->setTickmarkIntervals(4);
|
||||||
|
wid.push_back(myDrivingSpeed);
|
||||||
|
|
||||||
// Add 'allow all 4 directions' for joystick
|
// Add 'allow all 4 directions' for joystick
|
||||||
ypos += lineHeight + VGAP * 4;
|
ypos += lineHeight + VGAP * 3;
|
||||||
myAllowAll4 = new CheckboxWidget(myTab, _font, HBORDER, ypos,
|
myAllowAll4 = new CheckboxWidget(myTab, _font, HBORDER, ypos,
|
||||||
"Allow all 4 directions on joystick");
|
"Allow all 4 directions on joystick");
|
||||||
wid.push_back(myAllowAll4);
|
wid.push_back(myAllowAll4);
|
||||||
|
@ -194,7 +204,7 @@ void InputDialog::addDevicePortTab()
|
||||||
int fwidth;
|
int fwidth;
|
||||||
|
|
||||||
// Add EEPROM erase (part 1/2)
|
// Add EEPROM erase (part 1/2)
|
||||||
ypos += VGAP*4;
|
ypos += VGAP * 3;
|
||||||
fwidth = _font.getStringWidth("AtariVox/SaveKey");
|
fwidth = _font.getStringWidth("AtariVox/SaveKey");
|
||||||
lwidth = _font.getStringWidth("AtariVox/SaveKey");
|
lwidth = _font.getStringWidth("AtariVox/SaveKey");
|
||||||
new StaticTextWidget(myTab, _font, _w - HBORDER - 4 - (fwidth + lwidth) / 2, ypos,
|
new StaticTextWidget(myTab, _font, _w - HBORDER - 4 - (fwidth + lwidth) / 2, ypos,
|
||||||
|
@ -319,6 +329,8 @@ void InputDialog::loadConfig()
|
||||||
|
|
||||||
// Trackball speed
|
// Trackball speed
|
||||||
myTrackBallSpeed->setValue(instance().settings().getInt("tsense"));
|
myTrackBallSpeed->setValue(instance().settings().getInt("tsense"));
|
||||||
|
// Driving controller speed
|
||||||
|
myDrivingSpeed->setValue(instance().settings().getInt("dcsense"));
|
||||||
|
|
||||||
// AtariVox serial port
|
// AtariVox serial port
|
||||||
myAVoxPort->setText(instance().settings().getString("avoxport"));
|
myAVoxPort->setText(instance().settings().getString("avoxport"));
|
||||||
|
@ -389,6 +401,11 @@ void InputDialog::saveConfig()
|
||||||
instance().settings().setValue("tsense", sensitivity);
|
instance().settings().setValue("tsense", sensitivity);
|
||||||
PointingDevice::setSensitivity(sensitivity);
|
PointingDevice::setSensitivity(sensitivity);
|
||||||
|
|
||||||
|
// Driving controller speed
|
||||||
|
sensitivity = myDrivingSpeed->getValue();
|
||||||
|
instance().settings().setValue("dcsense", sensitivity);
|
||||||
|
Driving::setSensitivity(sensitivity);
|
||||||
|
|
||||||
// AtariVox serial port
|
// AtariVox serial port
|
||||||
instance().settings().setValue("avoxport", myAVoxPort->getText());
|
instance().settings().setValue("avoxport", myAVoxPort->getText());
|
||||||
|
|
||||||
|
@ -447,6 +464,7 @@ void InputDialog::setDefaults()
|
||||||
myDejitterBase->setValue(0);
|
myDejitterBase->setValue(0);
|
||||||
myDejitterDiff->setValue(0);
|
myDejitterDiff->setValue(0);
|
||||||
#endif
|
#endif
|
||||||
|
myDrivingSpeed->setValue(10);
|
||||||
myTrackBallSpeed->setValue(10);
|
myTrackBallSpeed->setValue(10);
|
||||||
|
|
||||||
// AtariVox serial port
|
// AtariVox serial port
|
||||||
|
@ -621,6 +639,10 @@ void InputDialog::handleCommand(CommandSender* sender, int cmd,
|
||||||
myDPaddleSpeed->setValueLabel(myDPaddleSpeed->getValue() * 10);
|
myDPaddleSpeed->setValueLabel(myDPaddleSpeed->getValue() * 10);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
case kDCSpeedChanged:
|
||||||
|
myDrivingSpeed->setValueLabel(myDrivingSpeed->getValue() * 10);
|
||||||
|
break;
|
||||||
|
|
||||||
case kTBSpeedChanged:
|
case kTBSpeedChanged:
|
||||||
myTrackBallSpeed->setValueLabel(myTrackBallSpeed->getValue() * 10);
|
myTrackBallSpeed->setValueLabel(myTrackBallSpeed->getValue() * 10);
|
||||||
break;
|
break;
|
||||||
|
|
|
@ -77,6 +77,7 @@ class InputDialog : public Dialog
|
||||||
kDejitterReChanged = 'JRch',
|
kDejitterReChanged = 'JRch',
|
||||||
kDPSpeedChanged = 'PDch',
|
kDPSpeedChanged = 'PDch',
|
||||||
kTBSpeedChanged = 'TBch',
|
kTBSpeedChanged = 'TBch',
|
||||||
|
kDCSpeedChanged = 'DCch',
|
||||||
kDBButtonPressed = 'DBbp',
|
kDBButtonPressed = 'DBbp',
|
||||||
kEEButtonPressed = 'EEbp',
|
kEEButtonPressed = 'EEbp',
|
||||||
kConfirmEEEraseCmd = 'EEcf',
|
kConfirmEEEraseCmd = 'EEcf',
|
||||||
|
@ -103,6 +104,7 @@ class InputDialog : public Dialog
|
||||||
SliderWidget* myDPaddleSpeed{nullptr};
|
SliderWidget* myDPaddleSpeed{nullptr};
|
||||||
SliderWidget* myMPaddleSpeed{nullptr};
|
SliderWidget* myMPaddleSpeed{nullptr};
|
||||||
SliderWidget* myTrackBallSpeed{nullptr};
|
SliderWidget* myTrackBallSpeed{nullptr};
|
||||||
|
SliderWidget* myDrivingSpeed{nullptr};
|
||||||
CheckboxWidget* myAllowAll4{nullptr};
|
CheckboxWidget* myAllowAll4{nullptr};
|
||||||
CheckboxWidget* myGrabMouse{nullptr};
|
CheckboxWidget* myGrabMouse{nullptr};
|
||||||
CheckboxWidget* myModCombo{nullptr};
|
CheckboxWidget* myModCombo{nullptr};
|
||||||
|
|
|
@ -179,30 +179,36 @@ LauncherDialog::LauncherDialog(OSystem& osystem, DialogContainer& parent,
|
||||||
myStartButton = new ButtonWidget(this, font, xpos, ypos, (bwidth + 0) / 4, bheight,
|
myStartButton = new ButtonWidget(this, font, xpos, ypos, (bwidth + 0) / 4, bheight,
|
||||||
"Select", kLoadROMCmd);
|
"Select", kLoadROMCmd);
|
||||||
wid.push_back(myStartButton);
|
wid.push_back(myStartButton);
|
||||||
|
|
||||||
xpos += (bwidth + 0) / 4 + BUTTON_GAP;
|
xpos += (bwidth + 0) / 4 + BUTTON_GAP;
|
||||||
myPrevDirButton = new ButtonWidget(this, font, xpos, ypos, (bwidth + 1) / 4, bheight,
|
myPrevDirButton = new ButtonWidget(this, font, xpos, ypos, (bwidth + 1) / 4, bheight,
|
||||||
"Go Up", kPrevDirCmd);
|
"Go Up", kPrevDirCmd);
|
||||||
wid.push_back(myPrevDirButton);
|
wid.push_back(myPrevDirButton);
|
||||||
|
|
||||||
xpos += (bwidth + 1) / 4 + BUTTON_GAP;
|
xpos += (bwidth + 1) / 4 + BUTTON_GAP;
|
||||||
myOptionsButton = new ButtonWidget(this, font, xpos, ypos, (bwidth + 2) / 4, bheight,
|
myOptionsButton = new ButtonWidget(this, font, xpos, ypos, (bwidth + 3) / 4, bheight,
|
||||||
"Options" + ELLIPSIS, kOptionsCmd);
|
"Options" + ELLIPSIS, kOptionsCmd);
|
||||||
wid.push_back(myOptionsButton);
|
wid.push_back(myOptionsButton);
|
||||||
|
|
||||||
xpos += (bwidth + 2) / 4 + BUTTON_GAP;
|
xpos += (bwidth + 2) / 4 + BUTTON_GAP;
|
||||||
myQuitButton = new ButtonWidget(this, font, xpos, ypos, (bwidth + 3) / 4, bheight,
|
myQuitButton = new ButtonWidget(this, font, xpos, ypos, (bwidth + 4) / 4, bheight,
|
||||||
"Quit", kQuitCmd);
|
"Quit", kQuitCmd);
|
||||||
wid.push_back(myQuitButton);
|
wid.push_back(myQuitButton);
|
||||||
#else
|
#else
|
||||||
myQuitButton = new ButtonWidget(this, font, xpos, ypos, (bwidth + 0) / 4, bheight,
|
myQuitButton = new ButtonWidget(this, font, xpos, ypos, (bwidth + 0) / 4, bheight,
|
||||||
"Quit", kQuitCmd);
|
"Quit", kQuitCmd);
|
||||||
wid.push_back(myQuitButton);
|
wid.push_back(myQuitButton);
|
||||||
|
|
||||||
xpos += (bwidth + 0) / 4 + BUTTON_GAP;
|
xpos += (bwidth + 0) / 4 + BUTTON_GAP;
|
||||||
myOptionsButton = new ButtonWidget(this, font, xpos, ypos, (bwidth + 1) / 4, bheight,
|
myOptionsButton = new ButtonWidget(this, font, xpos, ypos, (bwidth + 1) / 4, bheight,
|
||||||
"Options" + ELLIPSIS, kOptionsCmd);
|
"Options" + ELLIPSIS, kOptionsCmd);
|
||||||
wid.push_back(myOptionsButton);
|
wid.push_back(myOptionsButton);
|
||||||
|
|
||||||
xpos += (bwidth + 1) / 4 + BUTTON_GAP;
|
xpos += (bwidth + 1) / 4 + BUTTON_GAP;
|
||||||
myPrevDirButton = new ButtonWidget(this, font, xpos, ypos, (bwidth + 2) / 4, bheight,
|
myPrevDirButton = new ButtonWidget(this, font, xpos, ypos, (bwidth + 2) / 4, bheight,
|
||||||
"Go Up", kPrevDirCmd);
|
"Go Up", kPrevDirCmd);
|
||||||
wid.push_back(myPrevDirButton);
|
wid.push_back(myPrevDirButton);
|
||||||
|
|
||||||
xpos += (bwidth + 2) / 4 + BUTTON_GAP;
|
xpos += (bwidth + 2) / 4 + BUTTON_GAP;
|
||||||
myStartButton = new ButtonWidget(this, font, xpos, ypos, (bwidth + 3) / 4, bheight,
|
myStartButton = new ButtonWidget(this, font, xpos, ypos, (bwidth + 3) / 4, bheight,
|
||||||
"Select", kLoadROMCmd);
|
"Select", kLoadROMCmd);
|
||||||
|
@ -302,6 +308,13 @@ void LauncherDialog::loadConfig()
|
||||||
myList->clearFlags(Widget::FLAG_WANTS_RAWDATA); // always reset this
|
myList->clearFlags(Widget::FLAG_WANTS_RAWDATA); // always reset this
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||||
|
void LauncherDialog::saveConfig()
|
||||||
|
{
|
||||||
|
if(instance().settings().getBool("followlauncher"))
|
||||||
|
instance().settings().setValue("romdir", myList->currentDir().getShortPath());
|
||||||
|
}
|
||||||
|
|
||||||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||||
void LauncherDialog::updateUI()
|
void LauncherDialog::updateUI()
|
||||||
{
|
{
|
||||||
|
@ -571,6 +584,7 @@ void LauncherDialog::handleCommand(CommandSender* sender, int cmd,
|
||||||
|
|
||||||
case kLoadROMCmd:
|
case kLoadROMCmd:
|
||||||
case FileListWidget::ItemActivated:
|
case FileListWidget::ItemActivated:
|
||||||
|
saveConfig();
|
||||||
loadRom();
|
loadRom();
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
@ -598,6 +612,7 @@ void LauncherDialog::handleCommand(CommandSender* sender, int cmd,
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case kQuitCmd:
|
case kQuitCmd:
|
||||||
|
saveConfig();
|
||||||
close();
|
close();
|
||||||
instance().eventHandler().quit();
|
instance().eventHandler().quit();
|
||||||
break;
|
break;
|
||||||
|
@ -637,6 +652,12 @@ void LauncherDialog::loadRom()
|
||||||
instance().frameBuffer().showMessage(result, MessagePosition::MiddleCenter, true);
|
instance().frameBuffer().showMessage(result, MessagePosition::MiddleCenter, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||||
|
void LauncherDialog::setDefaultDir()
|
||||||
|
{
|
||||||
|
instance().settings().setValue("romdir", myList->currentDir().getShortPath());
|
||||||
|
}
|
||||||
|
|
||||||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||||
void LauncherDialog::openSettings()
|
void LauncherDialog::openSettings()
|
||||||
{
|
{
|
||||||
|
|
|
@ -107,6 +107,7 @@ class LauncherDialog : public Dialog
|
||||||
Event::Type getJoyAxisEvent(int stick, JoyAxis axis, JoyDir adir, int button) override;
|
Event::Type getJoyAxisEvent(int stick, JoyAxis axis, JoyDir adir, int button) override;
|
||||||
|
|
||||||
void loadConfig() override;
|
void loadConfig() override;
|
||||||
|
void saveConfig() override;
|
||||||
void updateUI();
|
void updateUI();
|
||||||
void applyFiltering();
|
void applyFiltering();
|
||||||
|
|
||||||
|
@ -117,6 +118,7 @@ class LauncherDialog : public Dialog
|
||||||
void loadRomInfo();
|
void loadRomInfo();
|
||||||
void handleContextMenu();
|
void handleContextMenu();
|
||||||
void showOnlyROMs(bool state);
|
void showOnlyROMs(bool state);
|
||||||
|
void setDefaultDir();
|
||||||
void openSettings();
|
void openSettings();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
|
@ -189,8 +189,14 @@ UIDialog::UIDialog(OSystem& osystem, DialogContainer& parent,
|
||||||
myRomPath = new EditTextWidget(myTab, font, xpos, ypos + 1,
|
myRomPath = new EditTextWidget(myTab, font, xpos, ypos + 1,
|
||||||
_w - xpos - HBORDER - 2, lineHeight, "");
|
_w - xpos - HBORDER - 2, lineHeight, "");
|
||||||
wid.push_back(myRomPath);
|
wid.push_back(myRomPath);
|
||||||
|
|
||||||
|
xpos = _w - HBORDER - font.getStringWidth("Follow Launcher path") - 24;
|
||||||
|
ypos += lineHeight + V_GAP * 2;
|
||||||
|
myFollowLauncherWidget = new CheckboxWidget(myTab, font, xpos, ypos, "Follow Launcher path");
|
||||||
|
wid.push_back(myFollowLauncherWidget);
|
||||||
|
|
||||||
xpos = HBORDER;
|
xpos = HBORDER;
|
||||||
ypos += lineHeight + V_GAP * 4;
|
ypos += V_GAP * 2;
|
||||||
|
|
||||||
// Launcher width and height
|
// Launcher width and height
|
||||||
myLauncherWidthSlider = new SliderWidget(myTab, font, xpos, ypos, "Launcher width ",
|
myLauncherWidthSlider = new SliderWidget(myTab, font, xpos, ypos, "Launcher width ",
|
||||||
|
@ -309,6 +315,9 @@ void UIDialog::loadConfig()
|
||||||
myLauncherWidthSlider->setValue(w);
|
myLauncherWidthSlider->setValue(w);
|
||||||
myLauncherHeightSlider->setValue(h);
|
myLauncherHeightSlider->setValue(h);
|
||||||
|
|
||||||
|
// Follow Launcher path
|
||||||
|
myFollowLauncherWidget->setState(settings.getBool("followlauncher"));
|
||||||
|
|
||||||
// Launcher font
|
// Launcher font
|
||||||
const string& font = settings.getString("launcherfont");
|
const string& font = settings.getString("launcherfont");
|
||||||
myLauncherFontPopup->setSelected(font, "medium");
|
myLauncherFontPopup->setSelected(font, "medium");
|
||||||
|
@ -379,6 +388,9 @@ void UIDialog::saveConfig()
|
||||||
// ROM path
|
// ROM path
|
||||||
settings.setValue("romdir", myRomPath->getText());
|
settings.setValue("romdir", myRomPath->getText());
|
||||||
|
|
||||||
|
// Follow Launcher path
|
||||||
|
settings.setValue("followlauncher", myFollowLauncherWidget->getState());
|
||||||
|
|
||||||
// Launcher size
|
// Launcher size
|
||||||
settings.setValue("launcherres",
|
settings.setValue("launcherres",
|
||||||
Common::Size(myLauncherWidthSlider->getValue(),
|
Common::Size(myLauncherWidthSlider->getValue(),
|
||||||
|
|
|
@ -54,6 +54,7 @@ class UIDialog : public Dialog, public CommandSender
|
||||||
|
|
||||||
// Launcher options
|
// Launcher options
|
||||||
EditTextWidget* myRomPath{nullptr};
|
EditTextWidget* myRomPath{nullptr};
|
||||||
|
CheckboxWidget* myFollowLauncherWidget{nullptr};
|
||||||
SliderWidget* myLauncherWidthSlider{nullptr};
|
SliderWidget* myLauncherWidthSlider{nullptr};
|
||||||
SliderWidget* myLauncherHeightSlider{nullptr};
|
SliderWidget* myLauncherHeightSlider{nullptr};
|
||||||
PopUpWidget* myLauncherFontPopup{nullptr};
|
PopUpWidget* myLauncherFontPopup{nullptr};
|
||||||
|
|
Loading…
Reference in New Issue