summaryrefslogtreecommitdiff
path: root/Source/Core/DiscIO
diff options
context:
space:
mode:
authorcrediar <crediar@rypp.net>2025-11-12 19:11:21 +0100
committerJordan Woyak <jordan.woyak@gmail.com>2026-02-15 20:14:14 -0600
commit56ed7817de87736dc62d3c6725eb0779a9ee0c2e (patch)
tree348bf9522003eb581ebbdb130c67ac8765592401 /Source/Core/DiscIO
parentce802f1e62d5448cc802d85885fabc46ce643550 (diff)
Triforce: Code fixes.
Fixed a bug caused by static usage of Core::System::GetInstance() Removed unused headers Removed unneeded code Optimised code Added sanity checks Added SafeCopyFromEmu/SafeCopyToEmu Set Triforce buttons to be translatable
Diffstat (limited to 'Source/Core/DiscIO')
-rw-r--r--Source/Core/DiscIO/VolumeDisc.cpp34
1 files changed, 11 insertions, 23 deletions
diff --git a/Source/Core/DiscIO/VolumeDisc.cpp b/Source/Core/DiscIO/VolumeDisc.cpp
index 12e92eb0f8..5913f63c11 100644
--- a/Source/Core/DiscIO/VolumeDisc.cpp
+++ b/Source/Core/DiscIO/VolumeDisc.cpp
@@ -30,41 +30,24 @@ std::string VolumeDisc::GetGameID(const Partition& partition) const
memcpy(id + 1, boot_id->game_id.data() + 2, 2);
- switch (boot_id->region_flags)
+ switch (GetCountry())
{
default:
- case 0x02: // JAPAN
+ case Country::Japan:
id[3] = 'J';
break;
- case 0x08: // ASIA
+ case Country::Taiwan:
id[3] = 'W';
break;
- case 0x0E: // USA
+ case Country::USA:
id[3] = 'E';
break;
- case 0x0C: // EXPORT
+ case Country::Europe:
id[3] = 'P';
break;
}
- // There only seem to be three different makers here,
- // so we can just check the first char to difference between them.
- //
- // NAMCO CORPORATION, SEGA CORPORATION and Hitmaker co,ltd.
-
- switch (boot_id->manufacturer[0])
- {
- case 'N': // NAMCO CORPORATION
- id[4] = '8';
- id[5] = '2';
- break;
- default:
- case 'H': // Hitmaker co,ltd.
- case 'S': // SEGA CORPORATION
- id[4] = '6';
- id[5] = 'E';
- break;
- }
+ memcpy(id + 4, GetMakerID().c_str(), 2);
return DecodeString(id);
}
@@ -133,6 +116,11 @@ std::string VolumeDisc::GetMakerID(const Partition& partition) const
{
const BootID* boot_id = static_cast<const VolumeGC*>(this)->GetTriforceBootID();
+ // There only seem to be three different makers here,
+ // so we can just check the first char to difference between them.
+ //
+ // NAMCO CORPORATION, SEGA CORPORATION and Hitmaker co,ltd.
+
switch (boot_id->manufacturer[0])
{
case 'S': // SEGA CORPORATION