Opened 18 years ago

Closed 17 years ago

#2331 closed defect (fixed)

mythgame computing bad crc values, all systems, all bad

Reported by: njustn@… 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:1 Changed 18 years ago by greg

Example, snes rom Donkey Kong Country (V1.0)(U)[!].zip mythgame crc: 4ad0bf54

I'm going to address this specific zip file first.

Does that zip file contain 1 file or multiple?

Can you unzip it and give me details on filesize and the output of an md5sum on the uncompressed version?

comment:2 Changed 18 years ago by greg

Status: newassigned

comment:3 Changed 18 years ago by njustn@…

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 njustn@…

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 njustn@…

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 njustn@…

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

comment:7 Changed 17 years ago by greg

Resolution: fixed
Status: assignedclosed

Closing this. It was fixed in changeset #11079 and #11100 pre 0.20 release

Note: See TracTickets for help on using tickets.