@@ -93,9 +93,8 @@ namespace data
9393 if (smdh == NULL )
9494 return false ;
9595
96- title = ( char16_t *)smdh->applicationTitles [1 ].shortDescription ;
96+ title. assign (( char16_t *)( smdh->applicationTitles [1 ].shortDescription )) ;
9797 titleSafe.assign (safeTitle (title));
98- wideTitle = util::toUtf32 (title);
9998
10099 char tmp[16 ];
101100 AM_GetTitleProductCode (m, id, tmp);
@@ -118,7 +117,6 @@ namespace data
118117
119118 title.assign (_title);
120119 titleSafe.assign (safeTitle (title));
121- wideTitle.assign (util::toUtf32 (title));
122120 prodCode.assign (code);
123121
124122 return true ;
@@ -252,6 +250,19 @@ namespace data
252250 std::fstream cache (" /JKSV/titles" , std::ios::in | std::ios::binary);
253251 if (cache.is_open ())
254252 {
253+ uint8_t cacheRev = 0 ;
254+ cache.seekg (2 , cache.beg );
255+ cacheRev = cache.get ();
256+ cache.seekg (0 , cache.beg );
257+
258+ if (cacheRev < 2 )
259+ {
260+ cache.close ();
261+ std::remove (" /JKSV/titles" );
262+ loadTitles ();
263+ return ;
264+ }
265+
255266 uint16_t count = 0 ;
256267 cache.read ((char *)&count, sizeof (uint16_t ));
257268
@@ -301,6 +312,7 @@ namespace data
301312 titles.push_back (newTitle);
302313 }
303314 }
315+ else
304316
305317 prog.update (i);
306318
@@ -320,7 +332,7 @@ namespace data
320332 {
321333 uint16_t countOut = titles.size ();
322334 cache.write ((char *)&countOut, sizeof (uint16_t ));
323- cache.put (0x00 );
335+ cache.put (0x02 );
324336
325337 for (unsigned i = 0 ; i < titles.size (); i++)
326338 {
@@ -354,6 +366,18 @@ namespace data
354366 std::fstream cache (" /JKSV/nand" , std::ios::in | std::ios::binary);
355367 if (cache.is_open ())
356368 {
369+ uint8_t cacheRev = 0 ;
370+ cache.seekg (2 , cache.beg );
371+ cacheRev = cache.get ();
372+ cache.seekg (0 , cache.beg );
373+ if (cacheRev < 2 )
374+ {
375+ cache.close ();
376+ std::remove (" /JKSV/nand" );
377+ loadNand ();
378+ return ;
379+ }
380+
357381 uint16_t count;
358382 cache.read ((char *)&count, sizeof (uint16_t ));
359383
@@ -411,7 +435,7 @@ namespace data
411435 uint16_t countOut = nand.size ();
412436 cache.open (" /JKSV/nand" , std::ios::out | std::ios::binary);
413437 cache.write ((char *)&countOut, sizeof (uint16_t ));
414- cache.put (0x00 );
438+ cache.put (0x02 );
415439 for (unsigned i = 0 ; i < nand.size (); i++)
416440 {
417441 char16_t titleOut[0x40 ];
0 commit comments