2010-11-07 13:16:34 +01:00
|
|
|
#ifndef _H
|
|
|
|
#define _H
|
|
|
|
|
|
|
|
#include "libs/libwbfs/libwbfs.h"
|
|
|
|
#include "usbloader/utils.h"
|
|
|
|
#include "usbloader/frag.h"
|
2011-02-06 10:34:06 +01:00
|
|
|
#include "usbloader/wbfs.h"
|
2010-11-07 13:16:34 +01:00
|
|
|
|
2010-12-28 18:02:10 +01:00
|
|
|
#define CACHE_SIZE 32
|
|
|
|
#define CACHED_SECTORS 64
|
|
|
|
|
2010-11-07 13:16:34 +01:00
|
|
|
class Wbfs
|
|
|
|
{
|
|
|
|
public:
|
2011-06-22 19:57:37 +02:00
|
|
|
Wbfs(u32 lba, u32 size, u32 part, u32 usbport);
|
2011-06-24 21:11:36 +02:00
|
|
|
virtual ~Wbfs() { Close(); };
|
2010-11-07 13:16:34 +01:00
|
|
|
static s32 Init(u32);
|
|
|
|
s32 CheckGame(u8 *);
|
|
|
|
s32 GameSize(u8 *, f32 *);
|
2010-12-31 00:49:22 +01:00
|
|
|
bool IsMounted() { return hdd == 0; };
|
2010-11-07 13:16:34 +01:00
|
|
|
virtual int GetFragList(u8 *id) { return 0; };
|
|
|
|
|
|
|
|
virtual s32 Open() = 0;
|
2011-02-04 16:25:27 +01:00
|
|
|
virtual void Close() {};
|
2010-11-07 13:16:34 +01:00
|
|
|
virtual wbfs_disc_t* OpenDisc(u8 *discid) = 0;
|
|
|
|
virtual void CloseDisc(wbfs_disc_t *disc) = 0;
|
|
|
|
virtual s32 Format();
|
|
|
|
virtual s32 GetCount(u32 *) = 0;
|
|
|
|
virtual s32 GetHeaders(struct discHdr *, u32, u32) = 0;
|
|
|
|
virtual s32 AddGame(void) = 0;
|
|
|
|
virtual s32 RemoveGame(u8 *) = 0;
|
|
|
|
virtual s32 DiskSpace(f32 *, f32 *) = 0;
|
|
|
|
virtual s32 RenameGame(u8 *, const void *) = 0;
|
|
|
|
virtual s32 ReIDGame(u8 *discid, const void *newID) = 0;
|
2011-01-16 14:12:07 +01:00
|
|
|
virtual u64 EstimateGameSize(void) = 0;
|
2011-02-06 19:36:32 +01:00
|
|
|
virtual u8 GetFSType(void) const { return PART_FS_WBFS; }
|
|
|
|
const wbfs_t *GetHDDHandle(void) { return hdd; }
|
2010-11-07 13:16:34 +01:00
|
|
|
protected:
|
|
|
|
wbfs_t *hdd;
|
2011-02-05 11:36:55 +01:00
|
|
|
const u32 lba;
|
|
|
|
const u32 size;
|
2011-02-05 22:06:52 +01:00
|
|
|
const u32 partition;
|
2011-06-22 19:57:37 +02:00
|
|
|
const u32 usbport;
|
2010-11-07 13:16:34 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif //_H
|