no way to compare when less than two revisions

Differences

This shows you the differences between two versions of the page.


Previous revision
Next revision
fuss:retroarch [2020/11/04 13:12] office
Line 1: Line 1:
 +====== Fixing Fast and Uncontrollable Menu Behaviour ======
 +
 +In case the menu seems to scoll uncontrollably or very sensitive then most likely vsync has been turned off. To fix this issue, navigate the menu ''Settings->Frame Throttle'' and set the ''Frame Time Counter'' to ''1.0x''.
 +
 +====== Assigning a Default Core to all ROMs within a Playlist ======
 +
 +Some reasons for collecting ROM sets for various different versions of the same libretro emulation core would be:
 +  * emulation cores such as MAME have versions that match specific ROM sets; for example, latest FinalBurn Neo releases are entirely synchronized to particular ROM sets,
 +  * netplay will only work in case both players have the same matching ROM and the same matching core
 +
 +For example, a MAME ROM collection might end up looking like a collection of folders containing ROMs meant to be ran by different libretro emulation cores:
 +<code>
 +/storage/external/MAME/0.37b/...
 +/storage/external/MAME/2003+/...
 +/storage/external/MAME/FBA 0.2.97.42
 +</code>
 +
 +where each path contains the ROM set version that is supposed to work with a certain MAME core version.
 +
 +Unfortunately, when scanning ''/storage/external/MAME'' for ROMs, retroarch generates playlists where the ''core_name'' and ''core_path'' is set to DETECT. When a player selects the ROM and attempts to play it, retroarch might ask with which core retroarch should run the ROM with. A player might not know the best version of the core to run the ROM with such that the player would end up selecting an ad-hoc core.
 +
 +The following script traverses a previously generated playlist and attempts to set the "core_name" and "core_path" based on the names of folders containing ROM collections. A new playlist is then generated with each ROM mapped to the core corresponding to the ROM set version.
 +
 +<file bash coreMapper.sh>
 +#!/bin/bash
 +###########################################################################
 +##  Copyright (C) Wizardry and Steamworks 2020 - License: GNU GPLv3      ##
 +##  Please see: http://www.gnu.org/licenses/gpl.html for legal details,  ##
 +##  rights of fair usage, the disclaimer and warranty conditions.        ##
 +###########################################################################
 +## The following is a short script meant to read a retroarch playlist    ##
 +## and assign a default core for all ROMs previously scanned.            ##
 +###########################################################################
 +## The script works on the principle that certain roms within ROM sets   ##
 +## (ie: Goodset, No-Intro or MAME ROMs) work best with a specific core   ##
 +## or core version and it is mostly impossible for retroarch to guess    ##
 +## what core variant a certain ROM works with.                           ##
 +##                                                                       ##
 +## A playlist generated by retroarch may contain set the "core_path" and ##
 +## "core_name" to "DETECT", indicating that the ROM will be ran with the ##
 +## best-guess core that retroarch can find. Then, assuming, for example, ##
 +## multiple MAME ROM sets stored on the drive in separate folders such   ##
 +## as 2003+, 0.37b5 or FBA 0.2.97.42, this script can be used to set the ##
 +## "core_path" parameter to the core matching the folder names.          ##
 +###########################################################################
 +## Requirements:                                                         ##
 +##   * jq                                                                ##
 +##   * Bourne Shell (pure POSIX will not work, ie: dash)                 ##
 +## Example invocation:                                                   ##
 +##    $ cat MAME.lpl | ./coreMapper.sh >> MAME_mapped.lpl                ##
 +###########################################################################
 +
 +###########################################################################
 +##                            CONFIGURATION                              ##
 +###########################################################################
 +
 +# An array containing parts of paths in a retroarch playlist for which
 +# cores should be assigned. 
 +PATH_MATCH=(
 +    "2003+"
 +    "FBA 0.2.97.42"
 +    "0.37b5"
 +)
 +
 +# A list of retroarch cores matching the path parts that must be set.
 +ASSIGNED_CORE=(
 +    "/tmp/cores/mame2003_plus_libretro.so"
 +    "/tmp/cores/fbneo_libretro.so"
 +    "/tmp/cores/mame2003_plus_libretro.so"
 +)
 +
 +ASSIGNED_CORE_NAME=(
 +    "MAME 2003-Plus"
 +    "FinalBurn Neo"
 +    "MAME 2000 (0.37b5)"
 +)
 +
 +# Set the jq binary that should be used (default: jq-win64.exe for Windows)
 +JQ="jq-win64.exe"
 +
 +###########################################################################
 +##                              INTERNALS                                ##
 +###########################################################################
 +
 +# Grab STDIN (pine input)
 +INPUT="$(< /dev/stdin)"
 +
 +# Split indices using IFS (without other tools).
 +OIFS=$IFS
 +IFS=" "
 +INDICES=${!PATH_MATCH[*]}
 +IFS=$OIFS
 +
 +# Perform all core substitutions based on the matching path part.
 +JSON=$INPUT
 +for i in $INDICES; do
 +    MATCH="${PATH_MATCH[$i]}"
 +    CORE="${ASSIGNED_CORE[$i]}"
 +    NAME="${ASSIGNED_CORE_NAME[$i]}"
 +    # Variable overloading without storing intermediary partial results.
 +    IFS="{}"
 +    read -d '' JSON <<< $(printf '%s' "$JSON" | \
 +        $JQ "
 +            walk(
 +                if type == \"object\" and (.path | type == \"string\" and contains (\""$MATCH"\"))
 +                then 
 +                    (.core_path |= \""$CORE\"" | .core_name |= \""$NAME\"")
 +                else 
 +                    . 
 +                end
 +            )")
 +    IFS=$OIFS
 +done
 +
 +# Pretty print JSON result.
 +echo $JSON | $JQ .
 +
 +</file>
 +
 +In order to use the script, edit the variables under the ''CONFIGURATION'' header within the script, retrieve a retroarch generated playlist from ''~/playlist'' (ie: ''MAME.lpl'') and pass the playlist through the script, ie:
 +<code bash>
 +cat MAME.lpl | ./coreMapper.sh
 +</code>
  

fuss/retroarch.txt · Last modified: 2023/12/31 15:50 by office

Access website using Tor Access website using i2p Wizardry and Steamworks PGP Key


For the contact, copyright, license, warranty and privacy terms for the usage of this website please see the contact, license, privacy, copyright.