mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-07-24 14:49:42 -06:00
updated the filesystemviewer. maybe someone can help and explain why the treectrl doesn't work for me in non-debug builds?
git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@807 8ced0084-cf51-0410-be5f-012b33b47a6e
This commit is contained in:
@ -38,8 +38,11 @@ class IVolume
|
||||
|
||||
|
||||
virtual bool Read(u64 _Offset, u64 _Length, u8* _pBuffer) const = 0;
|
||||
virtual std::string GetName() const = 0;
|
||||
virtual std::string GetUniqueID() const = 0;
|
||||
virtual std::string GetMakerID() const = 0;
|
||||
virtual std::string GetName() const = 0;
|
||||
virtual u32 GetFSTSize() const = 0;
|
||||
virtual std::string GetApploaderDate() const = 0;
|
||||
|
||||
|
||||
enum ECountry
|
||||
|
@ -129,26 +129,6 @@ bool CVolumeDirectory::Read(u64 _Offset, u64 _Length, u8* _pBuffer) const
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
std::string CVolumeDirectory::GetName() const
|
||||
{
|
||||
_dbg_assert_(DVDINTERFACE, m_diskHeader);
|
||||
std::string name = (char*)(m_diskHeader + 0x20);
|
||||
return name;
|
||||
}
|
||||
|
||||
void CVolumeDirectory::SetName(std::string _Name)
|
||||
{
|
||||
_dbg_assert_(DVDINTERFACE, m_diskHeader);
|
||||
|
||||
u32 length = _Name.length();
|
||||
if(length > MAX_NAME_LENGTH)
|
||||
length = MAX_NAME_LENGTH;
|
||||
|
||||
memcpy(m_diskHeader + 0x20, _Name.c_str(), length);
|
||||
m_diskHeader[length + 0x20] = 0;
|
||||
}
|
||||
|
||||
std::string CVolumeDirectory::GetUniqueID() const
|
||||
{
|
||||
_dbg_assert_(DVDINTERFACE, m_diskHeader);
|
||||
@ -222,6 +202,40 @@ IVolume::ECountry CVolumeDirectory::GetCountry() const
|
||||
return(country);
|
||||
}
|
||||
|
||||
std::string CVolumeDirectory::GetMakerID() const
|
||||
{
|
||||
return "VOID";
|
||||
}
|
||||
|
||||
std::string CVolumeDirectory::GetName() const
|
||||
{
|
||||
_dbg_assert_(DVDINTERFACE, m_diskHeader);
|
||||
std::string name = (char*)(m_diskHeader + 0x20);
|
||||
return name;
|
||||
}
|
||||
|
||||
void CVolumeDirectory::SetName(std::string _Name)
|
||||
{
|
||||
_dbg_assert_(DVDINTERFACE, m_diskHeader);
|
||||
|
||||
u32 length = _Name.length();
|
||||
if(length > MAX_NAME_LENGTH)
|
||||
length = MAX_NAME_LENGTH;
|
||||
|
||||
memcpy(m_diskHeader + 0x20, _Name.c_str(), length);
|
||||
m_diskHeader[length + 0x20] = 0;
|
||||
}
|
||||
|
||||
u32 CVolumeDirectory::GetFSTSize() const
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
std::string CVolumeDirectory::GetApploaderDate() const
|
||||
{
|
||||
return "VOID";
|
||||
}
|
||||
|
||||
u64 CVolumeDirectory::GetSize() const
|
||||
{
|
||||
return 0;
|
||||
|
@ -43,11 +43,17 @@ class CVolumeDirectory
|
||||
|
||||
bool Read(u64 _Offset, u64 _Length, u8* _pBuffer) const;
|
||||
|
||||
std::string GetUniqueID() const;
|
||||
void SetUniqueID(std::string _ID);
|
||||
|
||||
std::string GetMakerID() const;
|
||||
|
||||
std::string GetName() const;
|
||||
void SetName(std::string);
|
||||
|
||||
std::string GetUniqueID() const;
|
||||
void SetUniqueID(std::string _ID);
|
||||
u32 GetFSTSize() const;
|
||||
|
||||
std::string GetApploaderDate() const;
|
||||
|
||||
ECountry GetCountry() const;
|
||||
|
||||
|
@ -38,18 +38,6 @@ bool CVolumeGC::Read(u64 _Offset, u64 _Length, u8* _pBuffer) const
|
||||
return m_pReader->Read(_Offset, _Length, _pBuffer);
|
||||
}
|
||||
|
||||
std::string CVolumeGC::GetName() const
|
||||
{
|
||||
if (m_pReader == NULL)
|
||||
return false;
|
||||
|
||||
char Name[128];
|
||||
if (!Read(0x20, 0x60, (u8*)&Name))
|
||||
return false;
|
||||
|
||||
return Name;
|
||||
}
|
||||
|
||||
std::string CVolumeGC::GetUniqueID() const
|
||||
{
|
||||
static const std::string NO_UID("NO_UID");
|
||||
@ -96,7 +84,7 @@ IVolume::ECountry CVolumeGC::GetCountry() const
|
||||
|
||||
case 'X':
|
||||
country = COUNTRY_EUROPE;
|
||||
break; // XIII <- uses X but is PAL rip
|
||||
break; // XIII <- uses X but is PAL
|
||||
|
||||
case 'E':
|
||||
country = COUNTRY_USA;
|
||||
@ -119,6 +107,57 @@ IVolume::ECountry CVolumeGC::GetCountry() const
|
||||
return(country);
|
||||
}
|
||||
|
||||
std::string CVolumeGC::GetMakerID() const
|
||||
{
|
||||
if (m_pReader == NULL)
|
||||
return false;
|
||||
|
||||
char makerID[3];
|
||||
if (!Read(0x4, 0x2, (u8*)&makerID))
|
||||
return false;
|
||||
makerID[2] = 0;
|
||||
|
||||
return makerID;
|
||||
}
|
||||
|
||||
std::string CVolumeGC::GetName() const
|
||||
{
|
||||
if (m_pReader == NULL)
|
||||
return false;
|
||||
|
||||
char name[128];
|
||||
if (!Read(0x20, 0x60, (u8*)&name))
|
||||
return false;
|
||||
|
||||
return name;
|
||||
}
|
||||
|
||||
u32 CVolumeGC::GetFSTSize() const
|
||||
{
|
||||
if (m_pReader == NULL)
|
||||
return false;
|
||||
|
||||
u32 size;
|
||||
if (!Read(0x428, 0x4, (u8*)&size))
|
||||
return false;
|
||||
|
||||
return Common::swap32(size);
|
||||
}
|
||||
|
||||
std::string CVolumeGC::GetApploaderDate() const
|
||||
{
|
||||
if (m_pReader == NULL)
|
||||
return false;
|
||||
|
||||
char date[16];
|
||||
if (!Read(0x2440, 0x10, (u8*)&date))
|
||||
return false;
|
||||
// Should be 0 already, but just in case
|
||||
date[10] = 0;
|
||||
|
||||
return date;
|
||||
}
|
||||
|
||||
u64 CVolumeGC::GetSize() const
|
||||
{
|
||||
if (m_pReader)
|
||||
|
@ -30,8 +30,11 @@ public:
|
||||
CVolumeGC(IBlobReader* _pReader);
|
||||
~CVolumeGC();
|
||||
bool Read(u64 _Offset, u64 _Length, u8* _pBuffer) const;
|
||||
std::string GetName() const;
|
||||
std::string GetUniqueID() const;
|
||||
std::string GetMakerID() const;
|
||||
std::string GetName() const;
|
||||
u32 GetFSTSize() const;
|
||||
std::string GetApploaderDate() const;
|
||||
ECountry GetCountry() const;
|
||||
u64 GetSize() const;
|
||||
|
||||
|
@ -86,26 +86,6 @@ CVolumeWiiCrypted::Read(u64 _ReadOffset, u64 _Length, u8* _pBuffer) const
|
||||
return(true);
|
||||
}
|
||||
|
||||
|
||||
std::string
|
||||
CVolumeWiiCrypted::GetName() const
|
||||
{
|
||||
if (m_pReader == NULL)
|
||||
{
|
||||
return(false);
|
||||
}
|
||||
|
||||
char Name[0xFF];
|
||||
|
||||
if (!Read(0x20, 0x60, (u8*)&Name))
|
||||
{
|
||||
return(false);
|
||||
}
|
||||
|
||||
return(Name);
|
||||
}
|
||||
|
||||
|
||||
std::string
|
||||
CVolumeWiiCrypted::GetUniqueID() const
|
||||
{
|
||||
@ -182,6 +162,82 @@ CVolumeWiiCrypted::GetCountry() const
|
||||
return(country);
|
||||
}
|
||||
|
||||
std::string
|
||||
CVolumeWiiCrypted::GetMakerID() const
|
||||
{
|
||||
if (m_pReader == NULL)
|
||||
{
|
||||
return(false);
|
||||
}
|
||||
|
||||
char makerID[3];
|
||||
|
||||
if (!Read(0x4, 0x2, (u8*)&makerID))
|
||||
{
|
||||
return(false);
|
||||
}
|
||||
|
||||
makerID[2] = 0;
|
||||
|
||||
return(makerID);
|
||||
}
|
||||
|
||||
std::string
|
||||
CVolumeWiiCrypted::GetName() const
|
||||
{
|
||||
if (m_pReader == NULL)
|
||||
{
|
||||
return(false);
|
||||
}
|
||||
|
||||
char name[0xFF];
|
||||
|
||||
if (!Read(0x20, 0x60, (u8*)&name))
|
||||
{
|
||||
return(false);
|
||||
}
|
||||
|
||||
return(name);
|
||||
}
|
||||
|
||||
u32
|
||||
CVolumeWiiCrypted::GetFSTSize() const
|
||||
{
|
||||
if (m_pReader == NULL)
|
||||
{
|
||||
return(false);
|
||||
}
|
||||
|
||||
u32 size;
|
||||
|
||||
if (!Read(0x428, 0x4, (u8*)&size))
|
||||
{
|
||||
return(false);
|
||||
}
|
||||
|
||||
return(size);
|
||||
}
|
||||
|
||||
std::string
|
||||
CVolumeWiiCrypted::GetApploaderDate() const
|
||||
{
|
||||
if (m_pReader == NULL)
|
||||
{
|
||||
return(false);
|
||||
}
|
||||
|
||||
char date[16];
|
||||
|
||||
if (!Read(0x2440, 0x10, (u8*)&date))
|
||||
{
|
||||
return(false);
|
||||
}
|
||||
|
||||
date[10] = 0;
|
||||
|
||||
return(date);
|
||||
}
|
||||
|
||||
|
||||
u64
|
||||
CVolumeWiiCrypted::GetSize() const
|
||||
|
@ -32,8 +32,11 @@ public:
|
||||
CVolumeWiiCrypted(IBlobReader* _pReader, u64 _VolumeOffset, const unsigned char* _pVolumeKey);
|
||||
~CVolumeWiiCrypted();
|
||||
bool Read(u64 _Offset, u64 _Length, u8* _pBuffer) const;
|
||||
std::string GetName() const;
|
||||
std::string GetUniqueID() const;
|
||||
std::string GetMakerID() const;
|
||||
std::string GetName() const;
|
||||
u32 GetFSTSize() const;
|
||||
std::string GetApploaderDate() const;
|
||||
ECountry GetCountry() const;
|
||||
u64 GetSize() const;
|
||||
|
||||
|
Reference in New Issue
Block a user