Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- s32 NandTitle::Get()
- {
- s32 ret;
- u64 *list = NULL;
- u32 numTitles = 0;
- titleIds.clear();
- NameList.clear();
- ret = ES_GetNumTitles( &numTitles );
- if ( ret < 0 )
- return WII_EINTERNAL;
- list = ( u64* )memalign( 32, numTitles * sizeof( u64 ) );
- if ( !list )
- {
- return -1;
- }
- ret = ES_GetTitles( list, numTitles );
- if ( ret < 0 )
- {
- free( list );
- return WII_EINTERNAL;
- }
- for( u32 i = 0; i < numTitles; i++ )
- {
- titleIds.push_back( list[ i ] );
- }
- free( list );
- MagicPatches( 1 );
- int language = CONF_GetLanguage();
- ISFS_Initialize();
- wchar_t name[ IMET_MAX_NAME_LEN ];
- for ( u32 i = 0; i < titleIds.size(); i++ )
- {
- bool r = GetName( titleIds.at( i ), language, name );
- if ( r )
- {
- NameList[ titleIds.at( i ) ] = name;
- //wString *wsname = new wString( name );
- //memcpy( nameList + ( IMET_MAX_NAME_LEN * i ), ( wsname->toUTF8() ).c_str(), strlen( ( wsname->toUTF8() ).c_str() ) );
- //gprintf("adding: %s\n", (wsname->toUTF8()).c_str() );
- //delete wsname;
- }
- }
- ISFS_Deinitialize();
- MagicPatches( 0 );
- return 1;
- }
Advertisement
Add Comment
Please, Sign In to add comment