diff --git a/Changes.txt b/Changes.txt index bd5295857..c98056fbf 100644 --- a/Changes.txt +++ b/Changes.txt @@ -14,6 +14,15 @@ 3.9.1 to 3.9.2: (August xx, 2013) + * Improved parsing of the DASM lst file for the debugger disassembly; + it sometimes missed constant declarations. + + * Changed 'usemouse' argument from a true/false option to accept + 'always', 'analog' and 'never'. This allows to use the mouse as a + controller under more specific circumstances. The default is + 'analog', which means the mouse is only used to emulate analog-like + devices (paddles, trackball, etc). + * Added ability to use bold fonts within the debugger window, which can be set with the 'dbg.boldfont' commandline argument as well as in the debugger UI Settings dialog. This is useful for those that find the diff --git a/docs/graphics/eventmapping_devsports.png b/docs/graphics/eventmapping_devsports.png index 98253baf8..ff3c663b9 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 870db8285..9f0c22a11 100644 --- a/docs/index.html +++ b/docs/index.html @@ -1984,8 +1984,10 @@ -
-usemouse <1|0>
- Use mouse as a controller as specified by ROM properties. +
-usemouse <always|analog|never>
+ Use mouse as a controller as specified by ROM properties in specific case. + Always and never are self-explanatory, analog means only for analog-type devices + (paddles, trackball, etc). @@ -2616,14 +2618,14 @@ - + + - + -
ItemBrief descriptionFor more information,
see CommandLine
Stelladaptor X isSpecifies which virtual port each Stelladaptor/2600-daptor uses (See Advanced Configuration - Stelladaptor/2600-daptor Support)-saport
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
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 sensitivitySensitvity used when emulating a paddle using a digital device-dsense
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
Use mouse as ...Allow the mouse to emulate various controllers-usemouse
@@ -2687,7 +2689,7 @@

  1. Power-on options: Selecting this option shows a dialog whereby - ROM properties can be temporarily overriden, and joystick/console buttons can be + ROM properties can be temporarily overridden, and joystick/console buttons can be temporarily held down. Selecting options from this dialog will cause all ROMs launched after that to use those properties you specify. Clicking Defaults will disable its functionality, and use ROM properties as defined by the ROM itself. The dialog is as diff --git a/src/emucore/EventHandler.cxx b/src/emucore/EventHandler.cxx index ee68855e4..d5bef88e7 100644 --- a/src/emucore/EventHandler.cxx +++ b/src/emucore/EventHandler.cxx @@ -2020,13 +2020,48 @@ void EventHandler::takeSnapshot(uInt32 number) } // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -void EventHandler::setMouseControllerMode(bool enable) +void EventHandler::setMouseControllerMode(const string& enable) { if(&myOSystem->console()) { delete myMouseControl; myMouseControl = NULL; - const string& control = enable ? + bool usemouse = false; + if(BSPF_equalsIgnoreCase(enable, "always")) + usemouse = true; + else if(BSPF_equalsIgnoreCase(enable, "never")) + usemouse = false; + else // 'analog' + { + switch(myOSystem->console().controller(Controller::Left).type()) + { + case Controller::Paddles: + case Controller::Driving: + case Controller::TrackBall22: + case Controller::TrackBall80: + case Controller::AmigaMouse: + case Controller::MindLink: + usemouse = true; + break; + default: + break; + } + switch(myOSystem->console().controller(Controller::Right).type()) + { + case Controller::Paddles: + case Controller::Driving: + case Controller::TrackBall22: + case Controller::TrackBall80: + case Controller::AmigaMouse: + case Controller::MindLink: + usemouse = true; + break; + default: + break; + } + } + + const string& control = usemouse ? myOSystem->console().properties().get(Controller_MouseAxis) : "none"; myMouseControl = new MouseControl(myOSystem->console(), control); diff --git a/src/emucore/EventHandler.hxx b/src/emucore/EventHandler.hxx index f6d669896..ab4bd11fd 100644 --- a/src/emucore/EventHandler.hxx +++ b/src/emucore/EventHandler.hxx @@ -161,8 +161,10 @@ class EventHandler the ROM properties, otherwise disable mouse control completely @param enable Whether to use the mouse to emulate controllers + Currently, this will be one of the following values: + 'always', 'analog', 'never' */ - void setMouseControllerMode(bool enable); + void setMouseControllerMode(const string& enable); /** Set the number of seconds between taking a snapshot in diff --git a/src/emucore/OSystem.cxx b/src/emucore/OSystem.cxx index da508bea9..5750ebf90 100644 --- a/src/emucore/OSystem.cxx +++ b/src/emucore/OSystem.cxx @@ -522,7 +522,7 @@ string OSystem::createConsole(const FilesystemNode& rom, const string& md5sum, ////////////////////////////////////////////////////////////////////////// myConsole->initializeAudio(); myEventHandler->reset(EventHandler::S_EMULATE); - myEventHandler->setMouseControllerMode(mySettings->getBool("usemouse")); + myEventHandler->setMouseControllerMode(mySettings->getString("usemouse")); if(createFrameBuffer() != kSuccess) // Takes care of initializeVideo() { logMessage("ERROR: Couldn't create framebuffer for console", 0); diff --git a/src/emucore/Settings.cxx b/src/emucore/Settings.cxx index 4801564d5..7b0880d8a 100644 --- a/src/emucore/Settings.cxx +++ b/src/emucore/Settings.cxx @@ -88,7 +88,7 @@ Settings::Settings(OSystem* osystem) setInternal("combomap", ""); setInternal("joydeadzone", "13"); setInternal("joyallow4", "false"); - setInternal("usemouse", "true"); + setInternal("usemouse", "analog"); setInternal("dsense", "5"); setInternal("msense", "7"); setInternal("saport", "lr"); @@ -397,7 +397,9 @@ void Settings::usage() << " -logtoconsole <1|0> Log output to console/commandline\n" << " -joydeadzone Sets 'deadzone' area for analog joysticks (0-29)\n" << " -joyallow4 <1|0> Allow all 4 directions on a joystick to be pressed simultaneously\n" - << " -usemouse <1|0> Use mouse as a controller as specified by ROM properties (see manual)\n" + << " -usemouse Use mouse as a controller as specified by ROM properties in given mode(see manual)\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 156f4d15b..abefcbac2 100644 --- a/src/gui/InputDialog.cxx +++ b/src/gui/InputDialog.cxx @@ -115,16 +115,26 @@ void InputDialog::addDevicePortTab(const GUI::Font& font) // Stelladaptor mappings xpos = 5; ypos = 5; - lwidth = font.getStringWidth("Stelladaptor port order: "); - pwidth = font.getStringWidth("left / right"); + lwidth = font.getStringWidth("Use mouse as a controller: "); + pwidth = font.getStringWidth("Analog devices"); items.clear(); - items.push_back("left / right", "lr"); - items.push_back("right / left", "rl"); + items.push_back("Left / Right", "lr"); + items.push_back("Right / Left", "rl"); mySAPort = new PopUpWidget(myTab, font, xpos, ypos, pwidth, lineHeight, items, "Stelladaptor port order: ", lwidth); wid.push_back(mySAPort); + // Use mouse as controller + ypos += lineHeight + 5; + items.clear(); + items.push_back("Always", "always"); + items.push_back("Analog devices", "analog"); + items.push_back("Never", "never"); + myMouseControl = new PopUpWidget(myTab, font, xpos, ypos, pwidth, lineHeight, items, + "Use mouse as a controller: ", lwidth); + wid.push_back(myMouseControl); + // Add AtariVox serial port ypos += lineHeight + 5; lwidth = font.getStringWidth("AVox serial port: "); @@ -188,12 +198,6 @@ void InputDialog::addDevicePortTab(const GUI::Font& font) myGrabMouse->clearFlags(WIDGET_ENABLED); #endif - // Use mouse as a controller - ypos += lineHeight + 4; - myMouseControl = new CheckboxWidget(myTab, font, xpos, ypos, - "Use mouse as a controller"); - wid.push_back(myMouseControl); - // Add items for virtual device ports addToFocusList(wid, myTab, tabID); } @@ -202,8 +206,11 @@ void InputDialog::addDevicePortTab(const GUI::Font& font) void InputDialog::loadConfig() { // Left & right ports - const string& saport = instance().settings().getString("saport"); - mySAPort->setSelectedIndex(BSPF_equalsIgnoreCase(saport, "rl") ? 1 : 0); + mySAPort->setSelected(instance().settings().getString("saport"), "lr"); + + // Use mouse as a controller + myMouseControl->setSelected( + instance().settings().getString("usemouse"), "analog"); // Joystick deadzone myDeadzone->setValue(instance().settings().getInt("joydeadzone")); @@ -224,9 +231,6 @@ void InputDialog::loadConfig() // Allow all 4 joystick directions myAllowAll4->setState(instance().settings().getBool("joyallow4")); - // Use mouse as a controller - myMouseControl->setState(instance().settings().getBool("usemouse")); - myTab->loadConfig(); } @@ -236,6 +240,11 @@ void InputDialog::saveConfig() // Left & right ports instance().eventHandler().mapStelladaptors(mySAPort->getSelectedTag().toString()); + // Use mouse as a controller + const string& usemouse = myMouseControl->getSelectedTag().toString(); + instance().settings().setValue("usemouse", usemouse); + instance().eventHandler().setMouseControllerMode(usemouse); + // Joystick deadzone int deadzone = myDeadzone->getValue(); instance().settings().setValue("joydeadzone", deadzone); @@ -260,11 +269,6 @@ void InputDialog::saveConfig() bool allowall4 = myAllowAll4->getState(); instance().settings().setValue("joyallow4", allowall4); instance().eventHandler().allowAllDirections(allowall4); - - // Use mouse as a controller - bool usemouse = myMouseControl->getState(); - instance().settings().setValue("usemouse", usemouse); - instance().eventHandler().setMouseControllerMode(usemouse); } // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -285,6 +289,9 @@ void InputDialog::setDefaults() // Left & right ports mySAPort->setSelected("lr"); + // Use mouse as a controller + myMouseControl->setSelected("analog"); + // Joystick deadzone myDeadzone->setValue(0); myDeadzoneLabel->setValue(3200); @@ -304,8 +311,6 @@ void InputDialog::setDefaults() // Allow all 4 joystick directions myAllowAll4->setState(false); - // Use mouse as a controller - myMouseControl->setState(true); break; } diff --git a/src/gui/InputDialog.hxx b/src/gui/InputDialog.hxx index 72b22777f..297900680 100644 --- a/src/gui/InputDialog.hxx +++ b/src/gui/InputDialog.hxx @@ -67,6 +67,7 @@ class InputDialog : public Dialog EventMappingWidget* myMenuEventMapper; PopUpWidget* mySAPort; + PopUpWidget* myMouseControl; EditTextWidget* myAVoxPort; @@ -78,7 +79,6 @@ class InputDialog : public Dialog StaticTextWidget* myMPaddleLabel; CheckboxWidget* myAllowAll4; CheckboxWidget* myGrabMouse; - CheckboxWidget* myMouseControl; }; #endif