diff --git a/Source/Core/DiscIO/VolumeDirectory.cpp b/Source/Core/DiscIO/VolumeDirectory.cpp index 56e9553a4b..35970f7d02 100644 --- a/Source/Core/DiscIO/VolumeDirectory.cpp +++ b/Source/Core/DiscIO/VolumeDirectory.cpp @@ -369,7 +369,7 @@ void CVolumeDirectory::BuildFST() u32 root_offset = 0; // Offset of root of FST // write root entry - WriteEntryData(&fst_offset, DIRECTORY_ENTRY, 0, 0, total_entries); + WriteEntryData(&fst_offset, DIRECTORY_ENTRY, 0, 0, total_entries, m_address_shift); WriteDirectory(rootEntry, &fst_offset, &name_offset, ¤t_data_address, root_offset); @@ -425,7 +425,7 @@ void CVolumeDirectory::Write32(u32 data, u32 offset, std::vector* const buff } void CVolumeDirectory::WriteEntryData(u32* entry_offset, u8 type, u32 name_offset, u64 data_offset, - u64 length) + u64 length, u32 address_shift) { m_fst_data[(*entry_offset)++] = type; @@ -433,7 +433,7 @@ void CVolumeDirectory::WriteEntryData(u32* entry_offset, u8 type, u32 name_offse m_fst_data[(*entry_offset)++] = (name_offset >> 8) & 0xff; m_fst_data[(*entry_offset)++] = (name_offset)&0xff; - Write32((u32)(data_offset >> m_address_shift), *entry_offset, &m_fst_data); + Write32((u32)(data_offset >> address_shift), *entry_offset, &m_fst_data); *entry_offset += 4; Write32((u32)length, *entry_offset, &m_fst_data); @@ -465,8 +465,8 @@ void CVolumeDirectory::WriteDirectory(const File::FSTEntry& parent_entry, u32* f if (entry.isDirectory) { u32 entry_index = *fst_offset / ENTRY_SIZE; - WriteEntryData(fst_offset, DIRECTORY_ENTRY, *name_offset, - parent_entry_index << m_address_shift, entry_index + entry.size + 1); + WriteEntryData(fst_offset, DIRECTORY_ENTRY, *name_offset, parent_entry_index, + entry_index + entry.size + 1, 0); WriteEntryName(name_offset, entry.virtualName); WriteDirectory(entry, fst_offset, name_offset, data_offset, entry_index); @@ -474,7 +474,8 @@ void CVolumeDirectory::WriteDirectory(const File::FSTEntry& parent_entry, u32* f else { // put entry in FST - WriteEntryData(fst_offset, FILE_ENTRY, *name_offset, *data_offset, entry.size); + WriteEntryData(fst_offset, FILE_ENTRY, *name_offset, *data_offset, entry.size, + m_address_shift); WriteEntryName(name_offset, entry.virtualName); // write entry to virtual disk diff --git a/Source/Core/DiscIO/VolumeDirectory.h b/Source/Core/DiscIO/VolumeDirectory.h index 13a8799eda..155459285c 100644 --- a/Source/Core/DiscIO/VolumeDirectory.h +++ b/Source/Core/DiscIO/VolumeDirectory.h @@ -85,7 +85,8 @@ private: void Write32(u32 data, u32 offset, std::vector* const buffer); // FST creation - void WriteEntryData(u32* entry_offset, u8 type, u32 name_offset, u64 data_offset, u64 length); + void WriteEntryData(u32* entry_offset, u8 type, u32 name_offset, u64 data_offset, u64 length, + u32 address_shift); void WriteEntryName(u32* name_offset, const std::string& name); void WriteDirectory(const File::FSTEntry& parent_entry, u32* fst_offset, u32* name_offset, u64* data_offset, u32 parent_entry_index);