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.
The “bezel” 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/jSjT9R
Multiplying the positions and/or sizes by the “stretch” and “offset” 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