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.
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`.
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.
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`.
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.