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
This commit is contained in:
Shawn Hoffman
2009-05-21 19:19:15 +00:00
parent ab6a38a18f
commit d210fbac2c
38 changed files with 539 additions and 82 deletions

View File

@ -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;