2010-02-15 00:22:52 +01:00
|
|
|
#ifndef _WBFS_FAT_H
|
|
|
|
#define _WBFS_FAT_H
|
|
|
|
|
|
|
|
#include <ogcsys.h>
|
|
|
|
|
|
|
|
#include "usbloader/splits.h"
|
|
|
|
#include "wbfs_base.h"
|
|
|
|
|
2010-09-24 02:48:03 +02:00
|
|
|
class Wbfs_Fat: public Wbfs
|
2010-02-15 00:22:52 +01:00
|
|
|
{
|
2010-09-19 01:16:05 +02:00
|
|
|
public:
|
2010-09-24 02:48:03 +02:00
|
|
|
Wbfs_Fat(u32 device, u32 lba, u32 size);
|
2010-09-19 01:16:05 +02:00
|
|
|
~Wbfs_Fat();
|
2010-02-15 00:22:52 +01:00
|
|
|
|
2010-09-19 01:16:05 +02:00
|
|
|
virtual s32 Open();
|
2010-09-24 02:48:03 +02:00
|
|
|
wbfs_disc_t* OpenDisc(u8 *);
|
|
|
|
void CloseDisc(wbfs_disc_t *);
|
2010-02-22 22:29:47 +01:00
|
|
|
|
2010-09-24 02:48:03 +02:00
|
|
|
s32 GetCount(u32 *);
|
|
|
|
s32 GetHeaders(struct discHdr *, u32, u32);
|
2010-02-22 22:29:47 +01:00
|
|
|
|
2010-09-19 01:16:05 +02:00
|
|
|
s32 AddGame();
|
2010-09-24 02:48:03 +02:00
|
|
|
s32 RemoveGame(u8 *);
|
2010-02-22 22:29:47 +01:00
|
|
|
|
2010-09-24 02:48:03 +02:00
|
|
|
s32 DiskSpace(f32 *, f32 *);
|
2010-02-22 22:29:47 +01:00
|
|
|
|
2010-09-24 02:48:03 +02:00
|
|
|
s32 RenameGame(u8 *, const void *);
|
|
|
|
s32 ReIDGame(u8 *, const void *);
|
2010-02-22 22:29:47 +01:00
|
|
|
|
2010-09-19 01:16:05 +02:00
|
|
|
f32 EstimateGameSize();
|
2010-02-22 22:29:47 +01:00
|
|
|
|
2010-09-24 02:48:03 +02:00
|
|
|
int GetFragList(u8 *);
|
|
|
|
virtual int GetFragList(char *, _frag_append_t, FragList *);
|
|
|
|
virtual bool ShowFreeSpace(void);
|
2010-02-15 00:22:52 +01:00
|
|
|
|
2010-09-19 01:16:05 +02:00
|
|
|
protected:
|
|
|
|
static char wbfs_fs_drive[16];
|
|
|
|
private:
|
|
|
|
split_info_t split;
|
2010-02-22 22:29:47 +01:00
|
|
|
|
2010-09-19 01:16:05 +02:00
|
|
|
static u32 fat_sector_size;
|
|
|
|
static char wbfs_fat_dir[16];
|
|
|
|
static char invalid_path[];
|
|
|
|
static struct discHdr *fat_hdr_list;
|
|
|
|
static u32 fat_hdr_count;
|
2010-02-22 22:29:47 +01:00
|
|
|
|
2010-09-24 02:48:03 +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);
|
2010-09-19 01:16:05 +02:00
|
|
|
s32 GetHeadersCount();
|
2010-09-24 02:48:03 +02:00
|
|
|
void GetDir(struct discHdr *header, char *path);
|
2010-02-22 22:29:47 +01:00
|
|
|
|
2010-09-24 02:48:03 +02:00
|
|
|
void mk_title_txt(struct discHdr *header, char *path);
|
|
|
|
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-02-22 22:29:47 +01:00
|
|
|
|
2010-09-24 02:48:03 +02:00
|
|
|
static int nop_rw_sector(void *_fp, u32 lba, u32 count, void* buf)
|
|
|
|
{
|
|
|
|
return 0;
|
|
|
|
}
|
2010-02-15 00:22:52 +01:00
|
|
|
};
|
|
|
|
|
2010-02-16 21:21:47 +01:00
|
|
|
#endif //_WBFS_FAT_H
|