Commit Graph

38448 Commits

Author SHA1 Message Date
Jordan Woyak
1234a4e479 SI_DeviceAMBaseboard: Use CreateStatusResponse to fix "RunSIBuffer: expected_response_length" WARN_LOGs. 2026-03-12 02:48:07 -05:00
Jordan Woyak
8da0a94ab9 SI_DeviceAMBaseboard: Add baseboard 0x70 command to SerialInterface::EBufferCommands enum to eliminate BaseBoardCommand enum. 2026-03-12 02:48:07 -05:00
Jordan Woyak
cda384d40f SI_DeviceAMBaseboard: Remove unnecessary code. 2026-03-12 02:48:07 -05:00
Jordan Woyak
fe2d604060
Merge pull request #14401 from naari3/master
AMMediaboard: stub Triforce NETWORK TEST command handling
2026-03-12 02:47:37 -05:00
Dentomologist
252ec7452c PerformanceMetrics: Use HookableEvent for state changed callback
Use the normal state changed `HookableEvent` instead of having
`Core::NotifyStateChanged` call `g_perf_metrics.OnEmulationStateChanged`
directly.

The direct call was added in bad78cfed4 to
avoid a crash. At the time state changed callbacks were stored in a
vector, and the crash was caused by `g_perf_metric`'s destructor trying
to remove the callback from the already-destroyed vector.

Later a97627e736 switched state changed
callbacks to use `HookableEvent`, which is specifically designed to
handle the case where a hook outlives its associated event.

Since the workaround is no longer necessary replace it with a standard
`EventHook`.
2026-03-07 12:50:59 -08:00
JosJuice
a3b37c041a Core: Optimize RemoveHostPageTableMappings
This switches from an O(log(N) * M) algorithm to an O(N * log(M))
algorithm. This is advantageous because N, the size of `mappings`, is
usually much smaller than M, the size of `m_page_table_mapped_entries`.

RemoveLargePageTableMapping already did something similar, so we can
even deduplicate some code between it and RemoveHostPageTableMappings.

Speeds up Rogue Squadron 3 by roughly 3% on my PC.
2026-03-07 12:56:36 +01:00
JosJuice
d25ef67d6f DolphinQt: Save when closing settings window
If Dolphin crashes, changes that have been made to settings are often
lost. This has been a minor annoyance for me when developing, but it has
become a much bigger issue recently due to the problem where Dolphin
freezes on shutdown for ROG Ally users.

Instead of saving the config when certain arbitrary settings are
changed, let's save the config when the user closes the settings window.
2026-03-04 22:26:25 +01:00
JMC47
43def54de2
Merge pull request #14435 from Simonx22/fix/metal-early-stop-shutdown
Metal: Always run endEncoding on command encoders
2026-03-03 12:25:16 -05:00
Simonx22
d2e381090c DolphinQt: Improve Gecko code download failure message 2026-03-03 11:09:39 -05:00
Simonx22
03bcd564c5 Metal: Always run endEncoding on command encoders
Fixes a macOS Metal crash when stopping immediately after boot starts.

m_upload_encoder and m_texture_upload_encoder could be dealloc'd during shutdown before endEncoding could be called, which causes a Metal assertion failure.

Co-authored-by: OatmealDome <julian@oatmealdome.me>
2026-03-03 09:49:42 -05:00
Dentomologist
edb576f4c0 VertexLoaderManager: Fix crash caused by invalid array base
Don't set cached array bases to invalid pointers. If a game tries to set
an invalid base just keep the old one, which might cause game problems
but won't crash the emulator.
2026-03-02 13:02:51 -08:00
Dentomologist
15f24c56e4
Merge pull request #14327 from Dentomologist/performancemetrics_fix_graph_size_and_spacing
PerformanceMetrics: Fix graph size and spacing
2026-03-02 11:01:37 -08:00
TellowKrinkle
80762e0575 DSU: Don't crash on bad hostname 2026-03-01 00:08:08 -06:00
JMC47
63fc9d7ca3
Merge pull request #14425 from JosJuice/android-wiimote-crash
Android: Fix Wii Remote connection crashes
2026-02-28 16:16:20 -05:00
Simonx22
79f0c814e4 Android: Convert AfterDirectoryInitializationRunner to Kotlin 2026-02-28 10:44:05 -05:00
JosJuice
5a914e5247 Android: Use DeleteLocalRef more in WiimoteAndroid
Doesn't matter a lot, but we're supposed to do this to be nice citizens.
2026-02-28 16:13:36 +01:00
JosJuice
faa861f1ab Android: Fix Wii Remote connection crashes
Users are reporting a crash at the point where WiimoteAndroid::IORead
tries to use m_java_wiimote_payload. This commit solves the problem by
making m_java_wiimote_payload a global reference.

The code for setting up m_java_wiimote_payload has also been moved to
the constructor just because that way it's impossible for it to run
twice. (If the code as written were to run a second time, the old global
reference would be leaked. ConnectInternal should only run once, so this
is just to be on the safe side.)

Fixes https://bugs.dolphin-emu.org/issues/13960.
2026-02-28 16:10:58 +01:00
JosJuice
1a08708a75
Merge pull request #14418 from LillyJadeKatrin/retroachievements-wii-menu
RetroAchievements - Close game on switch to null hash
2026-02-28 15:15:50 +01:00
Simonx22
2660412b29 Android: Convert WiiUpdateCallback to Kotlin 2026-02-27 21:30:46 -05:00
Simonx22
a7bb03b6f0 Android: Convert AlertDialogItemsBuilder to Kotlin 2026-02-27 15:06:12 -05:00
Simonx22
46c410e30b Android: Convert TvSettingsViewHolder to Kotlin 2026-02-27 14:41:25 -05:00
Simonx22
58f85aa65c Android: Convert USBPermService to Kotlin 2026-02-27 14:11:48 -05:00
Dentomologist
f898d75bf3
Merge pull request #14317 from JosJuice/jit-cache-macro-loop
Jit: Use RangeSet for physical_addresses
2026-02-26 19:25:29 -08:00
Dentomologist
65f0dc9b2e
Merge pull request #14416 from JosJuice/game-id-ascii
DiscIO: Only allow alphanumeric ASCII in game IDs
2026-02-26 14:07:27 -08:00
Julien Bernard
0e8db4fa22 Send neutral stick positions when disconnected rather than down-left 2026-02-25 23:06:50 +01:00
Julien Bernard
afc2920a5f Gcc adapter fixes (hotplugging, claim retries, shutdown, bad yields) 2026-02-25 22:55:48 +01:00
naari3
65f8c8f6cc AMMediaboard: derive TestHardware phase2 delay from tick rate
Use the existing system reference instead of Core::System::GetInstance(),
and calculate the phase 2 scheduling delay from GetTicksPerSecond()
instead of hardcoding 50000 ticks.
2026-02-26 00:49:24 +09:00
Lilly Jade Katrin
713d557d5e RetroAchievements - Close game on switch to null hash
Mistakenly thought the change media call would close the current
game if the new media failed to hash. This wasn't the case so
instead I'll close the current game myself. This fixes an issue
where a default ISO would immediately load achievements when
starting up the Wii menu.
2026-02-24 22:55:30 -05:00
Dentomologist
2a3078b833
Merge pull request #14415 from JosJuice/android-achievement-defaults
Android: Fix defaults for RetroAchievements settings
2026-02-24 18:45:54 -08:00
JosJuice
7b372db559 DiscIO: Only allow alphanumeric ASCII in game IDs
We often use game IDs in paths, so we should try to make sure path
traversal is impossible in game IDs. Admittedly, doing any kind of real
attack using the six bytes available in game IDs is unrealistic, but no
game ID should contain non-alphanumeric or non-ASCII characters anyway.

Might also fix https://bugs.dolphin-emu.org/issues/13982 by skipping
converting between encodings for game IDs.
2026-02-24 21:36:02 +01:00
JosJuice
1d74321212 DiscIO: Move DecodeString to Volume.cpp
This had to be in the header back when it was templated, but 083faa8b
made it not templated.
2026-02-24 21:09:12 +01:00
JMC47
ff27147a71
Merge pull request #14407 from jordan-woyak/mag-card-fixup
MagneticCardReader: Minor fixup to writing card data.
2026-02-23 19:09:23 -05:00
JosJuice
c1a26808ce Jit: Use RangeSet for physical_addresses
This makes JitBaseBlockCache::ErasePhysicalRange around 50% faster and
PPCAnalyzer::Analyze around 40% faster. Rogue Squadron 2's notoriously
laggy action of switching to and from cockpit view is made something
like 20-30% faster by this, though this is a very rough measurement.
2026-02-23 23:01:49 +01:00
JosJuice
36f45dce44 Move RangeSet from Externals to Common
This is a very small libary, and as I understand it, it was more or less
developed for Dolphin.

This moves the two relevant files from Externals to Common, changes the
namespace to Common, reformats the code, and adds Dolphin copyright
notices. The change in copyright notice and license was approved by
AdmiralCurtiss.
2026-02-23 22:55:38 +01:00
JosJuice
99d82829c8 Android: Fix defaults for RetroAchievements settings
Default values for settings need to be the same in Kotlin and C++,
otherwise settings that haven't been changed by the user will be shown
as having one value in the Android GUI but treated as having a different
value in the core.
2026-02-23 19:24:58 +01:00
Admiral H. Curtiss
0d359e23da
Merge pull request #14212 from cscd98/cast-func
mingw: use reinterpret_cast for function→void* conversion to satisfy C++ standard
2026-02-21 18:27:50 +01:00
Admiral H. Curtiss
fee2b0ee03
Merge pull request #14209 from cscd98/static-cast-fix
mingw: replace static_cast with reinterpret_cast as not permitted between void* and function params
2026-02-21 18:27:22 +01:00
Sepalani
0950999d08 AMMediaboard: Check for EAGAIN in WSAGetLastError 2026-02-21 13:41:39 +04:00
Sepalani
543d5f89e6 AMMediaboard: Improve recv/send log messages 2026-02-21 12:27:04 +04:00
Jordan Woyak
97a88dd7db MagneticCardReader: Minor fixup to writing card data.
Ensure the 3rd track is written even if the 2nd track isn't.
Moved GetHexDump helper function to StringUtil.
2026-02-21 01:01:57 -06:00
naari3
ab0d300041 AMMediaboard: extract TestHardware "TEST OK" magic numbers to named constants
Replace raw hex literals with TEST_OK_WORD0/TEST_OK_WORD1 constexpr
constants and consolidate the endianness explanation at the definition
site.
2026-02-21 14:40:22 +09:00
naari3
adbecd00ec AMMediaboard: fix TestHardware string endianness in legacy Execute path
The legacy Execute1 path (offset=0, length=0) was using Write_U32
(big-endian) to write the "TEST OK" status string. However, the PPC
display code in segaboot reads this buffer with lwz followed by manual
bswap32, so the data must be stored in little-endian. Use Write_U32_Swap
to match the other two TestHardware paths.
2026-02-21 14:38:38 +09:00
naari3
a297bb8068 State: bump version to 178 for Triforce NETWORK TEST command handling 2026-02-21 13:29:09 +09:00
naari3
402042b9bc AMMediaboard: add Triforce NETWORK TEST support
Implement the MediaBoard commands and response protocol needed for
the segaboot NETWORK TEST to pass:

- TestHardware (0x0301) two-phase response via CoreTiming: phase 1
  echoes test_type with 0x80 acknowledgment flag, phase 2 sends
  result with testStatus=2 and checkProgress=100
- GetNetworkConfig (0x0104) with trinetcfg.bin read intercept
- Separate Execute1/Execute2 last-response buffers to prevent
  cross-clobber on the shared s_media_buffer
- Generic 0x80xx cleanup command acknowledgment
- Network config persistence for SET IP ADDRESS
2026-02-21 13:29:09 +09:00
TryTwo
3ea93641b2 CheatSearch: Add ability to breakpoint the selected lines.
Adds three options, on read, on write, and both. Always Breaks and Logs.
2026-02-20 20:57:19 -07:00
Jordan Woyak
2eeff845bd
Merge pull request #14387 from Dentomologist/cheatsmanager_update_tabs_on_creation
CheatsManager: Update code tabs on creation
2026-02-20 19:31:40 -06:00
Jordan Woyak
2b590b12e6
Merge pull request #14402 from sepalani/tri-osd-bind
AMMediaboard: Replace bind PanicAlert with OSD message
2026-02-20 19:28:07 -06:00
Jordan Woyak
ddedae327f
Merge pull request #14395 from sepalani/tri-connect
AMMediaboard: Add more connect log messages
2026-02-20 19:25:59 -06:00
Jordan Woyak
b5a1a06f6c
Merge pull request #14394 from sepalani/tri-log
AMMediaboard: Add more log messages
2026-02-20 19:24:24 -06:00
cristian64
643fcaec03 DolphinQt: Restore log font current index accurately.
The logic in the code was deliberately avoiding index `2` (**Selected
Font**; the debug font) by using `std::min(index, 1)`. Presumably, the
reason was that there was no debugger in Qt version of Dolphin at the
time.

Test plan:

- Select a debug font via the **Options > Font...** action.
- Show the **Log** tab via the **View > Log** action.
- In the **Log** tab, choose the **Selected Font** item in the combobox.
- Restart Dolphin.

**Without** the patch, the **Monospaced Font** item is wrongly selected
in the combobox.

**With** the patch, the **Selected Font** item is now properly restored
from the saved settings, and the selected debug font is correctly used
in the log messages.
2026-02-20 22:14:35 +00:00
JMC47
981b7df420
Merge pull request #14335 from TixoRebel/joycon-config
Core: Add SDL Hints settings
2026-02-20 02:44:52 -05:00
Andrew Strauss
61c36b0cc8 Add new window to configure SDL hints and store them in the main ini file
Signed-off-by: Andrew Strauss <astrauss11@gmail.com>
2026-02-20 02:05:35 -05:00
Dentomologist
3d16e0c5be
Merge pull request #14343 from TryTwo/toggle_breaking
BreakpointsWidget: Add option to toggle all breaking
2026-02-19 21:55:38 -08:00
TryTwo
f9c7731f4d Debugger/ BreakpointsWidget: Add option to disable/enable all breaking without affecting individual breakpoint enabled states.
Allows you to quickly stop breaking, play the game, then re-enable breaking. useful if you have many active breakpoints, but need to run the game.
2026-02-19 16:23:42 -07:00
Sepalani
989586433a AMMediaboard: Replace bind PanicAlert with OSD message 2026-02-20 02:43:51 +04:00
Dentomologist
02db73c8dc
Merge pull request #14344 from TryTwo/cheatsearch_work2
Cheat Search: Add ability to delete items and fix duplicate commands
2026-02-19 14:36:54 -08:00
Sepalani
81b414c9c9 AMMediaboard: Add more connect log messages 2026-02-19 13:30:17 +04:00
Sepalani
b92cef5001 AMMediaboard: Add more log messages 2026-02-18 19:00:06 +04:00
Jordan Woyak
9674b1fa8f MagneticCardReader: Automatically insert a blank card when Command_A0_Clean is received. 2026-02-16 18:59:57 -06:00
Craig Carnell
bd728d1c20 mingw: replace static_cast with reinterpret_cast as not permitted between void* and function params 2026-02-16 13:28:11 +00:00
Jordan Woyak
bc0c3d9f6a HW/GCPad: Make Android default to shaking the device for Triforce coin input. 2026-02-16 00:46:50 -06:00
JosJuice
051133787e Android: Add Triforce Baseboard
This lets users select Triforce Baseboard for SI and SP1. Limitations:

* The test, service and coin buttons can be bound to gamepads and other
  physical inputs, but aren't available in the touch input overlay.
* The IP redirections are exposed to the user as a raw string rather than
  a table like in DolphinQt.
2026-02-15 23:13:18 -06:00
Jordan Woyak
c28ec7a6d3 Triforce: Rename IPOverrides to IPRedirections. 2026-02-15 23:13:18 -06:00
Jordan Woyak
cbd43914a5 Network: Improve IPv4PortRange::ToString to support CIDR notation and only last octet difference. 2026-02-15 23:13:18 -06:00
Jordan Woyak
0ff8fb71a3 Triforce: Minor cleanups. 2026-02-15 20:14:15 -06:00
Jordan Woyak
282e14cce6 AMMediaboard: Move things from global namespace to AMMediaboard namespace. 2026-02-15 20:14:15 -06:00
Jordan Woyak
f00b1c590e DolphinQt: Add Triforce tab to main settings window. 2026-02-15 20:14:15 -06:00
Jordan Woyak
0fc8f463f2 DolphinQt/Debugger/NetworkWidget: Minor cleanups. 2026-02-15 20:14:15 -06:00
Sepalani
2d9b3c4118 Debugger/NetworkWidget: Add Triforce support 2026-02-15 20:14:15 -06:00
Jordan Woyak
f657b32521 HW: Rewrite MagCard features of SI_DeviceAMBaseboard in new MagneticCardReader class.
A huge thank you goes to GXTX and https://github.com/GXTX/YACardEmu which this code is based on.
2026-02-15 20:14:15 -06:00
Jordan Woyak
d893565b78 AMMediaboard: IP override improvements and other cleanups.
Overrides now also apply in reverse for accepted connections.
IP Override UI now includes a description.
Mario Kart Arcade GP 4x Multicabinet now works on one PC without any tricky IP configurations.
Added AMMBCommandBind, NetDIMMBind, and some helper functions.
Removed redundant settings.
2026-02-15 20:14:15 -06:00
Jordan Woyak
cf8573421c AMMediaboard: Clean up the defined memory ranges. 2026-02-15 20:14:15 -06:00
Jordan Woyak
93565eb8fa AMMediaboard: Save the IP from AMMBCommandModifyMyIPaddr for later use. 2026-02-15 20:14:15 -06:00
Joshua Vandaële
dc4645d255 SI_DeviceAMBaseboard: Shadowed variable "command" 2026-02-15 20:14:15 -06:00
Jordan Woyak
b2bbbb64bd SI_DeviceAMBaseboard: Fix signed/unsigned comparison. 2026-02-15 20:14:15 -06:00
Joshua Vandaële
7b0ee77840 SI_DeviceAMBaseboard: Comparing an unsigned int and an int 2026-02-15 20:14:15 -06:00
Joshua Vandaële
2c2bfc1fe1 Enums: Unhandled switch statement 2026-02-15 20:14:15 -06:00
Jordan Woyak
535c81c8df Triforce: Automatically set SuggestedAspectRatio as ForceStandard to work around widescreen heuristic issues. 2026-02-15 20:14:15 -06:00
Jordan Woyak
e14a58c1d8 AMMediaboard: Make AMMBCommandSocket determine socket protocol from domain and type rather than forcing TCP. 2026-02-15 20:14:15 -06:00
Jordan Woyak
32e4d88aa9 AMMediaboard: Improve connect() and bind() logging. 2026-02-15 20:14:15 -06:00
Jordan Woyak
a4fd5f8343 Triforce: Lazily load the game into memory using CachedBlobReader. 2026-02-15 20:14:15 -06:00
Jordan Woyak
3681cade41 DiscIO: Add IsCached virtual function to BlobReader. 2026-02-15 20:14:15 -06:00
Jordan Woyak
aaa7094442 Triforce: Implement save states. 2026-02-15 20:14:15 -06:00
Jordan Woyak
63dc3b1972 AMMediaboard: Adjust the verbosity of many LOG entries. 2026-02-15 20:14:15 -06:00
Jordan Woyak
bd3739ce08 AMMediaboard: Flatten the NetDIMMConnect function. 2026-02-15 20:14:15 -06:00
Jordan Woyak
0d7aef298e AMMediaboard: Increase size of NetworkBufferAddress3 area to fix Mario Kart Arcade GP multicab. 2026-02-15 20:14:15 -06:00
Jordan Woyak
af5e90a160 AMMediaboard: Introduce GuestSocketAddress to fix bad sin_family values.
I think the "family" field is only one byte.
2026-02-15 20:14:15 -06:00
Jordan Woyak
f8f74b58fd AMMediaboard: Clean up AMMBCommandModifyMyIPaddr. 2026-02-15 20:14:15 -06:00
Jordan Woyak
0075313dc9 AMMediaboard: Don't swap32 the IPv4 result in AMMBCommand::InetAddr. 2026-02-15 20:14:15 -06:00
Jordan Woyak
a876529a02 AMMediaboard: Minor adjustments to logging. 2026-02-15 20:14:15 -06:00
Jordan Woyak
7ab2672698 DolphinQt: Add user interface for Triforce IP address overrides. 2026-02-15 20:14:15 -06:00
Jordan Woyak
3e2b7fee46 AMMediaboard: Allow IP address overrides to be configured. 2026-02-15 20:14:15 -06:00
Jordan Woyak
5545798e00 Common/Network: Add structs: IPv4Port, IPv4PortRange and functions: IPAddressToString, ParseIPv4PortRange. 2026-02-15 20:14:15 -06:00
Jordan Woyak
97ad5ad1a1 StringUtil: Add SplitStringIntoArray function template. 2026-02-15 20:14:15 -06:00
Jordan Woyak
84b136c994 BootManager: Fix "enumeration value not handled in switch" warning. 2026-02-15 20:14:15 -06:00
Jordan Woyak
17027f0173 MainWindow: Remove the check preventing Triforce volumes from booting without the Baseboard hardware attached.
The hardware is now automatically attached later in the boot process.
2026-02-15 20:14:15 -06:00
Jordan Woyak
b15c593eec BootManager: Automatically attach Triforce Baseboard hardware. 2026-02-15 20:14:15 -06:00
Jordan Woyak
6a53c8f512 AMMediaboard: Make timeout 0ms in NetDIMMAccept to improve performance. 2026-02-15 20:14:15 -06:00
Jordan Woyak
4c61b9e009 AMMediaboard: Replace select() with PlatformPoll in NetDIMMConnect. 2026-02-15 20:14:15 -06:00
Jordan Woyak
587c825a9e AMMediaboard: Clean up and make a function for AMMBCommandAccept. 2026-02-15 20:14:15 -06:00