mirror of
https://github.com/wiidev/usbloadergx.git
synced 2024-11-18 09:19:17 +01:00
2543c555a4
* Added MEM2 support by Hibern * Better partition support (by oggzee) * Support for subdirectories in FAT32 (by oggzee) * Added support for cios 223 and 250 * Added BCA support (go to Settings->Custom Paths) to change the path of the BCA files (by Hermes) * Fixed issue with hairless mode * Fixed issue with IOS_ReloadIOSsafe (by giantpune) * Added setting to save games in a subdirectory * Fixed slow startup when loading from FAT (WiiTDB required!) * Changed handling of new titles a bit (speed improvement) Known issue: * FAT rename and re-id broken again due to subdirectory support (yes, I'm lazy)
78 lines
1.5 KiB
C
78 lines
1.5 KiB
C
#ifndef _PARTITION_H_
|
|
#define _PARTITION_H_
|
|
|
|
#ifdef __cplusplus
|
|
extern "C" {
|
|
#endif
|
|
|
|
/* 'partition entry' structure */
|
|
typedef struct {
|
|
/* Boot indicator */
|
|
u8 boot;
|
|
|
|
/* Starting CHS */
|
|
u8 start[3];
|
|
|
|
/* Partition type */
|
|
u8 type;
|
|
|
|
/* Ending CHS */
|
|
u8 end[3];
|
|
|
|
/* Partition sector */
|
|
u32 sector;
|
|
|
|
/* Partition size */
|
|
u32 size;
|
|
} ATTRIBUTE_PACKED partitionEntry;
|
|
|
|
/* Constants */
|
|
#define MAX_PARTITIONS 4
|
|
#define MAX_PARTITIONS_EX 10
|
|
|
|
#define FS_TYPE_UNK 0
|
|
#define FS_TYPE_FAT16 1
|
|
#define FS_TYPE_FAT32 2
|
|
#define FS_TYPE_NTFS 3
|
|
#define FS_TYPE_WBFS 4
|
|
|
|
typedef struct
|
|
{
|
|
int fs_type;
|
|
int wbfs_i; // seq wbfs part index
|
|
int fat_i; // seq fat part index
|
|
} PartInfo;
|
|
|
|
typedef struct
|
|
{
|
|
int num;
|
|
u32 sector_size;
|
|
partitionEntry pentry[MAX_PARTITIONS_EX];
|
|
int wbfs_n;
|
|
int fat_n;
|
|
PartInfo pinfo[MAX_PARTITIONS_EX];
|
|
} PartList;
|
|
|
|
/* Prototypes */
|
|
s32 Partition_GetEntries(u32 device, partitionEntry *outbuf, u32 *outval);
|
|
s32 Partition_GetEntriesEx(u32 device, partitionEntry *outbuf, u32 *outval, int *num);
|
|
bool Device_ReadSectors(u32 device, u32 sector, u32 count, void *buffer);
|
|
bool Device_WriteSectors(u32 device, u32 sector, u32 count, void *buffer);
|
|
s32 Partition_GetList(u32 device, PartList *plist);
|
|
int Partition_FixEXT(u32 device, int part);
|
|
|
|
bool part_is_extended(int type);
|
|
bool part_is_data(int type);
|
|
char* part_type_data(int type);
|
|
char* part_type_name(int type);
|
|
bool part_valid_data(partitionEntry *entry);
|
|
int get_fs_type(void *buf);
|
|
bool is_type_fat(int type);
|
|
char* get_fs_name(int i);
|
|
|
|
#ifdef __cplusplus
|
|
}
|
|
#endif
|
|
|
|
#endif
|