msg_in and msg_out were ending up with only 4-byte alignment, which
is undefined behaviour, since they contain 64-bit fields. Probably
doesn't cause any issues, but it showed up in ubsan.
A malicious GCZ file could probably force this to be negative.
Shouldn't cause any issues other than file read failures, but need to fix
because it is causing errors on MSVC.
SectorReader::ReadChunk does do some validation on it, but it only
checks against the original disc size (reported by the GCZ file).
It has no idea how many blocks the header claimed the disc had.
A maliciously crafted GCZ file could trigger read overflows off the end
of the m_block_pointers/m_hashes arrays.
A malicious dol could theoretically use integer wraparound to bypass
bounds checking and cause DolReader to read past the end of m_bytes.
Could result in crashes, wasting large amounts of memory, or even the
disclosure of heap memory contents.
We are updating from 3.4.8
Changes relevant to us include:
3.4.10:
- Added controller sensor support for GameInput v3
- Fixed Ipega controllers being ignored in keyboard mode
- Added support for GameCube rumble when the adapter is in PC mode and has the latest firmware
- Fixed rumble on the new Steam Controller
- Added support for the GameSir Super Nova in Xbox 360 mode
- Added support for the PDP Afterglow Wave Wireless Controller for Switch
3.4.12:
- Added hotplug detection support when using libusb for HIDAPI controllers
- Fixed flipped Xbox 360 controller axes on macOS
It's not in the changelogs, but 3.4.10 is the revision which allowed for my Steam Controller's gyro to properly work in Dolphin
Since our bump to Qt, dxcompiler.dll and dxil.dll have been added alongside other Qt dlls as part of QtGui. Those DLLs are not needed since we use QtWidgets and not QML.
This introduces a CMakePresets file for both Unix-likes and Windows that replace the old CMakeSettings.
It adds presets for **Debug** and **Release** profiles for both **x64** and **ARM64** architectures, as well as **Generic builds**.
Presets can be used using[ Visual Studio's built-in CMakePresets support](https://learn.microsoft.com/en-us/cpp/build/cmake-presets-vs?view=msvc-170), or [Visual Studio Code's CMake Tools](https://marketplace.visualstudio.com/items?itemName=ms-vscode.cmake-tools) extension.
They can also be used from the command line, like so:
- x64/Unix-like/Ninja:
- Configure: `cmake --preset ninja-release-x64`
- Build: `cmake --build --preset ninja-build-release-x64`
- Configure + Build: `cmake --workflow --preset ninja-release-x64`
- ARM64/Windows/Visual Studio:
- Configure: `cmake --preset visualstudio-release-arm64`
- Build: `cmake --build --preset visualstudio-build-release-arm64`
- Configure + Build: `cmake --workflow --preset visualstudio-release-arm64`
The Ninja generator is available to both Windows and Unix-likes, while the Visual Studio Generator is only available on Windows.
**Cross-compiling**
On **Windows**, the Visual Studio generator automatically takes care of everything, you just need to select an ARM64 preset.
On **Unix-likes**, to cross-compile you need to install a cross-compiler and (optionally) a sysroot of the target system.
Here is an example to compile from x64 to ARM64 with a sysroot:
- `cmake --preset ninja-release-arm64 -DCMAKE_C_COMPILER=aarch64-linux-gnu-gcc -DCMAKE_CXX_COMPILER=aarch64-linux-gnu-g++ -DCMAKE_SYSROOT=/opt/sysroots/aarch64-linux-gnu`
- `cmake --build --preset ninja-build-release-arm64`
You will need a sysroot to link against Qt, since we do not vendor it in on platforms other than Windows.
**User presets**
A `CMakeUserPresets.json` file may be created locally at the root of the project to further customize your presets.
For example, here are the user presets I used to test this PR on Arch Linux with a generic Arch Linux ARM sysroot:
```json
{
"version": 10,
"configurePresets": [
{
"name": "gcc-debug-arm64",
"inherits": "ninja-debug-arm64",
"cacheVariables": {
"CMAKE_C_COMPILER": "aarch64-linux-gnu-gcc",
"CMAKE_CXX_COMPILER": "aarch64-linux-gnu-g++",
"CMAKE_EXE_LINKER_FLAGS": "-L/opt/sysroots/ArchLinuxARM/lib",
"CMAKE_SYSROOT": "/opt/sysroots/ArchLinuxARM"
}
},
{
"name": "clang-debug-arm64",
"inherits": "ninja-debug-arm64",
"cacheVariables": {
"CMAKE_C_COMPILER": "clang",
"CMAKE_CXX_COMPILER": "clang++",
"CMAKE_C_FLAGS": "-target aarch64-linux-gnu",
"CMAKE_CXX_FLAGS": "-target aarch64-linux-gnu",
"CMAKE_SYSROOT": "/opt/sysroots/ArchLinuxARM"
}
},
{
"name": "clang-debug-x64",
"inherits": "ninja-debug-x64",
"cacheVariables": {
"CMAKE_C_COMPILER": "clang",
"CMAKE_CXX_COMPILER": "clang++"
}
}
],
"buildPresets": [
{
"name": "gcc-build-debug-arm64",
"configurePreset": "gcc-debug-arm64"
},
{
"name": "clang-build-debug-arm64",
"configurePreset": "clang-debug-arm64"
},
{
"name": "clang-build-debug-x64",
"configurePreset": "clang-debug-x64"
}
],
"workflowPresets": [
{
"name": "gcc-debug-arm64",
"steps": [
{ "type": "configure", "name": "gcc-debug-arm64" },
{ "type": "build", "name": "gcc-build-debug-arm64" }
]
},
{
"name": "clang-debug-arm64",
"steps": [
{ "type": "configure", "name": "clang-debug-arm64" },
{ "type": "build", "name": "clang-build-debug-arm64" }
]
},
{
"name": "clang-debug-x64",
"steps": [
{ "type": "configure", "name": "clang-debug-x64" },
{ "type": "build", "name": "clang-build-debug-x64" }
]
}
]
}
```
They are then used like so:
Configure + Build with GCC: `cmake --workflow --preset gcc-debug-arm64`
Configure + Build with Clang: `cmake --workflow --preset clang-debug-arm64`
Configure + Build with Clang (x64): `cmake --workflow --preset clang-debug-x64`
*Addendum: It should also now be possible to cross-compile from Windows to Unix-likes, and Unix-like to other Unix-like (e.g. Linux -> FreeBSD), however this is untested.*
Log each rejected ELF header, range, and symbol reference. This
provides actionable diagnostics for malformed files without changing the
validation behavior.
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.
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.
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.
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.
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.
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.
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!!_).
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`.
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.
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.
Some of the speed hacks were not approved for RetroAchievements, meaning that users had to choose between not getting hardcore achievements, or having poor performance.
Also, renamed the instances of `$Limit internal FPS to VPS (improves performance)` to `$Limit internal frame rate (speed hack)` for consistency. They are enabled by default, so unless the user disabled them, it won't break the configuration.
WiimoteScannerAndroid::FindAttachedWiimotes() added every device
connected through the DolphinBar to the Wii Remote results, with a
TODO noting that balance boards were not differentiated. As a result,
a Wii Balance Board connected through the DolphinBar was always
assigned to a Wii Remote slot (Player 1), and games that request a
Balance Board never detected it.
Use Wiimote::IsBalanceBoard() to route balance boards into the
balance_boards results, matching the Linux and Windows scanner
backends. Tested on an AYN Thor (Android 13) with a Mayflash
DolphinBar in Mode 4 running Wii Fit Plus: the board is now detected
in the Balance Board slot.
This lets rumble work even if the user has turned off the Android
setting Sound and vibration > Vibration and haptics > Interactive
haptics > Touch feedback. Rumble can still be disabled through Dolphin's
controller bindings and through in-game settings (GameCube) or SYSCONF
(Wii).
fb4ff3e put all the code for the show internal resolution setting right
next to the code for the show FPS setting, presumably because an earlier
version of that commit had them next to each other in the GUI. It makes
more conceptual sense to put the code next to the code for the show
statistics settings, matching what the GUI looks like now.
fb4ff3e added a statistics option to show the internal resolution, but
it just showed the total size of the EFB (which is always 640x528) times
the IR scale, so it didn't convey any useful information.
This commit instead makes the option use the size of the last XFB copy
(not multiplied by the IR scale), which changes based on the game's
rendering resolution.
Check if Dolphin already has a handle for stdout or stderr before trying
to attach to the console of the parent process.
Previously, running Dolphin via Git Bash with options like `--help` or
`--version` wouldn't produce any output. This was the result of the fix
(1ce75ce217) for
https://bugs.dolphin-emu.org/issues/11042, before which output did work
for `Git Bash` but didn't for `Command Prompt` or `PowerShell`.
We don't need to see Compose previews when making a release build, but
androidx.compose.ui.tooling.preview.Preview is referenced in the source
code nonetheless, so the build system needs to know what it is.
Example:
```
nand. r1, r2, r3
```
Assuming that none of these registers will be used again:
- Before #14278, all of them would be flushed on both sides of the branch.
- After #14278, r2 and r3 would have been flushed earlier, but r1 won't.
- With this, r1 is flushed in ComputeRC.
Now SerialInterfaceManager::UpdateDevices reads the configured SI
devices directly from Config instead.
The main reason why I wanted to do this is so that Android can change SI
devices while emulation is running. (Android didn't have the code for
calling ChangeDevice.) But when implementing the change, I noticed that
NetPlay and Movie were using ChangeDevice as a way of overriding the SI
devices configured by the user. Replacing this ended up making the change
larger than I first anticipated.
For Wii Remotes, there was no equivalent to ChangeDevice, so NetPlay and
Movie were using Config::SetCurrent to override the Wii Remote source
configured by the user. If we can use the config system to override Wii
Remote sources, why not do the same for SI devices? This commit makes
NetPlay and Movie set SI devices and Wii Remote sources in the NetPlay
and Movie config layers, as that is the conceptually appropriate place
to do it.
As far as I can tell, the old Movie code for overriding SI devices and
Wii Remote sources didn't actually work. This new code does. I didn't
investigate exactly why it didn't work, but maybe it's because loading
a movie happens before emulation actually starts.
This fixes https://bugs.dolphin-emu.org/issues/14076. The issue report
more or less already says it all, but to provide a shorter summary:
We were fetching a list of vibrator IDs, but instead of passing the
vibrator ID to the vibrator manager, we passed the index of the ID in
the list. This happened to work fine on many devices, including all
devices that use DolphinVibratorManagerCompat, due to the only Vibrator
having both an index and ID of 0. But on some devices, it failed due to
the ID of the Vibrator being 1.
This fix makes us correctly pass the ID to the vibrator manager. We
still use indices in controller INI files, both for compatibility with
the controller mappings shipped with Dolphin (which use index 0) and for
backwards compatibility with older controller INI files.
These changes originate from testing the behaviour of the PI registers
in Linux on my Wii.
I started by testing the masks, writing 0xFFFF_FFFF to the registers on
the Wii, and then got told about their value on a GameCube, and then
figured out most of the registers through a discussion with Extrems.
This change was causing some issues:
> Made FMT_STRING a no-op when FMT_USE_CONSTEVAL is enabled, since the consteval format-string constructor already provides compile-time validation (#4611, #4612). Thanks @friedkeenan.
We had some code in VolumeVerifier to catch the error message that
Redump.org used to show when trying to access the Wii datfile without
logging in. This restriction was removed from Redump.org around the
start of 2022, and the code has been unnecessary ever since.
When we added the RetroAchievements integration, we had a discussion
about whether sending version information in the user agent was fine
from a privacy standpoint. We reached the conclusion that it was okay,
but it was conditional on the website having a privacy policy. Neither
incarnation of Redump has that, and Redump also never asked us to send
version information like RetroAchievements did, so let's use a user
agent that just says "Dolphin" when connecting to Redump.
All the staff of Redump (except the absentee sysadmin) have decided to
start a new version of the website at redump.info. It has every disc
from the old site, it has HTTPS, it isn't buckling under the load of AI
scrapers, and moving forward, all adding and verifying of discs is going
to be happening on the new website only. Let's move over.
I've taken the unusual step of updating the translation files manually.
This is because we're very close to a release and because the change is
simple enough that I feel confident about making the change to languages
I don't speak. (I double checked that the Korean translation doesn't
ever follow "Redump.org" by a particle that has a different form
depending on whether there's a final consonant.)
Found out when attempting to make a speed hack to help Dolphin detect an idle loop. The inserted `nop` was preventing it from considering it an idle loop.
A few actions were missing from shortcuts in the Tools menu. This allows using e.g. `ALT`+(`T`>`E`>`S`) to open the Skylanders Manager, or `ALT`+(`C`>`C`>`1`) to toggle the first Wii Remote's connection.
This makes us savestate the NAND using the same APIs the guest uses
instead of directly touching the host files. This solves several
problems:
* If the user loaded a malicious savestate, it could use path traversal
to overwrite arbitrary files on the host file system. (Reported by
MrSynAckster.)
* Metadata (UID, GID, attribute, modes) wasn't being savestated.
* NAND redirects weren't handled, except for NAND redirects at the root
of where the savestate was being done. (This only possibly matters if
TASing a Riivolution patch. The root of the savestate is at /tmp when
not TASing, and the only case where we do a NAND redirect is inside
/title if requested by a Riivolution patch.)
Extrems said that it's unnecessary because GBIHF doesn't use the GPU.
Video output doesn't work in GBIHF in Dolphin regardless of this
setting, so I can't actually test it.
The conditions were in reverse order (maybe someone was reading the
PowerPC manual and forgot about IBM's bit numbering), and additionally
the two conditions for unsigned comparison were wrong.
Fixes https://bugs.dolphin-emu.org/issues/14054.
Reported by MrSynAckster. A specifically crafted NAND dump could use
path traversal to overwrite files on the host file system.
This is also an accuracy fix for importing NAND dumps that contain
file names that Dolphin is supposed to escape. Some games' save files
are affected.
GetPath has two special cases where it doesn't add a slash.
The first is for the root entry's special name "/". The next commit will
be neater if we can skip calling GetPath for the root entry, because '/'
is one of the characters that Common::EscapeFileName replaces with an
escape sequence. Let's check for entry number 0 instead.
The second is for parent paths that already end in a slash. There's no
actual need to check for this - double slashes are harmless, and for
comparison, NANDImporter::ExtractCertificates already appends slashes
without checking if there already is one. Let's remove this check.
Workaround for the following error on gradle sync:
java.nio.file.InvalidPathException: Illegal char <:> at index 68:
C:\Users\tompr\Development\dolphin\Externals\minizip-ng\minizip-ng\C:\Users\tompr\Development\dolphin\Source\Android\app\.cxx\RelWithDebInfo\3b681gem\arm64-v8a\Externals\zlib-ng\zlib-ng
NetplayScreen was not drawing under the bottom nav bar like other screens. In landscape mode half of the screen scrolls and half is fixed, to make this look natural with edge to edge, provide a fade on the bottom of the scrolling side so things look natural when the screens loads and is resting at 0 scroll offset.
To avoid using dual pane layout on very small devices, ensure that the current width available for display is at least medium (600dp).
It also has to be landscape, the dual pane mode looks weird on a tablet in portrait mode since there's not that much content.
We just about get away with using a StateFlow in NetplaySession since the host sends AbortGameDigest when closing their own dialog. Without that it would be harder for the UI to distinguish between subsequent dialogs. If that wasn't the case then NetplaySession might need to expose the individual progress and result updates and have the view model assemble it into the overall GameDigestProgress.
Create a new NetplaySession each time we try to join a netplay game. Hold onto it in NetplayManager so its available to the different activities that need to access it. Close the session when backing out of the netplay UI. Some guardrails in case things go out of sync: creating a session closes the old one if it is still around for some reason, finalizer in NetplaySession to release native resources if not closed explicitly for some reason. Profiling done to ensure all kotlin and native objects are successfully cleared / garbage collected.
An orientation change can trigger this code path immediately when a game starts. e.g. dolphin is portrait when launching the game but settings force gameplay to landscape. We want to avoid this and continue to the netplay launch code below.
If the user backgrounds dolphin during netplay and then resumes after the process has died it will actually resume from the save state in single player mode, not sure if thats good or bad but fine for now.
Netplay doesnt handle rotation very well, seems to go more and more out of sync the more rotations.
Boot session data is already handled when the game is booted so this is just fallback in case the game launch fails in some weird way.
Add missing @Keep annotations to functions called from C++
If the last write to a register comes before the last read of it,
we can write the register to ppcState after the last write instead of
after the last read. This will hopefully help spread out m_ppc_state
writes across a code block, improving pipelining. Also, if there's a
conditional branch that's after the last write but before the last read,
instead of needing to emit one m_ppc_state write on each side of the
branch, we now only need to emit one m_ppc_state write.
A note about the changes made to stmw and mfcr: These instructions don't
write to any GPRs or CRs respectively – they only read from them.
With this commit, there are no longer any cases where registers get
written back to m_ppc_state after an instruction that just reads from
them, so we can get rid of all STP logic from these two instructions.
lmw still needs its STP logic, since that one does write to registers.
This jumps us up two releases, both of which only introduce bug fixes. Changes potentially relevant to us are:
[3.4.6](https://github.com/libsdl-org/SDL/tree/release-3.4.6):
- Fixed Xbox controllers being unresponsive on preview release of Windows 11
- Fixed the menu button state on controllers on Apple platforms
[3.4.8](https://github.com/libsdl-org/SDL/tree/release-3.4.8) (hotfix release):
- Fixed a controller related crash on Windows, introduced in 3.4.6
For some reason, NativeLibrary.kt calling Log for the alert message text
makes Dolphin die with a JNI error. Supposedly the jstring passed to the
logging function is invalid. I don't understand why, because the dialog
that we show right afterwards is able to read the string just fine. The
error happens even if I pass the string directly to Log without
prepending any extra text.
There's no real downside to having the logging in C++ instead of Kotlin,
so let's move it to C++ to avoid the JNI error.
When calling `ShowMessageAlert` with a given `MsgType`, log the alert
with a `LogLevel` matching the `MsgType` instead of always using
`LogLevel::LERROR`.
SendGameStatus() was writing SyncIdentifierComparison as a u32 but the server reads it as a u8 enum, so the server always gets 0 (SameGame). This bug was introduced in commit 66276ac.
Remove the [[maybe_unused]] annotation from various parameters that are
unconditionally unused and comment out their names instead. This makes
it unambiguous that the variables are unused, while making the remaining
[[maybe_unused]] annotations more reliable indicators that those
variables are in fact used in some contexts.
These parameters are mostly in overridden functions where the override
doesn't need that particular variable.
Make `s_is_adapter_wanted` and the elements of `s_config_rumble_enabled`
atomic.
The CPU thread reads `s_is_adapter_wanted` and `s_config_rumble_enabled`
in `Output`, while the host thread writes to them in `RefreshConfig`.
The simplest way to trigger this race is to close the `Settings` window
while playing a game with the adapter active.
The 0x8000 alignment in DirectoryBlob is needed for Wii disc group encryption,
but for GC/Triforce it inflates file offsets unnecessarily. Use 0x20 alignment
for Triforce (matching original disc layout) while keeping 0x8000 for GC due
to DTK audio streaming requirements.
On Triforce games with many files, the inflated offsets can land in the
AMMediaboard DIMM memory range (0x1F000000-0x1F800000). Reads from that
region return SRAM data instead of disc data, causing the game to hang.
Skip the DIMM range when assigning per-file data offsets if any portion of
the file would overlap [0x1F000000, 0x1F800000).
This fixes VolumeVerifier potentially calling TMDReader::GetIOSId for
invalid TMDs.
VolumeVerifier also has a call to TMDReader::GetContent that doesn't
check if the TMD is valid. In practice, this can't get called with an
invalid TMD because the previous commit made it so GetContentOffsets
returns an empty vector if the TMD is invalid, but I've added a check
inside TMDReader::GetContent just to be on the safe side.
I also made VolumeVerifier show a specifically worded problem if the
ticket or TMD is invalid. Before, invalid TMDs in Wii discs and WADs
and invalid tickets in WADs would show a more generic problem.
EGL is the de-facto GL context initialization API, including on X11
where it provides many additional features over GLX.
I’m planning on adding support for selecting the GPU (adapter in
Dolphin-speak) also to OpenGL, similarly to the Vulkan backend, and that
will require EGL, so let’s remove the legacy API first.
The warning can be seen since 1f72403ec7 when GCC 13.3.0 is used:
```counterexample
[1540/1898] Building CXX object Source/Core/VideoCommon/CMakeFiles/videocommon.dir/TextureCacheBase.cpp.o
/w/dolphin/Source/Core/VideoCommon/TextureCacheBase.cpp: In member function 'void TextureCacheBase::ApplyMaterialToCacheEntry(const VideoCommon::MaterialResource&, TCacheEntry*)':
/w/dolphin/Source/Core/VideoCommon/TextureCacheBase.cpp:3136:19: warning: loop variable 'texture' creates a copy from type 'const VideoCommon::MaterialResource::TextureLikeReference' [-Wrange-loop-construct]
3136 | for (const auto texture : material_data->GetTextures())
| ^~~~~~~
/w/dolphin/Source/Core/VideoCommon/TextureCacheBase.cpp:3136:19: note: use reference type to prevent copying
3136 | for (const auto texture : material_data->GetTextures())
| ^~~~~~~
| &
```
This is a follow-up to 3e788399b6 (#14153), where a custom
style for `QGroupBox` widgets was introduced when the Fusion style is
used.
However, it was overlooked that the custom QSS does not get along well
with Qt versions older than 6.6.0; on Windows, Qt 6.5.1 is used.
| With Qt 6.5.3 | With Qt 6.11.0 |
| ------------- | -------------- |
| <img alt="Dolphin with Qt 6.5.3" title="Dolphin with Qt 6.5.3" src="https://github.com/user-attachments/assets/9d341eef-0438-44c0-b341-8d0a53d9eb09" /> | <img alt="Dolphin with Qt 6.11.0" title="Dolphin with Qt 6.11.0" src="https://github.com/user-attachments/assets/1bc793d2-c958-413b-b99c-51d064104a75" /> |
Compile checks have been added now to only apply the custom style if
Qt 6.6.0 (or newer) is used.
This can be useful for experimenting with how a game behaves with and
without page table fastmem. As with everything in the JIT menu, this is
only available if Dolphin's debugger is enabled.
I didn't add this in 989a95a when I added the setting itself because we
were under a string freeze for Dolphin 2603a at the time.
Accomplished using `run-clang-tidy` with `performance-move-const-arg,performance-unnecessary-value-param,modernize-pass-by-value`.
Changed arguments to const references, removed them where inappropriate (e.g. sink parameters). Same with std::move.
Manually reviewed each change to make sure that it makes sense, and do something more appropriate if possible.
The only call of `IsScannerReady` was removed by
81be0001a9, and most of the `IsReady`
functions were only called by `IsScannerReady`.
The one exception was in `WiimoteScannerLinux`, which is now a private
function instead of inheriting from the one in `WiimoteScannerBackend`.
Allow ImmediateXFB since this game seems fine with it.
Don't force EFBAccess. Unlike other Krome games, this game doesn't do any EFB access on boot like the comment implies.
The Open in External Editor button makes editing a game INI file easy,
and the Refresh button is only useful if you edit the game INI. You're
not supposed to edit read-only game INIs, so let's not show these two
buttons for read-only game INIs.
I implemented this by hiding the buttons instead of not creating them in
the first place so we don't have to branch on whether the buttons exist
in GameConfigEdit::ConnectWidgets.
Back in 2018, a Presets system was added to DolphinQt's GameConfigEdit.
Presets was a dropdown menu where you could select a particular setting
to add to your custom game INI. Only a small number of settings were
made available, with the intent that more would be added over time.
8 years later, the set of available settings hasn't been expanded at
all, and I don't know of anyone who uses these presets. On top of this,
we have now made good progress in exposing per-game settings
graphically. I think the Presets system is best off removed.
In place of the Presets menu, we now have "Refresh" and "Open in
External Editor" buttons. These more useful actions were previously
hidden away in the Presets menu.
`value` contains 16 bits of data and `remainder` contains 11 bits of
data. When they're added together, we may end up with 17 bits of data,
so the result should be stored as u32 rather than u16.
This fixes `y` being set to 0 (minimum amplitude) when it should be set
to 32 (maximum amplitude).
In the PWM audio we output, instead of each group of 512 bits consisting
of a run of ones followed by a run of zeroes, now each group of 32 bits
consists of a run of ones followed by a run of zeroes. This gets rid of
noise that was previously present.
Doing this for every group of 8 bits instead makes the Game Boy Player
Start-Up Disc not start correctly for some reason. Game Boy Interface
works fine, though.
I also made us not discard the bottom 7 bits of each PCM sample.
According to Extrems, a real GBA doesn't actually output that many bits,
but doing it in this way makes the code simpler anyway.
Fix incorrect scaling of the gap drawn inside enabled breakpoints in
BreakpointWidget when breakpoints are globally disabled and the font
size is changed from the default.
As the font size increased the gap would become larger and its center
would "migrate" downward and rightward until the gap stopped being
visible at all.
Additionally, at small font sizes integer truncation issues could result
in the gap being offset towards the top left.
Now with cancel button and an actual progress bar. For simplicity, we do
two passes on the progress bar, one for loading the NAND into memory and
one for extracting it. The user directory is likely on an SSD, making
the extraction pass invisibly fast.
Mistakenly, MISALIGNED_HOLE_MASK_PAGE_TABLE_BASE was aligned and
MISALIGNED_HOLE_MASK_PAGE_TABLE_BASE_ALIGNED was misaligned. It should
be the other way around.
These variables are unused due to a separate mistake which is corrected
in the next commit.
Unmapped on the physical level, not the MMU level.
Fixes booting Game Boy Interface. Previously, Game Boy Interface thought
it was running on a Wii because accessing MEM2 didn't raise a PI
interrupt, and as a result tried to exit to the Homebrew Channel in a
way Dolphin's HLE doesn't recognize. (Dolphin's HLE catches jumps to
0x80001800, but GBI is running without address translation at this point
and therefore jumps to 0x00001800 instead.)
Use `sizeHint` instead of `setMinimumSize` to increase the default size
of `StickWidget` and `IRWidget`.
0531286906 doubled the initial sizes of
`StickWidget` and `IRWidget`, but using `setMinimumSize` to do so
prevented users from shrinking the widgets manually.
Resolves bugs.dolphin-emu.org/issues/14019.
Jit64::dcbz's fast path bypasses the dcache, so we shouldn't use it if
accurate dcache is turned on. This fixes the graphical corruption that
would occur in Mario Kart Wii's menu FMVs with accurate dcache.
JitArm64 never had this problem, because it implements dcbz in a
different way. It calls EmitBackpatchRoutine, which already has a check
for accurate dcache.
Rename `AUTO_UPDATE_BETA_INDEX` to `AUTO_UPDATE_RELEASE_INDEX` and
`AUTO_UPDATE_BETA_STRING` to `AUTO_UPDATE_RELEASE_STRING`.
Add a comment explaining that `AUTO_UPDATE_RELEASE_STRING = "beta"` for
backward compatibility reasons.
Some games are showing frame flickering, e.g. Pokémon games when only
the text at the bottom of the screen is updating. GB/GBC games are
apparently especially affected, presumably due to the extra border.
`OpenModeToAndroid("r")` is conceptually wrong, since we're opening a
binary file. It should be either `OpenModeToAndroid("rb")` or just
`"r"`. But either way it evaluates to `"r"`, so this doesn't affect
behavior.
The following settings were excluded:
* Port 1-4 ROM: We're only supporting Game Boy Player for now
* Save in Same Directory as the ROM: Implementation nightmare due to SAF
SAF for save files is a huge can of worms because they're managed in a
more complicated way than asking the user to select an existing file,
so I won't be touching save files for now.
Don't set `s_update_triggered` if the updater process fails to be
created. This will allow users in that situation to try to start an
update later without having to restart Dolphin first.
We used to create User/Logs/ as a side effect of creating
User/Logs/Mail/, but the creation of User/Logs/Mail/ was removed in
8cbfee2, so now nothing is creating User/Logs/ anymore. Let's explicitly
create it.
Give MixerFifo a variable sample rate dividend.
Handle byte-swapping and stereo channel construction outside of MixerFifo to better handle the custom layouts of each stream.
- Row height is no longer hardcoded to `24`; instead, the height is
determined by the font height of the currently selected debug font.
- Header height has been reduced (a factor of the font height) as it
only serves as a column resizer.
- A `OnDebugFontChanged()` slot has been connected to properly update
the widget on debug font changes.
| Before | After |
| --- | --- |
| <img alt="Registers widget (before)" title="Registers widget (before)" src="https://github.com/user-attachments/assets/8a6644f9-1081-4ac8-9fff-c79ddb73e103" /> | <img alt="Registers widget (after)" title="Registers widget (after)" src="https://github.com/user-attachments/assets/67f799d0-8afd-4081-bb40-3d7a76ddc705" /> |
These two games have some strange rendering behaviors and therefore can't use the generic bloom actions.
These games have several bloom EFB copies and they draw that on top of an already rendered game. After doing that, they render some other draw calls to "fixup" the bloom that it drew to effectively remove it. This isn't uncommon but there is one special thing these games do...they use a RAM EFB copy for the 'fixup'. This means when playing with high IR, the game will look blurry in specific parts of the screen where the game was attempting to fix the copy!
Bloom removal has addressed this by removing all the draw calls related to the bloom, including the fixup draws. The user then needs to turn on 'EFB Copy To Texture Only' for the best visuals (De Blob 2 in particular is broken without this) as the default settings.
Bloom blurred will need special attention too but Dolphin doesn't currently have enough functionality to handle it.
Add a mod for all games with bloom targets that blurs the bloom based on resolution using a custom material. The shader exposes bloom brightness and the amount of spread through uniforms (not exposed in the UI yet).
The original shader logic was done by TryTwo. This shader was reworked for graphics mods and cleaned up slightly.
Co-authored-by: TryTwo <taolas@gmail.com>
After an EFB operation is turned into a texture, if there is a graphics mod action that provides a custom material, update the EFB texture with the material
This expands the interface of 'CustomResourceManager' to get a Material for post processing a frame buffer (currently EFB). The flow is similar to the normal draw material but distinguishes itself by not needing a UID. The full shader is much simpler than the draw shader and is currently put inline with the shader resource.
* Add a 'AfterEFB' function to graphics mod action that can return a Material
* Rename previous EFB graphics mod function to 'BeforeEFB' to differentiate from 'AfterEFB'
* Rename previous XFB graphics mod function to 'BeforeXFB' to mirror EFB
INI files for both known regions of _Mario Kart Arcade GP 2_ (Triforce)
have been added to the `GameSettings` directory:
| Game ID | Region | Revision Date |
| ------- | ------ | ------------------- |
| GNLE82 | NTSC-U | 2007/02/07 02:47:24 |
| GNLJ82 | NTSC-J | 2007/02/06 20:29:25 |
The files contain Action Replay and Gecko cheat codes. Some of the cheat
codes have been sourced from the Internet; others have been developed by
the author of this change.
> [!IMPORTANT]
> Triforce games may have had multiple revisions for a given game region
> after the original release, and Dolphin cannot distinguish them at
> this time. Cheat codes are developed for one revision only, and cannot
> work with other revisions.
>
> For this reason, every cheat code name is provided with a prefix that
> states the revision date of the target game revision. It will be up to
> the user to enable the cheat codes for their correct game revision and
> region. The revision date for _Mario Kart Arcade GP 2_ games can be
> seen in the SegaBoot menu, under the **ENTER GAME TEST > OTHERS**
> screen.
> [!NOTE]
> Prior to issue #14470, the game ID for the NTSC-U region was
> incorrectly assigned the game ID of the NTSC-J region due to an issue
> in how the region flag in boot.id files was treated. This issue
> blocked the addition of the INI files until the issue was resolved (a
> region mismatch would cause fatal errors if cheat codes for the wrong
> version were enabled in Dolphin).
> [!CAUTION]
> There have been seen game dumps in the wild that, even though their
> real region is NTSC-U, the region flag in their `boot.id` file is
> `0x02` (NTSC-J), instead of `0x0E` (NTSC-U).
Moved JVS IO emulation from SI_DeviceAMBaseboard into new JVSIOBoard class.
Sega/Namco board-specific functionality is handled by derived JVSIOBoard classes.
Game input is now sourced from IOPorts rather than being hard coded into JVS IO handlers.
SI_DeviceAMBaseboard: Use IOPorts for status switch input.
Created IOAdapter classes for FZeroAX games.
Created SerialDevice classes for MarioKartGP and FZeroAX FFB steering wheels.
Added game-specific input handling to the various IOAdapter classes.
Some users seem to be under the impression that the panic alert is
saying that enabling MMU will fix the issue, but that's not what it
actually says. Let's try to make this a bit clearer.
Override AGP-bundled R8 in settings.gradle.kts:
- classpath("com.android.tools:r8:9.1.34") from r8-releases/raw
This resolves :app:minifyReleaseWithR8 failing with:
java.lang.IndexOutOfBoundsException: Index -1 out of bounds for length 0
Bug report: https://issuetracker.google.com/issues/495458806
Co-Authored-By: OatmealDome <julian@oatmealdome.me>
This is fixed by setting Texture Cache Accuracy to Safe.
Affected titles:
- R2F Freddi Fish: Kelp Seed Mystery
- RDL Spy Fox in Dry Cereal
- RJQ Pajama Sam: Don't Fear the Dark
I think we've gotten all the useful reports we can get from this now.
Nowadays we're just getting repeated reports of issues we already know
about, like https://bugs.dolphin-emu.org/issues/12321.
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`.
This was causing the achievement runtime to shutdown in the middle
of a disc change even if the resulting disc was valid, which was
causing achievements like the ones in Resident Evil for completing
the entire game in a single session to break midway through.
Also adds a log to notify the user when the disc change is invalid
(e.g. different game inserted).
Significantly rewrote ICCardReader and DeckReader functionality.
Dual IC card slots of VirtuaStriker4 + Gekitou now work.
IC cards are automatically inserted/ejected in VirtuaStriker4 + Gekitou + Avalon.
IC card data is saved to a file.
Avalon deck contents are loaded from a JSON file.
Added IOPorts class to handle bespoke GPIO functionality.
TimeSplitters: Future Perfect is crashing if page table fastmem is
enabled. The reason hasn't been analyzed yet. For the time being, let's
use GameSettings to bring back the old behavior of not having page table
fastmem.
Fixes https://bugs.dolphin-emu.org/issues/14000.
I am not certain what this was used for, but the last non-formatting related change made to it was over 16 years ago.
The project targets Windows Vista, uses a Visual Studio 2010 project.
Looking at the entry point in `DSP_InterC.cpp`, the program opens a hardcoded path to a DSP rom in `C:\_\dsp_rom.bin` without any documentation on it whatsoever, and decodes something between two mystery addresses before exiting.
This should stop AchievementManager::LoadGame from being called for the
default ISO when CBoot::BootUp is booting something other than a disc or
IPL (most notably, the Wii Menu), while still detecting all disc changes
that happen while a disc game is running.
Don't copy null terminators from the log's `header.gameid` into
`FifoDataFile`'s `m_game_id`.
Doing so would cause an infinite loop in `Core::GenerateScreenshotName`
as the various concatenations and `fmt::format` calls would then
effectively drop all the timestamps and disambiguating arbitrary numbers
since they followed the null terminator in the gameid, and so the
`File::Exists` calls would always return true.
Fixes https://bugs.dolphin-emu.org/issues/14002.
In some Triforce games (e.g. _F-Zero AX_), the bytes that follow the
region flag in the `boot.id` file (at `0x38`) happen to be `0x00`.
However, in other games (e.g _Mario Kart Arcade GP 2_), it seems the
region flag is padded with `0xFF`.
_Mario Kart Arcade GP 2_ (`boot.id` in the USA version):
```
00000 0000: 42 54 49 44 00 00 01 E0 00 00 00 01 00 00 00 01 BTID.... ........
00000 0010: FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF ........ ........
00000 0020: 47 43 41 4D 00 00 01 C0 07 D3 05 0F 00 00 00 07 GCAM.... ........
00000 0030: 53 42 4E 4C 00 00 00 00 0E FF FF FF FF FF FF FF SBNL.... ........
-----------
^
|
region flag
```
When the region flag was tested in `switch` statements (where a single
byte was expected in the `case`s), the test would fail, depending
on the game.
This issue would lead to the wrong calculation of the country in
`VolumeDisc::GetCountry()`, which was then used to build the game ID in
`VolumeDisc::GetGameID()`.
The solution is to test using only the least meaningful byte in the
region flag.
Unexpected game IDs were first noticed with USA version of _Mario Kart
Arcade GP 2_, which was wrongly assigned the same game ID that is given
to the Japan version (i.e. `GNLJ82`). The correct game ID for the USA
version is `GNLE82`.
Check the return value of calls to `GetBuffer` and stop the `WASAPI
handler` sound thread if they fail.
This prevents a crash due to a null pointer dereference if `GetBuffer`
is unable to retrieve a buffer, which could be triggered during
emulation by disabling the selected WASAPI output device in the Windows
Sound settings.
The status bar shows the number of games in your collection. If any
games are hidden by the platform, region, or search filters it will also
show how many games are visible and how many are filtered.
The visibility of the status bar can be toggled from the menu by
selecting `View`->`Show Game Count`.
Implements https://bugs.dolphin-emu.org/issues/9517.
Reasons:
- Only 0.000341% of all Android users were on API 21-23 in the last 365 days.
- These devices are old and likely do not run Dolphin well.
- Android 5.x and 6.0 have been without security updates for about 8 years.
- Staying on API 21–23 blocks AndroidX updates, including Lifecycle.
Added SerialDevice base class interface.
Adapted MagneticCardReader to use the SerialDevice interface.
Implemented The Key of Avalon touchscreen SerialDevice.
Altered CSIDevice_AMBaseboard to use SerialDevice.
Made serial reads happen every GCAMCommand rather than only upon write.
Made Stick and IR Widgets bigger
Improved Stick and IR layouts to better utilize space
Made Stick and IR Widgets Scale at a fixed ratio when window is resized
Added Scrollbars to Stick and IR Widgets
Reduced Spinbox padding in dark style
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`.
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.
Use the existing system reference instead of Core::System::GetInstance(),
and calculate the phase 2 scheduling delay from GetTicksPerSecond()
instead of hardcoding 50000 ticks.
Previously, SDL would `find_package(libusb)` which would actually overwrite the user preference in the case where both USE_SYSTEM_LIBUSB and USE_SYSTEM_SDL were OFF. This coincidentally also allows SDL to use libusb on Windows.
Our FindLibUSB.cmake was previously entirely unused unless SDL was being built from Externals, we now rely on it again. It will use PkgConfig if applicable or fall back to looking around on the system, and more importantly it will always create an imported target.
cURL tries to find ZSTD anyways due to the lack of setting it in CACHE, and for both ZLIB and ZSTD if we had done find_package previously, cURL would still use ZLIB/ZSTD regardless of the set variable.
This also fixes the CMake build on Windows, since it would fail to find our target defined in Externals and would fall back to trying to redefine it, which produces an error.
Currently, configuring from System>Bundled doesn't work, it instead produces cryptic errors. And configuring from Bundled>System wont produce errors, but wont use the system libraries either. This change produces a clear error in both cases.
APPROVED_LIST_HASH is moved to a separate file, making tests compilation faster after changing it.
The error message prints the hash in a way that it can be directly copy-pasted (though it still needs clang-format).
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.
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
This PR provides 60 FPS code additions to Sonic Unleashed.
NTSC-U:
* Added 60 FPS code, coming from the Dolphin wiki.
* Followed my code naming convention for Sega games.
This PR provides 60 FPS code additions to Sonic and the Secret Rings & Sonic and the Black Knight.
All regions:
* Formatting fixes.
NTSC-U/PAL:
* Added 60 FPS code, coming from the Dolphin wiki.
* Followed my code naming convention for Sega games.
This PR provides 60 FPS code additions to NiGHTS: Journey of Dreams.
NTSC-U/PAL/NTSC-J:
* Added 60 FPS code, coming from the Dolphin wiki.
* Followed my code naming convention for Sega games.
* The wiki says that the code is for NTSC-U but it's actually region free. It's been confirmed via testing.
* The wiki also says that a certain part in the final level softlocks, but that's actually not true and can be bypassed. An explanation has been included with the code.
In the past, the register cache would contain either a host register or
an immediate (or neither) for a given guest register. Jit64::cmpXX would
roll with whichever one it got. But now that PR 12134 is merged, the
register cache can contain a host register at the same time as an
immediate. This gives us an optimization opportunity in Jit64::cmpXX.
Some paths are more efficient when we use an immediate and some paths
are more efficient when we don't, so to generate the best code, we
should carefully choose if we want an immediate or not rather than
leaving it to the register cache.
This fixes a regression in ac84ea17a6. That commit was intended to
reduce the number of MapInMemoryRegion calls while otherwise keeping
behavior the same, but it accidentally messed up our logic for writing
to m_logical_page_mappings. This commit restores the old
m_logical_page_mappings behavior, fixing a crash that would occur when
running JitArm64 without fastmem.
Tested with a binary that has VMA != (LMA | 0x80000000), unlike most
libogc binaries. This is indeed a valid setup for ELFs, and one that is
generally expected to work properly.
Test code: https://github.com/Wii-Linux/NPLL/tree/reloc
In either case, you still need to set the PC in the debugger to get it
to boot properly, though that is a different issue that I will be fixing
in a future patch.
Without this patch, the code to be runtime-relocated ends up already
loaded at the desired final address, and then when the code tries to
relocate from what it thinks is the source address (where the code
should be, where the LMA is) to the destination address (the VMA, where
Dolphin mistakenly already put the code), it ends up overwriting the
code that it is about to execute with garbage, and then promptly
crashing.
After this patch is applied, the behavior now matches the GameCube with
Swiss (assuming a [recent patch](https://github.com/emukidid/swiss-gc/commit/bb4a57186c1481e291b7b0ea6d8e722bab816042)
is applied), and the Wii with the Homebrew Channel.
# like add_library(new ALIAS old) but avoids add_library cannot create ALIAS target "new" because target "old" is imported but not globally visible. on older cmake
# This can be replaced with a direct alias call once our minimum is cmake 3.18
message(FATAL_ERROR"Requires ${COMPILER} ${${COMPILER}_min_version} or higher")
endif()
# libstdc++ is almost always used on Linux, even when using clang as the compiler.
# libc++ is used on the likes of Android, Apple devices, FreeBSD, and a few (very) rare Linux distros like Chimera Linux.
# Windows uses its own standard library named STL, which we check as part of the toolset above. (outside of MinGW which can use either libstdc++ or libc++)
@@ -22,6 +23,12 @@ If you know any confidential information related to the GameCube, Wii, or Trifor
Also, this probably goes without saying, but piracy is strictly forbidden both on GitHub and in all other Dolphin channels.
## <a name="genai"></a>Generative AI
We accept contributions from humans, not from AI agents. We expect you to understand and take responsibility for code submitted in your name. If a non-trivial part of your contribution is generated using AI, you need to disclose which parts are generated.
Because large language models are trained on massive amounts of data gathered from the internet, we have to assume that they contain leaked Nintendo information. Therefore, you're not allowed to use LLMs to make changes related to the behavior of the emulated console or to use LLMs to obtain information related to the console.
## <a name="code-licensing"></a>Code licensing
If you make any contributions to Dolphin after December 1st, 2014, you are agreeing that any code you have contributed will be licensed under the GNU GPL version 2 (or any later version).
@@ -188,7 +195,7 @@ Summary:
- [Classes and Structs](#cpp-code-classes-and-structs)
## <a name="cpp-code-general"></a>General
- The codebase currently uses C++20, though not all compilers support all C++20 features.
- The codebase currently uses C++23, though compiler support for newer language features varies.
- See CMakeLists.txt "Enforce minimum compiler versions" for the currently supported compilers.
- Use the [nullptr](https://en.cppreference.com/w/cpp/language/nullptr) type over the macro `NULL`.
- If a [range-based for loop](https://en.cppreference.com/w/cpp/language/range-for) can be used instead of container iterators, use it.
# Add memory patches to be applied every frame here.
@@ -115,14 +115,28 @@ C242E040 00000004 # Set to 60 FPS when cutscene ends
04513C5C 40100000 # Map translation speed 1
04513C60 3F800000 # Map translation speed 2
0451D7B0 3C75C28F # Map scale speed
C236ECA8 00000002 # Mitite active time
5400083C 901E02C0
60000000 00000000
C236ECCC 00000002 # If on Piklopedia (which runs at 30 FPS), revert the above
5400F87E 901E02C0
60000000 00000000
04514128 3ECCCCCD # Final floor animation
045140D4 3EB33333 # Cave result animation (there's also the background panel animation at 8051FFB8, but it affects other things and it's basically unnoticeable)
04516140 3F000000 # Pay dept animation
04520078 3EB33333 # Ready-go animation
045201B4 3F000000 # Final result animation (this unfortunately breaks the color interpolation a little since it shares the 1.0)
# DSP HLE doesn't work with this homebrew's ucode.
DSPHLE=False
[DSP]
# Make sure we get DSP LLE recompiler and not DSP LLE interpreter, for performance.
EnableJIT=True
[Video_Settings]
# Fixes old frames being shown when a game only updates a small part of the screen. Examples include gradually revealed text and the HP bars in Pokémon.
# DSP HLE doesn't work with this homebrew's ucode.
DSPHLE=False
[DSP]
# Make sure we get DSP LLE recompiler and not DSP LLE interpreter, for performance.
EnableJIT=True
[Video_Settings]
# Fixes old frames being shown when a game only updates a small part of the screen. Examples include gradually revealed text and the HP bars in Pokémon.
SafeTextureCacheColorSamples=0
[Video_Hacks]
# Fixes the entire screen being magenta. (ImmediateXFBEnable = True also solves the problem, but XFBToTextureEnable = False is more accurate and there doesn't seem to be a significant performance difference.)
# Add memory patches to be applied every frame here.
[ActionReplay]
# Add action replay cheats here.
[Gecko]
$60 FPS
C242E098 00000004 # Set to 30 FPS when cutscene starts
3C608042 606335A8
7C6903A6 806D9AEC
38800002 4E800421
801F01F0 00000000
C242E1B0 00000004 # Set to 60 FPS when cutscene ends
3C608042 606335A8
7C6903A6 806D9AEC
38800001 4E800421
801F01F0 00000000
0414B758 38800001 # `BaseGameSection::init`, force `setFramerate` argument to 60 FPS (2P mode doesn't start with a cutscene)
04513B9C 40100000 # Map translation speed 1
04513BA0 3F800000 # Map translation speed 2
0451D6F0 3C75C28F # Map scale speed
C236ECDC 00000002 # Mitite active time
5400083C 901E02C0
60000000 00000000
C236ED00 00000002 # If on Piklopedia (which runs at 30 FPS), revert the above
5400F87E 901E02C0
60000000 00000000
04514068 3ECCCCCD # Final floor animation
04514014 3EB33333 # Cave result animation
04516080 3F000000 # Pay dept animation
045200F4 3F000000 # Final result animation
045140D4 3CCCCCCD # Final result color animation
04514050 3EB33333 # Ready-go animation
04411020 388000C8 # Win/Lose reason duration 1
04411028 386000FA # Win/Lose reason duration 2
04520164 3F000000 # Win/Lose animation
04410758 38800078 # Win/Lose duration 1
04410760 38600168 # Win/Lose duration 2
*Causes the following issues:
** Particle effects are sped up.
** Some UI animations are sped up.
** The player camera rotates faster.
** The Armored Cannon Beetle is unable to spit boulders (they collide with itself as they spawn).
** Other minor physics differences.
*
*To avoid lag when staying near the onions with many Pikmin, it's recommended to overclock the emulated CPU by at least 250% for single player, or 1000% for two players.
Some files were not shown because too many files have changed in this diff
Show More
Reference in New Issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.