summaryrefslogtreecommitdiff
path: root/Source/Core
diff options
context:
space:
mode:
authorShawn Hoffman <godisgovernment@gmail.com>2009-12-29 13:59:38 +0000
committerShawn Hoffman <godisgovernment@gmail.com>2009-12-29 13:59:38 +0000
commit37b9fed89e478dd3687adf095757252553e6dff3 (patch)
treedcd7f75b3da481e603e20a3ed011b7c0e1f373b3 /Source/Core
parent7816bc6900e77c0f9584b4013a13e315596e58e2 (diff)
allow for extracting apploader/dol from gc/wii images without having to extract the whole fst. for now, the wii extraction just comes from partition 1.
git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@4746 8ced0084-cf51-0410-be5f-012b33b47a6e
Diffstat (limited to 'Source/Core')
-rw-r--r--Source/Core/DiscIO/Src/FileSystemGCWii.cpp6
-rw-r--r--Source/Core/DolphinWX/Src/ISOProperties.cpp34
-rw-r--r--Source/Core/DolphinWX/Src/ISOProperties.h3
3 files changed, 39 insertions, 4 deletions
diff --git a/Source/Core/DiscIO/Src/FileSystemGCWii.cpp b/Source/Core/DiscIO/Src/FileSystemGCWii.cpp
index 163046a5b1..0a8314c959 100644
--- a/Source/Core/DiscIO/Src/FileSystemGCWii.cpp
+++ b/Source/Core/DiscIO/Src/FileSystemGCWii.cpp
@@ -118,9 +118,9 @@ bool CFileSystemGCWii::ExportFile(const char* _rFullPath, const char* _rExportFi
bool CFileSystemGCWii::ExportApploader(const char* _rExportFolder) const
{
- u32 AppSize = Read32(0x2440 + 0x14) << m_OffsetShift;// apploader size
- AppSize += Read32(0x2440 + 0x18) << m_OffsetShift; // + trailer size
- AppSize += 0x20; // + header size
+ u32 AppSize = Read32(0x2440 + 0x14);// apploader size
+ AppSize += Read32(0x2440 + 0x18); // + trailer size
+ AppSize += 0x20; // + header size
DEBUG_LOG(DISCIO,"AppSize -> %x", AppSize);
u8* buffer = new u8[AppSize];
diff --git a/Source/Core/DolphinWX/Src/ISOProperties.cpp b/Source/Core/DolphinWX/Src/ISOProperties.cpp
index 7d2bb46a99..ececd3ba24 100644
--- a/Source/Core/DolphinWX/Src/ISOProperties.cpp
+++ b/Source/Core/DolphinWX/Src/ISOProperties.cpp
@@ -65,6 +65,8 @@ BEGIN_EVENT_TABLE(CISOProperties, wxDialog)
EVT_MENU(IDM_EXTRACTFILE, CISOProperties::OnExtractFile)
EVT_MENU(IDM_EXTRACTDIR, CISOProperties::OnExtractDir)
EVT_MENU(IDM_EXTRACTALL, CISOProperties::OnExtractDir)
+ EVT_MENU(IDM_EXTRACTAPPLOADER, CISOProperties::OnExtractDataFromHeader)
+ EVT_MENU(IDM_EXTRACTDOL, CISOProperties::OnExtractDataFromHeader)
EVT_CHOICE(ID_LANG, CISOProperties::OnChangeBannerLang)
END_EVENT_TABLE()
@@ -565,6 +567,9 @@ void CISOProperties::OnRightClickOnTree(wxTreeEvent& event)
popupMenu->Append(IDM_EXTRACTFILE, _("Extract File..."));
popupMenu->Append(IDM_EXTRACTALL, _("Extract All Files..."));
+ popupMenu->AppendSeparator();
+ popupMenu->Append(IDM_EXTRACTAPPLOADER, _("Extract Apploader..."));
+ popupMenu->Append(IDM_EXTRACTDOL, _("Extract DOL..."));
PopupMenu(popupMenu);
@@ -634,7 +639,6 @@ void CISOProperties::ExportDir(const char* _rFullPath, const char* _rExportFolde
index[0] = 0;
index[1] = (u32)fst.size();
- // Add buttons to do this without dumping whole disc, sometime
FS->ExportApploader(_rExportFolder);
if (!DiscIO::IsVolumeWiiDisc(OpenISO))
FS->ExportDOL(_rExportFolder);
@@ -745,6 +749,34 @@ void CISOProperties::OnExtractDir(wxCommandEvent& event)
ExportDir(Directory.mb_str(), Path.mb_str());
}
+void CISOProperties::OnExtractDataFromHeader(wxCommandEvent& event)
+{
+ std::vector<const DiscIO::SFileInfo *> fst;
+ DiscIO::IFileSystem *FS = 0;
+ wxString Path = wxDirSelector(wxT("Choose the folder to extract to"));
+
+ if (Path.empty())
+ return;
+
+ if (DiscIO::IsVolumeWiiDisc(OpenISO))
+ FS = WiiDisc.at(1).FileSystem;
+ else
+ FS = pFileSystem;
+
+ bool ret = false;
+ if (event.GetId() == IDM_EXTRACTAPPLOADER)
+ {
+ ret = FS->ExportApploader(Path.mb_str());
+ }
+ else if (event.GetId() == IDM_EXTRACTDOL)
+ {
+ ret = FS->ExportDOL(Path.mb_str());
+ }
+
+ if (!ret)
+ PanicAlert("Failed to extract to %s!", Path.mb_str());
+}
+
void CISOProperties::SetRefresh(wxCommandEvent& event)
{
bRefreshList = true;
diff --git a/Source/Core/DolphinWX/Src/ISOProperties.h b/Source/Core/DolphinWX/Src/ISOProperties.h
index 129b8b82ac..6e69c0cec8 100644
--- a/Source/Core/DolphinWX/Src/ISOProperties.h
+++ b/Source/Core/DolphinWX/Src/ISOProperties.h
@@ -216,6 +216,8 @@ class CISOProperties : public wxDialog
IDM_EXTRACTDIR,
IDM_EXTRACTALL,
IDM_EXTRACTFILE,
+ IDM_EXTRACTAPPLOADER,
+ IDM_EXTRACTDOL,
IDM_BNRSAVEAS
};
@@ -231,6 +233,7 @@ class CISOProperties : public wxDialog
void OnRightClickOnTree(wxTreeEvent& event);
void OnExtractFile(wxCommandEvent& event);
void OnExtractDir(wxCommandEvent& event);
+ void OnExtractDataFromHeader(wxCommandEvent& event);
void SetRefresh(wxCommandEvent& event);
void OnChangeBannerLang(wxCommandEvent& event);