2010-11-07 13:16:34 +01:00
|
|
|
#ifndef _WBFS_FAT_H
|
|
|
|
#define _WBFS_FAT_H
|
|
|
|
|
|
|
|
#include <ogcsys.h>
|
|
|
|
|
|
|
|
#include "usbloader/splits.h"
|
2010-12-31 00:49:22 +01:00
|
|
|
#include "usbloader/wbfs.h"
|
2010-11-07 13:16:34 +01:00
|
|
|
#include "wbfs_base.h"
|
|
|
|
|
|
|
|
class Wbfs_Fat: public Wbfs
|
|
|
|
{
|
2011-07-26 00:28:22 +02:00
|
|
|
public:
|
|
|
|
Wbfs_Fat(u32 lba, u32 size, u32 part, u32 port);
|
2010-11-07 13:16:34 +01:00
|
|
|
|
2011-07-26 00:28:22 +02:00
|
|
|
virtual s32 Open();
|
|
|
|
virtual void Close();
|
|
|
|
wbfs_disc_t* OpenDisc(u8 *);
|
|
|
|
void CloseDisc(wbfs_disc_t *);
|
2010-11-07 13:16:34 +01:00
|
|
|
|
2011-07-26 00:28:22 +02:00
|
|
|
s32 GetCount(u32 *);
|
|
|
|
s32 GetHeaders(struct discHdr *, u32, u32);
|
2010-11-07 13:16:34 +01:00
|
|
|
|
2011-07-26 00:28:22 +02:00
|
|
|
s32 AddGame();
|
|
|
|
s32 RemoveGame(u8 *);
|
2010-11-07 13:16:34 +01:00
|
|
|
|
2011-07-26 00:28:22 +02:00
|
|
|
s32 DiskSpace(f32 *, f32 *);
|
2010-11-07 13:16:34 +01:00
|
|
|
|
2011-07-26 00:28:22 +02:00
|
|
|
s32 RenameGame(u8 *, const void *);
|
|
|
|
s32 ReIDGame(u8 *, const void *);
|
2010-11-07 13:16:34 +01:00
|
|
|
|
2011-07-26 00:28:22 +02:00
|
|
|
u64 EstimateGameSize();
|
2010-11-07 13:16:34 +01:00
|
|
|
|
2011-07-26 00:28:22 +02:00
|
|
|
virtual int GetFragList(u8 *);
|
|
|
|
virtual u8 GetFSType(void) { return PART_FS_FAT; }
|
2010-11-07 13:16:34 +01:00
|
|
|
|
2011-07-26 00:28:22 +02:00
|
|
|
protected:
|
|
|
|
split_info_t split;
|
2010-11-07 13:16:34 +01:00
|
|
|
|
2011-07-26 00:28:22 +02:00
|
|
|
struct discHdr *fat_hdr_list;
|
|
|
|
u32 fat_hdr_count;
|
|
|
|
char wbfs_fs_drive[16];
|
2010-11-07 13:16:34 +01:00
|
|
|
|
2011-07-26 00:28:22 +02:00
|
|
|
wbfs_t* OpenPart(char *fname);
|
|
|
|
void ClosePart(wbfs_t* part);
|
|
|
|
wbfs_t* CreatePart(u8 *id, char *path);
|
|
|
|
int FindFilename(u8 *id, char *fname, int len);
|
|
|
|
void Filename(u8 *id, char *fname, int len, char *path);
|
|
|
|
bool CheckLayoutB(char *fname, int len, u8* id, char *fname_title);
|
|
|
|
s32 GetHeadersCount();
|
|
|
|
void GetDir(struct discHdr *header, char *path);
|
2010-11-07 13:16:34 +01:00
|
|
|
|
2011-07-26 00:28:22 +02:00
|
|
|
void mk_gameid_title(struct discHdr *header, char *name, int re_space, int layout);
|
|
|
|
void title_filename(char *title);
|
|
|
|
bool is_gameid(char *id);
|
2010-11-07 13:16:34 +01:00
|
|
|
|
2011-07-26 00:28:22 +02:00
|
|
|
static int nop_rw_sector(void *_fp, u32 lba, u32 count, void* buf) { return 0; }
|
2010-11-07 13:16:34 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif //_WBFS_FAT_H
|