This is a hassle-free BBA option intended for local play with multiple
Dolphin instances running *in the same system*. After selecting
**Broadband Adapter (IPC)** in the **SP1** slot in the GameCube section
in the settings, games that support LAN play will be able to discover
each other, without requiring third-party software or relatively complex
TAP setups.
The implementation is based on cpp-ipc, a high-performance inter-process
communication library that uses shared memory as transport layer.
Supported platforms are:
- [x] Linux
- [x] Windows
- [ ] macOS (cpp-ipc does not support this platform)
- [ ] FreeBSD (cpp-ipc does not support this platform)
- [ ] Android (cpp-ipc needs some adjustments; while it could work,
launching two Dolphin instances within the same Android system may be
both challenging and impractical)
PauseAndLock is now only called with do_lock=true, and unpause_on_unlock
only ever was used when do_lock is false (which is now handled in
RestoreStateAndUnlock instead), so both parameters are unnecessary.
Replace calls of PauseAndLock(do_lock=false) with new function
RestoreStateAndUnlock for clarity.
Callers of PauseAndLock ignored the return value when do_lock is
false, so RestoreStateAndUnlock doesn't need to return anything.
RestoreStateAndUnlock was only called with control_adjacent=true. Remove
the parameter and unconditionally call the function that was gated
behind it being true.
CPUManager::PauseAndLock is now only called with do_lock=true, and
unpause_on_unlock only ever was used when do_lock is false (which is now
handled in RestoreStateAndUnlock instead), so both parameters are
unnecessary.
Replace call of CPUManager::PauseAndLock(do_lock=false) with new
function RestoreStateAndUnlock for clarity.
Callers of Core::PauseAndLock ignore the return value when do_lock is
false, so in that case was_unpaused in Core::PauseAndLock doesn't need
to be set and so RestoreStateAndUnlock doesn't need to return anything.
Make s_have_fake_cpu_thread a class member instead. In addition to
getting rid of a bit of static state, this simplifies refactoring in an
upcoming commit.
OProfile is not used at all these days, most major distributions do not ship it anymore (Debian, Fedora, and Alpine to name the few I've checked) and following a discussion on Discord, nobody is apparently using it, most devs not even being aware of it. This removes an optional dependency from Dolphin.
Allow loading a custom font by naming it OSD_Font.ttf and placing the file in the User/Load folder, to load that font instead. Useful for future testing.
Don't log a warning in GetPropertyHelper when the property isn't
present. The function returns an optional, so any callers that want to
log a warning when nullopt is returned can do so themselves.
This prevents plugged-in devices (an Xbox One controller in my case)
from spamming the message "W[COMMON]: CM_Get_DevNode_Property returned:
37" twice per second (that value being CR_NO_SUCH_VALUE).
Added some new visibility toggles so players can choose what to show (or hide) during their RetroAchievements runs:
Toggle for the Speedrun Leaderboards timer
Toggle for Achievement Challenge badges
Check if the return value of std::filesystem::remove_all is -1 rather
than 0; the former is the specified return value if there's an error
while 0 just means the directory already didn't exist (which is the end
result we want).
Previously error messages such as the following were possible:
E[COMMON]: DeleteDirRecursively: [path]/User/RedirectSession/ failed The
operation completed successfully.
Also adds a period in the error string to make it look nicer.
Rename m_session to m_last_value_session to better reflect its meaning
and distinguish it from m_current_value_session which will be introduced
in another commit.
macOS does not support `SO_PRIORITY` on sockets, but it does apparently
support configuring sockets with a priority flag via a parameter called
`SO_NET_SERVICE_TYPE`. It doesn't appear to be especially well
documented, but it seems to exist as far back as 10.11 (El Capitan).
This patch sets QoSSession to treat connections as
"responsive multimedia audio/video", which some docs appear to describe
as "low delay tolerant, low-medium, loss tolerant, elastic flow,
variable packet interval, rate and size".
Preserve the configured logging verbosity unless the user actually
changes it, rather than capping it to LINFO on release builds.
Rename LogManager::m_level to m_effective_level and distinguish between
the config and effective level in various function/variable names.
Make m_effective_level atomic to prevent data races when setting the
effective log level from the config changed callback.
USBDevicePicker: Modify USBDeviceAddToWhitelistDialog to be more generic, and use it for a new "More Options..." selection in Bluetooth Passthrough adapters
The `QtUtils::AdjustSizeWithinScreen()` function now centers the
widget on their parent window after the widget's size is adjusted. This
is required in some desktop environments (generally on Linux systems) to
ensure that the just-resized widget remains aligned with its parent
window.
The creation of the **Cheats Manager** dialog is now deferred to first
show, as creating it within the main window's constructor prevents the
dialog from knowing the real position of its parent window, which is
only properly calculated on first show.
For the same reasons, the analytics prompt is now shown only when the
application is ready (i.e. when the main window has been shown).
| Before | After |
| ------ | ----- |
| <img width="1920" height="1080" alt="[Dolphin Emulator] Misplaced analytics prompt" title="[Dolphin Emulator] Misplaced analytics prompt" src="https://github.com/user-attachments/assets/c3e43b3b-cf79-4398-b531-7de6068c583e" /> | <img width="1920" height="1080" alt="[Dolphin Emulator] Centered analytics prompt" title="[Dolphin Emulator] Centered analytics prompt" src="https://github.com/user-attachments/assets/a10d06d9-7438-4032-b96c-dfcb48826349" /> |
| <img width="1920" height="1080" alt="[Dolphin Emulator] Misplaced Settings dialog" title="[Dolphin Emulator] Misplaced Settings dialog" src="https://github.com/user-attachments/assets/f35b10ee-4f07-48d4-86f9-2537ad5ca7ca" /> | <img width="1920" height="1080" alt="[Dolphin Emulator] Centered Settings dialog" title="[Dolphin Emulator] Centered Settings dialog" src="https://github.com/user-attachments/assets/33e37237-77a4-44f6-a0e2-b709f65b672b" /> |
| <img width="1920" height="1080" alt="[Dolphin Emulator] Misplaced Cheats Manager dialog" title="[Dolphin Emulator] Misplaced Cheats Manager dialog" src="https://github.com/user-attachments/assets/1fbd3836-5639-4d5a-b57e-e2e21f21c9db" /> | <img width="1920" height="1080" alt="[Dolphin Emulator] Centered Cheats Manager dialog" title="[Dolphin Emulator] Centered Cheats Manager dialog" src="https://github.com/user-attachments/assets/3f2b1b50-de16-49b7-bac4-c444c6cab0bc" /> |
Avoid creating and then destroying a leaderboard list when game is null,
as doing so causes an access to uninitialized memory due to a bug in
rcheevos.
This can be triggered by starting a game with an invalid or expired
login token.
Without cache emulation, these instructions are functionally identical.
In the interpreter, their only difference is related to HID registers checks, which the JIT already doesn't do for `dcbz`.
A loop with `dcbz_l` is used in the SDK function `LCEnable`, which is called frequently in some games.
When opening a file dialog to set the location of a custom path, use the
corresponding user path as the starting location instead of the current
custom path.
When no custom path was set the dialog would be opened with a blank path
which causes Windows (not sure about other platforms) to open the dialog
at the same location where the last dialog was closed, or at the current
working directory if no previous dialog had been opened.
If a nonempty custom path has been set then it has also set the
corresponding user path, so the behavior in that case is unchanged.
Adds `DocumentsContract.Root.FLAG_SUPPORTS_IS_CHILD` to the list of the flags in order to show up for third-party apps for easier file syncing with local/cloud file server providers
Adds `DocumentsContract.Root.FLAG_LOCAL_ONLY` to the list of the flags in order to show up for third-party apps for easier file syncing with local/cloud file server providers
The callback mechanism AchievementManager had until now only supported
one caller registering a callback, and it didn't have any
synchronization. This isn't a problem for DolphinQt, but the PR to add
Android support for RetroAchievements exposes these problems. Let's
replace it with HookableEvent, which can handle all of this.
The instruction implementations that were shifting the size by 4 would
emit an incorrect instruction when given a size of 64. The correct
implementation is to count the number of leading or trailing zeroes in
the size parameter, which is what IntLog2 does.
No callers are affected by this, as they all use sizes other than 64.
Actually, some of these instructions are even invalid with a size of 64,
but I'm changing them anyway for consistency with the others.
When dragging the selection, the mismatch between signal
(itemSelectionChanged) and data consumed (currentRow) seemed to cause
the description to lag behind by one row.
We should attempt to use not only mirrored versions of the immediate as
an ORR base, but also the immediate itself. This lets us emit certain
64-bit constants using fewer instructions.
Improves the accuracy of FMADDS and other single precision FMA operations
This is accomplished by using an error-free transformation
It also thoroughly explains the quirks and difficulty of these operations
This fixes Mario Strikers and is necessary for fully fixing 1080 Avalanche
For single precision inputs it should be equivalent to a 32-bit FMA
Aside from allowing users to persistently set the window to their
desired size, this is also necessary to allow saving of the splitter
positions in FIFOAnalyzer to work correctly.
Make MainWindow::m_fifo_window a unique_ptr to ensure its destructor is
triggered when MainWindow is destroyed.
FIFOPlayerWindow doesn't set MainWindow as its parent in order to
prevent raising MainWindow when focusing FIFOPlayerWindow. This avoids
MainWindow covering up RenderWidget when, e.g., trying to use the object
range feature to pinpoint the index of a particular object.
As a consequence, unlike most QObjects FIFOPlayerWindow wasn't destroyed
when its parent widget was since it didn't have one.
IsolateWasOverwritten and IsolateNotOverwritten share the same basic
logic and have almost exactly the same code, with the only difference
being the comparison function used to keep or discard branches. To avoid
unnecessary code duplication and ensure that the functions stay in sync
after any future changes, create a helper function that takes the
comparison function as a parameter and have IsolateWasOverwritten and
IsolateNotOverwritten call that helper.
Show "(off)" instead of "" when the default post-processing effect is
selected. This also indirectly fixes issues with keyboard navigation of
the post-processing effect combobox when the default is selected,
resolving https://bugs.dolphin-emu.org/issues/13863.
m_post_processing_effect was previously using the ConfigStringChoice
constructor that assumes the text and data of each option are identical.
This is true for all the other effects, but since "(off)" has the config
value of "" this assumption was failing for it, causing the combobox to
be blank.
Previous changes to the patch allowlist format were not reflected in AchievementManager; this corrects that and re-enables patches and codes in hardcore mode.
Equivalent to a negation, no need to materialize the zero.
Before:
0x52800015 mov w21, #0x0 ; =0
0x6b1802b6 subs w22, w21, w24
After:
0x6b1803f6 negs w22, w24
This case can be handled as a move. It also generates a constant carry
flag.
Before:
0x52800013 mov w19, #0x0 ; =0
0x6b1302b3 subs w19, w21, w19
After:
0x2a1503f3 mov w19, w21
In certain cases, the platform can be "wayland-egl", "wayland-xcomposite", and other values for which I haven't found a full list yet. Instead of matching only "wayland", we now look for "wayland" anywhere in the `QT_QPA_PLATFORM` string in a case-insensitive manner.
Acknowledgements:
`CaseInsensitiveContains`' implementation was heavily inspired by GNU's non-standard glibc `strcasestr` function, which can be found here licensed under GPLv2 or later: https://ftp.gnu.org/gnu/libc/
Host_RequestFullscreen and Host_UpdateMainFrame have been removed, and
Host_RequestRenderWindowSize has been used by DolphinQt since 80699096
and by Android since e8739156.
Remove Host_RefreshDSPDebuggerWindow (which hasn't done anything since
DolphinWX was removed in 44b22c90) and DSP::Host::UpdateDebugger (which
only called Host_RefreshDSPDebuggerWindow).
Remove Host_UpdateMainFrame(). The only non-empty call happened in
DolphinNoGUI which called s_update_main_frame_event.Set(), but
DolphinNoGUI never waits on that event.
Compared to the former, the latter invalidates the icache, which is
something that is likely desired for patches (especially if they are
applied while the game is running).
Invalidate icache only if target address has a different value. Take separate arguements,
instead of a struct, to allow easier usage elsewhere. Overload with u8,
u16 and u32 values for the same reason.
Keep the BalloonTip open when the BalloonTip's arrow prevents the cursor
from being inside the spawning ToolTipWidget, which triggers the
ToolTipWidget's leaveEvent and would previously close the BalloonTip.
When that happens track the cursor until it either leaves the
ToolTipWidget's bounding box or leaves the BalloonTip and goes back to
the ToolTipWidget, and respectively close the BalloonTip or leave it
open.
When 9d9b6d8 changed our target SDK version to Android 16, it made
Android 16 stop calling onBackPressed and stop delivering KEYCODE_BACK
events. Dolphin's code isn't ready for that yet.
Android lets us opt out of this new behavior for now, so let's do so.
But the opt-out will presumably stop working once we start targeting
Android 17, so we're going to have to update Dolphin's code within the
next one or two years to support the replacement API.
Number of instructions stays the same, but we remove the false
dependency on the input registers.
Before:
0x7a1b037a sbcs w26, w27, w27
After:
0x5a9f23fa csetm w26, lo
Another instance where we needlessly materialized constant zero in a
register. We can just write the carry flag directly.
Before:
0x5280001a mov w26, #0x0 ; =0
0x1a1f035a adc w26, w26, wzr
After:
0x1a9f37fa cset w26, hs