From 2039a47250bfb0eafe733a5a3d19897244f0ae2c Mon Sep 17 00:00:00 2001 From: dimok321 <15055714+dimok789@users.noreply.github.com> Date: Tue, 28 Jul 2009 16:44:19 +0000 Subject: [PATCH] *little change to the bootup (might fix some startup problems) --- source/main.cpp | 21 ++++++++++----------- 1 file changed, 10 insertions(+), 11 deletions(-) diff --git a/source/main.cpp b/source/main.cpp index 0316e712..d4bb9868 100644 --- a/source/main.cpp +++ b/source/main.cpp @@ -27,6 +27,7 @@ #include "menu.h" #include "input.h" #include "filelist.h" +#include "listfiles.h" #include "main.h" #include "fatmounter.h" #include "sys.h" @@ -58,25 +59,23 @@ main(int argc, char *argv[]) else if(!strncasecmp(argv[0], "sd:/", 4)) 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); if(ret2 < 0) { ret2 = IOS_ReloadIOS(222); load_ehc_module(); } - + SDCard_Init(); // mount SD for loading cfg's 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(); CFG_Load(); @@ -120,7 +119,7 @@ main(int argc, char *argv[]) InitVideo(); // Initialise video InitAudio(); // Initialize audio - + WPAD_SetDataFormat(WPAD_CHAN_ALL,WPAD_FMT_BTNS_ACC_IR); WPAD_SetVRes(WPAD_CHAN_ALL, screenwidth, screenheight);