mirror of
https://github.com/Fledge68/WiiFlow_Lite.git
synced 2024-12-26 03:41:55 +01:00
af589b404e
- Added retry on read errors - Added skipping on read errors - Added pos to compress data - Added pos to align all files by 32k - Dumper will now only dump game.iso on default - Now using drivebay led to show disc reading activity - Now checking if game already exists before dumping it Configuration of the dumper: Set the following vars in wiiflow.ini (domain: DML) to config the dumper: - skip_on_error=yes/no to enable/disable error skipping (default = no) - compressed_dump=yes/no to enable/disable compressed dumping (default = no) - write_ex_files=yes/no write ex files yes/no (default = no) - align_files=yes/no to align all by 32k yes/no (default = no) - num_retries=# were # = the amount of read retries the dumper should perform before it marks the block as bad on read errors
89 lines
2.3 KiB
C++
89 lines
2.3 KiB
C++
/***************************************************************************
|
|
* Copyright (C) 2012
|
|
* by OverjoY for Wiiflow
|
|
*
|
|
* This software is provided 'as-is', without any express or implied
|
|
* warranty. In no event will the authors be held liable for any
|
|
* damages arising from the use of this software.
|
|
*
|
|
* Permission is granted to anyone to use this software for any
|
|
* purpose, including commercial applications, and to alter it and
|
|
* redistribute it freely, subject to the following restrictions:
|
|
*
|
|
* 1. The origin of this software must not be misrepresented; you
|
|
* must not claim that you wrote the original software. If you use
|
|
* this software in a product, an acknowledgment in the product
|
|
* documentation would be appreciated but is not required.
|
|
*
|
|
* 2. Altered source versions must be plainly marked as such, and
|
|
* must not be misrepresented as being the original software.
|
|
*
|
|
* 3. This notice may not be removed or altered from any source
|
|
* distribution.
|
|
*
|
|
* gc_disc.hpp
|
|
*
|
|
***************************************************************************/
|
|
|
|
#ifndef GC_DISC_H_
|
|
#define GC_DISC_H_
|
|
|
|
typedef void (*progress_callback_t)(int status,int total,void *user_data);
|
|
|
|
class GCDump
|
|
{
|
|
public:
|
|
void Init(bool skip, bool comp, bool wexf, bool align, u32 nretry, u32 rsize)
|
|
{
|
|
skiponerror = skip;
|
|
compressed = comp;
|
|
writeexfiles = wexf;
|
|
aligned = align;
|
|
gc_nbrretry = nretry;
|
|
gc_readsize = rsize;
|
|
gc_skipped = 0;
|
|
}
|
|
s32 DumpGame(progress_callback_t spinner, void *spinner_data);
|
|
s32 CheckSpace(u32 *needed, bool comp);
|
|
private:
|
|
bool aligned;
|
|
bool skiponerror;
|
|
bool compressed;
|
|
bool writeexfiles;
|
|
u32 gc_nbrretry;
|
|
u32 gc_error;
|
|
u32 gc_retry;
|
|
u32 gc_skipped;
|
|
u32 gc_readsize;
|
|
u32 DiscSize;
|
|
typedef struct
|
|
{
|
|
union
|
|
{
|
|
struct
|
|
{
|
|
u32 Type :8;
|
|
u32 NameOffset :24;
|
|
};
|
|
u32 TypeName;
|
|
};
|
|
union
|
|
{
|
|
struct
|
|
{
|
|
u32 FileOffset;
|
|
u32 FileLength;
|
|
};
|
|
struct
|
|
{
|
|
u32 ParentOffset;
|
|
u32 NextOffset;
|
|
};
|
|
u32 entry[2];
|
|
};
|
|
} FST;
|
|
s32 __DiscReadRaw(void *outbuf, u32 offset, u32 length);
|
|
s32 __DiscWrite(char * path, u32 offset, u32 length, progress_callback_t spinner , void *spinner_data);
|
|
s32 __DiscWriteAligned(char * path, u32 offset, u32 length);
|
|
};
|
|
#endif |