diff --git a/Makefile b/Makefile index 9d6d750a..2ba455d6 100644 --- a/Makefile +++ b/Makefile @@ -8,7 +8,6 @@ $(error "Please set DEVKITPPC in your environment. export DEVKITPPC=dev endif include $(DEVKITPPC)/wii_rules - #--------------------------------------------------------------------------------- # TARGET is the name of the output # BUILD is the directory where object files & intermediate files will be placed @@ -27,8 +26,8 @@ SVNDEV := -D'SVN_REV="$(shell svnversion -n ..)"' # options for code generation #--------------------------------------------------------------------------------- -CFLAGS = -g -O2 -Wall $(SVNDEV) $(MACHDEP) $(INCLUDE) -CXXFLAGS = -save-temps -Xassembler -aln=$@.lst $(CFLAGS) +CFLAGS = -g -O2 -save-temps -Wall $(SVNDEV) $(MACHDEP) $(INCLUDE) +CXXFLAGS = -Xassembler -aln=$@.lst $(CFLAGS) LDFLAGS = -g $(MACHDEP) -Wl,-Map,$(notdir $@).map,--section-start,.init=0x80a00100 #--------------------------------------------------------------------------------- diff --git a/source/fatmounter.c b/source/fatmounter.c index cfb01483..59b79952 100644 --- a/source/fatmounter.c +++ b/source/fatmounter.c @@ -160,13 +160,6 @@ int USBDevice_Init() } return -1; } -void USBDevice_ReInit() -{ - __io_usbstorage.shutdown(); - __io_wiiums.shutdown(); - if(__io_usbstorage.startup()) return; - else __io_wiiums.startup(); -} void USBDevice_deInit() { diff --git a/source/fatmounter.h b/source/fatmounter.h index ea844117..90154b6d 100644 --- a/source/fatmounter.h +++ b/source/fatmounter.h @@ -8,7 +8,6 @@ extern "C" int USBDevice_Init(); void USBDevice_deInit(); -void USBDevice_ReInit(); int isSdInserted(); int isInserted(const char *path); int SDCard_Init(); diff --git a/source/main.cpp b/source/main.cpp index f2f01a07..9c981b26 100644 --- a/source/main.cpp +++ b/source/main.cpp @@ -35,6 +35,7 @@ #include "wpad.h" #include "fat.h" +//#define SPECIAL_FOR_ARDI // Fix Problem with Trekstor Classic 250GB /* Constants */ #define CONSOLE_XCOORD 260 @@ -48,8 +49,20 @@ FreeTypeGX *fontClock=0; int main(int argc, char *argv[]) { - s32 ret2; + u8 preloaded_ios = 0; +#ifdef SPECIAL_FOR_ARDI + if( (ret2 = IOS_ReloadIOS(249)) >=0 ) + preloaded_ios = 249; + else + { + if( (ret2 = IOS_ReloadIOS(222)) >=0 ) + { + load_ehc_module(); + preloaded_ios = 222; + } + } +#endif SDCard_Init(); // mount SD for loading cfg's USBDevice_Init(); // and mount USB:/ @@ -78,14 +91,14 @@ main(int argc, char *argv[]) USBDevice_deInit();// unmount USB for reloading IOS /* Load Custom IOS */ - if(Settings.cios == ios222) { + if(Settings.cios == ios222 && preloaded_ios != 222) { ret2 = IOS_ReloadIOS(222); load_ehc_module(); if (ret2 < 0) { Settings.cios = ios249; ret2 = IOS_ReloadIOS(249); } - } else { + } else if(preloaded_ios != 249) { ret2 = IOS_ReloadIOS(249); } diff --git a/source/menu.cpp b/source/menu.cpp index b4c4f53f..e65e25c1 100644 --- a/source/menu.cpp +++ b/source/menu.cpp @@ -681,7 +681,6 @@ static int MenuDiscList() else if(sdcardBtn.GetState() == STATE_CLICKED) { - USBDevice_ReInit(); SDCard_deInit(); SDCard_Init(); if (Settings.gameDisplay==list){ diff --git a/source/prompts/PromptWindows.cpp b/source/prompts/PromptWindows.cpp index 6b0a4568..7e11d2ce 100644 --- a/source/prompts/PromptWindows.cpp +++ b/source/prompts/PromptWindows.cpp @@ -2294,32 +2294,11 @@ ProgressUpdateWindow() if(file.data != NULL) { char revtxt[10]; - char rev_txt[14]; - sprintf(rev_txt, "%srev.txt", Settings.update_path); - pfile = fopen(rev_txt, "w"); - fwrite(file.data,1,file.size,pfile); - fclose(pfile); - //has to be repeated or it isnt working (first file download bug) - pfile = fopen(rev_txt, "w"); - fwrite(file.data,1,file.size,pfile); - fclose(pfile); - //"w+" doesnt work, needs to be reopened as "r" - pfile = fopen(rev_txt, "r"); - int c = 0, i = 0; - while(c != EOF || i < 10) { - c = fgetc(pfile); - if (c != EOF) { - revtxt[i] = c; - } else { - revtxt[i] = 0x00; - break; - } - i++; - } - fclose(pfile); + u8 i; + for(i=0; i<9 || i currentrev) { diff --git a/source/usbloader/wbfs.h b/source/usbloader/wbfs.h index aea47eaf..2f8c4dfa 100644 --- a/source/usbloader/wbfs.h +++ b/source/usbloader/wbfs.h @@ -19,10 +19,10 @@ enum { /* Prototypes */ -s32 WBFS_Init(u32); +s32 WBFS_Init(u32); s32 WBFS_Open(); -s32 WBFS_Open2(int partition); -s32 GetPartition(); +s32 WBFS_Open2(int partition); +s32 GetPartition(); s32 WBFS_Close(void); s32 WBFS_Format(u32, u32); s32 WBFS_GetCount(u32 *); @@ -37,10 +37,6 @@ s32 WBFS_DiskSpace(f32 *, f32 *); s32 WBFS_RenameGame(u8 *, const void *); f32 WBFS_EstimeGameSize(void); -s32 __WBFS_ReadUSB(void *fp, u32 lba, u32 count, void *iobuf); -s32 __WBFS_WriteUSB(void *fp, u32 lba, u32 count, void *iobuf); - - #ifdef __cplusplus } #endif