mirror of https://github.com/stella-emu/stella.git
added bezel hotkeys
renamed bezel settings moved Bezel class to common
This commit is contained in:
parent
1be2526ee0
commit
3f1d5d644b
|
@ -137,24 +137,32 @@ bool Bezel::load()
|
||||||
const Int32 h = mySurface->height();
|
const Int32 h = mySurface->height();
|
||||||
uInt32 top, bottom, left, right;
|
uInt32 top, bottom, left, right;
|
||||||
|
|
||||||
if(settings.getBool("bezel.autoborders"))
|
if(settings.getBool("bezel.win.auto"))
|
||||||
{
|
{
|
||||||
// Determine transparent window inside bezel image
|
// Determine transparent window inside bezel image
|
||||||
top = borderSize(w >> 1, 0, h, w);
|
uInt32 xCenter, yCenter;
|
||||||
bottom = h - 1 - borderSize(w >> 1, h - 1, h, -w);
|
|
||||||
left = borderSize(0, (bottom + top) >> 1, w, 1);
|
xCenter = w >> 1;
|
||||||
right = w - 1 - borderSize(w - 1, (bottom + top) >> 1, w, -1);
|
top = borderSize(xCenter, 0, h, w);
|
||||||
|
bottom = h - 1 - borderSize(xCenter, h - 1, h, -w);
|
||||||
|
yCenter = (bottom + top) >> 1;
|
||||||
|
left = borderSize(0, yCenter, w, 1);
|
||||||
|
right = w - 1 - borderSize(w - 1, yCenter, w, -1);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
left = std::min(w, settings.getInt("bezel.leftborder"));
|
// BP: 13, 13, 0, 0%
|
||||||
right = w - 1 - std::min(w, settings.getInt("bezel.rightborder"));
|
// HY: 12, 12, 0, 0%
|
||||||
top = std::min(h, settings.getInt("bezel.topborder"));
|
// P1: 25, 25, 11, 22%
|
||||||
bottom = h - 1 - std::min(h, settings.getInt("bezel.bottomborder"));
|
// P2: 23, 23, 7, 20%
|
||||||
|
left = std::min(w - 1, static_cast<Int32>(w * settings.getInt("bezel.win.left") / 100. + .5));
|
||||||
|
right = w - 1 - std::min(w - 1, static_cast<Int32>(w * settings.getInt("bezel.win.right") / 100. + .5));
|
||||||
|
top = std::min(h - 1, static_cast<Int32>(h * settings.getInt("bezel.win.top") / 100. + .5));
|
||||||
|
bottom = h - 1 - std::min(h - 1, static_cast<Int32>(h * settings.getInt("bezel.win.bottom") / 100. + .5));
|
||||||
}
|
}
|
||||||
|
|
||||||
cerr << (int)(right - left + 1) << " x " << (int)(bottom - top + 1) << " = "
|
//cerr << (int)(right - left + 1) << " x " << (int)(bottom - top + 1) << " = "
|
||||||
<< double((int)(right - left + 1)) / double((int)(bottom - top + 1));
|
// << double((int)(right - left + 1)) / double((int)(bottom - top + 1));
|
||||||
|
|
||||||
// Disable bezel is no transparent window was found
|
// Disable bezel is no transparent window was found
|
||||||
if (left < right && top < bottom)
|
if (left < right && top < bottom)
|
|
@ -623,6 +623,7 @@ PhysicalKeyboardHandler::DefaultCommonMapping = {
|
||||||
#endif
|
#endif
|
||||||
{ Event::OptionsMenuMode, KBDK_TAB },
|
{ Event::OptionsMenuMode, KBDK_TAB },
|
||||||
{ Event::CmdMenuMode, KBDK_BACKSLASH },
|
{ Event::CmdMenuMode, KBDK_BACKSLASH },
|
||||||
|
{ Event::ToggleBezel, KBDK_B, KBDM_CTRL },
|
||||||
{ Event::TimeMachineMode, KBDK_T, KBDM_SHIFT },
|
{ Event::TimeMachineMode, KBDK_T, KBDM_SHIFT },
|
||||||
{ Event::DebuggerMode, KBDK_GRAVE },
|
{ Event::DebuggerMode, KBDK_GRAVE },
|
||||||
{ Event::PlusRomsSetupMode, KBDK_P, KBDM_SHIFT | KBDM_CTRL | MOD3 },
|
{ Event::PlusRomsSetupMode, KBDK_P, KBDM_SHIFT | KBDM_CTRL | MOD3 },
|
||||||
|
|
|
@ -386,6 +386,7 @@ NLOHMANN_JSON_SERIALIZE_ENUM(Event::Type, {
|
||||||
{Event::ToggleBits, "ToggleBits"},
|
{Event::ToggleBits, "ToggleBits"},
|
||||||
{Event::ToggleFixedColors, "ToggleFixedColors"},
|
{Event::ToggleFixedColors, "ToggleFixedColors"},
|
||||||
{Event::ToggleFrameStats, "ToggleFrameStats"},
|
{Event::ToggleFrameStats, "ToggleFrameStats"},
|
||||||
|
{Event::ToggleBezel, "ToggleBezel"},
|
||||||
{Event::ExitGame, "ExitGame"},
|
{Event::ExitGame, "ExitGame"},
|
||||||
{Event::SettingDecrease, "SettingDecrease"},
|
{Event::SettingDecrease, "SettingDecrease"},
|
||||||
{Event::SettingIncrease, "SettingIncrease"},
|
{Event::SettingIncrease, "SettingIncrease"},
|
||||||
|
|
|
@ -4,6 +4,7 @@ MODULE_OBJS := \
|
||||||
src/common/AudioQueue.o \
|
src/common/AudioQueue.o \
|
||||||
src/common/AudioSettings.o \
|
src/common/AudioSettings.o \
|
||||||
src/common/Base.o \
|
src/common/Base.o \
|
||||||
|
src/emucore/Bezel.o \
|
||||||
src/common/DevSettingsHandler.o \
|
src/common/DevSettingsHandler.o \
|
||||||
src/common/EventHandlerSDL2.o \
|
src/common/EventHandlerSDL2.o \
|
||||||
src/common/FBBackendSDL2.o \
|
src/common/FBBackendSDL2.o \
|
||||||
|
|
|
@ -126,7 +126,7 @@ class Event
|
||||||
ToggleBLCollision, ToggleBLBit, TogglePFCollision, TogglePFBit,
|
ToggleBLCollision, ToggleBLBit, TogglePFCollision, TogglePFBit,
|
||||||
ToggleCollisions, ToggleBits, ToggleFixedColors,
|
ToggleCollisions, ToggleBits, ToggleFixedColors,
|
||||||
|
|
||||||
ToggleFrameStats, ToggleSAPortOrder, ExitGame,
|
ToggleFrameStats, ToggleBezel, ToggleSAPortOrder, ExitGame,
|
||||||
SettingDecrease, SettingIncrease, PreviousSetting, NextSetting,
|
SettingDecrease, SettingIncrease, PreviousSetting, NextSetting,
|
||||||
ToggleAdaptRefresh, PreviousMultiCartRom,
|
ToggleAdaptRefresh, PreviousMultiCartRom,
|
||||||
// add new (after Version 4) events from here to avoid that user remapped events get overwritten
|
// add new (after Version 4) events from here to avoid that user remapped events get overwritten
|
||||||
|
|
|
@ -1517,6 +1517,14 @@ void EventHandler::handleEvent(Event::Type event, Int32 value, bool repeated)
|
||||||
if(pressed && !repeated) myOSystem.toggleTimeMachine();
|
if(pressed && !repeated) myOSystem.toggleTimeMachine();
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
case Event::ToggleBezel:
|
||||||
|
if(pressed && !repeated)
|
||||||
|
{
|
||||||
|
myOSystem.frameBuffer().toggleBezel();
|
||||||
|
myGlobalKeyHandler->setSetting(GlobalKeyHandler::Setting::BEZEL);
|
||||||
|
}
|
||||||
|
return;
|
||||||
|
|
||||||
#ifdef IMAGE_SUPPORT
|
#ifdef IMAGE_SUPPORT
|
||||||
case Event::ToggleContSnapshots:
|
case Event::ToggleContSnapshots:
|
||||||
if(pressed && !repeated) myOSystem.png().toggleContinuousSnapshots(false);
|
if(pressed && !repeated) myOSystem.png().toggleContinuousSnapshots(false);
|
||||||
|
@ -2827,6 +2835,7 @@ EventHandler::EmulActionList EventHandler::ourEmulActionList = { {
|
||||||
{ Event::ExitMode, "Exit current Stella menu/mode" },
|
{ Event::ExitMode, "Exit current Stella menu/mode" },
|
||||||
{ Event::OptionsMenuMode, "Enter Options menu UI" },
|
{ Event::OptionsMenuMode, "Enter Options menu UI" },
|
||||||
{ Event::CmdMenuMode, "Toggle Commands menu UI" },
|
{ Event::CmdMenuMode, "Toggle Commands menu UI" },
|
||||||
|
{ Event::ToggleBezel, "Toggle bezel display" },
|
||||||
{ Event::HighScoresMenuMode, "Toggle High Scores UI" },
|
{ Event::HighScoresMenuMode, "Toggle High Scores UI" },
|
||||||
{ Event::PlusRomsSetupMode, "Toggle PlusROMs setup UI" },
|
{ Event::PlusRomsSetupMode, "Toggle PlusROMs setup UI" },
|
||||||
{ Event::TogglePauseMode, "Toggle Pause mode" },
|
{ Event::TogglePauseMode, "Toggle Pause mode" },
|
||||||
|
@ -3148,7 +3157,7 @@ EventHandler::MenuActionList EventHandler::ourMenuActionList = { {
|
||||||
const Event::EventSet EventHandler::MiscEvents = {
|
const Event::EventSet EventHandler::MiscEvents = {
|
||||||
Event::Quit, Event::ReloadConsole, Event::Fry, Event::StartPauseMode,
|
Event::Quit, Event::ReloadConsole, Event::Fry, Event::StartPauseMode,
|
||||||
Event::TogglePauseMode, Event::OptionsMenuMode, Event::CmdMenuMode,
|
Event::TogglePauseMode, Event::OptionsMenuMode, Event::CmdMenuMode,
|
||||||
Event::PlusRomsSetupMode, Event::ExitMode,
|
Event::ToggleBezel, Event::PlusRomsSetupMode, Event::ExitMode,
|
||||||
Event::ToggleTurbo, Event::DecreaseSpeed, Event::IncreaseSpeed,
|
Event::ToggleTurbo, Event::DecreaseSpeed, Event::IncreaseSpeed,
|
||||||
Event::TakeSnapshot, Event::ToggleContSnapshots, Event::ToggleContSnapshotsFrame,
|
Event::TakeSnapshot, Event::ToggleContSnapshots, Event::ToggleContSnapshotsFrame,
|
||||||
// Event::MouseAxisXMove, Event::MouseAxisYMove,
|
// Event::MouseAxisXMove, Event::MouseAxisYMove,
|
||||||
|
|
|
@ -537,7 +537,7 @@ class EventHandler
|
||||||
#else
|
#else
|
||||||
REFRESH_SIZE = 0,
|
REFRESH_SIZE = 0,
|
||||||
#endif
|
#endif
|
||||||
EMUL_ACTIONLIST_SIZE = 232 + PNG_SIZE + COMBO_SIZE + REFRESH_SIZE,
|
EMUL_ACTIONLIST_SIZE = 233 + PNG_SIZE + COMBO_SIZE + REFRESH_SIZE,
|
||||||
MENU_ACTIONLIST_SIZE = 20
|
MENU_ACTIONLIST_SIZE = 20
|
||||||
;
|
;
|
||||||
|
|
||||||
|
|
|
@ -1263,6 +1263,25 @@ void FrameBuffer::switchVideoMode(int direction)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||||
|
void FrameBuffer::toggleBezel(bool toggle)
|
||||||
|
{
|
||||||
|
bool enabled = myOSystem.settings().getBool("bezel.show");
|
||||||
|
|
||||||
|
if(toggle)
|
||||||
|
{
|
||||||
|
if(myBufferType == BufferType::Emulator &&
|
||||||
|
(fullScreen() || myOSystem.settings().getBool("bezel.windowed")))
|
||||||
|
{
|
||||||
|
enabled = !enabled;
|
||||||
|
myOSystem.settings().setValue("bezel.show", enabled);
|
||||||
|
myBezel->load();
|
||||||
|
applyVideoMode();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
myOSystem.frameBuffer().showTextMessage(enabled ? "Bezel enabled" : "Bezel disabled");
|
||||||
|
}
|
||||||
|
|
||||||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||||
FBInitStatus FrameBuffer::applyVideoMode()
|
FBInitStatus FrameBuffer::applyVideoMode()
|
||||||
{
|
{
|
||||||
|
@ -1328,7 +1347,6 @@ FBInitStatus FrameBuffer::applyVideoMode()
|
||||||
return status;
|
return status;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||||
double FrameBuffer::maxWindowZoom() const
|
double FrameBuffer::maxWindowZoom() const
|
||||||
{
|
{
|
||||||
|
|
|
@ -257,6 +257,11 @@ class FrameBuffer
|
||||||
*/
|
*/
|
||||||
void switchVideoMode(int direction = +1);
|
void switchVideoMode(int direction = +1);
|
||||||
|
|
||||||
|
/**
|
||||||
|
Toggles the bezel display.
|
||||||
|
*/
|
||||||
|
void toggleBezel(bool toggle = true);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
Sets the state of the cursor (hidden or grabbed) based on the
|
Sets the state of the cursor (hidden or grabbed) based on the
|
||||||
current mode.
|
current mode.
|
||||||
|
|
|
@ -208,6 +208,8 @@ bool GlobalKeyHandler::skipAVSetting() const
|
||||||
myOSystem.settings().getInt("tv.scanlines") > 0;
|
myOSystem.settings().getInt("tv.scanlines") > 0;
|
||||||
const bool isSoftwareRenderer =
|
const bool isSoftwareRenderer =
|
||||||
myOSystem.settings().getString("video") == "software";
|
myOSystem.settings().getString("video") == "software";
|
||||||
|
const bool allowBezel =
|
||||||
|
myOSystem.settings().getBool("bezel.windowed") || isFullScreen;
|
||||||
|
|
||||||
return (mySetting == Setting::OVERSCAN && !isFullScreen)
|
return (mySetting == Setting::OVERSCAN && !isFullScreen)
|
||||||
|| (mySetting == Setting::ZOOM && isFullScreen)
|
|| (mySetting == Setting::ZOOM && isFullScreen)
|
||||||
|
@ -223,7 +225,8 @@ bool GlobalKeyHandler::skipAVSetting() const
|
||||||
&& mySetting <= Setting::NTSC_BLEEDING
|
&& mySetting <= Setting::NTSC_BLEEDING
|
||||||
&& !isCustomFilter)
|
&& !isCustomFilter)
|
||||||
|| (mySetting == Setting::SCANLINE_MASK && !hasScanlines)
|
|| (mySetting == Setting::SCANLINE_MASK && !hasScanlines)
|
||||||
|| (mySetting == Setting::INTERPOLATION && isSoftwareRenderer);
|
|| (mySetting == Setting::INTERPOLATION && isSoftwareRenderer)
|
||||||
|
|| (mySetting == Setting::BEZEL && !allowBezel);
|
||||||
}
|
}
|
||||||
|
|
||||||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||||
|
@ -391,6 +394,7 @@ GlobalKeyHandler::SettingData GlobalKeyHandler::getSettingData(const Setting set
|
||||||
{Setting::SCANLINES, {true, std::bind(&TIASurface::changeScanlineIntensity, &myOSystem.frameBuffer().tiaSurface(), _1)}},
|
{Setting::SCANLINES, {true, std::bind(&TIASurface::changeScanlineIntensity, &myOSystem.frameBuffer().tiaSurface(), _1)}},
|
||||||
{Setting::SCANLINE_MASK, {false, std::bind(&TIASurface::cycleScanlineMask, &myOSystem.frameBuffer().tiaSurface(), _1)}},
|
{Setting::SCANLINE_MASK, {false, std::bind(&TIASurface::cycleScanlineMask, &myOSystem.frameBuffer().tiaSurface(), _1)}},
|
||||||
{Setting::INTERPOLATION, {false, std::bind(&Console::toggleInter, &myOSystem.console(), _1)}},
|
{Setting::INTERPOLATION, {false, std::bind(&Console::toggleInter, &myOSystem.console(), _1)}},
|
||||||
|
{Setting::BEZEL, {false, std::bind(&FrameBuffer::toggleBezel, &myOSystem.frameBuffer(), _1)}},
|
||||||
// *** Input group ***
|
// *** Input group ***
|
||||||
{Setting::DIGITAL_DEADZONE, {true, std::bind(&PhysicalJoystickHandler::changeDigitalDeadZone, &joyHandler(), _1)}},
|
{Setting::DIGITAL_DEADZONE, {true, std::bind(&PhysicalJoystickHandler::changeDigitalDeadZone, &joyHandler(), _1)}},
|
||||||
{Setting::ANALOG_DEADZONE, {true, std::bind(&PhysicalJoystickHandler::changeAnalogPaddleDeadZone, &joyHandler(), _1)}},
|
{Setting::ANALOG_DEADZONE, {true, std::bind(&PhysicalJoystickHandler::changeAnalogPaddleDeadZone, &joyHandler(), _1)}},
|
||||||
|
|
|
@ -73,6 +73,7 @@ class GlobalKeyHandler
|
||||||
SCANLINES,
|
SCANLINES,
|
||||||
SCANLINE_MASK,
|
SCANLINE_MASK,
|
||||||
INTERPOLATION,
|
INTERPOLATION,
|
||||||
|
BEZEL,
|
||||||
// *** Input group ***
|
// *** Input group ***
|
||||||
DIGITAL_DEADZONE,
|
DIGITAL_DEADZONE,
|
||||||
ANALOG_DEADZONE,
|
ANALOG_DEADZONE,
|
||||||
|
@ -128,7 +129,7 @@ class GlobalKeyHandler
|
||||||
// *** Ranges ***
|
// *** Ranges ***
|
||||||
NUM_ADJ,
|
NUM_ADJ,
|
||||||
START_AV_ADJ = VOLUME,
|
START_AV_ADJ = VOLUME,
|
||||||
END_AV_ADJ = INTERPOLATION,
|
END_AV_ADJ = BEZEL,
|
||||||
START_INPUT_ADJ = DIGITAL_DEADZONE,
|
START_INPUT_ADJ = DIGITAL_DEADZONE,
|
||||||
END_INPUT_ADJ = MOUSE_RANGE,
|
END_INPUT_ADJ = MOUSE_RANGE,
|
||||||
START_DEBUG_ADJ = DEVELOPER,
|
START_DEBUG_ADJ = DEVELOPER,
|
||||||
|
|
|
@ -64,11 +64,11 @@ Settings::Settings()
|
||||||
setPermanent("pausedim", "true");
|
setPermanent("pausedim", "true");
|
||||||
setPermanent("bezel.show", "true");
|
setPermanent("bezel.show", "true");
|
||||||
setPermanent("bezel.windowed", "false");
|
setPermanent("bezel.windowed", "false");
|
||||||
setPermanent("bezel.autoborders", "true");
|
setPermanent("bezel.win.auto", "true");
|
||||||
setPermanent("bezel.leftborder", "0");
|
setPermanent("bezel.win.left", "12");
|
||||||
setPermanent("bezel.rightborder", "0");
|
setPermanent("bezel.win.right", "12");
|
||||||
setPermanent("bezel.topborder", "0");
|
setPermanent("bezel.win.top", "0");
|
||||||
setPermanent("bezel.bottomborder", "0");
|
setPermanent("bezel.win.bottom", "0");
|
||||||
// TIA specific options
|
// TIA specific options
|
||||||
setPermanent("tia.inter", "false");
|
setPermanent("tia.inter", "false");
|
||||||
setPermanent("tia.zoom", "3");
|
setPermanent("tia.zoom", "3");
|
||||||
|
@ -546,13 +546,14 @@ void Settings::usage()
|
||||||
<< " -turbo <1|0> Enable 'Turbo' mode for maximum emulation speed\n"
|
<< " -turbo <1|0> Enable 'Turbo' mode for maximum emulation speed\n"
|
||||||
<< " -uimessages <1|0> Show onscreen UI messages for different events\n"
|
<< " -uimessages <1|0> Show onscreen UI messages for different events\n"
|
||||||
<< " -pausedim <1|0> Enable emulation dimming in pause mode\n"
|
<< " -pausedim <1|0> Enable emulation dimming in pause mode\n"
|
||||||
<< " -bezel.show <1|0> Show bezel left and right of emulation\n"
|
<< endl
|
||||||
<< " -bezel.windowed <1|0> Show bezel in windowed modes\n"
|
<< " -bezel.show <1|0> Show bezel around emulation window\n"
|
||||||
<< " -bezel.autoborders <1|0> Automatically set bezel window borders\n"
|
<< " -bezel.windowed <1|0> Show bezel in windowed modes\n"
|
||||||
<< " -bezel.leftborder <number> Set left bezel window border\n"
|
<< " -bezel.win.auto <1|0> Automatically set bezel window position\n"
|
||||||
<< " -bezel.rightborder <number> Set right bezel window border\n"
|
<< " -bezel.win.left <0-40> Set left bezel window position [%]\n"
|
||||||
<< " -bezel.topborder <number> Set top bezel window border\n"
|
<< " -bezel.win.right <0-40> Set right bezel window position [%]\n"
|
||||||
<< " -bezel.bottomborder <number> Set bottom bezel window border\n"
|
<< " -bezel.win.top <0-40> Set top bezel window position [%]\n"
|
||||||
|
<< " -bezel.win.bottom <0-40> Set bottom bezel window position [%]\n"
|
||||||
<< endl
|
<< endl
|
||||||
#ifdef SOUND_SUPPORT
|
#ifdef SOUND_SUPPORT
|
||||||
<< " -audio.enabled <1|0> Enable audio\n"
|
<< " -audio.enabled <1|0> Enable audio\n"
|
||||||
|
|
|
@ -2,8 +2,7 @@ MODULE := src/emucore
|
||||||
|
|
||||||
MODULE_OBJS := \
|
MODULE_OBJS := \
|
||||||
src/emucore/AtariVox.o \
|
src/emucore/AtariVox.o \
|
||||||
src/emucore/Bezel.o \
|
src/emucore/Bankswitch.o \
|
||||||
src/emucore/Bankswitch.o \
|
|
||||||
src/emucore/Booster.o \
|
src/emucore/Booster.o \
|
||||||
src/emucore/Cart.o \
|
src/emucore/Cart.o \
|
||||||
src/emucore/CartARM.o \
|
src/emucore/CartARM.o \
|
||||||
|
|
|
@ -477,51 +477,47 @@ void VideoAudioDialog::addBezelTab()
|
||||||
|
|
||||||
ypos += lineHeight + VGAP * 3;
|
ypos += lineHeight + VGAP * 3;
|
||||||
myBezelShowWindowed = new CheckboxWidget(myTab, _font, xpos, ypos,
|
myBezelShowWindowed = new CheckboxWidget(myTab, _font, xpos, ypos,
|
||||||
"Show in windowed modes");
|
"Windowed modes");
|
||||||
//myBezelShowWindowed->setToolTip(Event::BezelToggle);
|
myBezelShowWindowed->setToolTip("Enable bezels in windowed modes as well.");
|
||||||
wid.push_back(myBezelShowWindowed);
|
wid.push_back(myBezelShowWindowed);
|
||||||
|
|
||||||
// Disable auto borders
|
// Disable auto borders
|
||||||
ypos += lineHeight + VGAP * 1;
|
ypos += lineHeight + VGAP * 1;
|
||||||
myManualBorders = new CheckboxWidget(myTab, _font, xpos, ypos,
|
myManualWindow = new CheckboxWidget(myTab, _font, xpos, ypos,
|
||||||
"Manual borders", kAutoBordersChanged);
|
"Manual emulation window", kAutoWindowChanged);
|
||||||
myManualBorders->setToolTip("Enable if automatic border detection fails.");
|
myManualWindow->setToolTip("Enable if automatic window detection fails.");
|
||||||
wid.push_back(myManualBorders);
|
wid.push_back(myManualWindow);
|
||||||
xpos += INDENT;
|
xpos += INDENT;
|
||||||
|
|
||||||
const int lWidth = _font.getStringWidth("Bottom ");
|
const int lWidth = _font.getStringWidth("Bottom ");
|
||||||
const int sWidth = myBezelPath->getRight() - xpos - lWidth - 5.5 * fontWidth; // _w - HBORDER - xpos - lwidth;
|
const int sWidth = myBezelPath->getRight() - xpos - lWidth - 4.5 * fontWidth; // _w - HBORDER - xpos - lwidth;
|
||||||
ypos += lineHeight + VGAP * 1;
|
ypos += lineHeight + VGAP * 1;
|
||||||
myLeftBorderSlider = new SliderWidget(myTab, _font, xpos, ypos, sWidth, lineHeight,
|
myWinLeftSlider = new SliderWidget(myTab, _font, xpos, ypos, sWidth, lineHeight,
|
||||||
"Left ", 0, 0, 5 * fontWidth, "px");
|
"Left ", 0, 0, 4 * fontWidth, "%");
|
||||||
myLeftBorderSlider->setMinValue(0); myLeftBorderSlider->setMaxValue(500);
|
myWinLeftSlider->setMinValue(0); myWinLeftSlider->setMaxValue(40);
|
||||||
myLeftBorderSlider->setTickmarkIntervals(10);
|
myWinLeftSlider->setTickmarkIntervals(4);
|
||||||
//myLeftBorderSlider->setToolTip(Event::VolumeDecrease, Event::VolumeIncrease);
|
wid.push_back(myWinLeftSlider);
|
||||||
wid.push_back(myLeftBorderSlider);
|
|
||||||
|
|
||||||
ypos += lineHeight + VGAP * 1;
|
ypos += lineHeight + VGAP * 1;
|
||||||
myRightBorderSlider = new SliderWidget(myTab, _font, xpos, ypos, sWidth, lineHeight,
|
myWinRightSlider = new SliderWidget(myTab, _font, xpos, ypos, sWidth, lineHeight,
|
||||||
"Right ", 0, 0, 5 * fontWidth, "px");
|
"Right ", 0, 0, 4 * fontWidth, "%");
|
||||||
myRightBorderSlider->setMinValue(0); myRightBorderSlider->setMaxValue(500);
|
myWinRightSlider->setMinValue(0); myWinRightSlider->setMaxValue(40);
|
||||||
myRightBorderSlider->setTickmarkIntervals(10);
|
myWinRightSlider->setTickmarkIntervals(4);
|
||||||
//myRightBorderSlider->setToolTip(Event::VolumeDecrease, Event::VolumeIncrease);
|
wid.push_back(myWinRightSlider);
|
||||||
wid.push_back(myRightBorderSlider);
|
|
||||||
|
|
||||||
ypos += lineHeight + VGAP * 1;
|
ypos += lineHeight + VGAP * 1;
|
||||||
myTopBorderSlider = new SliderWidget(myTab, _font, xpos, ypos, sWidth, lineHeight,
|
myWinTopSlider = new SliderWidget(myTab, _font, xpos, ypos, sWidth, lineHeight,
|
||||||
"Top ", 0, 0, 5 * fontWidth, "px");
|
"Top ", 0, 0, 4 * fontWidth, "%");
|
||||||
myTopBorderSlider->setMinValue(0); myTopBorderSlider->setMaxValue(250);
|
myWinTopSlider->setMinValue(0); myWinTopSlider->setMaxValue(40);
|
||||||
myTopBorderSlider->setTickmarkIntervals(5);
|
myWinTopSlider->setTickmarkIntervals(4);
|
||||||
//myTopBorderSlider->setToolTip(Event::VolumeDecrease, Event::VolumeIncrease);
|
wid.push_back(myWinTopSlider);
|
||||||
wid.push_back(myTopBorderSlider);
|
|
||||||
|
|
||||||
ypos += lineHeight + VGAP;
|
ypos += lineHeight + VGAP;
|
||||||
myBtmBorderSlider = new SliderWidget(myTab, _font, xpos, ypos, sWidth, lineHeight,
|
myWinBottomSlider = new SliderWidget(myTab, _font, xpos, ypos, sWidth, lineHeight,
|
||||||
"Bottom ", 0, 0, 5 * fontWidth, "px");
|
"Bottom ", 0, 0, 4 * fontWidth, "%");
|
||||||
myBtmBorderSlider->setMinValue(0); myBtmBorderSlider->setMaxValue(250);
|
myWinBottomSlider->setMinValue(0); myWinBottomSlider->setMaxValue(40);
|
||||||
myBtmBorderSlider->setTickmarkIntervals(5);
|
myWinBottomSlider->setTickmarkIntervals(4);
|
||||||
//myBtmBorderSlider->setToolTip(Event::VolumeDecrease, Event::VolumeIncrease);
|
wid.push_back(myWinBottomSlider);
|
||||||
wid.push_back(myBtmBorderSlider);
|
|
||||||
|
|
||||||
// Add items for tab 4
|
// Add items for tab 4
|
||||||
addToFocusList(wid, myTab, tabID);
|
addToFocusList(wid, myTab, tabID);
|
||||||
|
@ -774,11 +770,11 @@ void VideoAudioDialog::loadConfig()
|
||||||
myBezelEnableCheckbox->setState(settings.getBool("bezel.show"));
|
myBezelEnableCheckbox->setState(settings.getBool("bezel.show"));
|
||||||
myBezelPath->setText(settings.getString("bezel.dir"));
|
myBezelPath->setText(settings.getString("bezel.dir"));
|
||||||
myBezelShowWindowed->setState(settings.getBool("bezel.windowed"));
|
myBezelShowWindowed->setState(settings.getBool("bezel.windowed"));
|
||||||
myManualBorders->setState(!settings.getBool("bezel.autoborders"));
|
myManualWindow->setState(!settings.getBool("bezel.win.auto"));
|
||||||
myLeftBorderSlider->setValue(settings.getInt("bezel.leftborder"));
|
myWinLeftSlider->setValue(settings.getInt("bezel.win.left"));
|
||||||
myRightBorderSlider->setValue(settings.getInt("bezel.rightborder"));
|
myWinRightSlider->setValue(settings.getInt("bezel.win.right"));
|
||||||
myTopBorderSlider->setValue(settings.getInt("bezel.topborder"));
|
myWinTopSlider->setValue(settings.getInt("bezel.win.top"));
|
||||||
myBtmBorderSlider->setValue(settings.getInt("bezel.bottomborder"));
|
myWinBottomSlider->setValue(settings.getInt("bezel.win.bottom"));
|
||||||
handleBezelChange();
|
handleBezelChange();
|
||||||
|
|
||||||
/////////////////////////////////////////////////////////////////////////////
|
/////////////////////////////////////////////////////////////////////////////
|
||||||
|
@ -909,11 +905,11 @@ void VideoAudioDialog::saveConfig()
|
||||||
settings.setValue("bezel.show", myBezelEnableCheckbox->getState());
|
settings.setValue("bezel.show", myBezelEnableCheckbox->getState());
|
||||||
settings.setValue("bezel.dir", myBezelPath->getText());
|
settings.setValue("bezel.dir", myBezelPath->getText());
|
||||||
settings.setValue("bezel.windowed", myBezelShowWindowed->getState());
|
settings.setValue("bezel.windowed", myBezelShowWindowed->getState());
|
||||||
settings.setValue("bezel.autoborders", !myManualBorders->getState());
|
settings.setValue("bezel.win.auto", !myManualWindow->getState());
|
||||||
settings.setValue("bezel.leftborder", myLeftBorderSlider->getValueLabel());
|
settings.setValue("bezel.win.left", myWinLeftSlider->getValueLabel());
|
||||||
settings.setValue("bezel.rightborder", myRightBorderSlider->getValueLabel());
|
settings.setValue("bezel.win.right", myWinRightSlider->getValueLabel());
|
||||||
settings.setValue("bezel.topborder", myTopBorderSlider->getValueLabel());
|
settings.setValue("bezel.win.top", myWinTopSlider->getValueLabel());
|
||||||
settings.setValue("bezel.bottomborder", myBtmBorderSlider->getValueLabel());
|
settings.setValue("bezel.win.bottom", myWinBottomSlider->getValueLabel());
|
||||||
|
|
||||||
// Note: The following has to happen after all video related setting have been saved
|
// Note: The following has to happen after all video related setting have been saved
|
||||||
if(instance().hasConsole())
|
if(instance().hasConsole())
|
||||||
|
@ -1053,7 +1049,7 @@ void VideoAudioDialog::setDefaults()
|
||||||
myBezelEnableCheckbox->setState(true);
|
myBezelEnableCheckbox->setState(true);
|
||||||
myBezelPath->setText(instance().userDir().getShortPath());
|
myBezelPath->setText(instance().userDir().getShortPath());
|
||||||
myBezelShowWindowed->setState(false);
|
myBezelShowWindowed->setState(false);
|
||||||
myManualBorders->setState(false);
|
myManualWindow->setState(false);
|
||||||
handleBezelChange();
|
handleBezelChange();
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
@ -1223,15 +1219,15 @@ void VideoAudioDialog::handlePhosphorChange()
|
||||||
void VideoAudioDialog::handleBezelChange()
|
void VideoAudioDialog::handleBezelChange()
|
||||||
{
|
{
|
||||||
const bool enable = myBezelEnableCheckbox->getState();
|
const bool enable = myBezelEnableCheckbox->getState();
|
||||||
const bool nonAuto = myManualBorders->getState();
|
const bool nonAuto = myManualWindow->getState();
|
||||||
|
|
||||||
myOpenBrowserButton->setEnabled(enable);
|
myOpenBrowserButton->setEnabled(enable);
|
||||||
myBezelPath->setEnabled(enable);
|
myBezelPath->setEnabled(enable);
|
||||||
myBezelShowWindowed->setEnabled(enable);
|
myBezelShowWindowed->setEnabled(enable);
|
||||||
myLeftBorderSlider->setEnabled(enable && nonAuto);
|
myWinLeftSlider->setEnabled(enable && nonAuto);
|
||||||
myRightBorderSlider->setEnabled(enable && nonAuto);
|
myWinRightSlider->setEnabled(enable && nonAuto);
|
||||||
myTopBorderSlider->setEnabled(enable && nonAuto);
|
myWinTopSlider->setEnabled(enable && nonAuto);
|
||||||
myBtmBorderSlider->setEnabled(enable && nonAuto);
|
myWinBottomSlider->setEnabled(enable && nonAuto);
|
||||||
}
|
}
|
||||||
|
|
||||||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||||
|
@ -1350,7 +1346,7 @@ void VideoAudioDialog::handleCommand(CommandSender* sender, int cmd,
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case kBezelEnableChanged:
|
case kBezelEnableChanged:
|
||||||
case kAutoBordersChanged:
|
case kAutoWindowChanged:
|
||||||
handleBezelChange();
|
handleBezelChange();
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
|
|
@ -135,11 +135,11 @@ class VideoAudioDialog : public Dialog
|
||||||
ButtonWidget* myOpenBrowserButton{nullptr};
|
ButtonWidget* myOpenBrowserButton{nullptr};
|
||||||
EditTextWidget* myBezelPath{nullptr};
|
EditTextWidget* myBezelPath{nullptr};
|
||||||
CheckboxWidget* myBezelShowWindowed{nullptr};
|
CheckboxWidget* myBezelShowWindowed{nullptr};
|
||||||
CheckboxWidget* myManualBorders{nullptr};
|
CheckboxWidget* myManualWindow{nullptr};
|
||||||
SliderWidget* myLeftBorderSlider{nullptr};
|
SliderWidget* myWinLeftSlider{nullptr};
|
||||||
SliderWidget* myRightBorderSlider{nullptr};
|
SliderWidget* myWinRightSlider{nullptr};
|
||||||
SliderWidget* myTopBorderSlider{nullptr};
|
SliderWidget* myWinTopSlider{nullptr};
|
||||||
SliderWidget* myBtmBorderSlider{nullptr};
|
SliderWidget* myWinBottomSlider{nullptr};
|
||||||
|
|
||||||
// Audio
|
// Audio
|
||||||
CheckboxWidget* mySoundEnableCheckbox{nullptr};
|
CheckboxWidget* mySoundEnableCheckbox{nullptr};
|
||||||
|
@ -183,7 +183,7 @@ class VideoAudioDialog : public Dialog
|
||||||
|
|
||||||
kBezelEnableChanged = 'BZen',
|
kBezelEnableChanged = 'BZen',
|
||||||
kChooseBezelDirCmd = 'BZsl',
|
kChooseBezelDirCmd = 'BZsl',
|
||||||
kAutoBordersChanged = 'BZab',
|
kAutoWindowChanged = 'BZab',
|
||||||
|
|
||||||
kSoundEnableChanged = 'ADse',
|
kSoundEnableChanged = 'ADse',
|
||||||
kDeviceChanged = 'ADdc',
|
kDeviceChanged = 'ADdc',
|
||||||
|
|
|
@ -734,6 +734,7 @@
|
||||||
<ClCompile Include="..\..\common\audio\LanczosResampler.cxx" />
|
<ClCompile Include="..\..\common\audio\LanczosResampler.cxx" />
|
||||||
<ClCompile Include="..\..\common\audio\SimpleResampler.cxx" />
|
<ClCompile Include="..\..\common\audio\SimpleResampler.cxx" />
|
||||||
<ClCompile Include="..\..\common\Base.cxx" />
|
<ClCompile Include="..\..\common\Base.cxx" />
|
||||||
|
<ClCompile Include="..\..\common\Bezel.cxx" />
|
||||||
<ClCompile Include="..\..\common\DevSettingsHandler.cxx" />
|
<ClCompile Include="..\..\common\DevSettingsHandler.cxx" />
|
||||||
<ClCompile Include="..\..\common\EventHandlerSDL2.cxx" />
|
<ClCompile Include="..\..\common\EventHandlerSDL2.cxx" />
|
||||||
<ClCompile Include="..\..\common\FBBackendSDL2.cxx" />
|
<ClCompile Include="..\..\common\FBBackendSDL2.cxx" />
|
||||||
|
@ -993,7 +994,6 @@
|
||||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug-NoDebugger|x64'">true</ExcludedFromBuild>
|
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug-NoDebugger|x64'">true</ExcludedFromBuild>
|
||||||
</ClCompile>
|
</ClCompile>
|
||||||
<ClCompile Include="..\..\emucore\Bankswitch.cxx" />
|
<ClCompile Include="..\..\emucore\Bankswitch.cxx" />
|
||||||
<ClCompile Include="..\..\emucore\Bezel.cxx" />
|
|
||||||
<ClCompile Include="..\..\emucore\Cart03E0.cxx" />
|
<ClCompile Include="..\..\emucore\Cart03E0.cxx" />
|
||||||
<ClCompile Include="..\..\emucore\Cart3EPlus.cxx" />
|
<ClCompile Include="..\..\emucore\Cart3EPlus.cxx" />
|
||||||
<ClCompile Include="..\..\emucore\Cart3EX.cxx" />
|
<ClCompile Include="..\..\emucore\Cart3EX.cxx" />
|
||||||
|
@ -2051,6 +2051,7 @@
|
||||||
<ClInclude Include="..\..\common\audio\Resampler.hxx" />
|
<ClInclude Include="..\..\common\audio\Resampler.hxx" />
|
||||||
<ClInclude Include="..\..\common\audio\SimpleResampler.hxx" />
|
<ClInclude Include="..\..\common\audio\SimpleResampler.hxx" />
|
||||||
<ClInclude Include="..\..\common\Base.hxx" />
|
<ClInclude Include="..\..\common\Base.hxx" />
|
||||||
|
<ClInclude Include="..\..\common\Bezel.hxx" />
|
||||||
<ClInclude Include="..\..\common\bspf.hxx" />
|
<ClInclude Include="..\..\common\bspf.hxx" />
|
||||||
<ClInclude Include="..\..\common\DevSettingsHandler.hxx" />
|
<ClInclude Include="..\..\common\DevSettingsHandler.hxx" />
|
||||||
<ClInclude Include="..\..\common\EventHandlerSDL2.hxx" />
|
<ClInclude Include="..\..\common\EventHandlerSDL2.hxx" />
|
||||||
|
@ -2321,7 +2322,6 @@
|
||||||
<ClInclude Include="..\..\emucore\AmigaMouse.hxx" />
|
<ClInclude Include="..\..\emucore\AmigaMouse.hxx" />
|
||||||
<ClInclude Include="..\..\emucore\AtariMouse.hxx" />
|
<ClInclude Include="..\..\emucore\AtariMouse.hxx" />
|
||||||
<ClInclude Include="..\..\emucore\Bankswitch.hxx" />
|
<ClInclude Include="..\..\emucore\Bankswitch.hxx" />
|
||||||
<ClInclude Include="..\..\emucore\Bezel.hxx" />
|
|
||||||
<ClInclude Include="..\..\emucore\Cart03E0.hxx" />
|
<ClInclude Include="..\..\emucore\Cart03E0.hxx" />
|
||||||
<ClInclude Include="..\..\emucore\Cart3EPlus.hxx" />
|
<ClInclude Include="..\..\emucore\Cart3EPlus.hxx" />
|
||||||
<ClInclude Include="..\..\emucore\Cart3EX.hxx" />
|
<ClInclude Include="..\..\emucore\Cart3EX.hxx" />
|
||||||
|
|
|
@ -1209,8 +1209,8 @@
|
||||||
<ClCompile Include="..\..\debugger\gui\Cart03E0Widget.cxx">
|
<ClCompile Include="..\..\debugger\gui\Cart03E0Widget.cxx">
|
||||||
<Filter>Source Files\debugger\gui</Filter>
|
<Filter>Source Files\debugger\gui</Filter>
|
||||||
</ClCompile>
|
</ClCompile>
|
||||||
<ClCompile Include="..\..\emucore\Bezel.cxx">
|
<ClCompile Include="..\..\common\Bezel.cxx">
|
||||||
<Filter>Source Files\emucore</Filter>
|
<Filter>Source Files</Filter>
|
||||||
</ClCompile>
|
</ClCompile>
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
|
@ -2468,8 +2468,8 @@
|
||||||
<ClInclude Include="..\..\debugger\gui\Cart03E0Widget.hxx">
|
<ClInclude Include="..\..\debugger\gui\Cart03E0Widget.hxx">
|
||||||
<Filter>Header Files\debugger\gui</Filter>
|
<Filter>Header Files\debugger\gui</Filter>
|
||||||
</ClInclude>
|
</ClInclude>
|
||||||
<ClInclude Include="..\..\emucore\Bezel.hxx">
|
<ClInclude Include="..\..\common\Bezel.hxx">
|
||||||
<Filter>Header Files\emucore</Filter>
|
<Filter>Header Files</Filter>
|
||||||
</ClInclude>
|
</ClInclude>
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
|
|
Loading…
Reference in New Issue