From 3951fbf0ee24b719cc0a14234d75a5ab552e3b4d Mon Sep 17 00:00:00 2001 From: thrust26 Date: Thu, 13 Feb 2020 20:25:54 +0100 Subject: [PATCH 1/5] attempt to fix #575 --- src/common/PJoystickHandler.cxx | 16 ++++++++++++++++ src/emucore/EventHandlerConstants.hxx | 1 + 2 files changed, 17 insertions(+) diff --git a/src/common/PJoystickHandler.cxx b/src/common/PJoystickHandler.cxx index a4084763c..0f7a90493 100644 --- a/src/common/PJoystickHandler.cxx +++ b/src/common/PJoystickHandler.cxx @@ -849,12 +849,20 @@ PhysicalJoystickHandler::EventMappingArray PhysicalJoystickHandler::DefaultRight // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - PhysicalJoystickHandler::EventMappingArray PhysicalJoystickHandler::DefaultLeftPaddlesMapping = { +#if defined(RETRON77) + {Event::PaddleZeroAnalog, JOY_CTRL_NONE, JoyAxis::Z, JoyDir::ANALOG}, +#else {Event::PaddleZeroAnalog, JOY_CTRL_NONE, JoyAxis::X, JoyDir::ANALOG}, +#endif // Current code does NOT allow digital and anlog events on the same axis at the same time //{Event::PaddleZeroDecrease, JOY_CTRL_NONE, JoyAxis::X, JoyDir::POS}, //{Event::PaddleZeroIncrease, JOY_CTRL_NONE, JoyAxis::X, JoyDir::NEG}, {Event::PaddleZeroFire, 0}, +#if defined(RETRON77) + {Event::PaddleOneAnalog, JOY_CTRL_NONE, JoyAxis::A3, JoyDir::ANALOG}, +#else {Event::PaddleOneAnalog, JOY_CTRL_NONE, JoyAxis::Y, JoyDir::ANALOG}, +#endif // Current code does NOT allow digital and anlog events on the same axis at the same //{Event::PaddleOneDecrease, JOY_CTRL_NONE, JoyAxis::Y, JoyDir::POS}, //{Event::PaddleOneIncrease, JOY_CTRL_NONE, JoyAxis::Y, JoyDir::NEG}, @@ -863,12 +871,20 @@ PhysicalJoystickHandler::EventMappingArray PhysicalJoystickHandler::DefaultLeftP // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - PhysicalJoystickHandler::EventMappingArray PhysicalJoystickHandler::DefaultRightPaddlesMapping = { +#if defined(RETRON77) + {Event::PaddleTwoAnalog, JOY_CTRL_NONE, JoyAxis::Z, JoyDir::ANALOG}, +#else {Event::PaddleTwoAnalog, JOY_CTRL_NONE, JoyAxis::X, JoyDir::ANALOG}, +#endif // Current code does NOT allow digital and anlog events on the same axis at the same //{Event::PaddleTwoDecrease, JOY_CTRL_NONE, JoyAxis::X, JoyDir::POS}, //{Event::PaddleTwoIncrease, JOY_CTRL_NONE, JoyAxis::X, JoyDir::NEG}, {Event::PaddleTwoFire, 0}, +#if defined(RETRON77) + {Event::PaddleThreeAnalog, JOY_CTRL_NONE, JoyAxis::A3, JoyDir::ANALOG}, +#else {Event::PaddleThreeAnalog, JOY_CTRL_NONE, JoyAxis::Y, JoyDir::ANALOG}, +#endif // Current code does NOT allow digital and anlog events on the same axis at the same //{Event::PaddleThreeDecrease,JOY_CTRL_NONE, JoyAxis::Y, JoyDir::POS}, //{Event::PaddleThreeIncrease,JOY_CTRL_NONE, JoyAxis::Y, JoyDir::NEG}, diff --git a/src/emucore/EventHandlerConstants.hxx b/src/emucore/EventHandlerConstants.hxx index d25d5bf67..7246983eb 100644 --- a/src/emucore/EventHandlerConstants.hxx +++ b/src/emucore/EventHandlerConstants.hxx @@ -45,6 +45,7 @@ enum class JoyAxis { X = 0, // make sure these are set correctly, Y = 1, // since they'll be used as array indices Z = 2, + A3 = 3, NONE = JOY_CTRL_NONE }; From 79940c14ca8e7412e7ad7cfcf79d779c8eba1526 Mon Sep 17 00:00:00 2001 From: thrust26 Date: Thu, 13 Feb 2020 20:56:56 +0100 Subject: [PATCH 2/5] fix overscan issue (fixes #576) --- src/gui/Launcher.cxx | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/gui/Launcher.cxx b/src/gui/Launcher.cxx index b9f75515d..eb1324f9f 100644 --- a/src/gui/Launcher.cxx +++ b/src/gui/Launcher.cxx @@ -38,11 +38,14 @@ Launcher::Launcher(OSystem& osystem) // We check those bounds now myWidth = std::max(myWidth, FBMinimum::Width); myHeight = std::max(myHeight, FBMinimum::Height); + myWidth = std::min(myWidth, d.w); + myHeight = std::min(myHeight, d.h); + // do not include overscan when launcher saving size + myOSystem.settings().setValue("launcherres", Common::Size(myWidth, myHeight)); + // now make overscan effective myWidth = std::min(myWidth, uInt32(d.w * overscan)); myHeight = std::min(myHeight, uInt32(d.h * overscan)); - myOSystem.settings().setValue("launcherres", Common::Size(myWidth, myHeight)); - myBaseDialog = new LauncherDialog(myOSystem, *this, 0, 0, myWidth, myHeight); } From 155147ccd3d6d20f46384f2961242826a623fb6e Mon Sep 17 00:00:00 2001 From: Stephen Anthony Date: Sun, 16 Feb 2020 19:29:25 -0330 Subject: [PATCH 3/5] Take titlebar into account when calculating max desktop window size (fixes #577). --- src/common/FrameBufferSDL2.cxx | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/common/FrameBufferSDL2.cxx b/src/common/FrameBufferSDL2.cxx index 19f8b36b7..d7b9ecb17 100644 --- a/src/common/FrameBufferSDL2.cxx +++ b/src/common/FrameBufferSDL2.cxx @@ -119,11 +119,21 @@ void FrameBufferSDL2::queryHardware(vector& fullscreenRes, // Now get the maximum windowed desktop resolution // Try to take into account taskbars, etc, if available #if SDL_VERSION_ATLEAST(2,0,5) + // Take window title-bar into account; SDL_GetDisplayUsableBounds doesn't do that + int wTop = 0, wLeft = 0, wBottom = 0, wRight = 0; + SDL_Window* tmpWindow = SDL_CreateWindow("", 0, 0, 0, 0, SDL_WINDOW_HIDDEN); + if(tmpWindow != nullptr) + { + SDL_GetWindowBordersSize(tmpWindow, &wTop, &wLeft, &wBottom, &wRight); + SDL_DestroyWindow(tmpWindow); + } + SDL_Rect r; for(int i = 0; i < myNumDisplays; ++i) { // Display bounds minus dock SDL_GetDisplayUsableBounds(i, &r); // Requires SDL-2.0.5 or higher + r.h -= (wTop + wBottom); windowedRes.emplace_back(r.w, r.h); } #else From d661eedf7b90f2b83f1f6ea79b5d77e260544a0b Mon Sep 17 00:00:00 2001 From: thrust26 Date: Thu, 20 Feb 2020 08:28:18 +0100 Subject: [PATCH 4/5] fix #582 --- src/gui/LauncherDialog.cxx | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/gui/LauncherDialog.cxx b/src/gui/LauncherDialog.cxx index 761c08e1c..2bca9014e 100644 --- a/src/gui/LauncherDialog.cxx +++ b/src/gui/LauncherDialog.cxx @@ -283,6 +283,8 @@ void LauncherDialog::loadConfig() if(myRomInfoWidget) myRomInfoWidget->reloadProperties(currentNode()); + + myList->clearFlags(Widget::FLAG_WANTS_RAWDATA); // always reset this } // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - From e9698aea86653077ae17b636525223813ba9052b Mon Sep 17 00:00:00 2001 From: thrust26 Date: Thu, 20 Feb 2020 08:48:14 +0100 Subject: [PATCH 5/5] fix part 1 of #583 --- src/gui/LauncherDialog.cxx | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/src/gui/LauncherDialog.cxx b/src/gui/LauncherDialog.cxx index 2bca9014e..047b4e4c5 100644 --- a/src/gui/LauncherDialog.cxx +++ b/src/gui/LauncherDialog.cxx @@ -204,11 +204,9 @@ LauncherDialog::LauncherDialog(OSystem& osystem, DialogContainer& parent, addToFocusList(wid); - // Create context menu for ROM list options - VariantList l; - VarList::push_back(l, "Power-on options" + ELLIPSIS, "override"); - VarList::push_back(l, "Reload listing", "reload"); - myMenu = make_unique(this, osystem.frameBuffer().font(), l); + // Create (empty) context menu for ROM list options + myMenu = make_unique(this, osystem.frameBuffer().font(), EmptyVarList); + // Create global props dialog, which is used to temporarily overrride // ROM properties @@ -462,8 +460,17 @@ void LauncherDialog::handleMouseDown(int x, int y, MouseButton b, int clickCount // Grab right mouse button for context menu, send left to base class if(b == MouseButton::RIGHT) { + // Dynamically create context menu for ROM list options + VariantList items; + + if (!currentNode().isDirectory() && Bankswitch::isValidRomName(currentNode())) + VarList::push_back(items, "Power-on options" + ELLIPSIS, "override"); + VarList::push_back(items, "Reload listing", "reload"); + myMenu->addItems(items); + // Add menu at current x,y mouse location myMenu->show(x + getAbsX(), y + getAbsY(), surface().dstRect()); + } else Dialog::handleMouseDown(x, y, b, clickCount);