Skip to content

Commit f8494a8

Browse files
committed
NES: Fixed bogus corrections in rom_loadmem when crc32 isn't available (#181)
When loading a ROM, retro-go calcs the crc32 of the rom and searches for it in the database. If the CRC32 is 0, the last entry in the database will be selected, which is invalid. This patch just confirms that the selected entry is valid. A proper patch might be to not search the database at all if we don't have a crc function. But that would change multiple lines versus just this one!
1 parent eb70c10 commit f8494a8

File tree

1 file changed

+1
-1
lines changed
  • retro-core/components/nofrendo/nes

1 file changed

+1
-1
lines changed

retro-core/components/nofrendo/nes/rom.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ rom_t *rom_loadmem(uint8 *data, size_t size)
112112
while (entry->crc && entry->crc != rom.checksum)
113113
entry++;
114114

115-
if (entry->crc == rom.checksum)
115+
if (entry->crc && entry->crc == rom.checksum)
116116
{
117117
MESSAGE_INFO("ROM: Game found in database.\n");
118118

0 commit comments

Comments
 (0)