summaryrefslogtreecommitdiff
path: root/Source/Core/DiscIO
diff options
context:
space:
mode:
authorJordan Woyak <jordan.woyak@gmail.com>2025-10-26 21:53:53 -0500
committerJordan Woyak <jordan.woyak@gmail.com>2026-02-15 20:14:14 -0600
commitbe2da8dc7b79a4bee3d4ee5736e8619ed66a8c4d (patch)
tree23d53370ccdf580f5e38229c21ee4bbae04570c6 /Source/Core/DiscIO
parent083faa8b218d4ef7bdb1e9a4e609da0f790fe5c0 (diff)
Triforce: Code cleanups.
Diffstat (limited to 'Source/Core/DiscIO')
-rw-r--r--Source/Core/DiscIO/VolumeDisc.cpp8
-rw-r--r--Source/Core/DiscIO/VolumeDisc.h35
-rw-r--r--Source/Core/DiscIO/VolumeGC.cpp2
3 files changed, 24 insertions, 21 deletions
diff --git a/Source/Core/DiscIO/VolumeDisc.cpp b/Source/Core/DiscIO/VolumeDisc.cpp
index a915df1224..12e92eb0f8 100644
--- a/Source/Core/DiscIO/VolumeDisc.cpp
+++ b/Source/Core/DiscIO/VolumeDisc.cpp
@@ -28,9 +28,9 @@ std::string VolumeDisc::GetGameID(const Partition& partition) const
// Construct game ID from the BTID
id[0] = 'G';
- memcpy(id + 1, boot_id->gameId + 2, 2);
+ memcpy(id + 1, boot_id->game_id.data() + 2, 2);
- switch (boot_id->regionFlags)
+ switch (boot_id->region_flags)
{
default:
case 0x02: // JAPAN
@@ -83,7 +83,7 @@ Country VolumeDisc::GetCountry(const Partition& partition) const
{
const BootID* boot_id = static_cast<const VolumeGC*>(this)->GetTriforceBootID();
- switch (boot_id->regionFlags)
+ switch (boot_id->region_flags)
{
default:
case 0x02: // JAPAN
@@ -166,7 +166,7 @@ std::string VolumeDisc::GetInternalName(const Partition& partition) const
if (GetVolumeType() == Platform::Triforce)
{
const BootID* boot_id = static_cast<const VolumeGC*>(this)->GetTriforceBootID();
- return DecodeString(boot_id->gameName);
+ return DecodeString(boot_id->game_name);
}
if (!Read(0x20, sizeof(name), reinterpret_cast<u8*>(&name), partition))
diff --git a/Source/Core/DiscIO/VolumeDisc.h b/Source/Core/DiscIO/VolumeDisc.h
index f263c40c16..f630522e68 100644
--- a/Source/Core/DiscIO/VolumeDisc.h
+++ b/Source/Core/DiscIO/VolumeDisc.h
@@ -3,6 +3,7 @@
#pragma once
+#include <array>
#include <optional>
#include <string>
@@ -18,25 +19,25 @@ public:
struct BootID
{
u32 magic; // 0x00 (Always BTID)
- uint32_t unknown0[3];
- uint32_t unknown1[4];
- char mediaboardType[4]; // 0x20 (GCAM for Triforce)
+ std::array<uint32_t, 3> unknown0;
+ std::array<uint32_t, 4> unknown1;
+ std::array<char, 4> mediaboard_type; // 0x20 (GCAM for Triforce)
uint32_t unknown2;
- uint16_t year; // 0x28
- uint8_t month; // 0x2A
- uint8_t day; // 0x2B
- uint8_t videoMode; // 0x2C unknown bitmask, resolutions + horizontal/vertical
+ uint16_t year; // 0x28
+ uint8_t month; // 0x2A
+ uint8_t day; // 0x2B
+ uint8_t video_mode; // 0x2C unknown bitmask, resolutions + horizontal/vertical
uint8_t unknown3;
- uint8_t type3Compatible; // 0x2E (Type-3 compatible titles have this set to 1)
+ uint8_t type_3_compatible; // 0x2E (Type-3 compatible titles have this set to 1)
uint8_t unknown4;
- char gameId[8]; // 0x30
- uint32_t regionFlags; // 0x38
- uint32_t unknown6[9];
- char manufacturer[0x20]; // 0x60
- char gameName[0x20]; // 0x80
- char gameExecutable[0x20]; // 0xA0
- char testExecutable[0x20]; // 0xC0
- char creditTypes[8][0x20]; // 0xE0
+ std::array<char, 8> game_id; // 0x30
+ uint32_t region_flags; // 0x38
+ std::array<uint32_t, 9> unknown6;
+ std::array<char, 0x20> manufacturer; // 0x60
+ std::array<char, 0x20> game_name; // 0x80
+ std::array<char, 0x20> game_executable; // 0xA0
+ std::array<char, 0x20> test_executable; // 0xC0
+ std::array<std::array<char, 0x20>, 8> credit_types; // 0xE0
};
std::string GetGameID(const Partition& partition = PARTITION_NONE) const override;
@@ -53,4 +54,6 @@ protected:
void AddGamePartitionToSyncHash(Common::SHA1::Context* context) const;
};
+static_assert(sizeof(VolumeDisc::BootID) == 480);
+
} // namespace DiscIO
diff --git a/Source/Core/DiscIO/VolumeGC.cpp b/Source/Core/DiscIO/VolumeGC.cpp
index 52dacd59a4..5d3d372dcf 100644
--- a/Source/Core/DiscIO/VolumeGC.cpp
+++ b/Source/Core/DiscIO/VolumeGC.cpp
@@ -92,7 +92,7 @@ Region VolumeGC::GetRegion() const
{
if (m_is_triforce)
{
- switch (m_triforce_header.regionFlags)
+ switch (m_triforce_header.region_flags)
{
default:
case 0x02: // JAPAN