summaryrefslogtreecommitdiff
path: root/Source/Core/DiscIO/Src/FileSystemGCWii.cpp
diff options
context:
space:
mode:
authorskidau <skidau@gmail.com>2012-05-05 18:38:00 +1000
committerskidau <skidau@gmail.com>2012-12-26 23:10:40 +1100
commit0c845728ccfc5f3a93c69aa09a924a0413e8d151 (patch)
treeec8a141eb665ec6d9cfe6316f86711c989c5fec7 /Source/Core/DiscIO/Src/FileSystemGCWii.cpp
parent88e273fac13b6c3b95256fc083867c2b6553c9d6 (diff)
Added support for Reset (from menu). Fixes Sam & Max.
Diffstat (limited to 'Source/Core/DiscIO/Src/FileSystemGCWii.cpp')
-rw-r--r--Source/Core/DiscIO/Src/FileSystemGCWii.cpp17
1 files changed, 15 insertions, 2 deletions
diff --git a/Source/Core/DiscIO/Src/FileSystemGCWii.cpp b/Source/Core/DiscIO/Src/FileSystemGCWii.cpp
index 8f40ab2f18..f1d5f20b6e 100644
--- a/Source/Core/DiscIO/Src/FileSystemGCWii.cpp
+++ b/Source/Core/DiscIO/Src/FileSystemGCWii.cpp
@@ -159,7 +159,7 @@ bool CFileSystemGCWii::ExportApploader(const char* _rExportFolder) const
return false;
}
-bool CFileSystemGCWii::ExportDOL(const char* _rExportFolder) const
+u32 CFileSystemGCWii::GetBootDOLSize() const
{
u32 DolOffset = Read32(0x420) << m_OffsetShift;
u32 DolSize = 0, offset = 0, size = 0;
@@ -181,9 +181,22 @@ bool CFileSystemGCWii::ExportDOL(const char* _rExportFolder) const
if (offset + size > DolSize)
DolSize = offset + size;
}
+ return DolSize;
+}
+
+bool CFileSystemGCWii::GetBootDOL(u8* &buffer, u32 DolSize) const
+{
+ u32 DolOffset = Read32(0x420) << m_OffsetShift;
+ return m_rVolume->Read(DolOffset, DolSize, buffer);
+}
+bool CFileSystemGCWii::ExportDOL(const char* _rExportFolder) const
+{
+ u32 DolOffset = Read32(0x420) << m_OffsetShift;
+ u32 DolSize = GetBootDOLSize();
u8* buffer = new u8[DolSize];
- if (m_rVolume->Read(DolOffset, DolSize, buffer))
+
+ if (GetBootDOL(buffer, DolSize))
{
char exportName[512];
sprintf(exportName, "%s/boot.dol", _rExportFolder);