summaryrefslogtreecommitdiff
path: root/Source/Core/Common/Config
AgeCommit message (Collapse)Author
2026-04-12Merge pull request #14336 from SuperSamus/arbitrary-mipmap-disables-gpu-decodingJordan Woyak
VideoCommon: Invert interaction between Arbitrary Mipmap Detection and GPU Texture Decoding (the former disables the latter)
2026-03-21AudioPane: Fix WASAPI default device combo selectionDentomologist
Set the default value of `Config::MAIN_WASAPI_DEVICE` to `default` instead of `Default`. This fixes an issue where `AudioPane`'s `Output Device` combo would be blank if `WASAPI` was selected and the user had never changed the value of `Output Device`. We don't have to worry about backward compatibility with users who have `Default` in their config because config values aren't written unless they've been changed at some point from the default, and the combo has always saved `default` instead of `Default`. Audio still worked during emulation in this situation because the fallback for an unrecognized device name is the default device. To help prevent similar situations in the future references to `MAIN_WASAPI_DEVICE`'s default value now call `GetDefaultValue` instead of hardcoding the expected default, or use the new helper function `Config::IsDefaultValue`.
2026-02-13VideoCommon: Invert interaction between Arbitrary Mipmap Detection and GPU ↵Martino Fontana
Texture Decoding (the former disables the latter) Split from #14293. It makes sense for a setting that changes visual output to have priority over a setting that barely makes any difference.
2026-01-25Remove unused importsMartino Fontana
Yellow squiggly lines begone! Done automatically on .cpp files through `run-clang-tidy`, with manual corrections to the mistakes. If an import is directly used, but is technically unnecessary since it's recursively imported by something else, it is *not* removed. The tool doesn't touch .h files, so I did some of them by hand while fixing errors due to old recursive imports. Not everything is removed, but the cleanup should be substantial enough. Because this done on Linux, code that isn't used on it is mostly untouched. (Hopefully no open PR is depending on these imports...)
2025-11-08Config: Use maximum value of size_t instead of -1 as default value in ↵Simonx22
ConfigChangedCallbackID Co-authored-by: OatmealDome <julian@oatmealdome.me>
2025-11-02Config: Make ConfigInfo use Common::SpinLock to protect the CachedValue. ↵Jordan Woyak
These locks are nearly always uncontested and this makes Config::Get faster.
2025-11-02Config/ConfigInfo: Cleanups.Jordan Woyak
2025-09-26Merge pull request #13634 from jordan-woyak/enum-conceptsJMC47
Common: Replace enable_if with concepts and other minor modernizations.
2025-05-30Config: Make s_callbacks_lock recursive to fix hardcore mode deadlock.Jordan Woyak
2025-05-05Common: Replace enable_if with concepts and other minor modernizations.Jordan Woyak
2025-05-02Merge pull request #13596 from JosJuice/config-callback-lockingJosJuice
Config: Add locking for config changed callbacks
2025-04-30Merge pull request #13436 from JoshuaVandaele/clang-format-19OatmealDome
Update clang-format to version 19
2025-04-26Config: Add locking for config changed callbacksJosJuice
Different threads are adding and calling callbacks, so this should have some locking. This is both to ensure thread safety when accessing `s_callbacks` and to ensure that there won't be situations where a callback gets called after it's removed. `s_callback_guards` is also accessed from multiple threads and has therefore been made atomic.
2025-04-25Config: Add [[nodiscard]] to AddConfigChangedCallbackDentomologist
Require callers of Config::AddConfigChangedCallback and CPUThreadConfigCallback::AddConfigChangedCallback to handle the returned ConfigChangedCallbackIDs to hopefully prevent future issues with callbacks getting called after their associated objects have been destroyed.
2025-04-23 linter: Add and apply new formatting rulesJoshua Vandaële
New rules: `InsertNewlineAtEOF: true` `RemoveSemicolon: true` `RequiresClausePosition: WithPreceding`
2025-03-23Merge pull request #13093 from mitaclaw/ranges-modernization-4-projectionJMC47
Ranges Algorithms Modernization - Projection
2025-03-17Config: Allow passing a DefaultState object to Set functions to delete keys.Jordan Woyak
2025-03-09Simplify `std::find_if` with `std::ranges::find` and projectionsmitaclaw
In LabelMap.cpp, the code is currently unused so I was unable to test it. In WiiUtils.cpp, the magic value `1u` was replaced by the constant value `DiscIO::PARTITION_UPDATE`.
2024-10-10C++20: Synthesize `operator!=` From `operator==`mitaclaw
The inequality operator is automatically generated by the compiler if `operator==` is defined.
2023-11-27Remove references to Debugger.iniJosJuice
This file was only used by DolphinWX. DolphinQt uses Qt.ini instead.
2023-08-17Use structs for config callback IDsJosJuice
This way you can't mix up regular config callback IDs and CPU thread config callback IDs. (It would be rather bad if you did!)
2023-08-17Config: Don't clear callbacks on shutdownJosJuice
This fixes a problem that started happening in CoreTimingTest after the previous commit. CPUThreadConfigCallback registers a Config callback only once per run of the process, but CoreTimingTest calls Config::Shutdown after each test, and Config::Shutdown was clearing all callbacks, preventing the callback from running after that.
2023-08-17Don't call RunAsCPUThread in config callbacksJosJuice
In theory, our config system supports calling Set from any thread. But because we have config callbacks that call RunAsCPUThread, it's a lot more restricted in practice. Calling Set from any thread other than the host thread or the CPU thread is formally thread unsafe, and calling Set on the host thread while the CPU thread is showing a panic alert causes a deadlock. This is especially a problem because 04072f0 made the "Ignore for this session" button in panic alerts call Set. Because so many of our config callbacks want their code to run on the CPU thread, I thought it would make sense to have a centralized way to move execution to the CPU thread for config callbacks. To solve the deadlock problem, this new way is non-blocking. This means that threads other than the CPU thread might continue executing before the CPU thread is informed of the new config, but I don't think there's any problem with that. Intends to fix https://bugs.dolphin-emu.org/issues/13108.
2023-04-03Added Initial Achievement SettingsLillyJadeKatrin
Added AchievementSettings in Config with RA_INTEGRATION_ENABLED, RA_USERNAME, and RA_API_TOKEN. Includes code to load and store from Achievements.ini file in config folder.
2023-03-11Migrate game INI profile setting to new config systemJosJuice
2022-09-24Integrate "Ignore for this session" better with config systemJosJuice
Because of the previous commit, this is needed to stop DolphinQt from forgetting that the user pressed ignore whenever any part of the config is changed. This commit also changes the behavior a bit on DolphinQt: "Ignore for this session" now applies to the current emulation session instead of the current Dolphin launch. This matches how it already worked on Android, and is in my opinion better because it means the user won't lose out on important panic alerts in a game becase they played another game first that had repeated panic alerts that they wanted to ignore. For Android, this commit isn't necessary, but it makes the code cleaner.
2021-12-25Config: Allow unregistering callbacks.Admiral H. Curtiss
2021-12-10Treewide: Adjust order of includesPokechu22
2021-10-13Fix all uninitialized variable warnings (C26495)Pokechu22
2021-07-05treewide: convert GPLv2+ license info to SPDX tagsPierre Bourdon
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-06-09NetPlay/Jit64: Avoid using software FMAJosJuice
When I added the software FMA path in 2c38d64 and made us use it when determinism is enabled, I was assuming that either the performance impact of software FMA wouldn't be too large or CPUs that were too old to have FMA instructions were too slow to run Dolphin well anyway. This was wrong. To give an example, the netplay performance went from 60 FPS to 30 FPS in one case. This change makes netplay clients negotiate whether FMA should be used. If all clients use an x64 CPU that supports FMA, or AArch64, then FMA is enabled, and otherwise FMA is disabled. In other words, we sacrifice accuracy if needed to avoid massive slowdown, but not otherwise. When not using netplay, whether to enable FMA is simply based on whether the host CPU supports it. The only remaining case where the software FMA path gets used under normal circumstances is when an input recording is created on a CPU with FMA support and then played back on a CPU without. This is not an especially common scenario (though it can happen), and TASers are generally less picky about performance and more picky about accuracy than other users anyway. With this change, FMA desyncs are avoided between AArch64 and modern x64 CPUs (unlike before 2c38d64), but we do get FMA desyncs between AArch64 and old x64 CPUs (like before 2c38d64). This desync can be avoided by adding a non-FMA path to JitArm64 as an option, which I will wait with for another pull request so that we can get the performance regression fixed as quickly as possible. https://bugs.dolphin-emu.org/issues/12542
2021-03-07Config: Give Movie and Netplay higher priority than CommandLineJosJuice
Avoiding desyncs is more important than honoring what the user specified on the command line.
2021-02-26Common: don't call OnConfigChanged() unless it has actually changedFiloppi
DualShock UDP Client is the only place in the code that assumed OnConfigChanged() is called at least once on startup or it won't load up the setting, so I took care of that
2021-01-18Android: Fix in-game settings changes not getting savedJosJuice
EmulationActivity has an instance of Settings. If you go to SettingsActivity from EmulationActivity and change some settings, the changes get saved to disk, but EmulationActivity's Settings instance still contains the old settings in its map of all settings (assuming the EmulationActivity was not killed by the system to save memory). Then, once you're done playing your game and exit EmulationActivity, EmulationActivity calls Settings.saveSettings. This call to saveSettings first overwrites the entire INI file with its map of all settings (which is outdated) in order to save any legacy settings that have changed (which they haven't, since the GUI doesn't let you change legacy settings while a game is running). Then, it asks the new config system to write the most up-to-date values available for non-legacy settings, which should make all the settings be up-to-date again. The problem here is that the new config system would skip writing to disk if no settings changes had been made since the last time we asked it to write to disk (i.e. since SettingsActivity exited). NB: Calling Settings.loadSettings in EmulationActivity.onResume is not a working solution. I assume this is because SettingsActivity saves its settings in onStop and not onPause.
2020-12-29Config: Fix cache not being invalidated when callbacks are suppressedLéo Lam
The config version should always be incremented whenever config is changed, regardless of callbacks being suppressed or not. Otherwise, getters can return stale data until another config change (with callbacks enabled) happens.
2020-12-24Core: Add new Free Look settings and configiwubcode
2020-12-12Add caching to Config::InfoJosJuice
The goal of this change is to make Config::Get(const Info<T>&) fast so that we can use it in hot paths.
2020-12-11Turn Config::Info into a class with gettersJosJuice
2020-11-25Common: Optimize Config::GetJosJuice
The way Config::Get works in master, it first calls Config::GetActiveLayerForConfig which searches for the setting in all layers, and then calls Config::Layer::Get which searches for the same setting again within the given layer. We can remove this second search by combining the logic of Config::GetActiveLayerForConfig and Config::Layer::Get into one function.
2020-10-28Source/Core/Common/Config/Config.cpp: add missing <mutex> includeSergei Trofimovich
Noticed missing include as a build failure on gcc-11: ``` [ 15%] Building CXX object Source/Core/Common/CMakeFiles/common.dir/Config/Config.cpp.o Source/Core/Common/Config/Config.cpp:23:24: error: 'unique_lock' in namespace 'std' does not name a template type 23 | using WriteLock = std::unique_lock<std::shared_mutex>; | ^~~~~~~~~~~ Source/Core/Common/Config/Config.cpp:11:1: note: 'std::unique_lock' is defined in header '<mutex>'; did you forget to '#include <mutex>'? ``` Signed-off-by: Sergei Trofimovich <slyfox@gentoo.org>
2020-05-02Remove redundant Config prefix from ConfigInfo/ConfigLocationLéo Lam
Both structs are already in the Config namespace.
2020-01-13Merge pull request #8530 from s-daveb/masterConnor McLaughlin
MacOS: Fixes configuration hang; bump MacOS SDK.
2020-01-04Fix several warningsLéo Lam
A small, nonexhaustive set of warning fixes. The DiscIO Volume change is a workaround for a GCC bug [1] that causes returning an unengaged std::optional to emit annoying -Wmaybe-uninitialized warnings. This last change alone fixes pages upon pages of warnings since Volume.h is included from several files. -Wstringop-truncation is another irrelevant warning for us, but unfortunately there seems to be no way to disable it without adding ugly pragmas wherever the warning appears.
2019-12-22MacOS: Fixes configuration hang; bump MacOS SDK.S David
Removed conditional use of std::mutex instead of std::shared_mutex on MacOS. Because MacOS < 10.12 did not support std::shared_mutex, a previous commit naïvely substituted std::mutex, which does not have the same behavior. Reverses PR #8273, which substitues std::mutex for std::shared_mutex on macOS, and results in several bugs that seem to only affect MacOS - https://bugs.dolphin-emu.org/issues/11919 - https://bugs.dolphin-emu.org/issues/11842 - https://bugs.dolphin-emu.org/issues/11845 This change eliminates conditional code for MacOS in the core configuration layer code and enables the use of modern language features that are more secure and thread-safe.
2019-10-27Rename all instances of "CemuhookUDPServer"/"UDPServer" to ↵rlnilsen
"DualShockUDPClient"/"DSUClient".
2019-10-26Add support for motion controllers via the CemuHook controller input protocol.rlnilsen
This is done by: 1) Implementing said protocol in a new controller input class CemuHookUDPServer. 2) Adding functionality in the WiimoteEmu class for pushing that motion input to the emulated Wiimote and MotionPlus. 3) Suitably modifying the UI for configuring an Emulated Wii Remote.
2019-08-01Change Layer code not to create superfluous std::optional entries in LayerMapSilent
2019-07-30Fix race conditions in Config LayersSilent
API has been made stricter, layers are now managed with shared pointers, so using them temporarily increased their reference counters. Additionally, any s_layers map has been guarded by a read/write lock, as concurrent write/reads to it were possible.
2019-05-06Reformat repo to clang-format 7.0 rulesTechjar
2019-03-03Common/Config: Add a utility class to suppress config change callbacks.Jordan Woyak