Skip to content

Commit 8f09bae

Browse files
committed
Display nds-bootstrap version in settings
1 parent 7c5b22f commit 8f09bae

File tree

2 files changed

+22
-0
lines changed

2 files changed

+22
-0
lines changed

titleandsettings/arm9/source/settingsgui.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -169,6 +169,10 @@ void SettingsGUI::drawSub()
169169

170170
void SettingsGUI::drawTopText()
171171
{
172+
if (isDSiMode()) {
173+
printSmall(true, 4, 0, "nds-bootstrap Ver:");
174+
printSmall(true, 114, 0, bsVerText[ms().bootstrapFile]);
175+
}
172176
printSmall(true, 194, 174, vertext);
173177
for (int i = 0; i < _topText.size(); i++)
174178
{

titleandsettings/arm9/source/settingsgui.h

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,23 @@ class SettingsGUI
1919
{
2020

2121
snprintf(vertext, sizeof(vertext), "Ver %d.%d.%d", 6, 2, 0);
22+
if (isDSiMode()) {
23+
// Read nds-bootstrap version
24+
FILE* bsVerFile;
25+
for (int i = 0; i < 2; i++) {
26+
snprintf(bsVerText[i], sizeof(bsVerText[i]), "%s", "No version available ");
27+
if (i == 1) {
28+
bsVerFile = fopen("sd:/_nds/dsimenuplusplus/nightly-bootstrap.ver", "rb");
29+
} else {
30+
bsVerFile = fopen("sd:/_nds/dsimenuplusplus/release-bootstrap.ver", "rb");
31+
}
32+
if (bsVerFile) {
33+
snprintf(bsVerText[i], sizeof(bsVerText[i]), "%s", " ");
34+
fread(bsVerText[i], 1, 19, bsVerFile);
35+
}
36+
fclose(bsVerFile);
37+
}
38+
}
2239
}
2340
~SettingsGUI() {}
2441

@@ -224,6 +241,7 @@ class SettingsGUI
224241
std::function<void(void)> _exitCallback;
225242

226243
char vertext[13];
244+
char bsVerText[2][24];
227245
};
228246

229247
typedef singleton<SettingsGUI> settingsGui_s;

0 commit comments

Comments
 (0)