Update ImGui
This commit is contained in:
36
src/backend/GameDB.cpp
Normal file
36
src/backend/GameDB.cpp
Normal file
@@ -0,0 +1,36 @@
|
||||
#include <GameDB.hpp>
|
||||
#include <Mem.hpp>
|
||||
|
||||
namespace n64 {
|
||||
void GameDB::match(Mem& mem) {
|
||||
ROM& rom = mem.rom;
|
||||
for (const auto & i : gamedb) {
|
||||
bool matches_code = i.code == rom.code;
|
||||
bool matches_region = false;
|
||||
|
||||
for (int j = 0; j < i.regions.size() && !matches_region; j++) {
|
||||
if (i.regions[j] == rom.header.countryCode[0]) {
|
||||
matches_region = true;
|
||||
}
|
||||
}
|
||||
|
||||
if (matches_code) {
|
||||
if (matches_region) {
|
||||
mem.saveType = i.saveType;
|
||||
mem.rom.gameNameDB = i.name;
|
||||
Util::debug("Loaded {}\n", i.name);
|
||||
return;
|
||||
} else {
|
||||
Util::warn("Matched code for %s, but not region! Game supposedly exists in regions [{}] but this image has region {}\n",
|
||||
i.name, i.regions, rom.header.countryCode[0]);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Util::debug("Did not match any Game DB entries. Code: {} Region: {}\n", mem.rom.code, mem.rom.header.countryCode[0]);
|
||||
|
||||
mem.rom.gameNameDB = "";
|
||||
mem.saveType = SAVE_NONE;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user