summaryrefslogtreecommitdiff
path: root/Source/Core/DiscIO/DirectoryBlob.cpp
diff options
context:
space:
mode:
authorJosJuice <josjuice@gmail.com>2017-06-10 10:41:49 +0200
committerJosJuice <josjuice@gmail.com>2017-08-01 11:36:40 +0200
commitb28ec0b7eed764c4d642f9e9a1013bc05a401e65 (patch)
tree1483000f022705fc18158fc5c1790335844e8a9f /Source/Core/DiscIO/DirectoryBlob.cpp
parentc4879aa48dd29928e64516d4367be9328700989d (diff)
DirectoryBlob: Split out setting partition table to new function
Diffstat (limited to 'Source/Core/DiscIO/DirectoryBlob.cpp')
-rw-r--r--Source/Core/DiscIO/DirectoryBlob.cpp20
1 files changed, 12 insertions, 8 deletions
diff --git a/Source/Core/DiscIO/DirectoryBlob.cpp b/Source/Core/DiscIO/DirectoryBlob.cpp
index 6392651edd..16b5ac0de9 100644
--- a/Source/Core/DiscIO/DirectoryBlob.cpp
+++ b/Source/Core/DiscIO/DirectoryBlob.cpp
@@ -54,12 +54,7 @@ constexpr u64 BI2_SIZE = 0x2000;
constexpr u64 APPLOADER_ADDRESS = 0x2440;
constexpr u64 WII_REGION_DATA_ADDRESS = 0x4E000;
constexpr u64 WII_REGION_DATA_SIZE = 0x20;
-
constexpr u64 GAME_PARTITION_ADDRESS = 0x50000;
-constexpr u64 PARTITION_TABLE_ADDRESS = 0x40000;
-const std::array<u32, 10> PARTITION_TABLE = {
- {Common::swap32(1), Common::swap32((PARTITION_TABLE_ADDRESS + 0x20) >> 2), 0, 0, 0, 0, 0, 0,
- Common::swap32(GAME_PARTITION_ADDRESS >> 2), 0}};
DiscContent::DiscContent(u64 offset, u64 size, const std::string& path)
: m_offset(offset), m_size(size), m_content_source(path)
@@ -181,9 +176,7 @@ DirectoryBlobReader::DirectoryBlobReader(const std::string& root_directory)
if (m_is_wii)
{
- m_nonpartition_contents.emplace(PARTITION_TABLE_ADDRESS, PARTITION_TABLE.size() * sizeof(u32),
- reinterpret_cast<const u8*>(PARTITION_TABLE.data()));
-
+ SetPartitionTable();
SetWiiRegionData();
SetTMDAndTicket();
}
@@ -295,6 +288,17 @@ void DirectoryBlobReader::SetDiscHeaderAndDiscType()
}
}
+void DirectoryBlobReader::SetPartitionTable()
+{
+ constexpr u64 PARTITION_TABLE_ADDRESS = 0x40000;
+ static const std::array<u32, 10> PARTITION_TABLE = {
+ {Common::swap32(1), Common::swap32((PARTITION_TABLE_ADDRESS + 0x20) >> 2), 0, 0, 0, 0, 0, 0,
+ Common::swap32(GAME_PARTITION_ADDRESS >> 2), 0}};
+
+ m_nonpartition_contents.emplace(PARTITION_TABLE_ADDRESS, PARTITION_TABLE.size() * sizeof(u32),
+ reinterpret_cast<const u8*>(PARTITION_TABLE.data()));
+}
+
void DirectoryBlobReader::SetWiiRegionData()
{
m_wii_region_data.resize(0x10, 0x00);