Commit Graph

44541 Commits

Author SHA1 Message Date
JosJuice
9d27c145b9
Merge pull request #14076 from Simonx22/remove-action1-interface
Android: Replace Action1 helper with Kotlin lambda
2025-11-08 11:42:38 +01:00
Jordan Woyak
5af9bd5e46
Merge pull request #14074 from jordan-woyak/HookableEvent-no-strings
Common: Remove the string parameters from the HookableEvent interface.
2025-11-07 16:32:06 -06:00
Jordan Woyak
51cd0a676a
Merge pull request #14079 from Dentomologist/use_asyncworkthread_pushblocking_instead_of_sync_event
CubebStream: Use WorkQueueThread::PushBlocking instead of sync_event
2025-11-07 16:31:46 -06:00
Dentomologist
3b97a7bded CubebStream: Use WorkQueueThread::PushBlocking instead of sync_event
Push and wait on WorkQueueThread items using PushBlocking. Previously we
created a Common::Event sync_event on the caller's stack, called Wait on
it, then had the WorkQueueThread call Set on the sync_event once the
thread was done.

In addition to being simpler the new way avoids a use-after-free that
could happen in convoluted and unlikely yet possible thread scheduling
sequences.

One such case can be triggered as follows:

* Set your audio backend to Cubeb
* In CubebStream::SetVolume set a breakpoint at the call to Wait and at
  the call to cubeb_stream_set_volume.
* Start a game.
* Continue until the Cubeb Worker thread hits the
  cubeb_stream_set_volume breakpoint and Emuthread hits the Wait
  breakpoint, freezing each thread when it hits its breakpoint.
* Unfreeze Cubeb Worker.
* In Event::Set set a breakpoint at the end of the scope containing the
  lock_guard such that the guard has been constructed but not destructed
  when the breakpoint is hit.
* Continue until that breakpoint is hit by Cubeb Worker. If other
  threads hit it first keep going.
* Freeze Cubeb Worker.
* For convenience remove the breakpoint in Event::Set so other threads
  don't trigger it.
* In CubebStream::SetRunning set a breakpoint at the call to Wait.
* Unfreeze Emuthread and continue until the breakpoint is hit.
* In Cubeb Worker go to Event::Set and examine the values of m_mutex's
  member variables. In Visual Studio Debug these are locking_thread_id
  == 0xcccccc01 and ownership_levels == 0xcccccccc. This is the result
  of Visual Studio overwriting the memory used on the stack by
  sync_event in CubebStream::SetVolume with cc bytes to represent
  uninitialized memory on the stack (since that function already
  returned), and then allocating enough memory on the stack when calling
  AudioCommon::SetSoundStreamRunning and then CubebStream::SetRunning
  that it overwrote one byte of the memory formerly occupied by
  locking_thread_id.
* If you unfreeze Cubeb Worker at this point it will trigger the lock
  guard's destructor which will then try to unlock m_mutex. Since
  m_mutex is no longer in scope this is a use-after-free, and in VS
  debug triggers a debug assert due to locking_thread_id not matching
  the current thread id.
2025-11-07 13:19:18 -08:00
Simonx22
ddbbb2ea4b Android: Replace Action1 helper with Kotlin lambda 2025-11-07 11:56:11 -05:00
JosJuice
5ed4823ebc
Merge pull request #13858 from LillyJadeKatrin/retroachievements-message-adjustments
Retroachievements message adjustments
2025-11-07 16:50:48 +01:00
Jordan Woyak
da6c65bf3b Common: Remove the string parameters from the HookableEvent interface. 2025-11-06 22:34:40 -06:00
Jordan Woyak
5650be6842
Merge pull request #14069 from jordan-woyak/ciface-hookable-event
InputCommon: Make ControllerInterface RegisterDevicesChangedCallback use Common::HookableEvent.
2025-11-06 20:06:53 -06:00
LillyJadeKatrin
dd941bed70 Improve Achievements Window message
Special message on the Achievements window if the token is invalid/expired.
2025-11-06 20:44:08 -05:00
OatmealDome
852b7d85b2
Merge pull request #14062 from Simonx22/macos-design-fixes
macOS: UI fixes for dark mode
2025-11-06 20:20:05 -05:00
LillyJadeKatrin
1ad0a771d9 Delete Invalid RetroAchievements Tokens 2025-11-06 19:42:14 -05:00
LillyJadeKatrin
b1f27b6cfd Added message for bad RetroAchievements token
Displays a different message at game launch if RetroAchievements fails specifically due to an invalid or expired API token, instructing the player to log back in with the game closed.
2025-11-06 19:30:22 -05:00
LillyJadeKatrin
4985a1e19b Adjusted mastery message
Wes from RetroAchievements requested a minor phrasing change to the mastery message.
2025-11-06 19:30:22 -05:00
JMC47
2528feb98a
Merge pull request #14072 from jordan-woyak/cmake-pre-3.25-fix
CMakeLists: Fix build on Linux with CMake versions less than 3.25.
2025-11-06 12:56:33 -05:00
Jordan Woyak
1e144a7cfd CMakeLists: Fix build on Linux with CMake versions less than 3.25. 2025-11-06 02:41:55 -06:00
Jordan Woyak
ca6d8e1f0b InputCommon: Make ControllerInterface RegisterDevicesChangedCallback use Common::HookableEvent. 2025-11-05 17:12:56 -06:00
Simonx22
cd16ec02bd macOS: UI fixes for dark mode 2025-11-04 15:49:55 -05:00
Jordan Woyak
2170080f53
Merge pull request #14061 from jordan-woyak/config-info-spin-mutex
ConfigInfo: Cleanups and change mutex to a spin lock.
2025-11-04 14:09:35 -06:00
Jordan Woyak
7d617878e0
Merge pull request #13626 from jordan-woyak/non-global-hookable-event
Common: Make HookableEvent use non-static data.
2025-11-04 13:57:08 -06:00
JosJuice
947ed4aaf6
Merge pull request #14067 from VampireFlower/master
MainWindow: Change save state file filter to use *.s?? pattern
2025-11-04 16:48:51 +01:00
VampireFlower
40fa9ddadd MainWindow: Change save state file filter to use *.s?? pattern 2025-11-03 18:50:56 -05:00
Jordan Woyak
999333c0a1 Config: Make ConfigInfo use Common::SpinLock to protect the CachedValue. These locks are nearly always uncontested and this makes Config::Get faster. 2025-11-02 20:45:55 -06:00
Jordan Woyak
46369ef1b1 Common: Add AtomicMutex and SpinMutex classes as faster alternatives to std::mutex. 2025-11-02 20:45:55 -06:00
Jordan Woyak
fc9f25a418 Config/ConfigInfo: Cleanups. 2025-11-02 20:30:35 -06:00
Jordan Woyak
f289b06e0d Common: Make HookableEvent use non-static data.
Co-authored-by: Dentomologist <dentomologist@gmail.com>
2025-11-02 17:30:43 -06:00
Jordan Woyak
9c28f19e56
Merge pull request #14065 from iwubcode/glslang_compiler_fix
VideoCommon: fix wrong path to glslang include
2025-11-02 14:33:12 -06:00
iwubcode
ef87af2985 VideoCommon: fix wrong path to glslang include 2025-11-02 14:29:14 -06:00
JosJuice
cc69cc3f2e
Merge pull request #14058 from jordan-woyak/sdl-version-bump
Externals: Bump SDL submodule version to release-3.2.26
2025-11-02 19:18:56 +01:00
JMC47
a4a4416ff2
Merge pull request #14042 from iwubcode/bp_functions_global
VideoCommon: move global variables out of BPFunctions
2025-11-02 13:17:38 -05:00
JMC47
1d9c743ef7
Merge pull request #13975 from iwubcode/shader_includes
VideoBackends / VideoCommon: add support for specifying include files in shader code
2025-11-02 13:17:28 -05:00
JosJuice
8a0a8bb874
Merge pull request #14059 from jordan-woyak/state-nand-cleanup
Core/IOS/FS: Clean up some hard to read NAND state saving logic.
2025-11-02 19:13:15 +01:00
Jordan Woyak
57d7485ea6 Core/IOS/FS: Clean up some hard to read NAND state saving logic. 2025-11-01 12:33:30 -05:00
JosJuice
249f999c6a
Merge pull request #13655 from JosJuice/android-always-expand-sheets
Android: Expand bottom sheets on devices with touch too
2025-11-01 12:22:45 +01:00
JosJuice
35c5b51b62
Merge pull request #14048 from Simonx22/android-instant-settings-saving
Android: Save settings instantly after edits
2025-11-01 12:22:35 +01:00
JosJuice
da1d45dbd4
Merge pull request #14057 from TellowKrinkle/VkRenderWrongLayout
VideoCommon: Fix render to texture in wrong layout
2025-11-01 10:06:41 +01:00
JosJuice
91fd53a98c
Merge pull request #14035 from Dentomologist/pauseandlock_refactoring
PauseAndLock Refactoring
2025-11-01 10:06:08 +01:00
JosJuice
828e72d604
Merge pull request #14034 from JoshuaVandaele/byeprofile
JitRegister: Remove OProfile profiler
2025-11-01 10:05:11 +01:00
JosJuice
998a3577ce
Merge pull request #14054 from Dentomologist/libmgba_fix_build_when_disabled
libmgba: Fix build when disabled
2025-11-01 10:01:48 +01:00
Jordan Woyak
fc7241dec3 Externals: Bump SDL submodule version to release-3.2.26 2025-11-01 02:00:57 -05:00
iwubcode
6728007cb4 VideoCommon: rename ScissorResult 'm_result' to 'rectangles' to better reflect what the member is 2025-10-31 13:28:14 -05:00
iwubcode
ee7c476e24 VideoCommon: move global variables out of BPFunctions 2025-10-31 13:27:50 -05:00
TellowKrinkle
21ac489d57 VideoCommon: Fix render to texture in wrong layout 2025-10-30 20:50:17 -05:00
Jordan Woyak
c12d3a6d22
Merge pull request #14045 from JoshuaVandaele/warn-fix
Fix various warnings
2025-10-30 20:47:42 -05:00
JMC47
d065f1ae12
Merge pull request #14041 from jordan-woyak/lockless-async-requests
VideoCommon: Clean up and eliminate the mutex in AsyncRequests.
2025-10-30 19:26:22 -04:00
JMC47
ccc334cdd0
Merge pull request #14055 from sepalani/async-inetaton
IP/Top: Make InetAToN async
2025-10-30 19:22:01 -04:00
Sepalani
ba8f4ca6a2 IP/Top: Make InetAToN async 2025-10-31 01:13:36 +04:00
JosJuice
1b8a54024c Android: Expand bottom sheets on devices with touch too
In a few places in Dolphin, we're using BottomSheetDialogFragments.
These unhelpfully tend to start out in a "collapsed" state when in
landscape mode (presumably depending on factors like screen size). The
user then has to manually expand them before they can meaningfully
interact with them.

We've been automatically setting BottomSheetDialogFragments to the
expanded state if the device Dolphin is running on doesn't support
touch, since with d-pad navigation it's impossible to expand these
sheets. But I think we should set them to expanded on devices that
support touch too. I haven't encountered a single case where you can do
anything useful with any of Dolphin's BottomSheetDialogFragments while
they're collapsed, so the user always has to expand sheets manually if
they start out collapsed. And just because a device supports touch
doesn't necessarily mean you're interacting with it through the touch
screen right now - you could be using a gamepad, for instance.
2025-10-30 21:22:41 +01:00
Dentomologist
2836dd2b5e libmgba: Fix build when disabled 2025-10-30 12:00:13 -07:00
Joshua Vandaële
5c12677705
OnScreenDisplayPane: Fix unused-variable warning
This is used in AdvancedPane and was seemingly accidentally copied over
2025-10-30 12:35:22 +01:00
Joshua Vandaële
b66b2f71af
GameConfigEdit: Fix unused-result warning 2025-10-30 12:35:22 +01:00