mirror of
https://github.com/RetroDECK/Duckstation.git
synced 2024-11-25 07:05:40 +00:00
CDROM: Add PVD/directory entries to file map
This commit is contained in:
parent
8cfa4637a2
commit
df91c63b31
|
@ -3292,6 +3292,7 @@ void CDROM::CreateFileMap()
|
|||
}
|
||||
|
||||
Log_DevFmt("Creating file map for {}...", media->GetFileName());
|
||||
s_file_map.emplace(iso.GetPVDLBA(), std::make_pair(iso.GetPVDLBA(), std::string("PVD")));
|
||||
CreateFileMap(iso, std::string_view());
|
||||
Log_DevFmt("Found {} files", s_file_map.size());
|
||||
}
|
||||
|
@ -3302,6 +3303,10 @@ void CDROM::CreateFileMap(IsoReader& iso, const std::string_view& dir)
|
|||
{
|
||||
if (entry.IsDirectory())
|
||||
{
|
||||
Log_DevFmt("{}-{} = {}", entry.location_le, entry.location_le + entry.GetSizeInSectors() - 1, path);
|
||||
s_file_map.emplace(entry.location_le, std::make_pair(entry.location_le + entry.GetSizeInSectors() - 1,
|
||||
fmt::format("<DIR> {}", path)));
|
||||
|
||||
CreateFileMap(iso, path);
|
||||
continue;
|
||||
}
|
||||
|
|
|
@ -72,6 +72,7 @@ bool IsoReader::ReadPVD(Error* error)
|
|||
else if (header->type_code == 255)
|
||||
break;
|
||||
|
||||
m_pvd_lba = START_SECTOR + i;
|
||||
std::memcpy(&m_pvd, buffer, sizeof(ISOPrimaryVolumeDescriptor));
|
||||
Log_DevFmt("ISOReader: PVD found at index {}", i);
|
||||
return true;
|
||||
|
|
|
@ -145,6 +145,7 @@ public:
|
|||
|
||||
ALWAYS_INLINE const CDImage* GetImage() const { return m_image; }
|
||||
ALWAYS_INLINE u32 GetTrackNumber() const { return m_track_number; }
|
||||
ALWAYS_INLINE u32 GetPVDLBA() const { return m_pvd_lba; }
|
||||
ALWAYS_INLINE const ISOPrimaryVolumeDescriptor& GetPVD() const { return m_pvd; }
|
||||
|
||||
bool Open(CDImage* image, u32 track_number, Error* error = nullptr);
|
||||
|
@ -173,4 +174,5 @@ private:
|
|||
u32 m_track_number;
|
||||
|
||||
ISOPrimaryVolumeDescriptor m_pvd = {};
|
||||
u32 m_pvd_lba = 0;
|
||||
};
|
||||
|
|
Loading…
Reference in a new issue