mirror of
https://github.com/SourMesen/Mesen2.git
synced 2025-04-02 10:21:44 -04:00
SMS: Fixed region detection showing the region based on the previously loaded game's filename when loading a new game
This commit is contained in:
parent
0fbb19d52c
commit
a72b8bff6e
2 changed files with 4 additions and 1 deletions
|
@ -37,6 +37,8 @@ LoadRomResult SmsConsole::LoadRom(VirtualFile& romFile)
|
|||
romData.erase(romData.begin(), romData.begin() + 0x200);
|
||||
}
|
||||
|
||||
_filename = romFile.GetFileName();
|
||||
|
||||
string ext = romFile.GetFileExtension();
|
||||
bool isGameGear = ext == ".gg";
|
||||
if(isGameGear) {
|
||||
|
@ -169,7 +171,7 @@ void SmsConsole::UpdateRegion(bool forceUpdate)
|
|||
}
|
||||
|
||||
if(region == ConsoleRegion::Auto) {
|
||||
string filename = StringUtilities::ToLower(_emu->GetRomInfo().RomFile.GetFileName());
|
||||
string filename = StringUtilities::ToLower(_filename);
|
||||
if(filename.find("(europe)") != string::npos || filename.find("(e)") != string::npos) {
|
||||
region = ConsoleRegion::Pal;
|
||||
} else {
|
||||
|
|
|
@ -30,6 +30,7 @@ private:
|
|||
RomFormat _romFormat = RomFormat::Sms;
|
||||
SmsModel _model = SmsModel::Sms;
|
||||
ConsoleRegion _region = ConsoleRegion::Ntsc;
|
||||
string _filename;
|
||||
|
||||
void UpdateRegion(bool forceUpdate);
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue