Skip to content

Commit

Permalink
Fix a crash in heuristic memory mapping.
Browse files Browse the repository at this point in the history
Commit 712ed9b changed the way that the Sufami
Turbo base cartridge was detected, but it caused crashes. Apparently the way we
were converting the binary ROM data to a string for comparison, was actually
calling the wrong `string` constructor. Let's more explicitly create a
string_view instead of hoping for the compiler to pick a suitable constructor
chain.
  • Loading branch information
Screwtapello committed Sep 1, 2024
1 parent 712ed9b commit 0fd8f56
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion bsnes/heuristics/super-famicom.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -271,7 +271,7 @@ auto SuperFamicom::board() const -> string {
//Bishoujo Senshi Sailor Moon SuperS - Fuwafuwa Panic (Japan)
//so we identify it with this embedded string
string sufamiSignature = "BANDAI SFC-ADX";
if (string(data.view(0, sufamiSignature.length())) == sufamiSignature) board.append("ST-", mode);
if (string_view(data.data(), sufamiSignature.length()) == sufamiSignature) board.append("ST-", mode);

//this game's title ovewrites the map mode with '!' (0x21), but is a LOROM game
if(title() == "YUYU NO QUIZ DE GO!GO") mode = "LOROM-";
Expand Down

0 comments on commit 0fd8f56

Please sign in to comment.