Opened 18 years ago
Closed 17 years ago
#2331 closed defect (fixed)
mythgame computing bad crc values, all systems, all bad
Reported by: | Owned by: | greg | |
---|---|---|---|
Priority: | minor | Milestone: | unknown |
Component: | mythgame | Version: | |
Severity: | medium | Keywords: | |
Cc: | Ticket locked: | no |
Description
I'm running current SVN dev mythtv and mythgame, and just switched to that from V 0.19, both have calculated bad crc values for every rom I have.
Example, snes rom Donkey Kong Country (V1.0)(U)[!].zip
mythgame crc: 4ad0bf54
zsnes crc : c946dca0
romdb crc : c946dca0
As far as I have been able to determine, zsnes gets the crc right, i.e. matches romdb, in pretty much every case.
My system is a dual 1800+ athlon MP, 1.5GB ram, running gentoo, my filesystem is reiserfs.
Also tested, with identical results, on an Intel Pentium4 3GHZ laptop, 1GB ram running gentoo, same files, on ext3.
The snes roms are zipped, but the sega ones are not and they show the same error.
Any thoughts why this might be happening? What code is used to generate the CRCs that go into romdb, can I test it to see if it comes up with the same values as mythgame is giving on my computer?
Anyway, sorry to bug you guys here, but as far as I can tell, nobody else seems to be having this problem, so this is kind-of a last resort
Change History (7)
comment:2 Changed 18 years ago by
Status: | new → assigned |
---|
comment:3 Changed 18 years ago by
absolutely, I'm actually on campus right now so I can't get the file to you immediately, but I've looked into it further and it looks like I may have been wrong about it affecting all systems, but I'm completely sure it affects snes roms.
Since zsnes was working I downloaded the source for that and found where the CRC is being calculated and it looks like they do one thing that might be making all the difference, it detects the type of info header on the rom, and sets the month and day to 0x42 and 0x00 respectively, after which the correct CRC is produced.
I'll provide the information you requested as soon as I return to my appartment ~ 1.5 hours.
comment:4 Changed 18 years ago by
it contains a single file,
Wind# ls -lh Donkey\ Kong\ Country\ \(V1.0\)\ \(U\)\ \[\!\].zip
-rw-r--r-- 1 root root 2.5M Sep 6 18:49 Donkey Kong Country (V1.0) (U) [!].zip
Wind# ls -l Donkey\ Kong\ Country\ \(V1.0\)\ \(U\)\ \[\!\].zip
-rw-r--r-- 1 root root 2580317 Sep 6 18:49 Donkey Kong Country (V1.0) (U) [!].zip
Wind# unzip Donkey\ Kong\ Country\ \(V1.0\)\ \(U\)\ \[\!\].zip
Archive: Donkey Kong Country (V1.0) (U) [!].zip
inflating: Donkey Kong Country (V1.0) (U) [!].smc
Wind# ls -lh Donkey\ Kong\ Country\ \(V1.0\)\ \(U\)\ \[\!\].smc
-rw------- 1 root root 4.1M Jan 12 1999 Donkey Kong Country (V1.0) (U) [!].smc
Wind# ls -l Donkey\ Kong\ Country\ \(V1.0\)\ \(U\)\ \[\!\].smc
-rw------- 1 root root 4194816 Jan 12 1999 Donkey Kong Country (V1.0) (U) [!].smc
Wind# md5sum Donkey\ Kong\ Country\ \(V1.0\)\ \(U\)\ \[\!\].smc
5f2f40e26852b1b76c624d9b50013f9f Donkey Kong Country (V1.0) (U) [!].smc
Wind# perl crc.pl Donkey\ Kong\ Country\ \(V1.0\)\ \(U\)\ \[\!\].zip
66c1ca31
Wind# perl crc.pl Donkey\ Kong\ Country\ \(V1.0\)\ \(U\)\ \[\!\].smc
4ad0bf54
crc values for the zipped file, and the unzipped file computed using the following perl script crc.pl, which uses an algorithm that (for non NES roms) produces the same values as zlib's crc32
use String::CRC32;
open(somefile,@ARGV[0]);
$crc = crc32(*somefile);
close(somefile);
print sprintf("%x",$crc),"\n";
Also, I was incorrect in my reading of the zsnes code it does not modify the memory in that way, though it does modify it in a way I do not yet understand, if you wish to see what I'm referring to it's in the file initc.c at the root of the zsnes sources.
comment:5 Changed 18 years ago by
extra note, confirmed that NES roms get the correct crc on the same system, for some reason the mythgame browser still does not display the information, but it is in the database, so it looks like it may just be snes that's not getting the right crc
comment:6 Changed 18 years ago by
just realised that was unclear, the crc on nes games is correct, the crc goes into the gamemetadata table correctly, but the other fields are all populated with unknown and whatnot, even though the crc and all the data are in romdb, and romdb is populated, but that should definitely be a different problem
snes still wrong crc