Commit Graph

45916 Commits

Author SHA1 Message Date
OatmealDome c490bc2c2e BuildMacOSUniversalBinary: Add flag to enable CCache 2026-07-22 17:11:18 -04:00
Scott Mansell b008142f72 Merge pull request #14436 from cbartondock/master
Loading custom textures using combination of elf/dol game ids and iso game ids.
2026-07-22 09:54:01 +12:00
Scott Mansell 00626b263f Merge pull request #14744 from acts-1631/security/elf-reader-bounds
Core/Boot: validate standalone ELF input ranges
2026-07-21 14:58:38 +12:00
Jordan Woyak b24783f84d Merge pull request #14743 from AdmiralCurtiss/sockaddr-init
IOS/NetIPTopDevice: Zero-initialize sockaddr structs
2026-07-20 20:17:44 -05:00
Acts1631 49453c045c Core: log invalid ELF input
Log each rejected ELF header, range, and symbol reference. This
provides actionable diagnostics for malformed files without changing the
validation behavior.
2026-07-20 21:10:29 -04:00
Acts1631 24aafdeb47 Core: validate standalone ELF input ranges
ElfReader trusted table offsets and counts from standalone ELF files.
Malformed input could make it read and write past the loaded file buffer.

Validate the ELF header, table ranges, segment data, section data, and
string-table references before accessing them. Invalid files use the
existing executable boot failure path.
2026-07-20 19:50:54 -04:00
Admiral H. Curtiss 95ee7de40e IOS/NetIPTopDevice: Zero-initialize sockaddr structs
Fixes https://github.com/dolphin-emu/dolphin/security/advisories/GHSA-5fqv-9qrg-gm4j
2026-07-21 01:30:30 +02:00
Admiral H. Curtiss da1aad5188 Merge pull request #14740 from acts-1631/security/netplay-lzo-bounds
NetPlay: bound LZO decompression output
2026-07-21 01:30:10 +02:00
Acts1631 5b9961b0c6 NetPlay: bound LZO decompression output
NetPlay save synchronization decoded remote LZO blocks with the unsafe
decoder and no output capacity. A malicious host could overflow a client
buffer with a block larger than its declared size.

Use the bounds-checking decoder, validate the declared output length, and
grow buffer results only after each checked block has been decoded.
2026-07-19 21:28:23 -04:00
Scott Mansell cb9df12645 Merge pull request #14739 from JoshuaVandaele/mod-convert
GameFile: Disallow mods from being converted
2026-07-20 12:34:50 +12:00
Joshua Vandaële 48b640c8bb GameFile: Disallow mods from being converted 2026-07-19 23:50:05 +02:00
JosJuice 415ec4de18 Merge pull request #14673 from tommywaaf/android-dolphinbar-balance-board
Android: Route DolphinBar Balance Board to the Balance Board slot
2026-07-18 12:34:53 +02:00
Scott Mansell b6d8bc299e Merge pull request #14726 from JosJuice/gcadapter-deregister-on-thread-end
GCAdapter: Deregister callback when scan thread exits
2026-07-16 08:58:02 +12:00
Admiral H. Curtiss 81402ca6aa Merge pull request #14732 from khang06/small-tmd-check
IOS/ES: Prevent reading TMDs that are too small
2026-07-15 22:08:12 +02:00
cbartondock 83dc4685aa waterfall loading of textures via id to prefer elfid-gameid when launched via elf; fallback to gameid if no match 2026-07-15 12:02:16 -07:00
Khang 900febec29 IOS/ES: Prevent reading TMDs that are too small 2026-07-15 02:12:31 -04:00
Scott Mansell fd8391a852 Merge pull request #14263 from JoshuaVandaele/ccache-toggle
CCache: Set as opt-in by default
2026-07-15 17:48:30 +12:00
Scott Mansell 566519d135 Merge pull request #14222 from Sintendo/ppcsymboldb-lookup
PPCSymbolDB: Avoid double lookups
2026-07-15 17:46:54 +12:00
Scott Mansell ee5eba860d Merge pull request #14651 from DacoTaco/fixes/dolalignment
fixes: make dolreader validate section addresses and sizes
2026-07-15 17:08:11 +12:00
Scott Mansell 552126a0e6 Merge pull request #14675 from JosJuice/game-ini-gbihf-texcache
GameSettings: Remove SafeTextureCacheColorSamples from gbihf
2026-07-15 17:01:46 +12:00
Scott Mansell 1ab4403c23 Merge pull request #14703 from JoshuaVandaele/miniupnpc-arm64-cross
Externals/miniupnpc: Disable warnings
2026-07-15 17:00:28 +12:00
Scott Mansell d895ed7d5c Merge pull request #14722 from idkwhere1sthisname/master
IOS/ES: allow Wii System Transfer and WagonCompat Transfer Tool to pass SetUID check
2026-07-15 16:45:43 +12:00
Dentomologist d3b2943807 Merge pull request #14705 from JosJuice/directoryblob-dtk-comment
DiscIO: Add DTK alignment comment in DirectoryBlob
2026-07-14 13:52:09 -07:00
Dentomologist 00beaa84a5 Merge pull request #14730 from JoshuaVandaele/contributing-cxx-standard
Contributing.md: Update C++20 mentions to C++23
2026-07-14 11:58:45 -07:00
Admiral H. Curtiss 37726b610d Merge pull request #14723 from Dentomologist/resource_pack_manager_fix_crash_when_removing_pack
ResourcePackManager: Fix crash when removing pack and properly update list
2026-07-14 19:26:15 +02:00
Admiral H. Curtiss fee15d96ad Merge pull request #14719 from cscd98/m3u-fix
m3u: normalize line endings except win32
2026-07-14 19:14:59 +02:00
JosJuice 1b67ed71f4 Merge pull request #14357 from Windsurf7/sonicunleashed-gameini
GameINI: Add codes to Sonic Unleashed
2026-07-14 18:49:16 +02:00
JosJuice baf154de0e DiscIO: Add DTK alignment comment in DirectoryBlob
This requirement came up in the review of e013d95. Instead of just
removing the comment like e013d95 did, let's add a more detailed
comment.
2026-07-14 18:39:56 +02:00
JosJuice 19729879cb Merge pull request #14711 from tom-pratt/landscape-netplay-screens
Android: Netplay layout update for landscape navigation
2026-07-14 18:38:38 +02:00
Joshua Vandaële cdb93d0c99 Contributing.md: Update C++20 mentions to C++23 2026-07-14 14:51:38 +02:00
Scott Mansell 09fbe2a930 Merge pull request #14729 from JoshuaVandaele/fix-clang-libstdcpp
PerformanceMetrics: Fix compiling using clang&libstdc++
2026-07-14 20:24:24 +12:00
Tom Pratt 009a87de59 Scaffold / Appbar composable
Custom composable that switched between compact and medium size app bar depending on a combination of orientation and screen size. (Small app bar when horizontal on small devices, medium app bar otherwise. Medium app bar supports collapse on scroll.
2026-07-13 12:34:06 +02:00
Dentomologist cdaf67c6ce Merge pull request #14643 from Dentomologist/windows_git_bash_fix_command_line_output
Windows: Fix command line output not displaying when using Git Bash
2026-07-12 23:47:20 -07:00
Dentomologist d6d25b5302 Merge pull request #14351 from Windsurf7/nightsjod-gameini
GameINI: Add codes to NiGHTS Journey of Dreams
2026-07-12 23:28:28 -07:00
OatmealDome 990b421233 Merge pull request #14728 from Simonx22/android/api37-ndk30-dependency-updates
Android: Update dependencies and build tools
2026-07-13 01:00:52 -04:00
OatmealDome f544fbc0ae Merge pull request #14630 from Simonx22/android/convert-contenthandler-to-kotlin
Android: Convert ContentHandler to Kotlin and fix warnings
2026-07-13 01:00:44 -04:00
Joshua Vandaële 55761d9e6d PerformanceMetrics: Fix compiling using clang&libstdc++
When using clang and libstdc++, compiling fails with these errors:

```
FAILED: [code=1] Source/Core/VideoCommon/CMakeFiles/videocommon.dir/PerformanceMetrics.cpp.o
/usr/sbin/ccache /usr/sbin/clang++ -DAUTOUPDATE=1 -DDATA_DIR=\"/usr/local/share/dolphin-emu/\" -DHAS_OPENGL -DHAS_VULKAN -DHAVE_CPPIPC -DHAVE_LIBSYSTEMD -DIMGUI_USER_CONFIG=\"imgui_user_config.h\" -DLZMA_API_STATIC -DOFF -DPUGIXML_NO_EXCEPTIONS -DRC_CLIENT_SUPPORTS_HASH -DSFML_STATIC -DSPNG_STATIC -DTINYGLTF_NOEXCEPTION -DTINYGLTF_NO_EXTERNAL_IMAGE -DTINYGLTF_USE_CPP14 -DUSE_ANALYTICS=1 -DUSE_MEMORYWATCHER=1 -DUSE_PIPES=1 -DUSE_RETRO_ACHIEVEMENTS -DZSTD_MULTITHREAD -D_ARCH_64=1 -D_DEFAULT_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -D_M_X86_64=1 -D__LIBUSB__ -D__STDC_CONSTANT_MACROS -D__STDC_LIMIT_MACROS -I/dolphin-local/Source/Core -I/dolphin-local/Externals/picojson -I/dolphin-local/build/release/x64/Source/Core -I/dolphin-local/Externals/enet/enet/include -I/dolphin-local/Externals/fmt/fmt/include -I/dolphin-local/Externals/mbedtls/include -I/dolphin-local/Externals/minizip-ng/minizip-ng -I/dolphin-local/Externals/liblzma/api -I/dolphin-local/Externals/zstd/zstd/build/cmake/../../lib -I/dolphin-local/Externals/libiconv/include -I/dolphin-local/build/release/x64/Externals/libiconv/lib -I/dolphin-local/Externals/libiconv/libcharset/include -I/dolphin-local/build/release/x64/Externals/libiconv/libcharset -I/dolphin-local/Externals/SFML/SFML/include -I/dolphin-local/Externals/bzip2/bzip2 -I/dolphin-local/Externals/expr/include -I/dolphin-local/Externals/hidapi/hidapi-src/hidapi -I/dolphin-local/Externals/pugixml/pugixml/src -I/dolphin-local/Externals/glslang/glslang/glslang/.. -I/dolphin-local/build/release/x64/include -I/dolphin-local/Externals/rcheevos -I/dolphin-local/Externals/libspng/libspng/spng -I/dolphin-local/Externals/xxhash/xxHash -I/dolphin-local/Externals/imgui -I/dolphin-local/Externals/imgui/imgui -I/dolphin-local/Externals/implot/implot -I/dolphin-local/Externals/glslang/glslang/SPIRV/.. -I/dolphin-local/Externals/tinygltf -isystem /dolphin-local/Externals/libusb/libusb/libusb -isystem /dolphin-local/Externals/glslang/glslang -isystem /dolphin-local/Externals/glslang/glslang/Public -isystem /dolphin-local/Externals/glslang -Qunused-arguments -fcolor-diagnostics -O3 -DNDEBUG -std=c++23 -msse2 -fdiagnostics-color -fno-strict-aliasing -fno-exceptions -fvisibility-inlines-hidden -fvisibility=hidden -fomit-frame-pointer -Wall -Wtype-limits -Wsign-compare -Wignored-qualifiers -Wuninitialized -Wshadow -Wshadow-field-in-constructor -Winit-self -Wmissing-declarations-Wmissing-variable-declarations -Werror=format -Wno-trigraphs -MD -MT Source/Core/VideoCommon/CMakeFiles/videocommon.dir/PerformanceMetrics.cpp.o -MF Source/Core/VideoCommon/CMakeFiles/videocommon.dir/PerformanceMetrics.cpp.o.d -o Source/Core/VideoCommon/CMakeFiles/videocommon.dir/PerformanceMetrics.cpp.o -c /dolphin-local/Source/Core/VideoCommon/PerformanceMetrics.cpp
In file included from /dolphin-local/Source/Core/VideoCommon/PerformanceMetrics.cpp:4:
/dolphin-local/Source/Core/VideoCommon/PerformanceMetrics.h:69:51: error: no matching constructor for initialization of 'std::atomic<FrameBufferSize>'
   69 |   std::atomic<FrameBufferSize> m_frame_buffer_size{};
      |                                                   ^~
/usr/bin/../lib64/gcc/x86_64-pc-linux-gnu/16/../../../../include/c++/16/atomic:237:17: note: candidate constructor not viable: constraints not satisfied
  237 |       constexpr atomic() noexcept(is_nothrow_default_constructible_v<_Tp>)
      |                 ^
/usr/bin/../lib64/gcc/x86_64-pc-linux-gnu/16/../../../../include/c++/16/atomic:238:11: note: because 'is_default_constructible_v<PerformanceMetrics::FrameBufferSize>' evaluated to false
  238 |         requires is_default_constructible_v<_Tp>
      |                  ^
/usr/bin/../lib64/gcc/x86_64-pc-linux-gnu/16/../../../../include/c++/16/atomic:246:7: note: candidate constructor not viable: requires 1 argument, but 0 were provided
  246 |       atomic(const atomic&) = delete;
      |       ^      ~~~~~~~~~~~~~
/usr/bin/../lib64/gcc/x86_64-pc-linux-gnu/16/../../../../include/c++/16/atomic:252:17: note: candidate constructor not viable: requires single argument '__i', but no arguments were provided
  252 |       constexpr atomic(_Tp __i) noexcept : _M_i(__i)
      |                 ^      ~~~~~~~
1 error generated.
```

This was tested and occurs on both Arch and Alpine Linux.
2026-07-13 02:26:49 +02:00
Dentomologist b947a11380 Merge pull request #14356 from Windsurf7/sonicstorybook-gameini
GameINI: Add codes to Sonic Storybook games
2026-07-12 17:20:45 -07:00
Simonx22 aeb3fec03a Android: Update dependencies and build tools
Update Android dependencies and build tools to their latest available versions.

Rename the GameCube save magic constant to avoid a collision with the NDK 30 ARM64 signal context header.
2026-07-12 10:17:39 -04:00
Craig Carnell 4b55c26cdb m3u: normalize line endings except win32 2026-07-12 13:42:22 +01:00
JosJuice 05855a37f4 GCAdapter: Deregister callback when scan thread exits
We were registering the hotplug callback when starting the thread, but
deregistering it when shutting down GCAdapter as a whole. Because the
thread can start and stop potentially many times before GCAdapter shuts
down, this led to callbacks being registered when we already have
callbacks. On Android, this was making Dolphin's Kotlin code for
registering the callback throw an IllegalStateException.

To fix this, deregister the callback when stopping the thread.
2026-07-12 10:20:58 +02:00
Scott Mansell fc9fd6952a Merge pull request #14665 from cristian64/simulated_memory_size
Core: Adjust emulated memory size automatically.
2026-07-12 11:34:44 +12:00
cristian64 f9ef6c2151 Android: Update description for Enable Emulated Memory Size Override. 2026-07-11 23:02:54 +01:00
cristian64 594e5d2b56 DolphinQt: Update tool tip for Enable Emulated Memory Size Override. 2026-07-11 23:02:54 +01:00
cristian64 0cab1731d6 Core: Adjust emulated memory size automatically.
Dolphin now uses the simulated memory size defined in `bi2.bin` to
adjust the memory size in the emulated console automatically.

If **Enable Emulated Memory Size Override** has been enabled by the
user, the fixed memory size specified for **MEM1** and **MEM2** are
still used as they were before.

Most retail games do not define the simulated memory size (Wii or
Triforce games), or define it to a value that matches the default 24 MiB
(GameCube games), so, in the general case, there is no behavior change.
One game that sets the simulated memory to a non-default value is the
debug build of _Mario Kart: Double Dash!!_, where the value is set to
48 MiB.

This enhancement is focused mainly to the modding community. Prior to
these changes, modded games with extended memory requirements would
fail to launch in Dolphin [with no indication of what the problem is] if
the user failed to set the emulated memory override to the correct
value. Now, modding tools can specify the simulated memory size in the
`bi2.bin` file to produce extended games that _just work_ in Dolphin,
without cumbersome instructions that can be overlooked by the user.
2026-07-11 23:02:54 +01:00
cristian64 03b1f2148b DolphinAnalytics: Add game quirk for game simulated memory size.
This is the 32-bit unsigned integer that is seen at offset `0x04` in the
`bi2.bin` file.

The intent is to study what games define values that departure from the
norm. Common values are 0 MiB (Wii games) and 24 MiB (GameCube games),
with some debug and demo builds featuring 48 MiB (e.g. the debug build
of _Mario Kart: Double Dash!!_).
2026-07-11 23:02:54 +01:00
cristian64 ebcbb79f70 Core: Add SConfig::GetSimulatedMemorySize().
This makes the simulated memory size of the running game accessible via
the `SConfig` singleton.
2026-07-11 23:02:54 +01:00
cristian64 24ad562871 Core: Add Volume::GetSimulatedMemorySize().
The data structure of the `bi2.bin` file in which the simulated memory
size is set:

> **13.2  Disk header Information**
>
> this is loaded to the Address in `0x800000f4` when a disc is initialized by the IPL
>
> |  offset  | end | size | Description           |
> | :------: | --- | :--: | --------------------- |
> | `0x0000` |     |   4  | Debug-monitor Size    |
> | `0x0004` |     |   4  | Simulated Memory Size |
> | `0x0008` |     |   4  | Argument offset       |
> | `0x000c` |     |   4  | Debug flag            |
> | `0x0010` |     |   4  | Track Location        |
> | `0x0014` |     |   4  | Track size            |
> | `0x0018` |     |   4  | Countrycode           |
> | `0x001c` |     |   4  | ?                     |

See https://hitmen.c02.at/files/yagcd/yagcd/chap13.html#sec13.2.

Most GameCube games set the value to `24 MiB`, which matches the
physical memory size. Most Wii games set the value to `0 MiB` (unset).
The debug build of _Mario Kart: Double Dash!!_ is one game that sets the
value to `48 MiB`.
2026-07-11 23:02:54 +01:00
Dentomologist a18fd2d21b ResourcePackManager: Erase Removed pack from list and table
Erase a removed pack from ResourcePack::<anonymous namespace>::packs
instead of only deleting the pack file from the disk.

This causes the repopulated table to actually display that the pack has
been removed (which previously only happened after restarting Dolphin or
hitting `Refresh`), and also removes the pack from the `Packs.ini` file.
2026-07-11 12:49:35 -07:00
Dentomologist 37dd6c287e ResourcePackManager: Fix crash when removing pack
Avoid accessing destroyed `QTableWidgetItem` by retrieving the desired
path from the item before it's destroyed.

In `ResourcePackManager::Remove` pointers to the selected items in `m_table_widget`
were saved in the local variable `items` before calling `Uninstall`.
`Uninstall` called `RepopulateTable` which called
`m_table_widget->clear()`, destroying the table's descendants.  Upon
returning to `Remove` `items` then pointed to some of those destroyed descendants, and
passing `items[0]` to `GetResourcePackIndex` resulted in a call to
`item->row()` which was a use-after-free.

Fixes https://bugs.dolphin-emu.org/issues/14095.
2026-07-11 12:35:47 -07:00