From 240cb0ca1159af11c59120d13da7bd26a6065f64 Mon Sep 17 00:00:00 2001 From: JosJuice Date: Fri, 9 Jun 2017 17:57:05 +0200 Subject: [PATCH 1/2] VolumeDirectory: Use correct endianness when writing apploader -1 --- Source/Core/DiscIO/VolumeDirectory.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Source/Core/DiscIO/VolumeDirectory.cpp b/Source/Core/DiscIO/VolumeDirectory.cpp index f6f603d8ff..845c336bda 100644 --- a/Source/Core/DiscIO/VolumeDirectory.cpp +++ b/Source/Core/DiscIO/VolumeDirectory.cpp @@ -333,7 +333,7 @@ bool VolumeDirectory::SetApploader(const std::string& apploader) { m_apploader.resize(0x20); // Make sure BS2 HLE doesn't try to run the apploader - *(u32*)&m_apploader[0x10] = (u32)-1; + Write32(static_cast(-1), 0x10, &m_apploader); return false; } } From 2578a3553bbc817a5c07be5f285c3c3e6c14ad55 Mon Sep 17 00:00:00 2001 From: JosJuice Date: Fri, 9 Jun 2017 18:00:25 +0200 Subject: [PATCH 2/2] VolumeDirectory: That's not what "4 byte" means --- Source/Core/DiscIO/VolumeDirectory.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Source/Core/DiscIO/VolumeDirectory.cpp b/Source/Core/DiscIO/VolumeDirectory.cpp index 845c336bda..a205f0126a 100644 --- a/Source/Core/DiscIO/VolumeDirectory.cpp +++ b/Source/Core/DiscIO/VolumeDirectory.cpp @@ -372,7 +372,7 @@ void VolumeDirectory::BuildFST() if (m_fst_address == 0) m_fst_address = APPLOADER_ADDRESS + 0x2000; - // 4 byte aligned start of data on disk + // 32 KiB aligned start of data on disk m_data_start_address = Common::AlignUp(m_fst_address + m_fst_data.size(), 0x8000ull); u64 current_data_address = m_data_start_address; @@ -494,7 +494,7 @@ void VolumeDirectory::WriteDirectory(const File::FSTEntry& parent_entry, u32* fs _dbg_assert_(DVDINTERFACE, m_virtual_disk.find(*data_offset) == m_virtual_disk.end()); m_virtual_disk.emplace(*data_offset, entry.physicalName); - // 4 byte aligned + // 32 KiB aligned - many games are fine with less alignment, but not all *data_offset = Common::AlignUp(*data_offset + std::max(entry.size, 1ull), 0x8000ull); } }