summaryrefslogtreecommitdiff
path: root/Source/Core/DiscIO/Src/CompressedBlob.cpp
diff options
context:
space:
mode:
authorShawn Hoffman <godisgovernment@gmail.com>2009-05-21 19:19:15 +0000
committerShawn Hoffman <godisgovernment@gmail.com>2009-05-21 19:19:15 +0000
commitd210fbac2c1a934e3490f2da5068a201a1657106 (patch)
tree0eef3cba5cd3d1654614bfc2644c9b1916270205 /Source/Core/DiscIO/Src/CompressedBlob.cpp
parentab6a38a18f803bdabd513c1c23817f4b78598fd5 (diff)
Wii images can now be scrubbed and compressed (my z:tp wii is now 1.08GB :D )
Currently scrubbing will display a warning that it removes the garbage data PERMENENTLY from the original file (mainly for speed of scrubbing). It could be removed in the future if people agree with me, since it is indeed just garbage. Any tips for making scrubbing faster would be welcomed :) git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@3267 8ced0084-cf51-0410-be5f-012b33b47a6e
Diffstat (limited to 'Source/Core/DiscIO/Src/CompressedBlob.cpp')
-rw-r--r--Source/Core/DiscIO/Src/CompressedBlob.cpp21
1 files changed, 15 insertions, 6 deletions
diff --git a/Source/Core/DiscIO/Src/CompressedBlob.cpp b/Source/Core/DiscIO/Src/CompressedBlob.cpp
index f424b2c465..eb340ea216 100644
--- a/Source/Core/DiscIO/Src/CompressedBlob.cpp
+++ b/Source/Core/DiscIO/Src/CompressedBlob.cpp
@@ -1,4 +1,4 @@
-// Copyright (C) 2003-2008 Dolphin Project.
+// Copyright (C) 2003-2009 Dolphin Project.
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
@@ -26,6 +26,7 @@
#include "Common.h"
#include "CompressedBlob.h"
+#include "DiscScrubber.h"
#include "FileUtil.h"
#include "Hash.h"
@@ -159,17 +160,25 @@ void CompressedBlobReader::GetBlock(u64 block_num, u8 *out_ptr)
bool CompressFileToBlob(const char* infile, const char* outfile, u32 sub_type,
int block_size, CompressCB callback, void* arg)
{
- if (File::GetSize(infile) > 2000000000ULL) {
- PanicAlert("Sorry - compressing Wii games not yet supported.");
- return false;
- }
-
if (IsCompressedBlob(infile))
{
PanicAlert("%s is already compressed! Cannot compress it further.", infile);
return false;
}
+ if (sub_type == 1)
+ {
+ if (PanicYesNo("WARNING - Scrubbing Wii disc %s will permanently remove garbage data.\n"
+ "This should be 100%% OK, but you have the option to opt out.\n\n\n"
+ "Would you like to scrub it?", infile))
+ {
+ if (!DiscScrubber::Scrub(infile, callback, arg))
+ return false;
+ }
+ else
+ return false;
+ }
+
FILE* inf = fopen(infile, "rb");
if (!inf)
return false;