DirtBagXon
Batocera is quite different from RetroPie, let me share some of their implementation constraints:
Parsed from /usr/lib/python3.9/site-packages/configgen/batoceraFiles.py
HOME = ‘/userdata/system’
CONF = HOME + ‘/configs’
SAVES = ‘/userdata/saves’
ROMS = ‘/userdata/roms’
daphneConfig = CONF + ‘/daphne/hypinput.ini’
daphneHomedir = ROMS + ‘/daphne’
daphneDatadir = ‘/usr/share/daphne’
daphneSaves = SAVES + ‘/daphne’
Batocera has the folders “fonts”, “pics” and “sound” in /usr/share/daphne . As I was missing some “pics” (testing with Singe 1 version of MadDog) and I didn’t want to add them to /usr/share/daphne I added my own “fonts”, “pics” and “sound” to /userdata/roms/daphne/singegames and ignored -datadir completely in the generator.
I had to symlink /userdata/roms/daphne/singe to /userdata/roms/daphne/singegames, and to symlink /userdata/roms/daphne/singegames/maddog to /userdata/roms/daphne/maddog.daphne. The parameter -retropath is not yet supported by the included Hypseus version. I had to create the singegames folder to avoid Emulationstation going in an infinite loop of finding .daphne files if /userdata/roms/daphne/singe was symlinked to /userdata/roms/daphne . So the folder “singegames” contains the folders “fonts”, “pics” and “sound” and the symlinks e.g. “maddog” to the .daphne folder in /userdata/roms/daphne , avoiding the ES loops.
This code works, but I still need to adjust the controls.
/usr/lib/python3.9/site-packages/configgen/batoceraFiles.py
#!/usr/bin/env python
import Command
import batoceraFiles
from generators.Generator import Generator
import shutil
import os
from . import daphneControllers
class DaphneGenerator(Generator):
# Main entry of the module
def generate(self, system, rom, playersControllers, gameResolution):
if not os.path.exists(os.path.dirname(batoceraFiles.daphneConfig)):
os.makedirs(os.path.dirname(batoceraFiles.daphneConfig))
# controllers
daphneControllers.generateControllerConfig(batoceraFiles.daphneConfig, playersControllers)
# extension used .daphne and the file to start the game is in the folder .daphne with the extension .txt
romName = os.path.splitext(os.path.basename(rom))[0]
frameFile = rom + "/" + romName + ".txt"
commandsFile = rom + "/" + romName + ".commands"
singeFile = rom + "/" + romName + ".singe"
singeHome = batoceraFiles.daphneHomedir + "/singegames"
if os.path.isfile(singeFile):
commandArray = [batoceraFiles.batoceraBins[system.config['emulator']],
"singe", "vldp", "-framefile", frameFile, "-script", singeFile,
"-x", str(gameResolution["width"]), "-y", str(gameResolution["height"]), "-fullscreen",
"-fastboot", "-homedir", singeHome, "-datadir", singeHome]
elif system.config["ratio"] == "16/9":
commandArray = [batoceraFiles.batoceraBins[system.config['emulator']],
romName, "vldp", "-framefile", frameFile, "-useoverlaysb", "2", "-ignore_aspect_ratio",
"-x", str(gameResolution["width"]), "-y", str(gameResolution["height"]), "-fullscreen",
"-fastboot", "-datadir", batoceraFiles.daphneDatadir, "-homedir", batoceraFiles.daphneHomedir]
else:
commandArray = [batoceraFiles.batoceraBins[system.config['emulator']],
romName, "vldp", "-framefile", frameFile, "-useoverlaysb", "2", "-fullscreen",
"-fastboot", "-datadir", batoceraFiles.daphneDatadir, "-homedir", batoceraFiles.daphneHomedir]
# The folder may have a file with the game name and .commands with extra arguments to run the game.
if os.path.isfile(commandsFile):
commandArray.extend(open(commandsFile,'r').read().split())
return Command.Command(array=commandArray)
This is the current command line as Hypseus sees it ( /userdata/system/logs/es_launch_stdout.log)
[version] Hypseus Singe: batocera
[console] Setting screen width to 1280
[console] Setting screen height to 720
2021-08-18 14:54:15.785 INFO [2862] [reset_logfile@321] Version batocera
2021-08-18 14:54:15.785 INFO [2862] [reset_logfile@325] Command line: /usr/bin/hypseus singe vldp -framefile /userdata/roms/daphne/spacepirates.daphne/spacepirates.txt -script /userdata/roms/daphne/spacepirates.daphne/spacepirates.singe -x 1280 -y 720 -fullscreen -fastboot -homedir /userdata/roms/daphne/singegames -datadir /userdata/roms/daphne/singegames
2021-08-18 14:54:15.785 INFO [2862] [reset_logfile@326] CPU : UnknownCPU || Mem : 3328 megs
2021-08-18 14:54:15.785 INFO [2862] [reset_logfile@327] OS : Linux 5.10 || Video : Unknown video
2021-08-18 14:54:15.785 INFO [2862] [reset_logfile@328] RGB2YUV Function: C
2021-08-18 14:54:15.785 INFO [2862] [reset_logfile@334] Line Blending Function: C
2021-08-18 14:54:15.785 INFO [2862] [reset_logfile@341] Audio Mixing Function: C
2021-08-18 14:54:17.150 INFO [2862] [ldp_vldp::read_frame_conversions@1037] Framefile parse succeeded. Video/Audio directory is: /userdata/roms/daphne/spacepirates.daphne/./
2021-08-18 14:54:17.171 INFO [2862] [printline@96] Starting Singe version 1.20
2021-08-18 14:54:17.481 INFO [2862] [printline@96] SINGE: Overlay drawn to 320 x 240
2021-08-18 14:54:21.195 INFO [2862] [printline@96] SINGE: Playing CDROM version 1.0b