Skip to content

Commit 6bced37

Browse files
committed
Save selected bootstrap to TWLoader as well
1 parent b31e0a6 commit 6bced37

File tree

1 file changed

+13
-1
lines changed

1 file changed

+13
-1
lines changed

titleandsettings/arm9/source/main.cpp

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@
3838
#include "inifile.h"
3939

4040
const char* settingsinipath = "sd:/_nds/srloader/settings.ini";
41+
const char* twldrsettingsinipath = "sd:/_nds/twloader/settings.ini";
4142
const char* bootstrapinipath = "sd:/_nds/nds-bootstrap.ini";
4243

4344
bool is3DS = false;
@@ -106,6 +107,9 @@ void LoadSettings(void) {
106107
}
107108

108109
void SaveSettings(void) {
110+
bool twldrsettingsFound = false;
111+
if (!access(twldrsettingsinipath, F_OK)) twldrsettingsFound = true;
112+
109113
// GUI
110114
CIniFile settingsini( settingsinipath );
111115

@@ -121,6 +125,14 @@ void SaveSettings(void) {
121125
settingsini.SetInt("SRLOADER", "THEME", theme);
122126
settingsini.SetInt("SRLOADER", "SUB_THEME", subtheme);
123127
settingsini.SaveIniFile(settingsinipath);
128+
129+
if(is3DS && twldrsettingsFound) {
130+
// Save some settings to TWLoader as well.
131+
CIniFile twldrsettingsini( twldrsettingsinipath );
132+
133+
twldrsettingsini.SetInt("TWL-MODE", "BOOTSTRAP_FILE", bootstrapFile);
134+
twldrsettingsini.SaveIniFile(twldrsettingsinipath);
135+
}
124136

125137
// nds-bootstrap
126138
CIniFile bootstrapini( bootstrapinipath );
@@ -270,7 +282,7 @@ int main(int argc, char **argv) {
270282

271283
char vertext[12];
272284
// snprintf(vertext, sizeof(vertext), "Ver %d.%d.%d ", VERSION_MAJOR, VERSION_MINOR, VERSION_PATCH); // Doesn't work :(
273-
snprintf(vertext, sizeof(vertext), "Ver %d.%d.%d ", 1, 8, 0);
285+
snprintf(vertext, sizeof(vertext), "Ver %d.%d.%d ", 1, 9, 0);
274286

275287
if (showlogo) {
276288
graphicsInit();

0 commit comments

Comments
 (0)