Skip to content

Commit

Permalink
treewide: simplify M3 DLDI detection
Browse files Browse the repository at this point in the history
A new M3 DLDI uses `M3DS Real` as its name, which doesn't match the
others currently listed. Shrink the memcmp to `M3DS` specifically to
get around the problem.

Resolves #2391, resolves #2473
  • Loading branch information
lifehackerhansol committed Sep 29, 2024
1 parent 9ce7116 commit 59c970d
Show file tree
Hide file tree
Showing 6 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion archived/rungame/arm9/source/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -359,7 +359,7 @@ int lastRunROM() {
|| (memcmp(io_dldi_data->friendlyName, "DSTT", 4) == 0)
|| (memcmp(io_dldi_data->friendlyName, "DEMON", 5) == 0)
|| (memcmp(io_dldi_data->friendlyName, "DSONE", 5) == 0)
|| (memcmp(io_dldi_data->friendlyName, "M3DS DLDI", 9) == 0)
|| (memcmp(io_dldi_data->friendlyName, "M3DS", 4) == 0)
|| (memcmp(io_dldi_data->friendlyName, "M3-DS", 5) == 0)) {
CIniFile fcrompathini("fat:/TTMenu/YSMenu.ini");
path = ReplaceAll(ms().romPath[1], "fat:/", slashchar);
Expand Down
2 changes: 1 addition & 1 deletion quickmenu/arm9/source/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -819,7 +819,7 @@ void loadGameOnFlashcard(const char* ndsPath, bool dsGame) {
|| (memcmp(io_dldi_data->friendlyName, "DSTT", 4) == 0)
|| (memcmp(io_dldi_data->friendlyName, "DEMON", 5) == 0)
|| (memcmp(io_dldi_data->friendlyName, "DSONE", 5) == 0)
|| (memcmp(io_dldi_data->friendlyName, "M3DS DLDI", 9) == 0)
|| (memcmp(io_dldi_data->friendlyName, "M3DS", 4) == 0)
|| (memcmp(io_dldi_data->friendlyName, "M3-DS", 5) == 0)) {
CIniFile fcrompathini("fat:/TTMenu/YSMenu.ini");
fcPath = replaceAll(ndsPath, "fat:/", slashchar);
Expand Down
2 changes: 1 addition & 1 deletion romsel_aktheme/arm9/source/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -821,7 +821,7 @@ void loadGameOnFlashcard(const char* ndsPath, bool dsGame) {
|| (memcmp(io_dldi_data->friendlyName, "DSTT", 4) == 0)
|| (memcmp(io_dldi_data->friendlyName, "DEMON", 5) == 0)
|| (memcmp(io_dldi_data->friendlyName, "DSONE", 5) == 0)
|| (memcmp(io_dldi_data->friendlyName, "M3DS DLDI", 9) == 0)
|| (memcmp(io_dldi_data->friendlyName, "M3DS", 4) == 0)
|| (memcmp(io_dldi_data->friendlyName, "M3-DS", 5) == 0)) {
CIniFile fcrompathini("fat:/TTMenu/YSMenu.ini");
fcPath = replaceAll(ndsPath, "fat:/", slashchar);
Expand Down
2 changes: 1 addition & 1 deletion romsel_dsimenutheme/arm9/source/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -710,7 +710,7 @@ void loadGameOnFlashcard(const char *ndsPath, bool dsGame) {
|| (memcmp(io_dldi_data->friendlyName, "DSTT", 4) == 0)
|| (memcmp(io_dldi_data->friendlyName, "DEMON", 5) == 0)
|| (memcmp(io_dldi_data->friendlyName, "DSONE", 5) == 0)
|| (memcmp(io_dldi_data->friendlyName, "M3DS DLDI", 9) == 0)
|| (memcmp(io_dldi_data->friendlyName, "M3DS", 4) == 0)
|| (memcmp(io_dldi_data->friendlyName, "M3-DS", 5) == 0)) {
CIniFile fcrompathini("fat:/TTMenu/YSMenu.ini");
fcPath = replaceAll(ndsPath, "fat:/", slashchar);
Expand Down
2 changes: 1 addition & 1 deletion romsel_r4theme/arm9/source/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -788,7 +788,7 @@ void loadGameOnFlashcard(const char* ndsPath, bool dsGame) {
|| (memcmp(io_dldi_data->friendlyName, "DSTT", 4) == 0)
|| (memcmp(io_dldi_data->friendlyName, "DEMON", 5) == 0)
|| (memcmp(io_dldi_data->friendlyName, "DSONE", 5) == 0)
|| (memcmp(io_dldi_data->friendlyName, "M3DS DLDI", 9) == 0)
|| (memcmp(io_dldi_data->friendlyName, "M3DS", 4) == 0)
|| (memcmp(io_dldi_data->friendlyName, "M3-DS", 5) == 0)) {
CIniFile fcrompathini("fat:/TTMenu/YSMenu.ini");
fcPath = replaceAll(ndsPath, "fat:/", slashchar);
Expand Down
2 changes: 1 addition & 1 deletion title/arm9/source/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -693,7 +693,7 @@ void lastRunROM()
|| (memcmp(io_dldi_data->friendlyName, "DSTT", 4) == 0)
|| (memcmp(io_dldi_data->friendlyName, "DEMON", 5) == 0)
|| (memcmp(io_dldi_data->friendlyName, "DSONE", 5) == 0)
|| (memcmp(io_dldi_data->friendlyName, "M3DS DLDI", 9) == 0)
|| (memcmp(io_dldi_data->friendlyName, "M3DS", 4) == 0)
|| (memcmp(io_dldi_data->friendlyName, "M3-DS", 5) == 0)) {
CIniFile fcrompathini("fat:/TTMenu/YSMenu.ini");
fcPath = replaceAll(ms().romPath[ms().previousUsedDevice], "fat:/", slashchar);
Expand Down

0 comments on commit 59c970d

Please sign in to comment.