dolphin/Source/Core
cristian64 3eea3a90b5 Triforce: Check only first byte in region flag.
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`.
2026-03-15 18:43:00 +00:00
..
AudioCommon feat: Add an option to preserve audio pitch when emulation speed changes, integrating it into core configuration and both Qt and Android UIs. 2026-01-27 18:48:22 -05:00
Common Merge pull request #14317 from JosJuice/jit-cache-macro-loop 2026-02-26 19:25:29 -08:00
Core System: Use forward declarations in System.h 2026-03-14 10:53:45 -07:00
DiscIO Triforce: Check only first byte in region flag. 2026-03-15 18:43:00 +00:00
DolphinNoGUI Merge pull request #14214 from JoshuaVandaele/cmake-nonbreaking-improvements 2026-01-25 18:33:46 -08:00
DolphinQt Merge pull request #14345 from TryTwo/cheat_search_work 2026-03-12 12:35:51 -07:00
DolphinTool Merge pull request #14214 from JoshuaVandaele/cmake-nonbreaking-improvements 2026-01-25 18:33:46 -08:00
InputCommon DSU: Don't crash on bad hostname 2026-03-01 00:08:08 -06:00
MacUpdater Merge pull request #14036 from TellowKrinkle/SkipPostprocess 2026-01-25 22:01:29 -05:00
UICommon Added Triforce support 2026-02-15 20:14:14 -06:00
UpdaterCommon Misc: fix compiler warning: implicit declaration of function 2026-02-08 00:37:29 +01:00
VideoBackends Metal: Always run endEncoding on command encoders 2026-03-03 09:49:42 -05:00
VideoCommon Move PerformanceMetrics from global variable to System 2026-03-14 16:42:21 +02:00
WinUpdater Misc: fix compiler warning: implicit declaration of function 2026-02-08 00:37:29 +01:00
CMakeLists.txt
DolphinLib.ARM64.props
DolphinLib.props Triforce: Implement The Key of Avalon's touchscreen. 2026-03-12 03:57:47 -05:00
DolphinLib.vcxproj Core/HW: Add Broadband Adapter (IPC). 2025-10-28 18:50:59 +00:00
DolphinLib.vcxproj.user
DolphinLib.x64.props
VersionInfo.plist.in