This commit is contained in:
giantpune 2010-09-19 13:21:36 +00:00
parent bb234a9a51
commit 6012536f67
3 changed files with 17 additions and 6 deletions

View File

@ -130,6 +130,7 @@ int isInserted( const char *path )
return __io_sdhc.isInserted() || __io_wiisd.isInserted(); return __io_sdhc.isInserted() || __io_wiisd.isInserted();
} }
static u8 sdIsInited = 0;
int SDCard_Init() int SDCard_Init()
{ {
#ifdef DEBUG_FAT #ifdef DEBUG_FAT
@ -142,6 +143,7 @@ int SDCard_Init()
{ {
fat_sd_mount = MOUNT_SD; fat_sd_mount = MOUNT_SD;
fat_sd_sec = _FAT_startSector; fat_sd_sec = _FAT_startSector;
sdIsInited = 1;
#ifdef DEBUG_FAT #ifdef DEBUG_FAT
gprintf( ":1\n" ); gprintf( ":1\n" );
#endif #endif
@ -151,6 +153,7 @@ int SDCard_Init()
{ {
fat_sd_mount = MOUNT_SDHC; fat_sd_mount = MOUNT_SDHC;
fat_sd_sec = _FAT_startSector; fat_sd_sec = _FAT_startSector;
sdIsInited = 1;
#ifdef DEBUG_FAT #ifdef DEBUG_FAT
gprintf( ":1\n" ); gprintf( ":1\n" );
#endif #endif
@ -165,13 +168,17 @@ int SDCard_Init()
void SDCard_deInit() void SDCard_deInit()
{ {
#ifdef DEBUG_FAT #ifdef DEBUG_FAT
gprintf( "SDCard_deInit(): " ); gprintf( "SDCard_deInit( %d ): ", sdIsInited );
#endif #endif
//closing all open Files write back the cache and then shutdown em! //closing all open Files write back the cache and then shutdown em!
if( sdIsInited )
{
fatUnmount( "SD:/" ); fatUnmount( "SD:/" );
fat_sd_mount = MOUNT_NONE; fat_sd_mount = MOUNT_NONE;
fat_sd_sec = 0; fat_sd_sec = 0;
sdIsInited = 0;
}
#ifdef DEBUG_FAT #ifdef DEBUG_FAT
gprintf( "ok\n" ); gprintf( "ok\n" );
#endif #endif

View File

@ -1726,7 +1726,10 @@ void game_set( char *name, char *val )
} }
if ( strcmp( "returnTo", opt_name ) == 0 ) if ( strcmp( "returnTo", opt_name ) == 0 )
{ {
strlcpy( game->returnTo, opt_val, sizeof( game->returnTo ) ); if ( sscanf( opt_val, "%hd", &opt_c ) == 1 )
{
game->returnTo = opt_c;
}
} }
} }
// next opt // next opt
@ -1893,7 +1896,7 @@ bool cfg_save_games()
fprintf( f, "loadalternatedol:%d;", cfg_game[i].loadalternatedol ); fprintf( f, "loadalternatedol:%d;", cfg_game[i].loadalternatedol );
fprintf( f, "alternatedolstart:%d;", cfg_game[i].alternatedolstart ); fprintf( f, "alternatedolstart:%d;", cfg_game[i].alternatedolstart );
fprintf( f, "alternatedolname:%s;\n", cfg_game[i].alternatedolname ); fprintf( f, "alternatedolname:%s;\n", cfg_game[i].alternatedolname );
fprintf( f, "returnTo:%s;\n", cfg_game[i].returnTo ); fprintf( f, "returnTo:%d;\n", cfg_game[i].returnTo );
} }
fprintf( f, "# END\n" ); fprintf( f, "# END\n" );
fclose( f ); fclose( f );

View File

@ -298,6 +298,7 @@ s32 Disc_IsWii( void )
s32 Disc_BootPartition( u64 offset, u8 videoselected, u8 cheat, u8 vipatch, u8 patchcountrystring, u8 error002fix, u8 alternatedol, u32 alternatedoloffset, u32 returnTo ) s32 Disc_BootPartition( u64 offset, u8 videoselected, u8 cheat, u8 vipatch, u8 patchcountrystring, u8 error002fix, u8 alternatedol, u32 alternatedoloffset, u32 returnTo )
{ {
gprintf("booting partition IOS %u v%u\n", IOS_GetVersion(), IOS_GetRevision() );
entry_point p_entry; entry_point p_entry;
s32 ret; s32 ret;