Skip to content

Commit

Permalink
More TIDs in SDK5 list, and always use SDK5 bootstrap for games with …
Browse files Browse the repository at this point in the history
…T as first TID letter
  • Loading branch information
RocketRobz committed Jan 24, 2018
1 parent 3c3f383 commit d6fa562
Show file tree
Hide file tree
Showing 2 changed files with 86 additions and 18 deletions.
52 changes: 43 additions & 9 deletions romsel_dsimenutheme/arm9/source/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -284,9 +284,12 @@ void SetDonorSDK(const char* filename) {
scanKeys();

FILE *f_nds_file = fopen(filename, "rb");
fseek(f_nds_file, offsetof(sNDSHeadertitlecodeonly, gameCode), SEEK_SET);

char game_TID_full[5];
fread(game_TID_full, 1, 4, f_nds_file);
game_TID_full[4] = 0;
char game_TID[5];
fseek(f_nds_file, offsetof(sNDSHeadertitlecodeonly, gameCode), SEEK_SET);
fread(game_TID, 1, 4, f_nds_file);
game_TID[4] = 0;
game_TID[3] = 0;
Expand Down Expand Up @@ -327,22 +330,47 @@ void SetDonorSDK(const char* filename) {
"AZL", // Style Savvy
};

// TIDs without 4th letter
static const char sdk5_list[][4] = {
"CS3", // Sonic and Sega All Stars Racing
"B2D", // Doctor Who: Evacuation Earth
"BH2", // Super Scribblenauts
"BXS", // Sonic Colo(u)rs
"BOE", // Inazuma Eleven 3: Sekai heno Chousen! The Ogre
"BQ8", // Crafting Mama
"BK9", // Kingdom Hearts: Re-Coded
"BWB", // Plants vs. Zombies
"BRJ", // Radiant Historia
"B3R", // Pokemon Ranger: Guardian Signs
"IRA", // Pokemon Black Version
"IRB", // Pokemon White Version
"BOO", // Okamiden
"BT2", // TrackMania Turbo
"BYY", // Yu-Gi-Oh 5Ds World Championship 2011: Over The Nexus
"TAD", // Kirby Mass Attack
"BLF", // Professor Layton and the Last Specter
"UZP", // Learn with Pokemon: Typing Adventure
"IRE", // Pokemon Black Version 2
"IRD", // Pokemon White Version 2
"TCS", // Scribblenauts Collection
"BVP", // Drawn to Life Collection
"TFB", // Frozen: Olaf's Quest
"THM", // FabStyle
};

// Full TIDs
static const char sdk5_list2[][5] = {
"YEED", // Inazuma Eleven (Germany)
"YEEF", // Inazuma Eleven (France)
"YEEI", // Inazuma Eleven (Italy)
"YEEP", // Inazuma Eleven (Europe)
"YEES", // Inazuma Eleven (Spain)
"BEBD", // Inazuma Eleven 2: Blizzard (Germany)
"BEBF", // Inazuma Eleven 2: Blizzard (France)
"BEBI", // Inazuma Eleven 2: Blizzard (Italy)
"BEBP", // Inazuma Eleven 2: Blizzard (Europe)
"BEBS", // Inazuma Eleven 2: Blizzard (Spain)
"BEED", // Inazuma Eleven 2: Firestorm (Germany)
"BEEF", // Inazuma Eleven 2: Firestorm (France)
"BEEI", // Inazuma Eleven 2: Firestorm (Italy)
"BEEP", // Inazuma Eleven 2: Firestorm (Europe)
"BEES", // Inazuma Eleven 2: Firestorm (Spain)
};

// TODO: If the list gets large enough, switch to bsearch().
Expand Down Expand Up @@ -372,9 +400,6 @@ void SetDonorSDK(const char* filename) {
}
}

if(strcmp("V", game_TID_char1) == 0) {
donorSdkVer = 5;
} else
// TODO: If the list gets large enough, switch to bsearch().
for (unsigned int i = 0; i < sizeof(sdk5_list)/sizeof(sdk5_list[0]); i++) {
if (!memcmp(game_TID, sdk5_list[i], 3)) {
Expand All @@ -384,7 +409,16 @@ void SetDonorSDK(const char* filename) {
}
}

if(keysHeld() & KEY_UP){
// TODO: If the list gets large enough, switch to bsearch().
for (unsigned int i = 0; i < sizeof(sdk5_list2)/sizeof(sdk5_list2[0]); i++) {
if (!memcmp(game_TID_full, sdk5_list2[i], 4)) {
// Found a match.
donorSdkVer = 5;
break;
}
}

if((keysHeld() & KEY_UP) || (strcmp("T", game_TID_char1) == 0) || (strcmp("V", game_TID_char1) == 0)) {
donorSdkVer = 5;
}
}
Expand Down
52 changes: 43 additions & 9 deletions romsel_dsmenutheme/arm9/source/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -171,9 +171,12 @@ void SetDonorSDK(const char* filename) {
scanKeys();

FILE *f_nds_file = fopen(filename, "rb");
fseek(f_nds_file, offsetof(sNDSHeadertitlecodeonly, gameCode), SEEK_SET);

char game_TID_full[5];
fread(game_TID_full, 1, 4, f_nds_file);
game_TID_full[4] = 0;
char game_TID[5];
fseek(f_nds_file, offsetof(sNDSHeadertitlecodeonly, gameCode), SEEK_SET);
fread(game_TID, 1, 4, f_nds_file);
game_TID[4] = 0;
game_TID[3] = 0;
Expand Down Expand Up @@ -214,22 +217,47 @@ void SetDonorSDK(const char* filename) {
"AZL", // Style Savvy
};

// TIDs without 4th letter
static const char sdk5_list[][4] = {
"CS3", // Sonic and Sega All Stars Racing
"B2D", // Doctor Who: Evacuation Earth
"BH2", // Super Scribblenauts
"BXS", // Sonic Colo(u)rs
"BOE", // Inazuma Eleven 3: Sekai heno Chousen! The Ogre
"BQ8", // Crafting Mama
"BK9", // Kingdom Hearts: Re-Coded
"BWB", // Plants vs. Zombies
"BRJ", // Radiant Historia
"B3R", // Pokemon Ranger: Guardian Signs
"IRA", // Pokemon Black Version
"IRB", // Pokemon White Version
"BOO", // Okamiden
"BT2", // TrackMania Turbo
"BYY", // Yu-Gi-Oh 5Ds World Championship 2011: Over The Nexus
"TAD", // Kirby Mass Attack
"BLF", // Professor Layton and the Last Specter
"UZP", // Learn with Pokemon: Typing Adventure
"IRE", // Pokemon Black Version 2
"IRD", // Pokemon White Version 2
"TCS", // Scribblenauts Collection
"BVP", // Drawn to Life Collection
"TFB", // Frozen: Olaf's Quest
"THM", // FabStyle
};

// Full TIDs
static const char sdk5_list2[][5] = {
"YEED", // Inazuma Eleven (Germany)
"YEEF", // Inazuma Eleven (France)
"YEEI", // Inazuma Eleven (Italy)
"YEEP", // Inazuma Eleven (Europe)
"YEES", // Inazuma Eleven (Spain)
"BEBD", // Inazuma Eleven 2: Blizzard (Germany)
"BEBF", // Inazuma Eleven 2: Blizzard (France)
"BEBI", // Inazuma Eleven 2: Blizzard (Italy)
"BEBP", // Inazuma Eleven 2: Blizzard (Europe)
"BEBS", // Inazuma Eleven 2: Blizzard (Spain)
"BEED", // Inazuma Eleven 2: Firestorm (Germany)
"BEEF", // Inazuma Eleven 2: Firestorm (France)
"BEEI", // Inazuma Eleven 2: Firestorm (Italy)
"BEEP", // Inazuma Eleven 2: Firestorm (Europe)
"BEES", // Inazuma Eleven 2: Firestorm (Spain)
};

// TODO: If the list gets large enough, switch to bsearch().
Expand Down Expand Up @@ -259,9 +287,6 @@ void SetDonorSDK(const char* filename) {
}
}

if(strcmp("V", game_TID_char1) == 0) {
donorSdkVer = 5;
} else
// TODO: If the list gets large enough, switch to bsearch().
for (unsigned int i = 0; i < sizeof(sdk5_list)/sizeof(sdk5_list[0]); i++) {
if (!memcmp(game_TID, sdk5_list[i], 3)) {
Expand All @@ -271,7 +296,16 @@ void SetDonorSDK(const char* filename) {
}
}

if(keysHeld() & KEY_UP){
// TODO: If the list gets large enough, switch to bsearch().
for (unsigned int i = 0; i < sizeof(sdk5_list2)/sizeof(sdk5_list2[0]); i++) {
if (!memcmp(game_TID_full, sdk5_list2[i], 4)) {
// Found a match.
donorSdkVer = 5;
break;
}
}

if((keysHeld() & KEY_UP) || (strcmp("T", game_TID_char1) == 0) || (strcmp("V", game_TID_char1) == 0)) {
donorSdkVer = 5;
}
}
Expand Down

0 comments on commit d6fa562

Please sign in to comment.