@Substring
Ok, the MAME XML 
Let see how i handle multiple resolutions by emulator.
Sorry, i don't use Configgen.
Emulator :
Few games :
- R-Type (rtype.zip) : 384x256x55Hz
- After Burner II (aburner2.zip) : 320x224x60Hz
- Golden Axe (goldnaxe.zip) : 320x224x60Hz
- Caveman Ninja (cninja.zip) : 320x240x60Hz
I use 4 resolutions (more come soon) :
1920 1 48 192 240 248 1 3 10 6 0 0 0 60 0 38400000 1 For fullscreen 224p at 60Hz games.
1888 1 48 184 232 278 1 3 10 6 0 0 0 55 0 38400000 1 For fullscreen 256p at 55Hz games.
960 1 24 96 120 248 1 3 10 6 0 0 0 60 0 19200000 1 For all others games which are not in databases (just for try games).
480 1 14 45 56 300 1 10 5 5 0 0 0 60 0 9600000 1 For EmulationStation.
In datadases, i have referenced 2 games :
[aburner2.zip] to use 224p x 60Hz
[rtype.zip] to use 256p x 55Hz
From emulationstation/MAME, i have :
After Burner II
Caveman Ninja
Golden Axe
R-Type
If i choose After Burner, the game is launching in fullscreen 224p 60Hz with "retroarchcustom.cfg" AND 224-60.cfg (for adapted viewport of all 240p games)
If i choose R-Type, the game is launching in fullscreen 256p 55Hz with "retroarchcustom.cfg" AND 256-55.cfg (for adapted viewport of all 256p games)
If i choose Golden Axe, the game is launching in a 960x240x60Hs screen with "retroarchcustom.cfg" AND standart.cfg (small viewport to try games) because is not in database
If i choose Caveman Ninja, the game is launching in a 960x240x60Hs screen with "retroarchcustom.cfg" AND standart.cfg (small viewport to try games) because is not in database
I think is the perfect way to handle multiple resolutions per core.
It works great
The databases is a file named "resolution.cfg" in recalbox/share/roms/mame/ folder
In this file there's :
declare -A mame_games
#320x224x60Hz
mame_games[aburner2.zip]="224-60"
mame_games[goldnaxe.zip]="224-60"
mame_games[shinobi.zip]="224-60
...
#384x256x55Hz
mame_games[rtype.zip]="256-55"
...
It's very easy to add game to resolution.
CODE :
| . /recalbox/share/roms/mame/resolutions.cfg |
| |
| |
| if [[ "$emulator" == "mame" ]]; then |
| |
| if [[ -n ${mame_games[$filename]} ]]; then |
| |
| if [[ ${mame_games[$filename]} == "224-60" ]]; then |
| vcgencmd hdmi_timings 1920 1 48 192 240 248 1 3 10 6 0 0 0 60 0 38400000 1 |
| tvservice -e "DMT 87" |
| fbset -depth 8 && fbset -depth 16 |
| retroarch -L /usr/lib/libretro/mame078_libretro.so --config /recalbox/share/system/configs/retroarch/retroarchcustom.cfg --appendconfig /recalbox/share/system/configs/retroarch/resolutions/${mame_games[$filename]}.cfg $1 |
| elif [[ ${mame_games[$filename]} == "256-55" ]]; then |
| vcgencmd hdmi_timings 1888 1 48 184 232 278 1 3 10 6 0 0 0 55 0 38400000 1 |
| tvservice -e "DMT 87" |
| fbset -depth 8 && fbset -depth 16 |
| retroarch -L /usr/lib/libretro/mame078_libretro.so --config /recalbox/share/system/configs/retroarch/retroarchcustom.cfg --appendconfig /recalbox/share/system/configs/retroarch/resolutions/${mame_games[$filename]}.cfg $1 |
| fi |
| else |
| vcgencmd hdmi_timings 960 1 24 96 120 248 1 3 10 6 0 0 0 60 0 19200000 1 |
| tvservice -e "DMT 87" |
| fbset -depth 8 && fbset -depth 16 |
| retroarch -L /usr/lib/libretro/mame078_libretro.so --config /recalbox/share/system/configs/retroarch/retroarchcustom.cfg --appendconfig /recalbox/share/system/configs/retroarch/resolutions/standart.cfg $1 |
| fi |
| |
| vcgencmd hdmi_timings 480 1 14 45 56 300 1 10 5 5 0 0 0 60 0 9600000 1 |
| tvservice -e "DMT 87" |
| fbset -depth 8 && fbset -depth 16 |
| |
| fi |
Of course, it can (will) be optimised...