Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Proper 32X region header processing for licensed games #1824

Merged
merged 2 commits into from
Feb 9, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 6 additions & 14 deletions mia/medium/mega-32x.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -120,9 +120,12 @@ auto Mega32X::analyze(vector<u8>& rom) -> string {

vector<string> regions;
string region = slice((const char*)&rom[0x01f0], 0, 16).trimRight(" ");
if(!regions) {
if(region == "JAPAN" ) regions.append("NTSC-J");
if(region == "EUROPE") regions.append("PAL");

//Stellar Assault (U,E) is the one game using the single-byte region coding which
//uses an 'E' value for both PAL and NTSC-U region. (NTSC-J cartridge uses '1')
//https://segaretro.org/ROM_header#Regional_compatiblity
if(region(0) == 'E' && hash == "2f9b6017258fbb1c37d81df07c68d5255495d3bf76d9c7b680ff66bccf665750") {
regions.append("NTSC-U", "PAL");
}
if(!regions) {
if(region.find("J")) regions.append("NTSC-J");
Expand All @@ -143,17 +146,6 @@ auto Mega32X::analyze(vector<u8>& rom) -> string {
regions.append("NTSC-J", "NTSC-U", "PAL");
}

// FIFA Soccer 96 and Mortal Kombat II have an incorrect header, so force PAL based on name
if(location.ifind("(Europe)") || location.ifind("(PAL)")) {
regions.reset();
regions.append("PAL");
}

//Shadow Squadron - Stellar Assault is missing NTSC-U region in header
if(hash == "2f9b6017258fbb1c37d81df07c68d5255495d3bf76d9c7b680ff66bccf665750") {
regions.append("NTSC-U");
}

string domesticName;
domesticName.resize(48);
memory::copy(domesticName.get(), &rom[0x0120], domesticName.size());
Expand Down
Loading