Multi-part games, CRC calculation

I want to show you what I'm doing some evenings in my spare time.
At first I want to say that this is ONLY A PRIVATE HOBBY PROJECT, I don't want to "kill" eCC, But eventually wake up Andreas a bit ;-)

Moderator: DerMicha75

User avatar
DerMicha75
ECC2 (java) Developer
Posts: 521
Joined: 05 Feb 2007, 22:14
Location: Germany
Contact:

Multi-part games, CRC calculation

Unread post by DerMicha75 » 12 Mar 2012, 20:04

Hi,

I just decided to move some todos from 0.7 to 0.8 (Gamebase import for example). Instead of this I now want to completely support all the platforms. So I will need multi file support, based on datfiles.

I think I have no problem to audit the files, also with options romof and cloneof.... but I'm not sure which CRC32 to calculate for such a multi rom. ECC1 calculates a crc, but I can not say how this is calculated. Does anyone knows it? Any good suggestion of how I could do this?

We need a crc, since all functions are based on it. But there must be the same crc, even if the zip is packed with highest comression, torrentzipped or packed with compression 0 (or maybe 7zipped)

Micha

User avatar
ECC
ECC Founder & Developer 2005-2009
Posts: 3680
Joined: 28 Aug 2006, 11:58
Location: Hamburg, Germany
Contact:

Re: Multi-part games, CRC calculation

Unread post by ECC » 02 Apr 2012, 16:56

Im not 100% shure, but i think, i calculate the crc32 for each file and put them into an array, than i order this array of crc32, concat all crc32 strings togehter and than create a new crc32 of this concated string.

Example:

Code: Select all

array(
  'ABBBCCDD'
  'FFFFFFFF'
  'AABBCCDD'
  'DDDDDDDD'
);
after order

Code: Select all

array(
  'AABBCCDD'
  'ABBBCCDD'
  'DDDDDDDD'
  'FFFFFFFF'
);

Code: Select all

# pseudo code!
$multiRomCrc32 = $file->crc32('AABBCCDDABBBCCDDDDDDDDDDFFFFFFFF');
But i´m not 100% sure!

Please take a look on \ecc-system\manager\cEccParserDataProzessor.php

Code: Select all

$out['FILE_CRC32'] = FileIO::ecc_get_crc32_from_string($combinedCrc32String);
ECC Developer 2005-2009
http://www.camya.com/ecc/
contact: ecc@camya.com

User avatar
DerMicha75
ECC2 (java) Developer
Posts: 521
Joined: 05 Feb 2007, 22:14
Location: Germany
Contact:

Re: Multi-part games, CRC calculation

Unread post by DerMicha75 » 02 Apr 2012, 18:00

Wow!!!! There's life in the old dog yet. :happy:

Thank you for reply. I'll check this and try to do something similar. The best would be, if the calculated crcs would be the same in ECC1 and 2, so imagepacks are useful for both...

Currently I'm parsing clrmame datfiles and try to match them against the files... but much to do in job, so I have only a small amount of time.

Micha

User avatar
DerMicha75
ECC2 (java) Developer
Posts: 521
Joined: 05 Feb 2007, 22:14
Location: Germany
Contact:

Re: Multi-part games, CRC calculation

Unread post by DerMicha75 » 02 Apr 2012, 19:20

YES! I have a match for a "simple" game. (MAME game 1941.zip). In both systems the CRC is 85709ABD

The calculation works so:

- Create all CRCs, you were right
- Make them upper case (needed in ECC2 since I store them lower case)
- sort them, you were right
- make a combines string, , you were right, but separated with comma!!!!
- calculate the crc, you were right

So thank you, your hint was about 90% ok :-)

But I have an other crc for a clone game. 1941j.zip gives B9D8AD0D in ECC1 and 37F9D73D in ECC2. I will resarch this...

Micha

EDIT: After more tries I will give up (for the moment). I tried:
- Combine only the rom crcs in clone
- Combine the calculated crc from parent and the rom crcs from clone
- Combine all rom crcs (full merge)
- Combine all and double the shared roms
- Combine calculated crc of parent and calculated crc of clones
In no try I got the same CRC as in ECC1. And I do not really understand what the parser does...

User avatar
ECC
ECC Founder & Developer 2005-2009
Posts: 3680
Joined: 28 Aug 2006, 11:58
Location: Hamburg, Germany
Contact:

Re: Multi-part games, CRC calculation

Unread post by ECC » 02 Apr 2012, 23:18

I think, for cloned games maybe i´ve had combined the crc from the original plus the cloned one ... also not 90% confirmed! :-) I dont looked into the sources!

Code: Select all

$original = array(
  'AABBCCDD',
  'EEFF0011',
);

$cloned = array(
  'FFFFFFFF',
)

$merged = array(
  'AABBCCDD',
  'EEFF0011',
  'FFFFFFFF',
);

$out['FILE_CRC32'] = FileIO::ecc_get_crc32_from_string('AABBCCDDEEFF0011FFFFFFFF');
ECC Developer 2005-2009
http://www.camya.com/ecc/
contact: ecc@camya.com

User avatar
Vicman
PLATINUM member
Posts: 1233
Joined: 17 Jun 2007, 16:12
Location: Germany,Bochum

Re: Multi-part games, CRC calculation

Unread post by Vicman » 19 May 2012, 21:30

Hi Micha,

waiting for a new beta :surrender: O:)

......particularly :
- free configurable images for 4- and 6- images views,
- improved widget that shows all images....(larger size i.e. w 320 )
look here

any news here ? :D
imagepacks:
Done: Vic20, N64, Philips VG-5000 G7000 G7400, SordM5, Amstrad GX4000, Enterprise 64/128
Progress: Atari 8bit, Dosbox, Exelvision EXL 100
Vicman's eCC-Clips on You Tube

Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest