mirror of
https://github.com/wiidev/usbloadergx.git
synced 2024-11-16 16:29:18 +01:00
* little changes
* remove using of rev.txt
This commit is contained in:
parent
33eaefe81e
commit
fd4b98714f
5
Makefile
5
Makefile
@ -8,7 +8,6 @@ $(error "Please set DEVKITPPC in your environment. export DEVKITPPC=<path to>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
|
||||
|
||||
#---------------------------------------------------------------------------------
|
||||
|
@ -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()
|
||||
{
|
||||
|
@ -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();
|
||||
|
@ -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);
|
||||
}
|
||||
|
||||
|
@ -681,7 +681,6 @@ static int MenuDiscList()
|
||||
|
||||
else if(sdcardBtn.GetState() == STATE_CLICKED)
|
||||
{
|
||||
USBDevice_ReInit();
|
||||
SDCard_deInit();
|
||||
SDCard_Init();
|
||||
if (Settings.gameDisplay==list){
|
||||
|
@ -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<file.size; i++)
|
||||
revtxt[i] = file.data[i];
|
||||
revtxt[i] = 0;
|
||||
revnumber = atoi(revtxt);
|
||||
remove(rev_txt);
|
||||
free(file.data);
|
||||
}
|
||||
|
||||
if(revnumber > currentrev) {
|
||||
|
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user