Skip to content

Commit

Permalink
Remove GBARunner3 .ini setting
Browse files Browse the repository at this point in the history
GBARunner3 is now enabled by just placing the .nds file in the `emulators` folder, and GBARunner2 settings are now hidden
  • Loading branch information
RocketRobz committed Jun 12, 2024
1 parent 815639b commit 660f2b9
Show file tree
Hide file tree
Showing 11 changed files with 48 additions and 37 deletions.
7 changes: 4 additions & 3 deletions quickmenu/arm9/source/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1407,6 +1407,8 @@ int dsClassicMenu(void) {

logPrint("\n");

ms().gbaR3Test = (access(sys().isRunFromSD() ? "sd:/_nds/TWiLightMenu/emulators/GBARunner3.nds" : "fat:/_nds/TWiLightMenu/emulators/GBARunner3.nds", F_OK) == 0);

findPictochatAndDownladPlay();

if (sdFound() && ms().consoleModel < 2 && ms().launcherApp != -1) {
Expand Down Expand Up @@ -3102,9 +3104,8 @@ int dsClassicMenu(void) {
} else if (ms().gbaR3Test) {
ms().launchType[ms().secondaryDevice] = TWLSettings::EGBARunner2Launch;

ndsToBoot = "sd:/_nds/TWiLightMenu/emulators/GBARunner3.nds";
if (!isDSiMode() || access(ndsToBoot, F_OK) != 0) {
ndsToBoot = "fat:/_nds/TWiLightMenu/emulators/GBARunner3.nds";
ndsToBoot = sys().isRunFromSD() ? "sd:/_nds/TWiLightMenu/emulators/GBARunner3.nds" : "fat:/_nds/TWiLightMenu/emulators/GBARunner3.nds";
if (!isDSiMode()) {
boostVram = true;
}
} else if (ms().secondaryDevice) {
Expand Down
7 changes: 4 additions & 3 deletions romsel_aktheme/arm9/source/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1064,6 +1064,8 @@ int akTheme(void) {

logPrint("\n");

ms().gbaR3Test = (access(sys().isRunFromSD() ? "sd:/_nds/TWiLightMenu/emulators/GBARunner3.nds" : "fat:/_nds/TWiLightMenu/emulators/GBARunner3.nds", F_OK) == 0);

if (sdFound()) {
statvfs("sd:/", &st[0]);

Expand Down Expand Up @@ -2217,9 +2219,8 @@ int akTheme(void) {
} else if (ms().gbaR3Test) {
ms().launchType[ms().secondaryDevice] = TWLSettings::EGBARunner2Launch;

ndsToBoot = "sd:/_nds/TWiLightMenu/emulators/GBARunner3.nds";
if (!isDSiMode() || access(ndsToBoot, F_OK) != 0) {
ndsToBoot = "fat:/_nds/TWiLightMenu/emulators/GBARunner3.nds";
ndsToBoot = sys().isRunFromSD() ? "sd:/_nds/TWiLightMenu/emulators/GBARunner3.nds" : "fat:/_nds/TWiLightMenu/emulators/GBARunner3.nds";
if (!isDSiMode()) {
boostVram = true;
}
} else if (ms().secondaryDevice) {
Expand Down
2 changes: 1 addition & 1 deletion romsel_dsimenutheme/arm9/source/language.inl
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ STRING(LOCATION_SD, "Location: SD Card")
// Errors
STRING(START_FAILED_ERROR, "Start failed. Error %i")
STRING(GBA_BIOS_ERROR, "Error code: BINF")
STRING(GBA_BIOS_ERROR_DESC, "The GBA BIOS is required to\nrun this game. Please place\n\"bios.bin\" in \"root:/_gba/\".")
STRING(GBA_BIOS_ERROR_DESC, "The GBA BIOS is required.\nPlease place \"bios.bin\"\nin \"root:/_gba/\".")
STRING(BOOTSTRAP_NIGHTLY_NOT_FOUND, "nds-bootstrap (Nightly) not found.")
STRING(BOOTSTRAP_RELEASE_NOT_FOUND, "nds-bootstrap (Release) not found.")
STRING(BOOTSTRAP_HB_NIGHTLY_NOT_FOUND, "nds-bootstrap for homebrew\n(Nightly) not found.")
Expand Down
7 changes: 4 additions & 3 deletions romsel_dsimenutheme/arm9/source/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1096,6 +1096,8 @@ int dsiMenuTheme(void) {
tex().loadDSiTheme();
}

ms().gbaR3Test = (access(sys().isRunFromSD() ? "sd:/_nds/TWiLightMenu/emulators/GBARunner3.nds" : "fat:/_nds/TWiLightMenu/emulators/GBARunner3.nds", F_OK) == 0);

if (sdFound()) {
statvfs("sd:/", &st[0]);

Expand Down Expand Up @@ -2250,9 +2252,8 @@ int dsiMenuTheme(void) {
} else if (ms().gbaR3Test) {
ms().launchType[ms().secondaryDevice] = Launch::EGBARunner2Launch;

ndsToBoot = "sd:/_nds/TWiLightMenu/emulators/GBARunner3.nds";
if (!isDSiMode() || access(ndsToBoot, F_OK) != 0) {
ndsToBoot = "fat:/_nds/TWiLightMenu/emulators/GBARunner3.nds";
ndsToBoot = sys().isRunFromSD() ? "sd:/_nds/TWiLightMenu/emulators/GBARunner3.nds" : "fat:/_nds/TWiLightMenu/emulators/GBARunner3.nds";
if (!isDSiMode()) {
boostVram = true;
}
} else if (ms().secondaryDevice) {
Expand Down
2 changes: 1 addition & 1 deletion romsel_dsimenutheme/nitrofiles/languages/en/language.ini
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ LOCATION_SD = Location: SD Card

START_FAILED_ERROR = Start failed. Error %i
GBA_BIOS_ERROR = Error code: BINF
GBA_BIOS_ERROR_DESC = The GBA BIOS is required to\nrun this game. Please place\n"bios.bin" in "root:/_gba/".
GBA_BIOS_ERROR_DESC = The GBA BIOS is required.\nPlease place "bios.bin"\nin "root:/_gba/".
BOOTSTRAP_NIGHTLY_NOT_FOUND = nds-bootstrap (Nightly) not found.
BOOTSTRAP_RELEASE_NOT_FOUND = nds-bootstrap (Release) not found.
BOOTSTRAP_HB_NIGHTLY_NOT_FOUND = nds-bootstrap for homebrew\n(Nightly) not found.
Expand Down
7 changes: 4 additions & 3 deletions romsel_r4theme/arm9/source/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1030,6 +1030,8 @@ int r4Theme(void) {

logPrint("\n");

ms().gbaR3Test = (access(sys().isRunFromSD() ? "sd:/_nds/TWiLightMenu/emulators/GBARunner3.nds" : "fat:/_nds/TWiLightMenu/emulators/GBARunner3.nds", F_OK) == 0);

if (sdFound()) {
statvfs("sd:/", &st[0]);

Expand Down Expand Up @@ -2360,9 +2362,8 @@ int r4Theme(void) {
} else if (ms().gbaR3Test) {
ms().launchType[ms().secondaryDevice] = TWLSettings::EGBARunner2Launch;

ndsToBoot = "sd:/_nds/TWiLightMenu/emulators/GBARunner3.nds";
if (!isDSiMode() || access(ndsToBoot, F_OK) != 0) {
ndsToBoot = "fat:/_nds/TWiLightMenu/emulators/GBARunner3.nds";
ndsToBoot = sys().isRunFromSD() ? "sd:/_nds/TWiLightMenu/emulators/GBARunner3.nds" : "fat:/_nds/TWiLightMenu/emulators/GBARunner3.nds";
if (!isDSiMode()) {
boostVram = true;
}
} else if (ms().secondaryDevice) {
Expand Down
2 changes: 2 additions & 0 deletions settings/arm9/source/language.inl
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,9 @@ STRING(SYSSD_RUNFLUBBAEMUSIN, "Sys SD: FluBBa emus. in")

STRING(HYBRID, "Hybrid")
STRING(NATIVE_GBARUNNER2, "Native > GBARunner2")
STRING(NATIVE_GBARUNNER3, "Native > GBARunner3")
STRING(GBARUNNER2_ONLY, "GBARunner2 only")
STRING(GBARUNNER3_ONLY, "GBARunner3 only")

STRING(DESCRIPTION_COL_EMULATOR, "Select which emulator to use for ColecoVision ROMs.")
STRING(DESCRIPTION_DSIWAREBOOTER, "Select which app boots launched DSiWare apps or games.")
Expand Down
38 changes: 21 additions & 17 deletions settings/arm9/source/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -961,6 +961,8 @@ int settingsMode(void)
logPrint(widescreenFound ? "Widescreen found\n" : "Widescreen not found\n");
}

const bool gbaR3Found = (access(sys().isRunFromSD() ? "sd:/_nds/TWiLightMenu/emulators/GBARunner3.nds" : "fat:/_nds/TWiLightMenu/emulators/GBARunner3.nds", F_OK) == 0);

const bool sharedFound = (access("sd:/shared1", F_OK) == 0);

//widescreenEffects = (ms().wideScreen && widescreenFound);
Expand Down Expand Up @@ -1315,21 +1317,22 @@ int settingsMode(void)
.option(STR_LOGGING, STR_DESCRIPTION_LOGGING_1, Option::Bool(&bs().logging), {STR_ON, STR_OFF}, {true, false});

SettingsPage gbar2Page(STR_GBARUNNER2_SETTINGS);

if (flashcardFound()) {
gbar2Page.option(sdFound() ? STR_SLOT_1_DLDI_ACCESS : STR_DLDI_ACCESS, STR_DESCRIPTION_GBAR2_DLDIACCESS, Option::Bool(&ms().gbar2DldiAccess), {"ARM7", "ARM9"}, {true, false});
}
gbar2Page
.option(STR_DS_MAIN_MEMORY_I_CACHE, STR_DESCRIPTION_GBAR2_MAINMEMICACHE, Option::Bool(&gs().mainMemICache), {STR_ON, STR_OFF}, {true, false})
.option(STR_WRAM_I_CACHE, STR_DESCRIPTION_GBAR2_WRAMICACHE, Option::Bool(&gs().wramICache), {STR_ON, STR_OFF}, {true, false})
.option(STR_BIOS_INTRO, STR_DESCRIPTION_BIOSINTRO, Option::Bool(&gs().skipIntro), {STR_OFF, STR_ON}, {true, false});
if (!ms().macroMode) {
gbar2Page.option(STR_DISPLAY_SCREEN, STR_DESCRIPTION_DISPLAY_SCREEN, Option::Bool(&gs().bottomScreenPrefered), {STR_BOTTOM, STR_TOP}, {true, false});
if (!gbaR3Found) {
if (flashcardFound()) {
gbar2Page.option(sdFound() ? STR_SLOT_1_DLDI_ACCESS : STR_DLDI_ACCESS, STR_DESCRIPTION_GBAR2_DLDIACCESS, Option::Bool(&ms().gbar2DldiAccess), {"ARM7", "ARM9"}, {true, false});
}
gbar2Page
.option(STR_DS_MAIN_MEMORY_I_CACHE, STR_DESCRIPTION_GBAR2_MAINMEMICACHE, Option::Bool(&gs().mainMemICache), {STR_ON, STR_OFF}, {true, false})
.option(STR_WRAM_I_CACHE, STR_DESCRIPTION_GBAR2_WRAMICACHE, Option::Bool(&gs().wramICache), {STR_ON, STR_OFF}, {true, false})
.option(STR_BIOS_INTRO, STR_DESCRIPTION_BIOSINTRO, Option::Bool(&gs().skipIntro), {STR_OFF, STR_ON}, {true, false});
if (!ms().macroMode) {
gbar2Page.option(STR_DISPLAY_SCREEN, STR_DESCRIPTION_DISPLAY_SCREEN, Option::Bool(&gs().bottomScreenPrefered), {STR_BOTTOM, STR_TOP}, {true, false});
}
gbar2Page
.option(STR_BORDER_FRAME, STR_DESCRIPTION_BORDER_FRAME, Option::Bool(&gs().frame), {STR_ON, STR_OFF}, {true, false})
.option(STR_CENTER_AND_MASK, STR_DESCRIPTION_CENTERANDMASK, Option::Bool(&gs().centerMask), {STR_ON, STR_OFF}, {true, false})
.option(STR_SIMULATE_GBA_COLORS, STR_DESCRIPTION_GBACOLORS, Option::Bool(&gs().gbaColors), {STR_YES, STR_NO}, {true, false});
}
gbar2Page
.option(STR_BORDER_FRAME, STR_DESCRIPTION_BORDER_FRAME, Option::Bool(&gs().frame), {STR_ON, STR_OFF}, {true, false})
.option(STR_CENTER_AND_MASK, STR_DESCRIPTION_CENTERANDMASK, Option::Bool(&gs().centerMask), {STR_ON, STR_OFF}, {true, false})
.option(STR_SIMULATE_GBA_COLORS, STR_DESCRIPTION_GBACOLORS, Option::Bool(&gs().gbaColors), {STR_YES, STR_NO}, {true, false});

SettingsPage unlaunchPage(STR_UNLAUNCH_SETTINGS);
if (sdFound() && ms().consoleModel == 0) {
Expand Down Expand Up @@ -1369,7 +1372,7 @@ int settingsMode(void)
gamesPage.option(STR_DSIWAREBOOTER, STR_DESCRIPTION_DSIWAREBOOTER, Option::Bool((bool *)&ms().dsiWareBooter), {"nds-bootstrap", "Unlaunch"}, {true, false});
if (sys().isRegularDS()) {
gamesPage
.option(STR_GBA_BOOTER, STR_DESCRIPTION_GBA_BOOTER, Option::Int((int *)&ms().gbaBooter), {STR_NATIVE_GBARUNNER2, STR_GBARUNNER2_ONLY}, {TGbaBooter::EGbaNativeGbar2, TGbaBooter::EGbaGbar2})
.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})
.option(STR_GBABORDER, STR_DESCRIPTION_GBABORDER, Option::Nul(opt_gba_border_select), {STR_PRESS_A}, {0});
}
if (!(isDSiMode() && sdFound() && sys().arm7SCFGLocked()))
Expand Down Expand Up @@ -1549,8 +1552,9 @@ int settingsMode(void)

gui()
.addPage(guiPage)
.addPage(bootstrapPage)
.addPage(gbar2Page);
.addPage(bootstrapPage);
if (!gbaR3Found)
gui().addPage(gbar2Page);
if (sdFound() && ms().consoleModel == 0)
gui().addPage(unlaunchPage);
gui()
Expand Down
2 changes: 2 additions & 0 deletions settings/nitrofiles/languages/en/language.ini
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,9 @@ SYSSD_RUNFLUBBAEMUSIN=Sys SD: FluBBa emus. in

HYBRID=Hybrid
NATIVE_GBARUNNER2=Native > GBARunner2
NATIVE_GBARUNNER3=Native > GBARunner3
GBARUNNER2_ONLY=GBARunner2 only
GBARUNNER3_ONLY=GBARunner3 only

DESCRIPTION_COL_EMULATOR=Select which emulator to use for ColecoVision ROMs.
DESCRIPTION_DSIWAREBOOTER=Select which app boots launched DSiWare apps or games.
Expand Down
9 changes: 4 additions & 5 deletions title/arm9/source/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1207,11 +1207,10 @@ void lastRunROM()
} else if (ms().launchType[ms().previousUsedDevice] == Launch::EGBARunner2Launch) {
if (access(ms().romPath[ms().previousUsedDevice].c_str(), F_OK) != 0) return; // Skip to running TWiLight Menu++

if (ms().gbaR3Test) {
argarray.at(0) = (char*)"sd:/_nds/TWiLightMenu/emulators/GBARunner3.nds";
if (!isDSiMode() || access(argarray[0], F_OK) != 0) {
argarray.at(0) = (char*)"fat:/_nds/TWiLightMenu/emulators/GBARunner3.nds";
}
const char* gbaR3Path = sys().isRunFromSD() ? "sd:/_nds/TWiLightMenu/emulators/GBARunner3.nds" : "fat:/_nds/TWiLightMenu/emulators/GBARunner3.nds";

if (access(gbaR3Path, F_OK) == 0) {
argarray.at(0) = (char*)gbaR3Path;
} else {
char game_TID[5];

Expand Down
2 changes: 1 addition & 1 deletion universal/source/common/twlmenusettings.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -233,7 +233,7 @@ void TWLSettings::loadSettings()
} else {
gbaBooter = EGbaGbar2;
}
gbaR3Test = settingsini.GetInt("SRLOADER", "GBARUNNER3_TEST", gbaR3Test);
// gbaR3Test = settingsini.GetInt("SRLOADER", "GBARUNNER3_TEST", gbaR3Test);
colEmulator = (TColSegaEmulator)settingsini.GetInt("SRLOADER", "SHOW_COL", colEmulator);
if (colEmulator == 0) // 0 (don't show) is deprecated
colEmulator = EColSegaColecoDS;
Expand Down

0 comments on commit 660f2b9

Please sign in to comment.