diff --git a/Changes.txt b/Changes.txt index a5ed881b4..70c719aae 100644 --- a/Changes.txt +++ b/Changes.txt @@ -14,6 +14,10 @@ 4.6.1 to 4.7: (mmm dd, 2015) + * Changed 'hidecursor' commandline argument (and associated UI item) to + 'cursor'. The new argument allows to set mouse cursor visibility + separately for both UI and emulation modes. + * Fixed memory leak; the game console wasn't being closed after exiting a ROM. diff --git a/docs/graphics/eventmapping_devsports.png b/docs/graphics/eventmapping_devsports.png index af7762d98..7d5302fe6 100644 Binary files a/docs/graphics/eventmapping_devsports.png and b/docs/graphics/eventmapping_devsports.png differ diff --git a/docs/index.html b/docs/index.html index 9669aeb1b..32d3a9f6b 100644 --- a/docs/index.html +++ b/docs/index.html @@ -10,7 +10,7 @@

A multi-platform Atari 2600 VCS emulator

-

Release 4.6.1

+

Release 4.7



User's Guide

@@ -54,7 +54,7 @@


-
February 1999 - April 2015
+
February 1999 - July 2015
The Stella Team
Stella Homepage
@@ -1972,8 +1972,8 @@ -
-hidecursor <1|0>
- Always hide the mouse cursor, or show it when appropriate. +
-cursor <0|1|2|3>
+ Set mouse cursor state in UI/emulation modes. @@ -2610,13 +2610,13 @@ ItemBrief descriptionFor more information,
see CommandLine Stelladaptor port orderSpecifies which virtual port each Stelladaptor/2600-daptor uses (See Advanced Configuration - Stelladaptor/2600-daptor Support)-saport Use mouse as ...Allow the mouse to emulate various controllers-usemouse + Mouse cursor visibilityShow/hide cursor depending on current state-cursor AVox serial portDescribed in further detail in Advanced Configuration - AtariVox/SaveKey Support -avoxport Joy deadzone sizeDeadzone area for axes on joysticks/gamepads-joydeadzone Digital paddle sensitivitySensitivity used when emulating a paddle using a digital device-dsense Mouse paddle sensitivitySensitivity used when emulating a paddle using a mouse-msense Allow all 4 ...Allow all 4 joystick directions to be pressed simultaneously-joyallow4 Grab mouse ...Keep mouse in window in emulation mode-grabmouse - Always hide mouse ...Completely disable showing the mouse cursor-hidemouse Use Control key combosEnable using Control key in keyboard actions-ctrlcombo Show Joystick DatabaseShow all joysticks that Stella knows about, with the option to remove them  diff --git a/src/emucore/FrameBuffer.cxx b/src/emucore/FrameBuffer.cxx index 660d52333..b853cec2e 100644 --- a/src/emucore/FrameBuffer.cxx +++ b/src/emucore/FrameBuffer.cxx @@ -593,12 +593,19 @@ bool FrameBuffer::changeWindowedVidMode(int direction) // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - void FrameBuffer::setCursorState() { - // Always grab mouse in emulation (if enabled), - // and don't show the cursor during emulation (if enabled) + // Always grab mouse in emulation (if enabled) bool emulation = myOSystem.eventHandler().state() == EventHandler::S_EMULATE; grabMouse(emulation && myOSystem.settings().getBool("grabmouse")); - showCursor(!(emulation || myOSystem.settings().getBool("hidecursor"))); + + // Show/hide cursor in UI/emulation mode based on 'cursor' setting + switch(myOSystem.settings().getInt("cursor")) + { + case 0: showCursor(false); break; + case 1: showCursor(emulation); break; + case 2: showCursor(!emulation); break; + case 3: showCursor(true); break; + } } // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/src/emucore/Settings.cxx b/src/emucore/Settings.cxx index 3098607cf..a4db46735 100644 --- a/src/emucore/Settings.cxx +++ b/src/emucore/Settings.cxx @@ -84,7 +84,7 @@ Settings::Settings(OSystem& osystem) setInternal("joyallow4", "false"); setInternal("usemouse", "analog"); setInternal("grabmouse", "true"); - setInternal("hidecursor", "false"); + setInternal("cursor", "2"); setInternal("dsense", "5"); setInternal("msense", "7"); setInternal("saport", "lr"); @@ -296,6 +296,10 @@ void Settings::validate() if(i < 1) setInternal("dsense", "1"); else if(i > 10) setInternal("dsense", "10"); + i = getInt("cursor"); + if(i < 0 || i > 3) + setInternal("cursor", "2"); + i = getInt("dsense"); if(i < 1) setInternal("dsense", "1"); else if(i > 10) setInternal("dsense", "10"); @@ -393,7 +397,7 @@ void Settings::usage() const << " analog|\n" << " never> Use mouse as a controller as specified by ROM properties in given mode(see manual)\n" << " -grabmouse <1|0> Locks the mouse cursor in the TIA window\n" - << " -hidecursor <1|0> Always hide the cursor, or show it when appropriate\n" + << " -cursor <0,1,2,3> Set cursor state in UI/emulation modes\n" << " -dsense Sensitivity of digital emulated paddle movement (1-10)\n" << " -msense Sensitivity of mouse emulated paddle movement (1-15)\n" << " -saport How to assign virtual ports to multiple Stelladaptor/2600-daptors\n" diff --git a/src/gui/InputDialog.cxx b/src/gui/InputDialog.cxx index eb8cbc704..9dc7e90cc 100644 --- a/src/gui/InputDialog.cxx +++ b/src/gui/InputDialog.cxx @@ -112,7 +112,7 @@ void InputDialog::addDevicePortTab(const GUI::Font& font) // Stelladaptor mappings xpos = 5; ypos = 5; lwidth = font.getStringWidth("Use mouse as a controller: "); - pwidth = font.getStringWidth("Analog devices"); + pwidth = font.getStringWidth("-UI, -Emulation"); VarList::push_back(items, "Left / Right", "lr"); VarList::push_back(items, "Right / Left", "rl"); @@ -130,6 +130,20 @@ void InputDialog::addDevicePortTab(const GUI::Font& font) "Use mouse as a controller: ", lwidth); wid.push_back(myMouseControl); + // Mouse cursor state + ypos += lineHeight + 5; + items.clear(); + VarList::push_back(items, "-UI, -Emulation", "0"); + VarList::push_back(items, "-UI, +Emulation", "1"); + VarList::push_back(items, "+UI, -Emulation", "2"); + VarList::push_back(items, "+UI, +Emulation", "3"); + myCursorState = new PopUpWidget(myTab, font, xpos, ypos, pwidth, lineHeight, items, + "Mouse cursor visibility: ", lwidth); + wid.push_back(myCursorState); +#ifndef WINDOWED_SUPPORT + myCursorState->clearFlags(WIDGET_ENABLED); +#endif + // Add AtariVox serial port ypos += lineHeight + 5; lwidth = font.getStringWidth("AVox serial port: "); @@ -193,15 +207,6 @@ void InputDialog::addDevicePortTab(const GUI::Font& font) myGrabMouse->clearFlags(WIDGET_ENABLED); #endif - // Hide mouse cursor - ypos += lineHeight + 4; - myHideCursor = new CheckboxWidget(myTab, font, xpos, ypos, - "Always hide mouse cursor"); - wid.push_back(myHideCursor); -#ifndef WINDOWED_SUPPORT - myHideCursor->clearFlags(WIDGET_ENABLED); -#endif - // Enable/disable control key-combos ypos += lineHeight + 4; myCtrlCombo = new CheckboxWidget(myTab, font, xpos, ypos, @@ -229,6 +234,9 @@ void InputDialog::loadConfig() myMouseControl->setSelected( instance().settings().getString("usemouse"), "analog"); + // Mouse cursor state + myCursorState->setSelected(instance().settings().getString("cursor"), "2"); + // Joystick deadzone myDeadzone->setValue(instance().settings().getInt("joydeadzone")); myDeadzoneLabel->setValue(Joystick::deadzone()); @@ -248,9 +256,6 @@ void InputDialog::loadConfig() // Grab mouse myGrabMouse->setState(instance().settings().getBool("grabmouse")); - // Hide cursor - myHideCursor->setState(instance().settings().getBool("hidecursor")); - // Enable/disable control key-combos myCtrlCombo->setState(instance().settings().getBool("ctrlcombo")); @@ -290,8 +295,9 @@ void InputDialog::saveConfig() instance().eventHandler().allowAllDirections(allowall4); // Grab mouse and hide cursor + const string& cursor = myCursorState->getSelectedTag().toString(); + instance().settings().setValue("cursor", cursor); instance().settings().setValue("grabmouse", myGrabMouse->getState()); - instance().settings().setValue("hidecursor", myHideCursor->getState()); instance().frameBuffer().setCursorState(); // Enable/disable control key-combos @@ -319,6 +325,9 @@ void InputDialog::setDefaults() // Use mouse as a controller myMouseControl->setSelected("analog"); + // Mouse cursor state + myCursorState->setSelected("2"); + // Joystick deadzone myDeadzone->setValue(0); myDeadzoneLabel->setValue(3200); @@ -338,9 +347,6 @@ void InputDialog::setDefaults() // Grab mouse myGrabMouse->setState(true); - // Hide cursor - myHideCursor->setState(false); - // Enable/disable control key-combos myCtrlCombo->setState(true); diff --git a/src/gui/InputDialog.hxx b/src/gui/InputDialog.hxx index 9c08a96fd..47f6bb536 100644 --- a/src/gui/InputDialog.hxx +++ b/src/gui/InputDialog.hxx @@ -70,6 +70,7 @@ class InputDialog : public Dialog PopUpWidget* mySAPort; PopUpWidget* myMouseControl; + PopUpWidget* myCursorState; EditTextWidget* myAVoxPort; @@ -81,7 +82,6 @@ class InputDialog : public Dialog StaticTextWidget* myMPaddleLabel; CheckboxWidget* myAllowAll4; CheckboxWidget* myGrabMouse; - CheckboxWidget* myHideCursor; CheckboxWidget* myCtrlCombo; ButtonWidget* myJoyDlgButton; diff --git a/src/gui/JoystickDialog.cxx b/src/gui/JoystickDialog.cxx index 253393bdc..32b7dfd9a 100644 --- a/src/gui/JoystickDialog.cxx +++ b/src/gui/JoystickDialog.cxx @@ -41,6 +41,7 @@ JoystickDialog::JoystickDialog(GuiObject* boss, const GUI::Font& font, int w = _w - 2 * xpos; int h = _h - buttonHeight - ypos - 20; myJoyList = new StringListWidget(this, font, xpos, ypos, w, h); + myJoyList->setEditable(false); wid.push_back(myJoyList); // Joystick ID