After spending a lot of time trying to get a dual screen/dynamic marquee set up on the x86 architecture (failed)
and setting up an x86 to raspberry pi dual computer / dual screen setup (mostly successful)
i was finally able to get my hands on a pi4 and getting the dynamic marquee to work was actually fairly easy so i thought i would share my method here in case anyone else was interested.
my criteria for doing this was to get it to work with a standard install without having to add any special additional software or recompile batocera, etc. luckily batocera comes with everything needed to make this work
This setup assumes that you have only a pi4, with batocera installed. you will connect both monitors to the same pi4 (which has dual HDMI outputs)
please keep in mind that i am not a programmer so my scripts are probably sloppy and can use some improvement, but that is why i am posting it here in the hopes that others find it and improve on it
there are 3 scripts that are used to make this work
- marquee.sh - this is created and placed in the root of the userdata folder and is called by all of the scripts below based on which event is happening.
- system.sh - this is called from the emulationstation system-selected folder and is used to change the marquee to match whatever system you are hovering over
- game.sh - this is called from the emulationstation game-selected folder and will match the marquee to whichever game you are hovering over
- script.sh - this is called from batocera on game start and will trigger a game start/end event to handle what displays on the marquee (video, high res image, low res image, or wheel image)
please note that the marquee image files and videos i either found online or found in a romset that i downloaded for a hyperspin install which had a bunch of artwork already installed. I am fairly sure that batocera themes already have much of this artwork somewhere on my SD card, but i couldn’t find where it was so i decided to use my own art files which may be of higher quality.
this is the directory structure i used for the artwork which i decided to create in a “Marquee” folder inside of my roms directory as it suited my personal purposes:
these are all relative to the roms folder:
Marquee contains the default lower resolution marquee
hires contains higher resolution marquee files if available
systems contains images for each console/system if available
wheel contains basic images for games - pulled from the hyperspin wheel artwork that i had
videos contains several hundred custom videos i found online
so for the artwork, it would be
/userdata/roms/Marquee/
/userdata/roms/Marquee/hires
/userdata/roms/Marquee/systems
/userdata/roms/Marquee/wheel
/userdata/roms/Marquee/videos
additionally, (for the hyperspin files that i had) each system inside of the roms folder would have wheel/marquee artwork in an “images” folder
for example:
/userdata/roms/mame/images/
/userdata/roms/3do/images/
etc
here is the breakdown of how the scripts work:
all scripts use fbv, a frambuffer viewer already included in batocera to display the image to the frambuffer and ffmpeg to play videos directly to the framebuffer (if applicable)
- on system selected (when hovering over each system), the emulationstation “system-selected” script checks the “systems” folder for the corresponding system name image file and uses FBV to display it full screen on the marquee
- on game selected (when hovering over each game in the menu) the emulationstation “game-selected” script checks for marquee folder and looks for a higher resolution image in the hires folder and uses fbv to display the image on the marquee. if the hires image is not found, it then checks the root of the marquee folder for the standard lower resolution image and if that is not found it defaults to a generic “mame.png” marquee that i put in the folder as a default. (please keep in mind that this is all mame specific, but there is some code to handle other systems that i will explain later)
3) on game start (when a game is selected and launched to play) the batocera script runs and passes the game name to the “marquee” script which first checks the video folder for any videos that match and uses ffmpeg to play the video. after the video plays (or if no video is found) it searches through the folders looking for the matching marquee and displays it.
all of this worked fine for mame, but all of the other systems don’t have marquee files as they were console games. in this case i was able to pull a “marquee” artwork from each systems images folder (again this was a hyperspin romset to it is likely that this artwork stems from there). these images are not much more than a fancy “wheel” text, but it serves the purpose and looks pretty cool.
I will post a video once i get everything installed properly in my cabinet, and i can post a link to a download of all the images if someone can recommend a good place to upload them to that is free and reliable.
here are the scripts as i have them written so far
game.sh (located in /userdata/system/configs/emulationstation/scripts/game-selected/
#!/bin/bash
System=$1 #system name
Romname=${2%.*} #romname
rom=${Romname##*/}
/userdata/marquee.sh Gameselected $System "$rom"
system.sh (located in /userdata/system/configs/emulationstation/scripts/system-selected/)
#!/bin/bash
System=$1 #System name
/userdata/marquee.sh Systemselected $System &
marquee.sh (located in /userdata/)
#!/bin/bash
case $1 in
Start)
Romname=$3
Gamepath=$2
marqueeimage=$Gamepath/images/$Romname-marquee.png
if [ -f "/userdata/roms/Marquee/videos/$Romname.mp4" ]
then
ffmpeg -i /userdata/roms/Marquee/videos/$Romname.mp4 -vf scale=1280:720 -sws_flags bilinear -pix_fmt rgb565le -f fbdev /dev/fb0
fi
if [ -f "/userdata/roms/Marquee/hires/$Romname.jpg" ]
then
fbv /userdata/roms/Marquee/hires/$Romname.jpg -fer
elif [ -f "$marqueeimage" ]
then
fbv $marqueeimage -fer
else
fbv /userdata/roms/mame/images/mame.png -fer
fi
;;
Gameselected)
System=$2 #system name
Romname=$3 #romname
if [ -f "/userdata/roms/Marquee/$Romname.png" ]
then
fbv /userdata/roms/Marquee/$Romname.png -fer
elif [ -f "/userdata/roms/$System/images/$Romname-marquee.png" ]
then
fbv "/userdata/roms/$System/images/$Romname-marquee.png" -fer
else
fbv /userdata/roms/Marquee/mame.png -fer
fi
;;
Systemselected)
imagepath="/userdata/roms/sysimages/$2"
if [ -f "$imagepath.png" ]
then
fbv "$imagepath.png" -fer
else
fbv /userdata/roms/mame/images/mame.png -fer
fi
;;
esac
script.sh (located in /userdata/system/scripts/)
#!/bin/bash
case $1 in
gameStart)
gamepath=${5%/*}
romname=${5##*/}
/userdata/marquee.sh Start $gamepath ${romname%.*} &
;;
gameStop)
killall ffmpeg
;;
esac