@@ -543,6 +543,13 @@ void begin_update(int opt)
543
543
logPrint (" \n " );
544
544
if (opt == 1 ) {
545
545
// Slot-1 microSD > Console SD
546
+ if (access (" fat:/_nds/TWiLightMenu/addons/" , F_OK) == 0 ) {
547
+ logPrint (" Copying addons from fat to sd\n " );
548
+ mkdir (" sd:/_nds/TWiLightMenu/addons/" , 0777 );
549
+ fcopy (" fat:/_nds/TWiLightMenu/addons/Emulators" , " sd:/_nds/TWiLightMenu/addons/Emulators" );
550
+ fcopy (" fat:/_nds/TWiLightMenu/addons/Multimedia" , " sd:/_nds/TWiLightMenu/addons/Multimedia" );
551
+ }
552
+
546
553
logPrint (" Copying 3dssplash.srldr from fat to sd\n " );
547
554
fcopy (" fat:/_nds/TWiLightMenu/3dssplash.srldr" , " sd:/_nds/TWiLightMenu/3dssplash.srldr" );
548
555
logPrint (" Copying imageview.srldr from fat to sd\n " );
@@ -557,6 +564,13 @@ void begin_update(int opt)
557
564
fcopy (" fat:/_nds/TWiLightMenu/settings.srldr" , " sd:/_nds/TWiLightMenu/settings.srldr" );
558
565
} else {
559
566
// Console SD > Slot-1 microSD
567
+ if (access (" sd:/_nds/TWiLightMenu/addons/" , F_OK) == 0 ) {
568
+ logPrint (" Copying addons from sd to fat\n " );
569
+ mkdir (" fat:/_nds/TWiLightMenu/addons/" , 0777 );
570
+ fcopy (" sd:/_nds/TWiLightMenu/addons/Emulators" , " fat:/_nds/TWiLightMenu/addons/Emulators" );
571
+ fcopy (" sd:/_nds/TWiLightMenu/addons/Multimedia" , " fat:/_nds/TWiLightMenu/addons/Multimedia" );
572
+ }
573
+
560
574
logPrint (" Copying 3dssplash.srldr from sd to fat\n " );
561
575
fcopy (" sd:/_nds/TWiLightMenu/3dssplash.srldr" , " fat:/_nds/TWiLightMenu/3dssplash.srldr" );
562
576
logPrint (" Copying imageview.srldr from sd to fat\n " );
@@ -1004,6 +1018,7 @@ int settingsMode(void)
1004
1018
}
1005
1019
1006
1020
const bool gbaR3Found = (access (sys ().isRunFromSD () ? " sd:/_nds/TWiLightMenu/emulators/GBARunner3.nds" : " fat:/_nds/TWiLightMenu/emulators/GBARunner3.nds" , F_OK) == 0 );
1021
+ const bool emulatorsInstalled = (access (sys ().isRunFromSD () ? " sd:/_nds/TWiLightMenu/addons/Emulators" : " fat:/_nds/TWiLightMenu/addons/Emulators" , F_OK) == 0 );
1007
1022
1008
1023
const bool sharedFound = (access (" sd:/shared1" , F_OK) == 0 );
1009
1024
@@ -1419,27 +1434,29 @@ int settingsMode(void)
1419
1434
gamesPage.option (sdFound () ? (" S1SD: " +STR_GAMELOADER) : STR_GAMELOADER, STR_DESCRIPTION_GAMELOADER, Option::Bool (&ms ().useBootstrap ), {" nds-bootstrap" , STR_KERNEL}, {true , false });
1420
1435
}
1421
1436
1422
- gamesPage.option (STR_COL_EMULATOR, STR_DESCRIPTION_COL_EMULATOR, Option::Int ((int *)&ms ().colEmulator ), {" S8DS" , " ColecoDS" }, {TColSegaEmulator::EColSegaS8DS, TColSegaEmulator::EColSegaColecoDS});
1437
+ if (emulatorsInstalled)
1438
+ gamesPage.option (STR_COL_EMULATOR, STR_DESCRIPTION_COL_EMULATOR, Option::Int ((int *)&ms ().colEmulator ), {" S8DS" , " ColecoDS" }, {TColSegaEmulator::EColSegaS8DS, TColSegaEmulator::EColSegaColecoDS});
1423
1439
if (ms ().consoleModel == 0 && sdFound () && !sys ().arm7SCFGLocked ())
1424
1440
gamesPage.option (STR_DSIWAREBOOTER, STR_DESCRIPTION_DSIWAREBOOTER, Option::Bool ((bool *)&ms ().dsiWareBooter ), {" nds-bootstrap" , " Unlaunch" }, {true , false });
1425
1441
if (sys ().isRegularDS ()) {
1426
1442
gamesPage
1427
1443
.option (STR_GBA_BOOTER, STR_DESCRIPTION_GBA_BOOTER, Option::Int ((int *)&ms ().gbaBooter ), {gbaR3Found ? STR_NATIVE_GBARUNNER3 : STR_NATIVE_GBARUNNER2, gbaR3Found ? STR_GBARUNNER3_ONLY : STR_GBARUNNER2_ONLY}, {TGbaBooter::EGbaNativeGbar2, TGbaBooter::EGbaGbar2})
1428
1444
.option (STR_GBABORDER, STR_DESCRIPTION_GBABORDER, Option::Nul (opt_gba_border_select), {STR_PRESS_A}, {0 });
1429
1445
}
1430
- if (!(isDSiMode () && sdFound () && sys ().arm7SCFGLocked ()))
1446
+ if (emulatorsInstalled && !(isDSiMode () && sdFound () && sys ().arm7SCFGLocked ()))
1431
1447
gamesPage.option (STR_MD_EMULATOR, STR_DESCRIPTION_MD_EMULATOR, Option::Int ((int *)&ms ().mdEmulator ), {" jEnesisDS" , " PicoDriveTWL" , STR_HYBRID}, {TMegaDriveEmulator::EMegaDriveJenesis, TMegaDriveEmulator::EMegaDrivePico, TMegaDriveEmulator::EMegaDriveHybrid});
1432
1448
gamesPage.option (STR_SG_EMULATOR, STR_DESCRIPTION_SG_EMULATOR, Option::Int ((int *)&ms ().sgEmulator ), {" S8DS" , " ColecoDS" }, {TColSegaEmulator::EColSegaS8DS, TColSegaEmulator::EColSegaColecoDS});
1433
1449
gamesPage.option (STR_CPC_EMULATOR, STR_DESCRIPTION_CPC_EMULATOR, Option::Int ((int *)&ms ().cpcEmulator ), {" AmEDS" , " CrocoDS" }, {TCpcEmulator::ECpcAmEDS, TCpcEmulator::ECpcCrocoDS});
1434
1450
1435
1451
if (isDSiMode () && sdFound () && !sys ().arm7SCFGLocked ()) {
1436
- gamesPage
1437
- .option ((flashcardFound () ? STR_SYSSD_RUNFLUBBAEMUSIN : STR_RUNFLUBBAEMUSIN),
1438
- STR_DESCRIPTION_RUNFLUBBAEMUSIN,
1439
- Option::Bool (&ms ().smsGgInRam ),
1440
- {STR_DS_MODE, STR_DSI_MODE},
1441
- {true , false });
1442
-
1452
+ if (emulatorsInstalled) {
1453
+ gamesPage
1454
+ .option ((flashcardFound () ? STR_SYSSD_RUNFLUBBAEMUSIN : STR_RUNFLUBBAEMUSIN),
1455
+ STR_DESCRIPTION_RUNFLUBBAEMUSIN,
1456
+ Option::Bool (&ms ().smsGgInRam ),
1457
+ {STR_DS_MODE, STR_DSI_MODE},
1458
+ {true , false });
1459
+ }
1443
1460
if (ms ().consoleModel == 0 ) {
1444
1461
gamesPage.option (STR_SLOT1LAUNCHMETHOD, STR_DESCRIPTION_SLOT1LAUNCHMETHOD_1, Option::Int ((int *)&ms ().slot1LaunchMethod ), {STR_REBOOT, STR_DIRECT, " Unlaunch" }, {TSlot1LaunchMethod::EReboot, TSlot1LaunchMethod::EDirect, TSlot1LaunchMethod::EUnlaunch});
1445
1462
} else {
0 commit comments