diff --git a/HBC/META.XML b/HBC/META.XML index 961b86c6..632cd38e 100644 --- a/HBC/META.XML +++ b/HBC/META.XML @@ -2,8 +2,8 @@ USB Loader GX USB Loader GX Team - 1.0 r968 - 201009241346 + 1.0 r969 + 201009241511 Loads games from USB-devices 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. diff --git a/Makefile b/Makefile index a2ed0fb2..1e7cca35 100644 --- a/Makefile +++ b/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 diff --git a/source/libwiigui/gui_optionbrowser.cpp b/source/libwiigui/gui_optionbrowser.cpp index 3ff0df1c..bbae2f3c 100644 --- a/source/libwiigui/gui_optionbrowser.cpp +++ b/source/libwiigui/gui_optionbrowser.cpp @@ -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; diff --git a/source/system/IosLoader.cpp b/source/system/IosLoader.cpp index a20d9969..43f92867 100644 --- a/source/system/IosLoader.cpp +++ b/source/system/IosLoader.cpp @@ -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]; diff --git a/source/usbloader/partition_usbloader.c b/source/usbloader/partition_usbloader.c index 1bd59d91..cb06dcf8 100644 --- a/source/usbloader/partition_usbloader.c +++ b/source/usbloader/partition_usbloader.c @@ -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 diff --git a/source/usbloader/partition_usbloader.h b/source/usbloader/partition_usbloader.h index 4cde26f7..16b92552 100644 --- a/source/usbloader/partition_usbloader.h +++ b/source/usbloader/partition_usbloader.h @@ -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);