*little change to the bootup (might fix some startup problems)

This commit is contained in:
dimok321 2009-07-28 16:44:19 +00:00
parent c743cea589
commit 2039a47250

View File

@ -27,6 +27,7 @@
#include "menu.h" #include "menu.h"
#include "input.h" #include "input.h"
#include "filelist.h" #include "filelist.h"
#include "listfiles.h"
#include "main.h" #include "main.h"
#include "fatmounter.h" #include "fatmounter.h"
#include "sys.h" #include "sys.h"
@ -58,25 +59,23 @@ main(int argc, char *argv[])
else if(!strncasecmp(argv[0], "sd:/", 4)) else if(!strncasecmp(argv[0], "sd:/", 4))
bootDevice_found = true; bootDevice_found = true;
} }
if(!bootDevice_found)
{
//try USB
struct stat st;
if((stat("USB:/apps/usbloader_gx/boot.dol", &st) == 0) || (stat("USB:/apps/usbloader_gx/boot.elf", &st) == 0))
strcpy(bootDevice, "USB:");
}
ret2 = IOS_ReloadIOS(249); ret2 = IOS_ReloadIOS(249);
if(ret2 < 0) { if(ret2 < 0) {
ret2 = IOS_ReloadIOS(222); ret2 = IOS_ReloadIOS(222);
load_ehc_module(); load_ehc_module();
} }
SDCard_Init(); // mount SD for loading cfg's SDCard_Init(); // mount SD for loading cfg's
USBDevice_Init(); // and mount USB:/ USBDevice_Init(); // and mount USB:/
if(!bootDevice_found)
{
//try USB
if(checkfile((char*) "USB:/apps/usbloader_gx/boot.dol") || (checkfile((char*) "USB:/apps/usbloader_gx/boot.elf"))
|| checkfile((char*) "USB:/apps/usbloadergx/boot.dol") || (checkfile((char*) "USB:/apps/usbloadergx/boot.elf")))
strcpy(bootDevice, "USB:");
}
gettextCleanUp(); gettextCleanUp();
CFG_Load(); CFG_Load();
@ -120,7 +119,7 @@ main(int argc, char *argv[])
InitVideo(); // Initialise video InitVideo(); // Initialise video
InitAudio(); // Initialize audio InitAudio(); // Initialize audio
WPAD_SetDataFormat(WPAD_CHAN_ALL,WPAD_FMT_BTNS_ACC_IR); WPAD_SetDataFormat(WPAD_CHAN_ALL,WPAD_FMT_BTNS_ACC_IR);
WPAD_SetVRes(WPAD_CHAN_ALL, screenwidth, screenheight); WPAD_SetVRes(WPAD_CHAN_ALL, screenwidth, screenheight);