Skip to content

Commit

Permalink
mia: use SMS mode when loading .sms roms on gamegear
Browse files Browse the repository at this point in the history
  • Loading branch information
LukeUsher committed Nov 7, 2023
1 parent e589f8d commit d2e20f0
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions mia/medium/game-gear.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ struct GameGear : Cartridge {
auto extensions() -> vector<string> override { return {"gg"}; }
auto load(string location) -> bool override;
auto save(string location) -> bool override;
auto analyze(vector<u8>& rom) -> string;
auto analyze(vector<u8>& rom, string location) -> string;
};

auto GameGear::load(string location) -> bool {
Expand All @@ -17,7 +17,7 @@ auto GameGear::load(string location) -> bool {
}

this->location = location;
this->manifest = analyze(rom);
this->manifest = analyze(rom, location);
auto document = BML::unserialize(manifest);
if(!document) return false;

Expand Down Expand Up @@ -46,7 +46,7 @@ auto GameGear::save(string location) -> bool {
return true;
}

auto GameGear::analyze(vector<u8>& rom) -> string {
auto GameGear::analyze(vector<u8>& rom, string location) -> string {
string hash = Hash::SHA256(rom).digest();
string board = "Sega";
string region = "NTSC-J, NTSC-U"; //database required to detect region
Expand All @@ -55,6 +55,7 @@ auto GameGear::analyze(vector<u8>& rom) -> string {

//Master System
//=============
if(location.endsWith(".sms")) ms = 1;

//Castle of Illusion Starring Mickey Mouse (USA, Europe)
if(hash == "068fc6eaf728b3cd17c6fc5320c955deb0cd3b36343810470fe30c5a3661d0d3") {
Expand Down

0 comments on commit d2e20f0

Please sign in to comment.