MAME/Retroarch bezel/overlays tool

Retroarch bezels / overlays tool

Overlays (or bezels) are images added “above” the emulator, to mask the black borders around the image.

This tool provides several utilities:

  • convert MAME bezels to Retroarch overlays, so they can be used with any Libretro emulator
  • convert Retroarch overlays to MAME bezels
  • check Retroarch overlays integrity

It works under Windows x64/ARM64, Linux x64/ARM64 and MacOS x64. You can build it for any platform supported by .Net 5 (it’s very easy).

Download

Download the latest release

Usage

!!! BACKUP YOUR FILES BEFORE USING THIS TOOL !!! I have used it on my own files but I cannot guarantee that it will work on yours.

Get a detailed help and list of options by running bezel-tools --help or bezel-tools [verb] --help.

Check overlays integrity

Simple check:

bezel-tools check --overlays-config samples/retroarch/overlays --roms-config samples/retroarch/roms

Check and fix when possible:

bezel-tools check --overlays-config samples/retroarch/overlays --roms-config samples/retroarch/roms --autofix --input-overlay-path /opt/retropie/configs/all/retroarch/overlay/ --template-overlay templates/overlay.cfg --template-rom templates/game.cfg

Exemple of debug output for bugged coordinates in conf:

And suggested coordinates from transparency (it can write them to the conf if you provide --autofix parameter):

Convert MAME bezels to RetroArch overlays

bezel-tools mtr --source path/to/mame/zips --output-roms output/roms --output-overlays output/overlay --template-game templates/game.cfg --template-overlay templates/overlay.cfg

Convert RetroArch overlays to MAME bezels

bezel-tools rtm --source-roms path/to/rom/files --source-configs path/to/config/files --output path/to/output --template templates/default.lay --zip

4 Likes

dang, that’s pretty awesome! thanks for making this and sharing it :smiley:

1 Like

New release: v2.0

New features

  • Checks the integrity of your RA overlays, and fixes them

Usage

!!! BACKUP YOUR FILES BEFORE USING THIS TOOL !!! I have used it on my own files but I cannot guarantee that it will work on yours.

Get a detailed help and list of options by running bezel-tools --help or bezel-tools [verb] --help.

Check overlays integrity

Simple check:

bezel-tools check --overlays-config samples/retroarch/overlays --roms-config samples/retroarch/roms

Check and fix when possible:

bezel-tools check --overlays-config samples/retroarch/overlays --roms-config samples/retroarch/roms --autofix --input-overlay-path /opt/retropie/configs/all/retroarch/overlay/ --template-overlay templates/overlay.cfg --template-rom templates/game.cfg

2 Likes

Once development settles down, we can probably put binary builds of this on the content downloader, if you like.

1 Like

Why not :slight_smile:

I have only tested it on my own overlays collection, though, so it probably has bugs that somebody with different overlays will encounter. I think it would be better to wait a bit for feedback (if there is any, lol)

1 Like

Yeah, good point. I’ll post about it in our discord server’s shaders/overlays section and try to get some eyes on it.

2 Likes

New release: v3.0

New feature: generates overlays directly from images.

bezel-tools generate --images samples/images --roms-configs samples/roms --template-overlay templates/overlay.cfg --template-rom templates/game.cfg

I’m done with what I want to do with this tool right now (for my own personal use) and I’ll move on to other projects.

Feel free to open an issue if you find a bug, or if you want another feature.

I want to generate “complete” overlays from MAME layouts (with background layers, etc) but it can get pretty complicated pretty fast, and I don’t need it personally right now, but if people want it, I can take some time to do it. I’m open to pull requests, and I welcome forks.

3 Likes

Thanks for taking the time to make this very useful tool and to share it with the community. I’ll try to get it up on the content downloader soon! :slight_smile:

1 Like

Thanks :slight_smile:

Have you posted it to your Discord? :slight_smile:

yes, sure did. I’m not sure if anyone has gotten to try it yet, though.

1 Like

@cosmo0 hello mate, I’m using your tool to convert MAME -> Retroarch and works well on Mac!!! Thanks for your work and your time!!!

Its really really easy to use and to have a converted overlay files!

I’ve extracted your tool to a folder called conversor, and I put in a new MAME folder with Artwork and Cfg folders. Later I’ve done a new folder called ‘converted’ where all files will be created as result of the procces. Structure like this.

- conversor
|- default files tool and other folders...
|- templates
|- Mame
   |- Artwork
      |- ffight.zip
   |-Cfg
      |-ffight.cfg
|- converted
   |- Artwork
      |- ffight.cfg
      |- ffight.png
   |-Cfg
      |-ffight.zip.cfg

This is my command to run it:

sudo ./bezel-tools mtr --source Mame/Artwork --output-roms converted/Cfg --output-overlays converted/Artwork --template-game templates/game.cfg --template-overlay templates/overlay.cfg

Sorry for my poor english. Great work again!!!

2 Likes

Thanks! :slight_smile: I’m glad it’s useful to someone else than me ^^

Please let me know if you find any bug :slight_smile:

1 Like

Man, I just wanted login to thank you for this work, . I will not be able to test it yet because I’m focused on other projects right now, but this tools basically will save me thousands of hours of manual work importing my mame overlays to RA, which is something I have on my to-do list.

I’ll try to give you feedback when I test it.

Thanks @cosmo0

2 Likes

Thanks! Let me know if it works for you, and if it doesn’t, what I can do to improve it :slight_smile:

Hi cosmo0 thanks for this tool it looks great

my screen resolution is 1600x1200

I’m trying to convert some mame bezels to retroarch.

sudo ./bezel-tools mtr --source /Users/tomplums/Documents/OVERLAYS/downloaded --output-roms /Users/tomplums/Documents/OVERLAYS/converted/cfg --output-overlays /Users/tomplums/Documents/OVERLAYS/converted/artwork --template-game /Users/tomplums/Documents/OVERLAYS/templates/game.cfg --template-overlay /Users/tomplums/Documents/OVERLAYS/templates/overlay.cfg --target-resolution 1600x1200

however the output files don’t seem quite right

puckman Extracting files from archive /Users/tomplums/Documents/OVERLAYS/downloaded/puckman.zip
puckman doesn't have a cfg file
puckman image: pacman_bezel_upright.png
puckman source screen: {"Center":{"X":1996,"Y":2121},"Height":2720,"Orientation":1,"Width":2040,"X":976,"Y":761}
puckman screen offset:
puckman target screen: {"Center":{"X":1996,"Y":2121},"Height":2720,"Orientation":1,"Width":2040,"X":976,"Y":761}
puckman processing image
puckman creating configs
puckman processing done
########## DONE ##########

have I got the correct command or are my source bezels causing a problem?

Can you provide me with the MAME bezel please so I can try on my side?

sure here are the bezels I’m testing:

https://mrdo.mameworld.info/artwork/puckman.zip https://mrdo.mameworld.info/artwork/mspacman.zip

New release: v3.2

Fixes two bugs during MAME to RA conversion when the bezel was resized.

Release MAME / Retroarch bezel / overlays tool · cosmo0/mame-retroarch-bezel-converter (github.com)

@mousemat86: it won’t completely fix your problem because the bezel packs you’re using are very complex: they have several variants with different sizes, and resizing/computing them properly is a pain.

You can use the --scan-bezel option to fix some issues, and you can use --output-debug to check if it works (like --output-debug tmp/debug).

2 Likes

thanks for investigating. I will take another look :pray:

Let me know how it goes!

At the very worst, you can extract the images you want from the MAME bezels, and then use the generate action:

bezel-tools generate --images samples/images --roms-configs samples/roms --template-overlay templates/overlay.cfg --template-rom templates/game.cfg

1 Like