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: Validating samples in clones  (Read 3098 times)

Chad

  • Member
  • *
  • Karma: 0
  • Offline Offline
  • Posts: 19
  • Operating System:
  • Windows 7/Server 2008 R2 Windows 7/Server 2008 R2
  • Browser:
  • Chrome 86.0.4240.198 Chrome 86.0.4240.198
    • View Profile
Validating samples in clones
« on: 03 December 2020, 02:58 »

Hi I was wondering if I could get some help understanding how ClrMamePro would process an old DAT with samples. It's for an old version of MAME (mame4all). I removed all the information except the samples for dkong and a clone (dkongpe) to focus on that part of the DAT if it helps.

If the clone, in this case, dkongpe doesn't list any samples i.e. - <sample name="run01.wav"/>, etc. but it does have the tag <sampleof=dkong> will it look to the parent (dkong) to validate the set? I tried it and it shows no missing but I can't help to think it's like a false-positive and not really validating it. I'm so used to seeing the samples listed out in the clones that it looks off to me to see no sample list and just the <sampleof=dkong> tag in the game header information but maybe it's fine to do it this way?

Another question if you used something like DATUtil for example to pull just clones will it fail with no samples actually listed and only the tag <sampleof=dkong>? Is their a more "correct" way to do it as in listing each sample file out in each clone or just using the <sampleof=dkong> tag for all clones?


   <game name="dkong">
      <description>Donkey Kong (US set 1)</description>
      <year>1981</year>
      <manufacturer>Nintendo of America</manufacturer>
      <sample name="run01.wav"/>
      <sample name="run02.wav"/>
      <sample name="run03.wav"/>
      <sample name="jump.wav"/>
      <sample name="dkstomp.wav"/>
   </game>
   <game name="dkongpe" cloneof="dkong" romof="dkong" sampleof="dkong">
      <description>Donkey Kong - Pauline Edition</description>
      <year>2013</year>
      <manufacturer>hack</manufacturer>
   </game>
Logged


Roman

  • Global Moderator
  • Member
  • ***
  • Karma: 112
  • Offline Offline
  • Posts: 3287
  • Operating System:
  • Windows NT 10.0 Windows NT 10.0
  • Browser:
  • Chrome 86.0.4240.198 Chrome 86.0.4240.198
    • View Profile
Re: Validating samples in clones
« Reply #1 on: 03 December 2020, 06:39 »

Good question. The normal structure would be that the clone got the sampleof element listed AND lists the samples (as it does with rom clones). Haven't used old dats in the last 15 years or so ;)
Actually I have to check how this gets parsed. Either cmpro automatically takes over the samples from the parent if it finds the sampleof element or it ignores the sampleof element since the set does not list any samples and thinks it is a flaw in the dat....

So....I have to check what it needs....stay tuned.

Update: If I see this correctly, as long as the clone doesn't list any samples it got no samples, no matter if there is a sampleof or not.
but then - being picky -  the sampleof element should be removed. If it should use samples (from the parent), they should be listed.
« Last Edit: 03 December 2020, 10:18 by Roman »
Logged

Chad

  • Member
  • *
  • Karma: 0
  • Offline Offline
  • Posts: 19
  • Operating System:
  • Mac OS X Mac OS X
  • Browser:
  • Safari 14.0 Safari 14.0
    • View Profile
Re: Validating samples in clones
« Reply #2 on: 03 December 2020, 16:41 »

Roman, thanks a bunch for the help. I will mention the samples should be listed or remove the tag as it serves no real purpose.

I tried to find the answer then I churned it around for a while in my thoughts and still couldn’t come to a conclusion.

I thought if the parent is present and the samples are listed then they are verified by the parent. So I was looking at it thinking is the clone even doing anything in this scenario as the parent already did it and the clone has no information on the samples.

It seems like if nothing is listed in the clone (even with the tag) then it has no information for comparison and the tag is kind of like deprecated OR I thought it is passing all verification to the parent with the tag.

It reminded me of the chicken or the egg. Who’s doing the work, the parent or the clone. You can’t remove the parent or it changes the whole dynamic.

I removed the parent but left the clone with the sampleof tag and I would get “Missing alternative sample folder will be added as sample-only set”. Does that mean that ClrMamePro tried to correct it and the samples will be parsed with the same name as the clone so dkongpe would be the correct sample name vs actually being dkong due to the parent being not present. Basically it separates them?

After all that I thought there’s no clear error shown, in fact there’s no error shown at all in the example above plus it shows no samples missing. So I thought I need to ask someone that knows what’s happening under the hood so the DAT is built correctly. :)

I seem to spend a lot of time using old versions lately on low spec hardware like the Pi and such as they run pretty decent. I just wish I could find a DAT with region info to take advantage of 1G1R.
Logged

Roman

  • Global Moderator
  • Member
  • ***
  • Karma: 112
  • Offline Offline
  • Posts: 3287
  • Operating System:
  • Windows NT 10.0 Windows NT 10.0
  • Browser:
  • Chrome 87.0.4280.88 Chrome 87.0.4280.88
    • View Profile
Re: Validating samples in clones
« Reply #3 on: 03 December 2020, 17:07 »

I removed the parent but left the clone with the sampleof tag and I would get “Missing alternative sample folder will be added as sample-only set”. Does that mean that ClrMamePro tried to correct it and the samples will be parsed with the same name as the clone so dkongpe would be the correct sample name vs actually being dkong due to the parent being not present. Basically it separates them?

A set is generated which takes the samples from the clone and uses the name of the (not existing) sampleof element.

If I remember correctly this was also needed for invaders which had a setup where the parent did not have samples listed but each clone...or something like that....can't remember :)
Logged

Chad

  • Member
  • *
  • Karma: 0
  • Offline Offline
  • Posts: 19
  • Operating System:
  • Mac OS X Mac OS X
  • Browser:
  • Safari 14.0 Safari 14.0
    • View Profile
Re: Validating samples in clones
« Reply #4 on: 03 December 2020, 19:25 »

Yes you are correct I used current MAME last night and used the -listxml parameter piped to a file and noticed that. I didn’t load it into ClrMamePro to see if it prompted a conflict. I think invaders is a sample of itself with no samples and the clones are sampleof=“invaders” but do have have samples listed.

Just to be clear so the clone will only verify the samples listed in its own  set and the sampleof tag is basically what the set will be named or what it’s expecting it to be named?

Using the case in the OP it doesn’t give an error because the clone doesn’t have any samples to verify so technically it is correct?

One last question from the example if I could. If the parent has a sample folder named dkong with actual samples and the clone has no samples but has the sampleof tag why not an error or why doesn’t it (the clone) remove the samples from the dkong folder if that makes sense.
Logged

Chad

  • Member
  • *
  • Karma: 0
  • Offline Offline
  • Posts: 19
  • Operating System:
  • Mac OS X Mac OS X
  • Browser:
  • Safari 14.0 Safari 14.0
    • View Profile
Re: Validating samples in clones
« Reply #5 on: 03 December 2020, 19:31 »

To add a little perspective some folks are making a modified DAT for mame4all like 0.37b5 or close to it and removed the samples from the clones thinking the sampleof tag would push the verification to the parent for both the parent and clone. It shows no errors so they think it’s right. I didn’t I think that it is right and started doing some research and then ended up here asking you because I know you would know the answer to these questions! :)
Logged

Roman

  • Global Moderator
  • Member
  • ***
  • Karma: 112
  • Offline Offline
  • Posts: 3287
  • Operating System:
  • Windows NT 10.0 Windows NT 10.0
  • Browser:
  • Chrome 87.0.4280.88 Chrome 87.0.4280.88
    • View Profile
Re: Validating samples in clones
« Reply #6 on: 03 December 2020, 19:49 »

well...it's pretty easy to see....open scanner->scan results->setinformation and click on the (clone) sets...then you see if samples are listed there or not.

Either way, for sample sets it's not so important.
For roms, you either prefer full merged or split merged sets. So in split merge mode, you got a clone set with the roms which differ from the parent. In case of roms, this is pretty typical...different regions, different sprites, blablalbal... but for samples it's not. You usually don't have samples which only belong to one specific clone, so you don't really have "split" sample sets.
....and for emulator use it doesn't play a role either since e.g. MAME simply looks everywhere for the files it needs.
Logged

Chad

  • Member
  • *
  • Karma: 0
  • Offline Offline
  • Posts: 19
  • Operating System:
  • Windows NT 10.0 Windows NT 10.0
  • Browser:
  • Chrome 86.0.4240.198 Chrome 86.0.4240.198
    • View Profile
Re: Validating samples in clones
« Reply #7 on: 03 December 2020, 23:53 »

Nice tip for ClrMamePro! Looking through the set information is very helpful! I'm always learning something new about the software. That makes sense they have no split-sample sets, I'll have to remember that. On a side note I didn't know clones only listed the "non-merge" roms (in ClrMamePro--I'm so used to looking at the DAT which lists the clone and merge roms tagged accordingly) which makes sense really when merging, it's clever and easy to make a split-merge set or just merge that small list up to the parent.

With the OP it's exactly as you thought. When the sampleof tag is present but there's no sample list the clones display as if the clone has no samples.

I prefer to store my sets split-merge. I say this loosely as to not offend anyone but the Libretro community seems to mostly promote non-merged sets. In fact their cores can't handle merged sets and they will only run the parent from a merged set.

I remember when I discovered mame does hash matching first. I though what's the point of filenames for each set. I think the boundary extends as far as the <game>.zip file though but inside the zip I renamed every rom 1, 2, 3, 4, 5, 6, etc. up to about 26 and the game ran perfectly. I thought that's pretty nifty and was able to exploit that when using neogeo unibios. I was able to add multiple versions of unibios into one zip and just renamed the "equal name different hash" files. It works great.

I appreciate the help in understanding how the samples work and I hope you have a wonderful and safe holiday season! I'll keep an eye on the Sentinel! ;)
« Last Edit: 04 December 2020, 00:10 by Chad »
Logged

Roman

  • Global Moderator
  • Member
  • ***
  • Karma: 112
  • Offline Offline
  • Posts: 3287
  • Operating System:
  • Windows NT 10.0 Windows NT 10.0
  • Browser:
  • Chrome 87.0.4280.88 Chrome 87.0.4280.88
    • View Profile
Re: Validating samples in clones
« Reply #8 on: 04 December 2020, 06:48 »

Thanks, enjoy the holiday season and stay healthy.
And nice to see you remember and spotted the sentinel :)
Logged
Pages: [1]   Go Up
 

Page created in 0.125 seconds with 20 queries.

anything