HELP WANTED: MRA file converter for MiST

https://github.com/mist-devel/mist-board/wiki

Moderators: Mug UK, Zorro 2, spiny, Greenious, Moderator Team

slingshot
Atari God
Atari God
Posts: 1572
Joined: Mon Aug 06, 2018 3:05 pm

Re: HELP WANTED: MRA file converter for MiST

Postby slingshot » Tue Feb 11, 2020 10:44 am

Played with it a bit, some thoughts:
- RBF doesn't have to be quoted (no problem, but a bit ugly in my eyes)
- ARC file name should be the <name> tag to have a pretty long name
- Any solution for the toggle switch? Maybe:

Code: Select all

<dip bits="15"    name="Advance" type="trigger"/>

Should generate:

Code: Select all

CONF="TF,Advance"

sebdel
Captain Atari
Captain Atari
Posts: 228
Joined: Fri Dec 30, 2005 9:29 am

Re: HELP WANTED: MRA file converter for MiST

Postby sebdel » Tue Feb 11, 2020 11:13 am

slingshot wrote:Played with it a bit, some thoughts:
- RBF doesn't have to be quoted (no problem, but a bit ugly in my eyes)
- ARC file name should be the <name> tag to have a pretty long name
- Any solution for the toggle switch? Maybe:

Code: Select all

<dip bits="15"    name="Advance" type="trigger"/>

Should generate:

Code: Select all

CONF="TF,Advance"

Or it's a trigger when IDs is not set? This way we don't introduce a new attribute?

slingshot
Atari God
Atari God
Posts: 1572
Joined: Mon Aug 06, 2018 3:05 pm

Re: HELP WANTED: MRA file converter for MiST

Postby slingshot » Tue Feb 11, 2020 11:14 am

sebdel wrote:Or it's a trigger when IDs is not set? This way we don't introduce a new attribute?

Good idea!

Sorgelig
Ultimate Atarian
Ultimate Atarian
Posts: 6051
Joined: Mon Dec 14, 2015 10:51 am
Location: Russia/Taiwan

Re: HELP WANTED: MRA file converter for MiST

Postby Sorgelig » Tue Feb 11, 2020 12:14 pm

slingshot wrote:<dip bits="15" name="Advance" type="trigger"/>

Good idea. I will implement this parameter in MiSTer. If type is not used then it's a normal on/off switch.

slingshot
Atari God
Atari God
Posts: 1572
Joined: Mon Aug 06, 2018 3:05 pm

Re: HELP WANTED: MRA file converter for MiST

Postby slingshot » Tue Feb 11, 2020 12:26 pm

Sorgelig wrote:
slingshot wrote:<dip bits="15" name="Advance" type="trigger"/>

Good idea. I will implement this parameter in MiSTer. If type is not used then it's a normal on/off switch.

But sebdel's idea is better - if no <ids>, then it's a trigger. Type is not needed at all. On/off and a trigger is different, trigger is like a push button with a spring.

Sorgelig
Ultimate Atarian
Ultimate Atarian
Posts: 6051
Joined: Mon Dec 14, 2015 10:51 am
Location: Russia/Taiwan

Re: HELP WANTED: MRA file converter for MiST

Postby Sorgelig » Tue Feb 11, 2020 12:29 pm

sebdel wrote:I noticed you compute the MD5 before you interleave data to the destination. Is that correct? What is the ROM MD5 exactly?

MD5 is calculated at file loading stage, so basically it's MD5 of all used parts in the order they listed in MRA, not MD5 of constructed ROM.
The point is to check that rom is assembled from correct parts, not the MD5 of result. Some additional modifications such as <patch> can be used which would affect the MD5 if it would be calculated at the end, but there is no reason to add patch to MD5.
Later CRC of each part was introduced to help to find renamed files from different mame sets, so MD5 is not required for such ROMs. Still many MRAs don't include CRC, so MD5 is more generalised form of control.

Sorgelig
Ultimate Atarian
Ultimate Atarian
Posts: 6051
Joined: Mon Dec 14, 2015 10:51 am
Location: Russia/Taiwan

Re: HELP WANTED: MRA file converter for MiST

Postby Sorgelig » Tue Feb 11, 2020 12:29 pm

slingshot wrote:
Sorgelig wrote:
slingshot wrote:<dip bits="15" name="Advance" type="trigger"/>

Good idea. I will implement this parameter in MiSTer. If type is not used then it's a normal on/off switch.

But sebdel's idea is better - if no <ids>, then it's a trigger. Type is not needed at all. On/off and a trigger is different, trigger is like a push button with a spring.

Ok. Sounds reasonable.

sebdel
Captain Atari
Captain Atari
Posts: 228
Joined: Fri Dec 30, 2005 9:29 am

Re: HELP WANTED: MRA file converter for MiST

Postby sebdel » Tue Feb 11, 2020 12:37 pm

Sorgelig wrote:
sebdel wrote:I noticed you compute the MD5 before you interleave data to the destination. Is that correct? What is the ROM MD5 exactly?

MD5 is calculated at file loading stage, so basically it's MD5 of all used parts in the order they listed in MRA, not MD5 of constructed ROM.
The point is to check that rom is assembled from correct parts, not the MD5 of result. Some additional modifications such as <patch> can be used which would affect the MD5 if it would be calculated at the end, but there is no reason to add patch to MD5.
Later CRC of each part was introduced to help to find renamed files from different mame sets, so MD5 is not required for such ROMs. Still many MRAs don't include CRC, so MD5 is more generalised form of control.

Ah, make sense, you're validating the input, not the output. Thank you.

User avatar
jotego
Captain Atari
Captain Atari
Posts: 221
Joined: Wed May 04, 2016 10:02 am
Location: Valencia (Spain)
Contact:

Re: HELP WANTED: MRA file converter for MiST

Postby jotego » Wed Feb 12, 2020 9:36 am

Sebdel, did you add support for recognizing the files inside the zip by the CRC code? I am already running into trouble with my own MAME romset as the names do not match those in MAME source files.

If you could add the patch element Sorgelig told us about, that'd be great.

Thank you :-)
--
Source code of all my cores here.
My Patreon page here.

slingshot
Atari God
Atari God
Posts: 1572
Joined: Mon Aug 06, 2018 3:05 pm

Re: HELP WANTED: MRA file converter for MiST

Postby slingshot » Wed Feb 12, 2020 10:05 am

I have a simpler request for a future featue: put the ROM filename (=MRA filename) into a NAME=XXXXXXXX setting in .arc (converted to uppercase). It will allow to override the core name itself, allowing to load different romset for the same mod.
Also it will allow to leave the core name empty in the HDL code, to not deal with padding and such because of different length strings.

Another thing: I don't know if something inside the MRA cannot be used for the ROM filename. What is <setname> for?

E.g. Scramble Set 2.arc:

Code: Select all

[ARC]
RBF=SCRAMBLE
NAME=SCRAMBLES
MOD=0
CONF="O78,Lives,3,4,5,Unl"

sebdel
Captain Atari
Captain Atari
Posts: 228
Joined: Fri Dec 30, 2005 9:29 am

Re: HELP WANTED: MRA file converter for MiST

Postby sebdel » Wed Feb 12, 2020 12:08 pm

jotego wrote:Sebdel, did you add support for recognizing the files inside the zip by the CRC code? I am already running into trouble with my own MAME romset as the names do not match those in MAME source files.

If you could add the patch element Sorgelig told us about, that'd be great.

Thank you :-)

CRC should work although I never tested it. (edit: nope, it was broken, I just fixed it)
I'll think about patch, it's not trivial with the current code base.
Last edited by sebdel on Wed Feb 12, 2020 4:50 pm, edited 1 time in total.

sebdel
Captain Atari
Captain Atari
Posts: 228
Joined: Fri Dec 30, 2005 9:29 am

Re: HELP WANTED: MRA file converter for MiST

Postby sebdel » Wed Feb 12, 2020 1:54 pm

slingshot wrote:I have a simpler request for a future featue: put the ROM filename (=MRA filename) into a NAME=XXXXXXXX setting in .arc (converted to uppercase). It will allow to override the core name itself, allowing to load different romset for the same mod.
Also it will allow to leave the core name empty in the HDL code, to not deal with padding and such because of different length strings.

Another thing: I don't know if something inside the MRA cannot be used for the ROM filename. What is <setname> for?

E.g. Scramble Set 2.arc:

Code: Select all

[ARC]
RBF=SCRAMBLE
NAME=SCRAMBLES
MOD=0
CONF="O78,Lives,3,4,5,Unl"


According to that wiki that is fairly up to date: https://github.com/MiSTer-devel/Main_MiSTer/wiki/Arcade-Roms, setname is the name of the mame romset. No idea what that means.

I entered an issue to add NAME to ARC files. BTW, @jotego, @slingshot, and anyone else for that matter: don't hesitate to use the issue tracker. I'll try to stay on top of it :angel:

Sorgelig
Ultimate Atarian
Ultimate Atarian
Posts: 6051
Joined: Mon Dec 14, 2015 10:51 am
Location: Russia/Taiwan

Re: HELP WANTED: MRA file converter for MiST

Postby Sorgelig » Wed Feb 12, 2020 4:37 pm

slingshot wrote:I have a simpler request for a future featue: put the ROM filename (=MRA filename) into a NAME=XXXXXXXX setting in .arc (converted to uppercase). It will allow to override the core name itself, allowing to load different romset for the same mod.
Also it will allow to leave the core name empty in the HDL code, to not deal with padding and such because of different length strings.

Another thing: I don't know if something inside the MRA cannot be used for the ROM filename. What is <setname> for?

E.g. Scramble Set 2.arc:

Code: Select all

[ARC]
RBF=SCRAMBLE
NAME=SCRAMBLES
MOD=0
CONF="O78,Lives,3,4,5,Unl"

there is already node for this in MRA called <setname>. This is used to replace the core's ID.
Several MRAs can share the same setname where it is applicable. setname is usually within 8 chars, so it's also good for core's ID than MRA name. If setname node is absent then default ID from core is used.

slingshot
Atari God
Atari God
Posts: 1572
Joined: Mon Aug 06, 2018 3:05 pm

Re: HELP WANTED: MRA file converter for MiST

Postby slingshot » Wed Feb 12, 2020 5:03 pm

Then <setname> would be good for both NAME= and the ROM's filename, too. Then MRAs can have long filename. And if there's no <setname> it can fall back to the MRA filename (for both NAME and ROM's filename).

brunosilva
Obsessive compulsive Atari behavior
Obsessive compulsive Atari behavior
Posts: 130
Joined: Mon Apr 09, 2018 10:58 pm

Re: HELP WANTED: MRA file converter for MiST

Postby brunosilva » Wed Feb 12, 2020 10:38 pm

i think set name is unique between games/versions/hacks...

i pick setname from mame driver cpp

"GAME( 1981, frogger, 0, frogger, frogger, galaxian_state, init_frogger, ROT90, "Konami", "Frogger", MACHINE_SUPPORTS_SAVE )"

its the string after the year..

i have a "set" of mra (both "parent" games and alternative/hacks) and all have setname... so they can be used (i didnt check all the mra in official mister repos)

brunosilva
Obsessive compulsive Atari behavior
Obsessive compulsive Atari behavior
Posts: 130
Joined: Mon Apr 09, 2018 10:58 pm

Re: HELP WANTED: MRA file converter for MiST

Postby brunosilva » Wed Feb 12, 2020 11:09 pm

@sebdel - to use mra directly from mister we also need to mra software to read several zip files from zip property.

You can find one exame here:
https://github.com/MiSTer-devel/Arcade- ... Amidar.mra

why could we have more than one zip?
because of different sets of mame (merged, nonmerged, slipt).
before crc functionality we had to provide path inside zip and with this we had several "rom 0" entries. Because now mister tries to match crc with all files inside zip, no need for path anymore. but different sets could have different file names and that's why we provide more than one zip.
if mister doesnt find the file in one zip, it tries to find it in the next zip and so on
(if its not exactly like this... is more or less)

brunosilva
Obsessive compulsive Atari behavior
Obsessive compulsive Atari behavior
Posts: 130
Joined: Mon Apr 09, 2018 10:58 pm

Re: HELP WANTED: MRA file converter for MiST

Postby brunosilva » Wed Feb 12, 2020 11:19 pm

well sorry for the spam :)

about creating the arc filename with name inside (example: <name>Battle of Atlantis (set 2)</name>)

its possible to have a switch for creating the arc filename with mra filename?
because the name property is the mame name for the game and many names has "garbage" at the end.

Usually i use a "clean" filename for the "parent" games and the mame name for the alternatives/hacks.

Thanks

brunosilva
Obsessive compulsive Atari behavior
Obsessive compulsive Atari behavior
Posts: 130
Joined: Mon Apr 09, 2018 10:58 pm

Re: HELP WANTED: MRA file converter for MiST

Postby brunosilva » Wed Feb 12, 2020 11:36 pm

about arc files: should arc file include the rom filename?

for example in amidar (creating arc from mra): I get Amidar (Scramble hardware).arc and Amidar.rom
how does mist know what rom to load?
maybe using setname , core could use this as core name and also as rom filename to load?

sebdel
Captain Atari
Captain Atari
Posts: 228
Joined: Fri Dec 30, 2005 9:29 am

Re: HELP WANTED: MRA file converter for MiST

Postby sebdel » Thu Feb 13, 2020 7:16 am

brunosilva wrote:@sebdel - to use mra directly from mister we also need to mra software to read several zip files from zip property.

You can find one exame here:
https://github.com/MiSTer-devel/Arcade- ... Amidar.mra

Yes, I'm aware of this one. I was just waiting for someone to ask. I'll implement the logic described here: https://github.com/MiSTer-devel/Main_MiSTer/wiki/Arcade-Roms
The only thing that's unclear is whether the CRC is checked against the top level zip and then part zip or only part zip.

about creating the arc filename with name inside (example: <name>Battle of Atlantis (set 2)</name>)
its possible to have a switch for creating the arc filename with mra filename?
because the name property is the mame name for the game and many names has "garbage" at the end.
Usually i use a "clean" filename for the "parent" games and the mame name for the alternatives/hacks.

Regarding output file names in general, I was considering command line arguments to bypass the internal logic, like:

mra amidar.mra -a amidar.arc -r amidar.rom

Note that the logic is yet to be defined, you can add your comments to issue #20

slingshot
Atari God
Atari God
Posts: 1572
Joined: Mon Aug 06, 2018 3:05 pm

Re: HELP WANTED: MRA file converter for MiST

Postby slingshot » Thu Feb 13, 2020 8:03 am

brunosilva wrote:about arc files: should arc file include the rom filename?

for example in amidar (creating arc from mra): I get Amidar (Scramble hardware).arc and Amidar.rom
how does mist know what rom to load?
maybe using setname , core could use this as core name and also as rom filename to load?

The core name override implies ROM name override, too. MiST will know what to do, trust me :)

sebdel
Captain Atari
Captain Atari
Posts: 228
Joined: Fri Dec 30, 2005 9:29 am

Re: HELP WANTED: MRA file converter for MiST

Postby sebdel » Thu Feb 13, 2020 8:35 am

brunosilva wrote:about arc files: should arc file include the rom filename?

for example in amidar (creating arc from mra): I get Amidar (Scramble hardware).arc and Amidar.rom
how does mist know what rom to load?
maybe using setname , core could use this as core name and also as rom filename to load?

I just merged an update to that. Now, with mra -A amidar.mra, you will get:

Amidar (Scramble hardware).arc and AMIDAR.ROM and the arc will contain:

Code: Select all

[ARC]
NAME=AMIDAR

brunosilva
Obsessive compulsive Atari behavior
Obsessive compulsive Atari behavior
Posts: 130
Joined: Mon Apr 09, 2018 10:58 pm

Re: HELP WANTED: MRA file converter for MiST

Postby brunosilva » Thu Feb 13, 2020 10:31 am

sebdel wrote:
brunosilva wrote:@sebdel - to use mra directly from mister we also need to mra software to read several zip files from zip property.

You can find one exame here:
https://github.com/MiSTer-devel/Arcade- ... Amidar.mra

Yes, I'm aware of this one. I was just waiting for someone to ask. I'll implement the logic described here: https://github.com/MiSTer-devel/Main_MiSTer/wiki/Arcade-Roms
The only thing that's unclear is whether the CRC is checked against the top level zip and then part zip or only part zip.


i think you can forget the zip in part (it still works, i think, but its not used anymore - at least i dont use it). but if you implement it, i think it will only be searching for the file in that zip.

i talking about this: <rom index="0" zip="amidar.zip|amidars.zip" md5="22506edd9fb15fc2f5608c0174217753" type="merged|split|nonmerged">

brunosilva
Obsessive compulsive Atari behavior
Obsessive compulsive Atari behavior
Posts: 130
Joined: Mon Apr 09, 2018 10:58 pm

Re: HELP WANTED: MRA file converter for MiST

Postby brunosilva » Thu Feb 13, 2020 10:36 am

slingshot wrote:
brunosilva wrote:about arc files: should arc file include the rom filename?

for example in amidar (creating arc from mra): I get Amidar (Scramble hardware).arc and Amidar.rom
how does mist know what rom to load?
maybe using setname , core could use this as core name and also as rom filename to load?

The core name override implies ROM name override, too. MiST will know what to do, trust me :)


Name isnt yet in arc files in repo. it's already supported? do we need a firmware/core update?
mist cores will have the same rom file "layout" as mister? so i can use alternatives i do for mister in mist?
Thanks

sebdel
Captain Atari
Captain Atari
Posts: 228
Joined: Fri Dec 30, 2005 9:29 am

Re: HELP WANTED: MRA file converter for MiST

Postby sebdel » Thu Feb 13, 2020 12:33 pm

brunosilva wrote:i talking about this: <rom index="0" zip="amidar.zip|amidars.zip" md5="22506edd9fb15fc2f5608c0174217753" type="merged|split|nonmerged">

Why choose xml if you're going to put collections in strings... anyway, sure, I'll support that.

slingshot
Atari God
Atari God
Posts: 1572
Joined: Mon Aug 06, 2018 3:05 pm

Re: HELP WANTED: MRA file converter for MiST

Postby slingshot » Thu Feb 13, 2020 12:42 pm

brunosilva wrote:Name isnt yet in arc files in repo. it's already supported? do we need a firmware/core update?

Yes, firmware update + some core updates will needed. Actually they're in the source repos already. Probably will make releases at the weekend.
There won't be ARC files in the repos: both ROMs and ARCs could be generated from MRAs.

mist cores will have the same rom file "layout" as mister? so i can use alternatives i do for mister in mist?

I don't know - I noticed Scramble layout for example was changed in MiSTer. I won't follow it.
Mappy and Green Beret use the same.


Return to “MiST”

Who is online

Users browsing this forum: No registered users and 6 guests