EMULAB Forum

Please login or register.

Login with username, password and session length
Advanced search  

News:

The new forum is online, hope you enjoy it!

Pages: [1]   Go Down

Author Topic: Header-File Rule-Tests are ignored?  (Read 4296 times)

NikNak

  • Member
  • *
  • Karma: 0
  • Offline Offline
  • Posts: 4
  • Operating System:
  • Linux Linux
  • Browser:
  • Chrome 60.0.3112.113 Chrome 60.0.3112.113
    • View Profile
Header-File Rule-Tests are ignored?
« on: 02 September 2017, 02:13 »

Hello.

Lets say I have a NES headless ROM-Set. So no file starts with "NES" if I check them with a HEX-Editor. Then I download the No-Intro NES dat file with the no-intro_NES.xml header file for ClrMamePro. I put the no-intro_NES.xml into the headers directory.

The header file itself says:

Code: [Select]
<rule start_offset="10">
   <data offset="0" value="4E4553"/>
</rule>

So at the beginning of the file there has to be the value "NES". When I add the datfile to ClrMamePro it asks me to enable Header Support. I click Yes.

If I start up the Rebuilder and rebuild the headerless ROM-Set ClrMamePro should now find no files since all are missing the NES value at the beginning.

But for me ClrMamePro matches & rebuilds all files. Did I do something wrong?
Logged


Roman

  • Global Moderator
  • Member
  • ***
  • Karma: 113
  • Offline Offline
  • Posts: 3293
  • Operating System:
  • Windows NT 10.0 Windows NT 10.0
  • Browser:
  • Chrome 60.0.3112.113 Chrome 60.0.3112.113
    • View Profile
Re: Header-File Rule-Tests are ignored?
« Reply #1 on: 02 September 2017, 06:05 »

Most likely you did nothing wrong...but your assumption is most likely wrong.

The rebuilder rebuilds everything which passes a checksum check. It takes a file, calculates the crc32, looks in the currently used datfile and recreates all matched instances in the destination using the found filename.

"Header support" only means that for the checksum calculation it takes special rules into account. In the NES file the rule is like "If the file starts with the NES token, skip it and calculate the checksum for the rest of the bytes only".

So...it depends what the datfile holds...enabled NES header support does not necessarily mean you only rebuild files with NES headers.

So maybe it helps if we pick one file out of your collection. What's the file's crc32 (full file), does this checksum appear in the datfile.......Does the file start with NES token, what's its checksum without it? Does this crc32 appear in the datfile....

so...such things need to be double checked.

Logged

NikNak

  • Member
  • *
  • Karma: 0
  • Offline Offline
  • Posts: 4
  • Operating System:
  • Linux Linux
  • Browser:
  • Chrome 60.0.3112.113 Chrome 60.0.3112.113
    • View Profile
Re: Header-File Rule-Tests are ignored?
« Reply #2 on: 02 September 2017, 10:23 »

Ah I see. Yes, my assumption was wrong. The checksum of the headerless file matches the dat file and if ClrMamePro detects "NES" in that file it skippes a couple of bytes.

So for me, if I want a collection with headers only I could remove that data test. ClrMamePro should now always skip the offset and every file without a header should now mismatch.
The only problem are BIOS files now which have no header. I could try to set a size test here. A name test for "starting with '[BIOS]'" would be nice.

The thing is, I want a clear distinction between "headered" and "headerless". A mode like I assumed in my starting post. "If there is a header, skip it for checksum calculation, but reject the file if there is no header"... well... except for BIOS files.
Logged

Roman

  • Global Moderator
  • Member
  • ***
  • Karma: 113
  • Offline Offline
  • Posts: 3293
  • Operating System:
  • Windows NT 10.0 Windows NT 10.0
  • Browser:
  • Chrome 60.0.3112.113 Chrome 60.0.3112.113
    • View Profile
Re: Header-File Rule-Tests are ignored?
« Reply #3 on: 02 September 2017, 12:07 »

;-)
Logged
Pages: [1]   Go Up
 

Page created in 0.155 seconds with 20 queries.

anything