Giter Club home page Giter Club logo

mra-tools-c's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

mra-tools-c's Issues

Implement part zip attribute

Parts can source files from a particular zip rather than the zip file specified on the ROM node.

  • zip attribute on part probably takes priority when looking for the part. TBC.

Implement patch node support

  • The patch node is a child of the ROM index0 node.
  • It's applied at the end, once the ROM is fully built.
  • It's not accounted for in the MD5 computation.
  • Multiple patch nodes are allowed in the same ROM. In this case they will be applied in order, eventually overlapping.
  • Patching past the end of the ROM file will cause an error.
  • Patch node must have an offset attribute, and it's the only supported attribute.
  • Patch data are set in the node text area as hex string.

Byte order reversed in some recent commit

I don't know when but the byte order of the MRA tool changed internally. There is a CPU file that I used to need to swap and now I don't. It is this line:
<part name="dm-17.7j" crc="3ea1b0f2" pattern ="10"/>
Indeed, as I had been updating my ghouls.rom file recently, I got the CPS core to suddenly break down on Ghouls'n Ghosts to my dispair. It literally drove me crazy.
Today, when preparing the files for MiSTer using the interleave format we realized of this as I was debugging the MRA with the help of Sorgelig.
I think the current order is better so I'll just update the MRA files but you may want to track how this byte reversal thing got in and whether it has reached something else.

Working file on MiSTer ghouls_mr.mra.zip

Now broken file for MiST ghouls.mra.zip

Support MiSTer style interleaving

  • what we call group, they call interleave
  • what we call width, they call output
  • map is kind of like pattern but that will need some more analysis

TBD: Shall this replace group or be supported in addition to it?

Add support for config pages

In the next mist-firmware, a P config string option is added to define a new config page (as a submenu item).
There are two formats:
Px,Submenu
PxOyz,Menu Item
The former defines a new submenu, the other is just an ordinary option prefixed by the page.
This can be easily supported by two attributes in the switches element:

<switches page_name="Submenu" page_id="1">....</switches>

should generate:

P1,Submenu
P1Oxy,Ordinary options,a,b,c

If page_id is 0 (or omitted), then no change is necessary in the generated options.
if page_name is omitted, then no submenu option should be added.

Eventually more than one switches block can be also supported, each defining a different submenu. But not a high prio, especially for compatibility with the original. With one submenu, the separate OSD screen for the DIP switches can be easily achievable.

Changed DEFAULT value

I want to discuss the DEFAULT value change:
It was 0 (when it wasn't implemented), but it's 0xffffffff now. That might break some arcades in Gehstock's repo, where 0 was expected.
I think the DEFAULT value should be only written to the ARC file, when it's present in the MRA. Otherwise it should be left out. Please notice that the status bits are not just for DIP switches on MiST, but for every options.

Do not write problematic lines to ARC file

The current MRA version warns about lines too long in the MRA files but still outputs them to the MRA. This is a problem for end users who don't understand what is going on and will try to use those files with fatal results as the MiST OSD just gets corrupted.

I know that ideally the MRA should be clean for this but in practice there are literally hundreds of MRA files and developers have limited time so at any given time there will be MRA files around that have not been optimized for MiST OSD.

I thought I had already removed the output of problematic lines once. Could we stop those lines from getting to the ARC file? The warning is enough to get the developer know he has pending work.

Confusing message when bad file name is provided

If the tool is invoked with a non-existing file name, the following error is shown:

filename is not a valid xml file
src/part.c:259: error: ROM0 not found in MRA.
Writing ROM failed with error code: -1

which makes you think that there is a problem in the file. So you go checking the file without realizing that the file was never read. Could we have a more precise error message? Thank you.

zip="" "problem"

Hi
its possible if zip="" (with any file) in have the same behavior if no zip property exists in (without zip property it work ok - with zip="" it doesnt give any error but it also doest process the mra file).

Thanks

ignore md5="none"

MiSTer uses md5="none" to mark that md5 is not available. This should be ignored by the tool.

file path in windows

in windows, with verbose, i get a "/" when i should have "". Files are writen ok in filesystem (don't know if windows is converting the "/" to "" or if this only happens in output to screen in verbose

example:

C:\MRA_Files\mra\SiDi>c:\mra_files\mra.exe -Avz c:\mra_files\nonmerged -O "C:\MRA_files\mra\SiDi\alternatives\Sinistar" "C:\MRA_files\mra\SiDi\alternatives\Sinistar\Sinistar (prototype version).mra"
Parsing C:\MRA_files\mra\SiDi\alternatives\Sinistar\Sinistar (prototype version).mra to C:\MRA_files\mra\SiDi\alternatives\Sinistar/sinistar.rom
zip include dirs: c:\mra_files\nonmerged/, ./
Creating ARC file C:\MRA_files\mra\SiDi\alternatives\Sinistar/Sinistar (prototype version).arc
Uncompressing zip file: c:\mra_files\nonmerged/sinistar.zip
Uncompressing zip file: c:\mra_files\nonmerged/sinistar1.zip
FILE SIZE CRC


decoder.4 512 E6631C23
decoder.6 512 83FAF25E
sinistar.01 4096 F6F3A22C
sinistar.02 4096 CAB3185C
sinistar.03 4096 1CE1B3CC
sinistar.04 4096 6DA632BA
sinistar.05 4096 B662E8FC
sinistar.06 4096 2306183D
sinistar.07 4096 E5DD918E
sinistar.08 4096 4785A787
sinistar.09 4096 50CB63AD
sinistar.10 4096 3D670417
sinistar.11 4096 3162BC50
sinistar.snd 4096 B82F4DDB
speech.ic4 4096 4B56A626
speech.ic5 4096 CF3B5FFD
speech.ic6 4096 FF8D2645
speech.ic7 4096 E1019568
decoder.4 512 E6631C23
decoder.6 512 83FAF25E
sinistar.02 4096 CAB3185C
sinistar.snd 4096 B82F4DDB
sinrev1.01 4096 3810D7B8
sinrev1.03 4096 7C984CA9
sinrev1.04 4096 CC6C4F24
sinrev1.05 4096 12285BFE
sinrev1.06 4096 7A675F35
sinrev1.07 4096 B0463243
sinrev1.08 4096 909040D4
sinrev1.09 4096 CC949810
sinrev1.10 4096 EA87A53F
sinrev1.11 4096 88D36E80
speech.ic4 4096 4B56A626
speech.ic5 4096 CF3B5FFD
speech.ic6 4096 FF8D2645
speech.ic7 4096 E1019568
part selected by CRC (3810D7B8)
writing 4096 bytes @ 00000000
part selected by CRC (CAB3185C)
writing 4096 bytes @ 00001000
part selected by CRC (7C984CA9)
writing 4096 bytes @ 00002000
part selected by CRC (CC6C4F24)
writing 4096 bytes @ 00003000
part selected by CRC (12285BFE)
writing 4096 bytes @ 00004000
part selected by CRC (7A675F35)
writing 4096 bytes @ 00005000
part selected by CRC (B0463243)
writing 4096 bytes @ 00006000
part selected by CRC (909040D4)
writing 4096 bytes @ 00007000
part selected by CRC (CC949810)
writing 4096 bytes @ 00008000
part selected by CRC (EA87A53F)
writing 4096 bytes @ 00009000
part selected by CRC (EA87A53F)
writing 4096 bytes @ 0000A000
part selected by CRC (88D36E80)
writing 4096 bytes @ 0000B000
part selected by CRC (B82F4DDB)
writing 4096 bytes @ 0000C000
writing 1024 bytes @ 0000D000
ce723cbcfea8010e69a0a4f25b421405 C:\MRA_files\mra\SiDi\alternatives\Sinistar/sinistar.rom
MD5s match! (ce723cbcfea8010e69a0a4f25b421405)
done!

Process <interleave> inner elements regardless of order

will not parse correctly if map elements need to interpret the files in a different order from that in the file.

I know this was reported to be a limitation, but could we either:

  1. Detect the problem and produce an error, so the user knows the result .rom file is wrong
    or
  2. Fix it

Thank you

Bug: wrong offset assigned stops file from being processed

When trying to parse the attached MRA file I get the following error:

warning: offset set past the part size. Skipping part.
warning: offset set past the part size. Skipping part.

which seems to refer to parts sfz.01 and sfz.02 as I modified the code to print out the part names. It looks like if I insert the parts into an interleave section, the error goes away. So this might be some leftover data from a previous interleave affecting the program.

Anyway, there is no offset nor length for those two files as they are simply part files. The zip file for the game can be found here. This is a kind of homebrew version of a game, actually. The qsound.zip file is part of common MAME rom sets.

Could you have a look at this error, please?

Street Fighter Zero CPS 1.5.mra.zip

support for size attribute

Pang3! needs this code:

        <interleave output="64">
            <part name="pa3-01m.2c" crc="068a152c"  map="00000021" size="0x100000" offset="0"/>
            <part name="pa3-07m.2f" crc="3a4a619d"  map="00002100" size="0x100000" offset="0"/>
            <part name="pa3-01m.2c" crc="068a152c"  map="00210000" size="0x100000" offset="0x100000"/>
            <part name="pa3-07m.2f" crc="3a4a619d"  map="21000000" size="0x100000" offset="0x100000"/>
        </interleave>

This loads twice the same files and dumps it starting from different points. Only half the file is read each time.

Could you add support for this, please?

setname with more than 8 chars

Hi

there are some setnames with more than 8 chars. app is cutting the last chars but then some games have the same rom name.
it possible to cut the first chars?
Thanks

Attributes for dips

I am thinking of adding another attribute for dip switches: coin. This will serve to define coin related switches. This can serve to hide them in the OSD in MiSTer, or to ommit them in the ARC, which is my main purpose.

Check the example where coin="yes" is defined in a couple of places. As you see these are very long strings with little value for us.

    <switches default="FF,FF" base=10>
        <!-- DSW1 -->
        <dip name="Coinage" bits="0,3" ids="Free Play,4 Coins/3 Credits,4 Coins/1 Credit,3 Coins/4 Credits,3 Coins/2 Credits,3 Coins/1 Credit,2 Coins/5 Credits,2 Coins/3 Credits,2 Coins/1 Credit,1 Coin/7 Credits,1 Coin/6 Credits,1 Coin/5 Credits,1 Coin/4 Credits,1 Coin/3 Credits,1 Coin/2 Credits,1 Coin/1 Credit" coin="yes"></dip>
        <dip name="Coinage affects" bits="4" ids="Coin B,Coin A" coin="yes"></dip>
        <dip name="Demo Sounds" bits="5" ids="On,Off"></dip>
        <dip name="Service Mode" bits="6" ids="On,Off"></dip>
        <dip name="Flip Screen" bits="7" ids="On,Off"></dip>
        <!-- DSW2 -->
        <dip name="Lives" bits="8,9" ids="7,5,4,3"></dip>
        <dip name="Cabinet" bits="10" ids="Upright,Cocktail"></dip>
        <dip name="Bonus Life" bits="11,12" ids="30K and 80K Only,20K and 80K Only,30K 80K Every 80K,20K 70K Every 70K"></dip>
        <dip name="Difficulty" bits="13,14" ids="Very Difficult,Difficult,Easy,Normal"></dip>
        <dip name="Unused" bits="15" ids="On,Off"></dip>
    </switches>

If you are ok with it I'll make a PR when I'm ready

Add NAME to ARC files

  • use the name or the MRA file to generate a NAME in the ARC file:

e.g. after:
mra -A scramble.mra
The arc file should contain:

NAME=SCRAMBLE

Order for Dips in Mister/Mist

Hi

another request... sorry :)

about the ids of the dips:
we must sort the ids of the dips by its value and not by its name.

giving an example for 1942:

	PORT_DIPNAME( 0xc0, 0x40, DEF_STR( Lives ) )        PORT_DIPLOCATION("SWA:2,1")
	PORT_DIPSETTING(    0x80, "1" )
	PORT_DIPSETTING(    0x40, "2" )
	PORT_DIPSETTING(    0xc0, "3" )
	PORT_DIPSETTING(    0x00, "5" )

the dip will be:

<dip bits="6,7"   name="Lives"        ids="5,2,1,3"></dip>

in osd doesn't make much sense not having the lives sorted. whe should have something like this:

<dip bits="6,7"   name="Lives"        ids="1,2,4,5"></dip>

yes, I know that this doesn't work out of the box :)

So, in mister, we can change the sort order of ids for a "dip" having the values for each id.
you can see how in the end of this page:
https://github.com/MiSTer-devel/Main_MiSTer/wiki/Arcade-Roms#Dip-Switches

the "problem" here is mist that doesn't do this.

My question is:

  • its possible to have the mra with another order and values for each one like this example and the tool sort the ids by their value (like we have today) when it creates the arc?

Thanks :)

ROM0 not found

Trying to use the tool but whatever .mra file I use I always get this error:

➜  ghouls git:(master) ✗ ../mra Ghouls\'n\ Ghosts\ -World-.mra
src/rom.c:299: error: ROM0 not found in MRA.

Support for default DIP switch value in ARC files

Some arcade games will not boot up or will get halted after an initial screen if DIP switches are not correct. These are sometimes reserved configurations by developers or deliberate test conditions for the service operators.

For DIP switches to work conveniently in MiST we need to get the default value -already in the XML- to the ARC file, something like

DEFAULT=00ABCDEF

Could you add this feature, please?

about values in parts

Hi

because i don't know you are aware, some values can be hex or decimal:

you have here an example:
https://github.com/MiSTer-devel/Arcade-Arkanoid_MISTer/blob/master/releases/Arkanoid%20(unl.lives%2C%20slower).mra

patch offset here is in hex

and i dont know if its possible to have a decimal value in offset.

here offset and lenght are decimal
https://github.com/MiSTer-devel/Arcade-RallyX_MiSTer/blob/master/releases/New%20Rally-X.mra

In repeat is possible to have hex and decimal

hex example:
https://github.com/MiSTer-devel/Arcade-MCR3Scroll_MiSTer/blob/master/releases/Crater%20Raider.mra

decimal example:
https://github.com/MiSTer-devel/Arcade-MCR2_MiSTer/blob/master/releases/Domino%20Man.mra

Support multi zip attribute for ROM

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

  • zip attribute should be read as a list of file names to source from when using part crc and part name.

While doing this, change the way type is parsed as well. It is not used at the moment but we never know.

parameters length limit in windows?

Hi

is there any length limit for parameters in windows?

because if I do this in command line:

c:\mra_files\mra.exe -Az c:\mra_files\nonmerged -O "C:\MRA_files\mra\SiDi\alternatives\Disc of tron" "C:\MRA_files\mra\SiDi\alternatives\Disc of tron\Discs of Tron (Upright alternate).mra"

it does nothing but also it doesnt give any error.

but if I do this:
c:\mra_files\mra.exe -Az c:\mra_files\nonmerged -O "C:\MRA_files\mra\SiDi\alternatives\Disc of tron" "C:\tools\Discs of Tron (Upright alternate).mra"

it works and places the files in the correct folder

by the way paths are correct

Thanks

More informative error message when attributes are not within inverted commas

If I forget to use inverted commas for an attribute I get this message:

bash-4.1$ mra nemo_notest.mra -z zip

WE SHOULD NOT BE HERE!
[<patch offset=0x63c>]

nemo_notest.mra:20: An error was found (MEMORY(-1)), loading aborted...
nemo_notest.mra is not a valid xml file

Which is not very informative for the user. Could we have something that points out better to the problem in the XML file? Something like:
Line xx is not a valid XML statement.
Of course if you could go into details about why it is not valid, that's even better. But at least to put the focus at the file. Because a message with expressions such as An error was found (MEMORY(-1)) suggests a problem with the mra executable not with the input file.

Thank you

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.