MAMEWorld >> EmuChat
View all threads Index   Threaded Mode Threaded  

Pages: 1

Big Karnak
Part-time Lurker
Reged: 05/22/13
Posts: 1011
Loc: Mount St. Lurkling
Send PM


Program recognizing file size instead of file name
#341895 - 06/26/15 05:25 AM


Ya know how MAME needs to recognize the ROM's file name in order to play it. If [ pacman ] was named [pacmoon], MAME would not recognize it. Well, is there any emulator or program that instead of recognizing file names, recognizes file sizes (I'm not just talking about MAME either.) Each ROM, program, etc. has a unique file size. It is very rare for a file to have exactly the same file size. For example, the latest MAME Plus! release has a file size of 121,464,718 bytes. It would be hard to even find another program anywhere on the internet that has that exact same file size. It's kind of like our unique fingerprints. And the larger the file, the more unique file size it probably has.

I'm just curious if this technique has ever been thought up by any of the devs of the hundreds of different emulators out there?

Some will probably think this is a dumb question, but whatever, I'm curious and I'm dev illiterate. And I'm not suggesting MAME implement this technique either. But wouldn't it be possible to do so, since every MAME ROM zip has a unique file size?



RobbbertModerator
Sir
Reged: 08/21/04
Posts: 3200
Loc: A long way from you
Send PM


Re: Program recognizing file size instead of file name new [Re: Big Karnak]
#341897 - 06/26/15 06:06 AM





mw
MAME Fan
Reged: 01/01/07
Posts: 76
Send PM


Re: Program recognizing file size instead of file name new [Re: Big Karnak]
#341902 - 06/26/15 08:21 AM


> Ya know how MAME needs to recognize the ROM's file name in order to play it. If [
> pacman ] was named [pacmoon], MAME would not recognize it. Well, is there any
> emulator or program that instead of recognizing file names, recognizes file sizes
> (I'm not just talking about MAME either.) Each ROM, program, etc. has a unique file
> size. It is very rare for a file to have exactly the same file size. For example, the
> latest MAME Plus! release has a file size of 121,464,718 bytes. It would be hard to
> even find another program anywhere on the internet that has that exact same file
> size. It's kind of like our unique fingerprints. And the larger the file, the more
> unique file size it probably has.
>
> I'm just curious if this technique has ever been thought up by any of the devs of the
> hundreds of different emulators out there?
>
> Some will probably think this is a dumb question, but whatever, I'm curious and I'm
> dev illiterate. And I'm not suggesting MAME implement this technique either. But
> wouldn't it be possible to do so, since every MAME ROM zip has a unique file size?

You've mixed up the concept of a ROM and a ROM set. A ROM is the data from one IC chip (usually). A ROM set is a collection of ROMs that make up a game. The example names you put in brackets, [packman], [packmoon] are actually folders (or .zip files) that MAME looks inside of when looking for ROMs. The names of the files inside the folders are only there for human readability. What MAME is looking for is the size and CRC of each item. The sizes are usually a power of 2, like 8 KB, or 32 KB, or 1 MB etc. There are many ROMs with the same size. But the CRC is almost always unique, even when ROMs are the same size. by using both the size and CRC, all ROMs in MAME can be uniquely identified. (Well almost always, there is another thing called a SHA1 that can provide even more of a uniqueness factor, but I digress...)

As Robbbert pointed out, the size of the .zip file is not a good choice for matching ROM sets, due to possible inconsistencies in the way .zip files are created.

But there is a practical application for noticing the file sizes of ROM sets in .zip folders!

This application is called TorrentCheck 0.7. It is used to rebuild torrent data more quickly than clrmamepro when trying to join updated torrents. And you don't use plain .zip files, you use torrentzipped .zip files.

For more information, head over to Pleasuredome and the Pleasuredome forums, and search for "TorrentCheck 0.7".



Moose
Don't make me assume my ultimate form!
Reged: 05/03/04
Posts: 1483
Loc: Outback, Australia
Send PM


Re: Program recognizing file size instead of file name new [Re: mw]
#341934 - 06/27/15 01:17 AM


Excellent reply mw !!



Moose



R. Belmont
Cuckoo for IGAvania
Reged: 09/21/03
Posts: 9716
Loc: ECV-197 The Orville
Send PM


Re: Program recognizing file size instead of file name new [Re: Big Karnak]
#341976 - 06/28/15 01:54 PM


1) Renaming a file will cause it to zip to a different size.
2) There are half a dozen zip programs in common use, each of which will generate different sizes from the same input. And that's before you start fiddling with the many settings.
3) Torrentzip will change the sizes again, which would make it impossible to use.
4) MAME already ignores filenames once it's inside the zip; it prefers to load by CRC+SHA1 and will only check filenames if no hashes match.
5) Searching a full-set directory by size is a much slower operation than checking the zip name on any modern operating system.


Pages: 1

MAMEWorld >> EmuChat
View all threads Index   Threaded Mode Threaded  

Extra information Permissions
Moderator:  Robbbert, Tafoid 
1 registered and 301 anonymous users are browsing this forum.
You cannot start new topics
You cannot reply to topics
HTML is enabled
UBBCode is enabled
Thread views: 1462