diff options
| author | Shawn Hoffman <godisgovernment@gmail.com> | 2008-10-09 05:33:24 +0000 |
|---|---|---|
| committer | Shawn Hoffman <godisgovernment@gmail.com> | 2008-10-09 05:33:24 +0000 |
| commit | eb65601f90173d7567656540621c91bc0c5c222f (patch) | |
| tree | c97d7f8ddb18c942272176944ec264a3f096f957 /Source/Core/DiscIO | |
| parent | 4001e11116a9657d8d051aa718db558f956a6981 (diff) | |
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
Diffstat (limited to 'Source/Core/DiscIO')
| -rw-r--r-- | Source/Core/DiscIO/Src/Volume.h | 5 | ||||
| -rw-r--r-- | Source/Core/DiscIO/Src/VolumeDirectory.cpp | 54 | ||||
| -rw-r--r-- | Source/Core/DiscIO/Src/VolumeDirectory.h | 10 | ||||
| -rw-r--r-- | Source/Core/DiscIO/Src/VolumeGC.cpp | 65 | ||||
| -rw-r--r-- | Source/Core/DiscIO/Src/VolumeGC.h | 5 | ||||
| -rw-r--r-- | Source/Core/DiscIO/Src/VolumeWiiCrypted.cpp | 96 | ||||
| -rw-r--r-- | Source/Core/DiscIO/Src/VolumeWiiCrypted.h | 5 |
7 files changed, 182 insertions, 58 deletions
diff --git a/Source/Core/DiscIO/Src/Volume.h b/Source/Core/DiscIO/Src/Volume.h index 075addc815..0fe201b8ba 100644 --- a/Source/Core/DiscIO/Src/Volume.h +++ b/Source/Core/DiscIO/Src/Volume.h @@ -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
diff --git a/Source/Core/DiscIO/Src/VolumeDirectory.cpp b/Source/Core/DiscIO/Src/VolumeDirectory.cpp index 1d609266ec..0b9396fa61 100644 --- a/Source/Core/DiscIO/Src/VolumeDirectory.cpp +++ b/Source/Core/DiscIO/Src/VolumeDirectory.cpp @@ -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;
diff --git a/Source/Core/DiscIO/Src/VolumeDirectory.h b/Source/Core/DiscIO/Src/VolumeDirectory.h index 7642839632..1466b77b43 100644 --- a/Source/Core/DiscIO/Src/VolumeDirectory.h +++ b/Source/Core/DiscIO/Src/VolumeDirectory.h @@ -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;
diff --git a/Source/Core/DiscIO/Src/VolumeGC.cpp b/Source/Core/DiscIO/Src/VolumeGC.cpp index f942898e42..b10319c7cb 100644 --- a/Source/Core/DiscIO/Src/VolumeGC.cpp +++ b/Source/Core/DiscIO/Src/VolumeGC.cpp @@ -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)
diff --git a/Source/Core/DiscIO/Src/VolumeGC.h b/Source/Core/DiscIO/Src/VolumeGC.h index a29f30db29..e4f3b2f1fc 100644 --- a/Source/Core/DiscIO/Src/VolumeGC.h +++ b/Source/Core/DiscIO/Src/VolumeGC.h @@ -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;
diff --git a/Source/Core/DiscIO/Src/VolumeWiiCrypted.cpp b/Source/Core/DiscIO/Src/VolumeWiiCrypted.cpp index bbab62c531..549664f9b0 100644 --- a/Source/Core/DiscIO/Src/VolumeWiiCrypted.cpp +++ b/Source/Core/DiscIO/Src/VolumeWiiCrypted.cpp @@ -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
diff --git a/Source/Core/DiscIO/Src/VolumeWiiCrypted.h b/Source/Core/DiscIO/Src/VolumeWiiCrypted.h index 63e9cad76e..4d2aa0ab90 100644 --- a/Source/Core/DiscIO/Src/VolumeWiiCrypted.h +++ b/Source/Core/DiscIO/Src/VolumeWiiCrypted.h @@ -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;
|
