Understanding MAME overlay config to port them to Libretro config
-
I'm trying to automate the porting of OrionsAngel's amazing arcade overlays (see here), that are pre-configured as MAME overlays, to Libretro overlay configs.
From what I can see, the Mame overlays configuration consist of two main files.
The first is a
gamename.cfg
file for which I can't find any documentation. It usually looks like this:<mameconfig version="10"> <system name="altbeast2"> <video> <screen index="0" hstretch="0.606000" voffset="0.008000" vstretch="0.656000" /> </video> </system> </mameconfig>
I have no idea what these values represent. I assume they are multipliers, but for what? Screen resolution? Layout rendering? What are they used for?
The other important file is in a zip file (matching the rom name), and is called
default.lay
. This one is a little bit documented but not much. The content seems pretty obvious: it defines elements to draw and then specifies where to draw them.<mamelayout version="2"> <element name="nmva_widescreen"> <image file="altbeast.png" alphafile="mask.png" /> </element> <view name="NMVA_Widescreen"> <bezel element="nmva_widescreen"> <bounds x="0" y="0" width="1280" height="720" /> </bezel> <screen index="0"> <bounds x="232" y="54" width="816" height="612" /> </screen> </view> </mamelayout>
The problem is that the coordinates specified in the file do not match the image.
Above is the configuration taken from the Altered Beast overlay.
Thebezel
element seems to indicate that the screen should be in 720p. But applying the screen coordinates to the bezel resized in 720p makes the screen much larger that the area it's supposed to be in: https://ibb.co/jSjT9RMultiplying the positions and/or sizes by the
stretch
andoffset
values from the first file does not come close to where the screen is supposed to be, so I'm assuming that's the wrong approach.
So my question is: which calculations should I do to convert a MAME overlay to a Libretro overlay?
I'm assuming OrionsAngel overlay are correctly configured and work for everyone out of the box, but maybe that's where I'm wrong, and MAME overlay always require moving things around when you change your screen resolution?
Thanks for you help :)
This is a cross-post with Libretro forum: https://forums.libretro.com/t/understanding-mame-overlay-config-to-port-them-to-libretro-config/14539
-
@cosmo0 Are you basically trying to get mame overlays on RetroPie or are you doing something else.
-
@sammyboy well... I'm trying to convert the mame XML overlay files into the "ini-style" libretro config files. I'm not trying to directly use the mame XML files. Although, if it's possible (I'm assuming it's not), please do tell me :)
I have a repository with a few hundred mame overlays, and I want to convert these files to libretro. Right now I'm converting the files with wrong values, and I'll have to go through each of the game by hand to fix the overlays... :/
-
@cosmo0 Have you seen floobs video on using overlays?
-
@sammyboy yeah, but it's just telling how to use his script to download and apply pre-configured cfg files. I haven't found how he converted his configs ; as far as I can tell he created them manually one by one.
-
I didnt convert mine from .lay files, I used the original windows based libretro configs like:
https://github.com/biscuits99/rp-video-manager/blob/master/users/arcade-bezels/arcade-bezel-retroarch-configs/To Do/astdelux5.cfgThen from that, ripped the relevant lines to produce a simplified version a bit like:
https://github.com/biscuits99/rp-video-manager/blob/master/users/arcade-bezels/arcade-bezel-retroarch-configs/Done/actfancr.zip.cfgYou could parse the .lays if you wanted to and assume that 4:3 will be fine for them all and use
aspect_ratio_index = "0" video_scale_integer = true
Although I'd try one manually and see how it goes.
-
@Floob Thanks for stopping by! :)
The overlays I'm trying to convert are OrionsAngel's.
The only config files I have are the mameconfig and the mamelayout (in the zip)I have generated the cfg just using the values in the
mamelayout
file, but they are pretty much all configured with the same values (unless my conversion script is wrong, which is possible), so I'm starting to think the values in themameconfig
file are important as well... but I just can't figure out what I should multiply.For now I'm resigned to measure the values "by hand" in Photoshop (I have done about 20 of 250...) which will take some time but is not very hard.
Contributions to the project are always appreciated, so if you would like to support us with a donation you can do so here.
Hosting provided by Mythic-Beasts. See the Hosting Information page for more information.