Guest User

Untitled

a guest
May 16th, 2012
18
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.29 KB | None | 0 0
  1. s32 NandTitle::Get()
  2. {
  3. s32 ret;
  4. u64 *list = NULL;
  5. u32 numTitles = 0;
  6.  
  7. titleIds.clear();
  8. NameList.clear();
  9.  
  10.  
  11.  
  12. ret = ES_GetNumTitles( &numTitles );
  13. if ( ret < 0 )
  14. return WII_EINTERNAL;
  15.  
  16. list = ( u64* )memalign( 32, numTitles * sizeof( u64 ) );
  17. if ( !list )
  18. {
  19. return -1;
  20. }
  21.  
  22. ret = ES_GetTitles( list, numTitles );
  23. if ( ret < 0 )
  24. {
  25. free( list );
  26. return WII_EINTERNAL;
  27. }
  28.  
  29. for( u32 i = 0; i < numTitles; i++ )
  30. {
  31. titleIds.push_back( list[ i ] );
  32. }
  33.  
  34. free( list );
  35.  
  36.  
  37. MagicPatches( 1 );
  38. int language = CONF_GetLanguage();
  39. ISFS_Initialize();
  40.  
  41. wchar_t name[ IMET_MAX_NAME_LEN ];
  42.  
  43. for ( u32 i = 0; i < titleIds.size(); i++ )
  44. {
  45. bool r = GetName( titleIds.at( i ), language, name );
  46. if ( r )
  47. {
  48. NameList[ titleIds.at( i ) ] = name;
  49. //wString *wsname = new wString( name );
  50. //memcpy( nameList + ( IMET_MAX_NAME_LEN * i ), ( wsname->toUTF8() ).c_str(), strlen( ( wsname->toUTF8() ).c_str() ) );
  51. //gprintf("adding: %s\n", (wsname->toUTF8()).c_str() );
  52. //delete wsname;
  53. }
  54. }
  55.  
  56. ISFS_Deinitialize();
  57. MagicPatches( 0 );
  58. return 1;
  59. }
Advertisement
Add Comment
Please, Sign In to add comment