@@ -363,9 +363,6 @@ int main( int argc, char **argv) {
363
363
iprintf (" \n " );
364
364
if ((cursorPosition == 0 ) && (optionCount > 2 )) {
365
365
iprintf (" Change the SDNAND region.\n " );
366
- if (regionChar == ' J' ) {
367
- iprintf (" System settings will be reset.\n " );
368
- }
369
366
iprintf (" \n " );
370
367
iprintf (" Original region: " );
371
368
if (regionChar == ' J' ) {
@@ -461,71 +458,18 @@ int main( int argc, char **argv) {
461
458
if (newRegion != oldRegion) {
462
459
FILE* f_hwinfoS = fopen (" sd:/sys/HWINFO_S.dat" , " rb+" );
463
460
if (f_hwinfoS) {
464
- u32 supportedLangBitmask = 0x01 ; // JPN: Japanese
461
+ u32 supportedLangBitmask = 0x3F ; // Japanese, English, French, German, Italian, Spanish
465
462
if (newRegion == 5 ) { // KOR
466
463
supportedLangBitmask = 0x80 ; // Korean
467
464
} else if (newRegion == 4 ) { // CHN
468
465
supportedLangBitmask = 0x40 ; // Chinese
469
- } else if (newRegion == 3 ) { // AUS
470
- supportedLangBitmask = 0x02 ; // English
471
- } else if (newRegion == 2 ) { // EUR
472
- supportedLangBitmask = 0x3E ; // English, French, German, Italian, Spanish
473
- } else if (newRegion == 1 ) { // USA
474
- supportedLangBitmask = 0x26 ; // English, French, Spanish
475
466
}
476
467
fseek (f_hwinfoS, 0x88 , SEEK_SET);
477
468
fwrite (&supportedLangBitmask, sizeof (u32), 1 , f_hwinfoS);
478
469
fseek (f_hwinfoS, 0x90 , SEEK_SET);
479
470
fwrite (&newRegion, 1 , 1 , f_hwinfoS);
480
471
fclose (f_hwinfoS);
481
472
}
482
- if (regionChar == ' J' ) {
483
- // Reset system settings to work around touch inputs not working
484
- remove (" sd:/shared1/TWLCFG0.dat" );
485
- remove (" sd:/shared1/TWLCFG1.dat" );
486
- }
487
- }
488
-
489
- // Create dummy file
490
- // Check the free space
491
- struct statvfs st;
492
- statvfs (" sd:/" , &st);
493
- u32 freeSpace = st.f_bsize * st.f_bfree ;
494
- u64 realFreeSpace = st.f_bsize * st.f_bfree ;
495
-
496
- // If the free space is bigger than 2GiB (using a u32 so always 0 - 4GiB)
497
- // or the free space is less than 20MiB (and the actual free space is over 4GiB)
498
- if (freeSpace > (2u << 30 ) || (freeSpace < (20u << 20 ) && realFreeSpace > (4u << 30 ))) {
499
- consoleDemoInit ();
500
- size_t oldSize = 0 ;
501
- // Check old dummy file size to see if it can just be removed
502
- FILE *file = fopen (" sd:/hiya/dummy.bin" , " rb" );
503
- if (file) {
504
- fseek (file, 0 , SEEK_END);
505
- oldSize = ftell (file);
506
- fclose (file);
507
- }
508
-
509
- // Check that dummy file is still needed
510
- if ((freeSpace + oldSize) > (2u << 30 ) || (freeSpace + oldSize) < (20u << 20 )) {
511
- // Make sure hiya directory exists and make the file
512
- mkdir (" sd:/hiya" , 0777 );
513
- iprintf (" Making new dummy file... " );
514
-
515
- // Make sure the file exists
516
- file = fopen (" sd:/hiya/dummy.bin" , " wb" );
517
- if (file)
518
- fclose (file);
519
-
520
- // If free space is less than 20MiB, add free space + 2GiB + 10MiB
521
- // otherwise add free space - 2GiB + 10MiB
522
- truncate (" sd:/hiya/dummy.bin" , (freeSpace < (20u << 20 ) ? (freeSpace + (2 << 30 )) : (freeSpace - (2 << 30 ))) + (10 << 20 ));
523
- iprintf (" Done!\n " );
524
- } else {
525
- iprintf (" Removing old dummy file... " );
526
- remove (" sd:/hiya/dummy.bin" );
527
- iprintf (" Done!\n " );
528
- }
529
473
}
530
474
531
475
if (!gotoSettings && (*(u32*)0x02000300 == 0x434E4C54 )) {
0 commit comments