mirror of
https://github.com/wiidev/usbloadergx.git
synced 2024-11-16 00:15:08 +01:00
*optimization up to -O4
*removed all compile warnings on that level
This commit is contained in:
parent
5bf2c813b6
commit
a5a0289f9f
@ -2,8 +2,8 @@
|
||||
<app version="1">
|
||||
<name> USB Loader GX</name>
|
||||
<coder>USB Loader GX Team</coder>
|
||||
<version>1.0 r968</version>
|
||||
<release_date>201009241346</release_date>
|
||||
<version>1.0 r969</version>
|
||||
<release_date>201009241511</release_date>
|
||||
<short_description>Loads games from USB-devices</short_description>
|
||||
<long_description>USB Loader GX is a libwiigui based USB iso loader with a wii-like GUI. You can install games to your HDDs and boot them with shorter loading times.
|
||||
The interactive GUI is completely controllable with WiiMote, Classic Controller or GC Controller.
|
||||
|
2
Makefile
2
Makefile
@ -50,7 +50,7 @@ INCLUDES := source
|
||||
# options for code generation
|
||||
#---------------------------------------------------------------------------------
|
||||
|
||||
CFLAGS = -g -Os -Wall $(MACHDEP) $(INCLUDE) -DHAVE_CONFIG_H
|
||||
CFLAGS = -g -O4 -Wall $(MACHDEP) $(INCLUDE) -DHAVE_CONFIG_H
|
||||
CXXFLAGS = -Xassembler -aln=$@.lst $(CFLAGS)
|
||||
LDFLAGS = -g $(MACHDEP) -Wl,-Map,$(notdir $@).map,--section-start,.init=0x80B00000,-wrap,malloc,-wrap,free,-wrap,memalign,-wrap,calloc,-wrap,realloc,-wrap,malloc_usable_size
|
||||
-include $(PROJECTDIR)/Make.config
|
||||
|
@ -16,7 +16,7 @@
|
||||
|
||||
#define GAMESELECTSIZE 30
|
||||
|
||||
static int scrollbaron, startat, loaded = 0;
|
||||
static int scrollbaron = 0, startat = 0, loaded = 0;
|
||||
/**
|
||||
* Constructor for the GuiOptionBrowser class.
|
||||
*/
|
||||
@ -433,7 +433,7 @@ void GuiOptionBrowser::Update(GuiTrigger * t)
|
||||
selectedItem = startat;
|
||||
optionBtn[selectedItem]->SetState(STATE_SELECTED, t->chan);
|
||||
}
|
||||
else
|
||||
else if(startat < PAGESIZE)
|
||||
{
|
||||
listOffset = (startat - 4);
|
||||
selectedItem = startat;
|
||||
|
@ -28,7 +28,7 @@ s32 IosLoader::LoadAppCios()
|
||||
u32 activeCios = IOS_GetVersion();
|
||||
|
||||
|
||||
for (u8 i=(sizeof(ciosLoadPriority)/sizeof(ciosLoadPriority[0])); i>=0; i--)
|
||||
for (u8 i = (sizeof(ciosLoadPriority)/sizeof(ciosLoadPriority[0]))-1; i >= 0; i--)
|
||||
{
|
||||
u32 cios = ciosLoadPriority[i];
|
||||
|
||||
|
@ -150,7 +150,7 @@ s32 Partition_GetEntriesEx(u32 device, partitionEntry *outbuf, u32 *psect_size,
|
||||
ret = Device_ReadSectors(device, 0, 1, table);
|
||||
if (!ret) return -1;
|
||||
// Check if it's a RAW WBFS disc, without partition table
|
||||
if (get_fs_type(table) == FS_TYPE_WBFS)
|
||||
if (get_fs_type((u8 *) table) == FS_TYPE_WBFS)
|
||||
{
|
||||
memset(outbuf, 0, sizeof(table->entries));
|
||||
wbfs_head_t * head = (wbfs_head_t *) Buffer;
|
||||
@ -186,7 +186,7 @@ s32 Partition_GetEntriesEx(u32 device, partitionEntry *outbuf, u32 *psect_size,
|
||||
{
|
||||
// handle the invalid scenario where wbfs is on an EXTENDED
|
||||
// partition instead of on the Logical inside Extended.
|
||||
if (get_fs_type(&table) == FS_TYPE_WBFS) break;
|
||||
if (get_fs_type((u8 *) table) == FS_TYPE_WBFS) break;
|
||||
}
|
||||
entry = &table->entries[0];
|
||||
entry->sector = swap32(entry->sector);
|
||||
@ -283,20 +283,19 @@ char *part_type_name(int type)
|
||||
return unk;
|
||||
}
|
||||
|
||||
int get_fs_type(void *buff)
|
||||
int get_fs_type(u8 *buff)
|
||||
{
|
||||
char *buf = buff;
|
||||
// WBFS
|
||||
wbfs_head_t *head = (wbfs_head_t *) buff;
|
||||
if (head->magic == wbfs_htonl( WBFS_MAGIC )) return FS_TYPE_WBFS;
|
||||
// 55AA
|
||||
if (buf[0x1FE] == 0x55 && buf[0x1FF] == 0xAA)
|
||||
if (buff[0x1FE] == 0x55 && buff[0x1FF] == 0xAA)
|
||||
{
|
||||
// FAT
|
||||
if (memcmp(buf + 0x36, "FAT", 3) == 0) return FS_TYPE_FAT16;
|
||||
if (memcmp(buf + 0x52, "FAT", 3) == 0) return FS_TYPE_FAT32;
|
||||
if (memcmp(buff + 0x36, "FAT", 3) == 0) return FS_TYPE_FAT16;
|
||||
if (memcmp(buff + 0x52, "FAT", 3) == 0) return FS_TYPE_FAT32;
|
||||
// NTFS
|
||||
if (memcmp(buf + 0x03, "NTFS", 4) == 0) return FS_TYPE_NTFS;
|
||||
if (memcmp(buff + 0x03, "NTFS", 4) == 0) return FS_TYPE_NTFS;
|
||||
}
|
||||
return FS_TYPE_UNK;
|
||||
}
|
||||
@ -375,7 +374,7 @@ s32 Partition_GetList(u32 device, PartList *plist)
|
||||
// even though wrong, it's possible WBFS is on an extended part.
|
||||
//if (!part_is_data(entry->type)) continue;
|
||||
if (!Device_ReadSectors(device, entry->sector, 1, buf)) continue;
|
||||
pinfo->fs_type = get_fs_type(buf);
|
||||
pinfo->fs_type = get_fs_type((u8 *) buf);
|
||||
if (pinfo->fs_type == FS_TYPE_WBFS)
|
||||
{
|
||||
// multiple wbfs on sdhc not supported
|
||||
|
@ -72,7 +72,7 @@ extern "C"
|
||||
char* part_type_data(int type);
|
||||
char* part_type_name(int type);
|
||||
bool part_valid_data(partitionEntry *entry);
|
||||
int get_fs_type(void *buf);
|
||||
int get_fs_type(u8 *buf);
|
||||
bool is_type_fat(int type);
|
||||
char* get_fs_name(int i);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user