Naomi: non-encrypted M4 carts fix (sl2007)

This commit is contained in:
Flyinghead 2018-12-13 13:06:01 +01:00
parent 35d7d24b6b
commit d41e405a50
1 changed files with 12 additions and 5 deletions

View File

@ -147,7 +147,7 @@ bool M4Cartridge::Read(u32 offset, u32 size, void *dst) {
return true;
}
else
return NaomiCartridge::Read(offset, size, dst);
return NaomiCartridge::Read(offset & 0x1ffffffe, size, dst);
}
void *M4Cartridge::GetDmaPtr(u32 &limit)
@ -278,11 +278,18 @@ std::string M4Cartridge::GetGameId()
if (RomSize < 0x30 + 0x20)
return "(ROM too small)";
rom_cur_address = 0;
enc_reset();
enc_fill();
std::string game_id;
if (RomPtr[0] == 'N' && RomPtr[1] == 'A')
game_id = std::string((char *)(RomPtr + 0x30), 0x20);
else
{
rom_cur_address = 0;
enc_reset();
enc_fill();
game_id = std::string((char *)(buffer + 0x30), 0x20);
}
std::string game_id((char *)(buffer + 0x30), 0x20);
while (!game_id.empty() && game_id.back() == ' ')
game_id.pop_back();
return game_id;