usbloadergx/source/usbloader/wbfs/wbfs_base.h
dimok321 8e962e6187 *Optimized the automatic usb port switching. It is now a lot faster on mounting if partitions are FAT/NTFS/EXT because no port switch is required on WBFS_Open() or WBFS_Close() on those partitions.
*Disabled use of custom paths on other than SD if automatic port switching is enabled. This could damage a partition and we don't want to take that risk. So if you want to enable automatic usb port switching than you have to set all paths on sd:/ first now. Also when in this mode, only sd:/ will be available for setting custom paths.
*Changed setting of usb port switching to a more failsafer way.

NOTE: To all that did already enable the automatic usb port switching and have custom paths on some usb partition. Change this please or else your usbs filesystems are in danger. You have been warned!
2011-02-06 09:34:06 +00:00

47 lines
1.4 KiB
C++

#ifndef _H
#define _H
#include "libs/libwbfs/libwbfs.h"
#include "usbloader/utils.h"
#include "usbloader/frag.h"
#include "usbloader/wbfs.h"
#define CACHE_SIZE 32
#define CACHED_SECTORS 64
class Wbfs
{
public:
Wbfs(u32 lba, u32 size, u32 part);
~Wbfs() { Close(); };
static s32 Init(u32);
s32 CheckGame(u8 *);
s32 GameSize(u8 *, f32 *);
bool IsMounted() { return hdd == 0; };
virtual int GetFragList(u8 *id) { return 0; };
virtual bool ShowFreeSpace(void);
virtual s32 Open() = 0;
virtual void Close() {};
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;
virtual u64 EstimateGameSize(void) = 0;
virtual const u8 GetFSType(void) const { return PART_FS_WBFS; }
const wbfs_t *GetHDDHandle(void) const { return hdd; }
protected:
wbfs_t *hdd;
const u32 lba;
const u32 size;
const u32 partition;
};
#endif //_H