Commit Graph

84 Commits

Author SHA1 Message Date
a153c7cb7c DolphinQt: Use global settings object also for debugger settings.
A number of settings in the `debugger` group were wrongly using a newly
constructed `QSettings` object instead of the singleton object that
`GetQSettings()` provides.

This made the application create a spurious, extra configuration file in
the user directory:

```
~/.config/Dolphin Emulator/dolphin-emu.conf
```

Notice that,  by default, the application configuration files are stored
in `~/.config/dolphin-emu`; not in `~/.config/Dolphin Emulator`.
2025-01-30 22:02:03 +00:00
110d32729e Simplify std::find with Common::Contains
In NandPaths.cpp, the `std::initializer_list<char>` of illegal characters has been turned into a `char[]` (similar to the one in GameList.cpp).

The reverse iteration in ResourcePack.cpp seemed to provide no benefits, and doing without it it seemed to have no ill effects.
2025-01-01 09:52:03 -08:00
be0b13da97 Simplify std::remove with std::erase
`std::erase` is a replacement for the remove-erase idiom.

Changes to `OpenModeToAndroid` inadvertently revealed that the prior implementation had UB (potentially deleting the end iterator). This is now fixed.
2024-10-17 18:38:34 -07:00
5e8f5afb52 DolphinQt: Remove unneeded Win32 code
Dolphin already uses QStyleHints::colorScheme to detect dark mode,
so this code is now redundant.
2024-09-27 10:41:01 +01:00
d9336a5de0 GeneralPane: Add BalloonTip to cheats checkbox 2024-07-29 14:00:46 -07:00
f29fe15d77 FrameAdvance: Fix continuous frame advancing while the debug UI is open. Blocks signals from being spammed to update the UI. 2024-06-26 16:19:03 -07:00
0f659508ea DolphinQt: fix two -Wunused-lambda-capture warnings
Also clean up signals a bit.
2024-06-23 00:13:58 +01:00
22aa88109f Use a stub AchivementManager when USE_RETRO_ACHIEVEMENTS isn't defined
This lets us reduce the number of USE_RETRO_ACHIEVEMENTS ifdefs in the
code base, reducing visual clutter. In particular, needing an ifdef for
each call to IsHardcodeModeActive was annoying to me. This also reduces
the risk that someone writes code that accidentally fails to compile
with USE_RETRO_ACHIEVEMENTS disabled.

We could cut down on ifdefs even further by making HardcodeWarningWidget
always exist, but that would result in non-trivial code ending up in the
binary even with USE_RETRO_ACHIEVEMENTS disabled, so I'm leaving it out
of this PR. It's not a lot of code though, so I might end up revisiting
it at some point.
2024-06-06 08:26:20 +02:00
33b64d6c91 InterfacePane: Add BalloonTip to cursor visible radio buttons 2024-05-31 19:09:00 +02:00
a581fa2bfa InterfacePane: Add BalloonTip to lock mouse checkbox 2024-05-31 19:07:33 +02:00
266bbeefc8 InterfacePane: Add BalloonTip to top window checkbox 2024-05-31 18:52:22 +02:00
55aaa323ec InterfacePane: Add BalloonTip to theme combobox 2024-05-31 18:52:13 +02:00
ad969dfc0d Disabled Hardcore Mode when Achievements disabled
Bugfix for hardcore-disabled items being disabled when hardcore was true but achievement integration was false, which should mean hardcore is effectively disabled. Now everything checks the IsHardcoreModeActive method in AchievementManager which processes the setting AND the game state to determine if hardcore mode is actually active.
2024-05-02 04:44:52 -04:00
773ffd04b8 Merge pull request #11497 from vyuuui/debugger_assembler_ui
Built-in assembler for debugger interface
2023-12-16 21:15:31 +00:00
38c15df464 Parser and Assembler implementations 2023-12-13 05:32:20 -08:00
cb2fa9a1f2 Disable Debug Mode in hardcore mode
Debug Mode gives players direct read and write access to memory, which could be used to completely manipulate RetroAchievements logic and therefore is not allowed in hardcore mode.
2023-12-02 16:41:16 -05:00
8f55c28472 DolphinQt/Settings: Add option to force the light or dark style on Windows. 2023-11-05 12:59:32 +01:00
6d585b6eb6 DolphinQt/Settings: Split setting of the user style into two functions.
This makes it so that if you just want to reload the current style (eg. on program start, or in response to a system event), you don't need to know the name of the currently selected user style. It's also more consistent with the way the 'userstyle/enabled' flag works.
2023-11-05 12:58:11 +01:00
24012cfc7f DolphinQt: Adjust panel-specific colors and syntax highlighting for dark theme. 2023-08-12 19:43:12 +02:00
d725aaa5bc DolphinQt: Set the application palette to a matching one when the Windows dark theme is in use. 2023-08-12 16:54:54 +02:00
250d5f55de DolphinQt: Switch dark/light theme when Windows theme changes. 2023-08-12 16:54:54 +02:00
adbe56ce15 DolphinQt: Auto-load embedded dark theme on Windows if the user uses a system-wide dark theme. 2023-08-12 16:54:53 +02:00
5d33f2abd1 DolphinQt: On Windows, detect whether the system is using a dark theme.
Co-authored-by: FearlessTobi <thm.frey@gmail.com>
2023-08-12 16:54:53 +02:00
b3c9f49cbe Core: Assert that only the Host thread may call PauseAndLock(). 2023-06-02 18:51:43 +02:00
801fa8e905 Only force-show the code widget when first enabling the debugger
Before, any call of Settings::SetDebugModeEnabled(true) would show it. This means that if the debugging UI is enabled, but the user manually closed the code widget, then toggling any option on the interface pane (such as "Pause on Focus Loss") would cause the code widget to reappear. Additionally, closing and reopening dolphin did not call SetDebugModeEnabled, so the code widget did not reappear in that case (it only appeared after touching the interface pane). This is a bit silly, so now only enabling the debugger does it.

This also somewhat resolves an inconsistency introduced by the previous commit: prior to it, --debugger would call SetDebugModeEnabled(true) and thus show the code pane; after these commits, it does not, as it acts like a config change. This is a behavior difference, but not a particularly important one.
2023-04-17 23:23:36 -07:00
abfc75f362 Cleanup headers 2023-01-31 19:41:24 +13:00
1c63349984 AudioCommon: Pass Core::System to AudioCommon functions. 2022-11-06 02:13:58 +01:00
8aef0015fd DolphinQt: add warning if graphics mods are not enabled 2022-06-27 18:28:28 -05:00
27dd2c4aa4 qt: unregister Settings' DevicesChanged callback during shutdown
fixes a crash on close
2022-06-02 23:32:21 -07:00
059cd5f6e1 Windows: Remove unused Qt 5 code and references 2022-05-25 17:51:17 -07:00
5d459380d1 qt/win: remove hack for tab bar scroll buttons 2022-05-09 01:45:42 -07:00
1ad7aac008 Qt: Set font size for default debug font. 2022-03-31 05:28:39 +02:00
90c576e075 Use config changed callback to detect SD insertion/ejection
This saves the GUI from having to manually call SDIO_EventNotify.
With that out of the way, we can let users change the
"Insert SD Card" setting on Android while a game is running.
2022-02-20 10:55:55 +01:00
b2da738c81 Config: Port WiiKeyboard setting to new config system. 2022-01-06 16:13:57 +01:00
f19cf1753b Config: Port WiiSDCard setting to new config system. 2022-01-06 16:13:56 +01:00
d590aa88a4 Config: Port remaining General settings to new config system. 2022-01-01 19:02:45 +01:00
d6331c1e71 Config: Port remaining Interface settings to new config system. 2021-12-31 17:40:04 +01:00
96fa0919be Config: Port AutoUpdate settings to new config system. 2021-12-27 21:19:28 +01:00
1badceb455 ControllerInterface: fix UpdateReferences() deadlock
Removed useless locks to DeviceContainer::m_devices_mutex, as they were all already protected by m_devices_population_mutex.
We have no interest in blocking other threads that were potentially reading devices at the same time so this seems fine.
This simplifies the code, and I've adjusted a few comments which mentioned possible deadlock that should now be totally gone.

The deadlock could have happen if a thread directly called EmulatedController::UpdateReferences(), while another another thread also reached EmulatedController::UpdateReferences() within a call to ControllerInterface::UpdateDevices(), as the mentioned function locked both the DeviceContainer::m_devices_mutex and s_get_state_mutex at the same time.

The deadlock was frequent on game emulation startup on Android, due to the UpdateReferences() call in InputConfig::LoadConfig() and the UI thread triggering calls to ControllerInterface::UpdateDevices().
It could also have happened on Desktop if a user pressed "Refresh Devices" manually in the UI while the input config was loading.

Also brought some UpdateReferences() comments and thread safety fixes from https://github.com/dolphin-emu/dolphin/pull/9489
2021-11-20 16:54:36 +02:00
8ea6bef98f Port Main.DSP to MainSettings
While trying to work on adding audiodump support for CLI, I was alerted that it was important to first try moving the DSP configs to the new config before continuing, as that makes it substantially easier to write clean code to add such a feature.

This commit aims to allow for Dolphin to only rely on the new config for DSP-related settings.
2021-10-15 23:24:46 -04:00
2aa400e72f Add option for Never Hide Mouse Cursor
Instead of having a single GUI checkbox for "Always Hide Mouse Cursor",
I have instead opted to use radio buttons so the user can swap between
different states of mouse visibility. "Movement" is the default
behavior, "Never" will hide the mouse cursor the entire time the game is
running, and "Always" will keep the mouse cursor always visible.
2021-10-12 21:04:27 -04:00
32c7524f4d Merge pull request #10021 from Dentomologist/make_windows_tabbar_scroll_buttons_opaque
DolphinQt: Make Windows tab bar scroll buttons opaque
2021-08-31 19:18:03 +02:00
1fa1e7135c DolphinQt: Make Windows tab bar scroll buttons opaque 2021-08-31 08:33:00 -07:00
fa0525f826 Port Enable Cheats to the new config system 2021-08-11 18:07:43 +02:00
e149ad4f0a treewide: convert GPLv2+ license info to SPDX tags
SPDX standardizes how source code conveys its copyright and licensing
information. See https://spdx.github.io/spdx-spec/1-rationale/ . SPDX
tags are adopted in many large projects, including things like the Linux
kernel.
2021-07-05 04:35:56 +02:00
a09d9cf608 Merge pull request #9606 from Filoppi/patch-14
Qt: avoid queuing ConfigChanged() more than once
2021-06-11 18:59:39 +02:00
83ea16f402 Qt: Fix IOWindow keeping a shared ptr to devices even after them being removed by the ControllerInterface
this prevented some devices from being recreated correctly, as they were exclusive (e.g. DInput Joysticks)

This is achieved by calling Settings::ReleaseDevices(), which releases all the UI devices shared ptrs.
If we are the host (Qt) thread, DevicesChanged() is now called in line, to avoid devices being hanged onto by the UI.
For this, I had to add a method to check whether we are the Host Thread to Qt.

Avoid calling ControllerInterface::RefreshDevices() from the CPU thread if the emulation is running
and we manually refresh devices from Qt, as that is not necessary anymore.

Refactored the way IOWindow lists devices to make it clearer and hold onto disconnected devices.
There were so many issues with the previous code:
-Devices changes would not be reflected until the window was re-opened
-If there was no default device, it would fail to select the device at index 0
-It could have crashed if we had 0 devices
-The default device was not highlighted as such
2021-06-07 11:48:30 +03:00
3c7c2dfaa1 Implement Cursor Locking and new input focus checks for it 2021-05-27 10:31:12 +03:00
e6057c5f62 Qt: avoid queuing ConfigChanged() more than once 2021-05-20 00:30:14 +03:00
678e035126 Merge pull request #9678 from Filoppi/tooltips_style
Make all Qt ToolTips look similar to BalloonTips
2021-05-17 16:40:49 -04:00