Improve NES cart detection

This commit is contained in:
sanni 2022-07-07 10:51:36 +02:00
parent 6561b8d5d9
commit d6a4101a96
2 changed files with 4 additions and 4 deletions

View File

@ -409,14 +409,14 @@ boolean getMapping() {
println_Msg(F("Searching database..."));
display_Update();
// Read first 16 bytes of prg rom
for (int x = 0; x < 16; x++) {
// Read first 512 bytes of prg rom
for (int x = 0; x < 512; x++) {
sdBuffer[x] = read_prg_byte(0x8000 + x);
}
// Calculate CRC32
uint32_t oldcrc32 = 0xFFFFFFFF;
for (int c = 0; c < 16; c++) {
for (int c = 0; c < 512; c++) {
oldcrc32 = updateCRC(sdBuffer[c], oldcrc32);
}
char crcStr[9];

View File

@ -49,7 +49,7 @@ Savetypes:
6 = 16K Eeprom
## nes.txt
This file stores the iNES Header, the CRC32 of the first 16 bytes after the iNES header and the CRC32 of the complete ROM minus the iNES header.
This file stores the iNES Header, the CRC32 of the first 512 bytes after the iNES header and the CRC32 of the complete ROM minus the iNES header.
Example:
89 Dennou Kyuusei Uranai (Japan).nes