Add support for different CIC chips

This commit is contained in:
CocoSimone
2022-10-01 14:45:43 +02:00
parent 38b5b4d430
commit b79c869415
11 changed files with 317 additions and 27 deletions

View File

@@ -148,10 +148,10 @@ ImDrawData* Window::Present(n64::Core& core) {
void Window::LoadROM(n64::Core& core, const std::string &path) {
if(!path.empty()) {
u32 crc = core.LoadROM(path);
n64::CartInfo cartInfo = core.LoadROM(path);
std::ifstream gameDbFile("resources/game_db.json");
json gameDb = json::parse(gameDbFile);
auto entry = gameDb[fmt::format("{:08x}", crc)]["name"];
auto entry = gameDb[fmt::format("{:08x}", cartInfo.crc)]["name"];
std::string name{};
if(!entry.empty()) {
name = entry.get<std::string>();