Skip to content

Commit

Permalink
Add .ini-only setting to swap DS and DSi splash screens
Browse files Browse the repository at this point in the history
  • Loading branch information
RocketRobz committed May 23, 2024
1 parent e0b77b3 commit 9f6ef6b
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 7 deletions.
11 changes: 6 additions & 5 deletions title/arm9/source/bootsplash.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -41,10 +41,11 @@ void bootSplashDSi(void) {
const struct tm *Time = localtime(&Raw);

strftime(currentDate, sizeof(currentDate), "%m/%d", Time);
bool virtualPain = (strcmp(currentDate, "04/01") == 0 || (ms().getGameRegion() == 0 ? (strcmp(currentDate, "07/21") == 0) : (strcmp(currentDate, "08/14") == 0))); // If April Fools, or the release date of the Virtual Boy
bool super = (*(u16*)(0x020000C0) == 0x334D || *(u16*)(0x020000C0) == 0x3647 || *(u16*)(0x020000C0) == 0x4353); // Slot-2 flashcard
const bool virtualPain = (strcmp(currentDate, "04/01") == 0 || (ms().getGameRegion() == 0 ? (strcmp(currentDate, "07/21") == 0) : (strcmp(currentDate, "08/14") == 0))); // If April Fools, or the release date of the Virtual Boy
const bool super = (*(u16*)(0x020000C0) == 0x334D || *(u16*)(0x020000C0) == 0x3647 || *(u16*)(0x020000C0) == 0x4353); // Slot-2 flashcard
const bool regularDS = (sys().isRegularDS() && !ms().oppositeSplash) || (!sys().isRegularDS() && ms().oppositeSplash);

bool custom = ms().dsiSplash == 3;
const bool custom = ms().dsiSplash == 3;

char path[256];
if (virtualPain) {
Expand All @@ -56,14 +57,14 @@ void bootSplashDSi(void) {
} else if (super) {
sprintf(path, "nitro:/video/splash/superDS.gif");
} else {
sprintf(path, "nitro:/video/splash/%s.gif", language == TWLSettings::ELangChineseS ? "iquedsi" : (sys().isRegularDS() ? "ds" : "dsi"));
sprintf(path, "nitro:/video/splash/%s.gif", language == TWLSettings::ELangChineseS ? "iquedsi" : (regularDS ? "ds" : "dsi"));
}
Gif splash(path, true, true);

path[0] = '\0';
if (virtualPain) { // Load Virtual Pain image
strcpy(path, "nitro:/video/hsmsg/virtualPain.gif");
} else if (ms().dsiSplash == 1) { // Load Touch the Touch Screen to continue image
} else if (ms().dsiSplash == 1) { // Load "Touch the Touch Screen to continue" image
sprintf(path, "nitro:/video/tttstc/%i.gif", language);
} else if (ms().dsiSplash == 2) { // Load H&S image
sprintf(path, "nitro:/video/hsmsg/%i.gif", language);
Expand Down
5 changes: 3 additions & 2 deletions title/arm9/source/sound.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -142,10 +142,11 @@ SoundControl::SoundControl()

mmInitDefaultMem((mm_addr)soundBank);

mmLoadEffect( (sys().isRegularDS() || ms().macroMode) ? SFX_DSBOOT : SFX_DSIBOOT );
const bool regularDS = (sys().isRegularDS() && !ms().oppositeSplash) || (!sys().isRegularDS() && ms().oppositeSplash);
mmLoadEffect( (regularDS || ms().macroMode) ? SFX_DSBOOT : SFX_DSIBOOT );
mmLoadEffect( SFX_SELECT );

if (sys().isRegularDS() || ms().macroMode) {
if (regularDS || ms().macroMode) {
snd_dsiboot = {
{ SFX_DSBOOT } , // id
(int)(1.0f * (1<<10)), // rate
Expand Down
1 change: 1 addition & 0 deletions universal/include/common/twlmenusettings.h
Original file line number Diff line number Diff line change
Expand Up @@ -321,6 +321,7 @@ class TWLSettings
TSlot1LaunchMethod slot1LaunchMethod;

int dsiSplash;
bool oppositeSplash;
bool dsiSplashAutoSkip;
int nintendoLogoColor;
bool showlogo;
Expand Down
2 changes: 2 additions & 0 deletions universal/source/common/twlmenusettings.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@ TWLSettings::TWLSettings()
slot1LaunchMethod = EDirect;

dsiSplash = isDSiMode();
oppositeSplash = false;
dsiSplashAutoSkip = false;
nintendoLogoColor = 1;
showlogo = true;
Expand Down Expand Up @@ -275,6 +276,7 @@ void TWLSettings::loadSettings()
slot1LaunchMethod = (TSlot1LaunchMethod)settingsini.GetInt("SRLOADER", "SLOT1_LAUNCHMETHOD", slot1LaunchMethod);

dsiSplash = settingsini.GetInt("SRLOADER", "DSI_SPLASH", dsiSplash);
oppositeSplash = settingsini.GetInt("SRLOADER", "OPPOSITE_SPLASH", oppositeSplash);
dsiSplashAutoSkip = settingsini.GetInt("SRLOADER", "DSI_SPLASH_AUTO_SKIP", dsiSplashAutoSkip);
nintendoLogoColor = settingsini.GetInt("SRLOADER", "NINTENDO_LOGO_COLOR", nintendoLogoColor);
showlogo = settingsini.GetInt("SRLOADER", "SHOWLOGO", showlogo);
Expand Down

0 comments on commit 9f6ef6b

Please sign in to comment.