RetroPie forum home
    • Recent
    • Tags
    • Popular
    • Home
    • Docs
    • Register
    • Login

    ReDirect - Solution for CUE/BIN Problem

    Scheduled Pinned Locked Moved Ideas and Development
    cue filesruncommandemulationstaionfrontend
    5 Posts 2 Posters 1.4k Views
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • hanoneH
      hanone
      last edited by mitu

      Hi Retro-Gaming Fans!

      imho is the display of cue/bin systems in frontends not solved.

      I configured hyperspin and retropie and the problem is the same:

      if you want to have showed all media for your roms, you have to place all files within the "ROM" folder.

      e.g.
      ROMS/file1.cue
      ROMS/file1.bin
      ROMS/file2.cue
      ROMS/file2.bin

      then system menu will show up all media (marquee, video and so on).

      If you want to keep your files sorted or some files have same names and can not exist in only one folder, you have the opinion for option2:

      path for files=../system/
      ROMS/file1/file1.cue
      ROMS/file1/core.bin
      ROMS/file2/file2.cue
      ROMS/file2/core.bin

      no media will be shown in the filelist.
      You have to enter the folder - then all media is displayed.

      I found a method to have both!
      Files keep on their place where they are belong.
      The menu shows all files with the correct media.

      The idea:
      I use 2 folders
      folder1=../system_redirect (contais all .cue files which can be empty dummies)
      folder2=../system (contains the original files in their folders)

      ../system_redirect/file1.cue
      ../system_redirect/file2.cue

      this folder should be set as file folder for emulationstation.

      My script does the following
      replaces the string "_redirect" with ""
      replace file_name with file_name/file_name

      example:
      ../system_redirect/file1.cue
      ../system_redirect/file2.cue

      ../system/file1/file1.cue
      ../system/file1/file1.bin
      ../system/file2/file2.cue
      ../system/file2/file2.bin

      INPUT: redirect.sh 0 SYS {system} "../system_redirect/file1.cue"
      OUTPUT: runcommand.sh 0 SYS {system} "../system/file1/file1.cue"

      The idea is to replace "runcommand.sh" in es_system.cfg with "redirect.sh" on cue-based files.

      (i read the code style guide and did my best to rename everything correct - please be patient - this is my first try)

      Hopefully someone can use this.

      #!/bin/bash
      # redirect.sh
      # 2019-04
      
      # $0=command
      # $1=0
      # $2=_SYS_
      # $3={system}
      # $4=file
      
      ARG0=$0
      ARG1=$1
      ARG2=$2
      ARG3=$3
      FILE_SRC=$4
      
      PATH_FIND="_Redirect"
      PATH_REPLACE=""
      DELIMITER_PATH="/"
      DELIMITER_EXT="."
      
      # check if arguments are empty
      if [ "${ARG1}" == "" ] || [ "${ARG2}" == "" ] || [ "${ARG3}"  == "" ] || [ "${FILE_SRC}" == "" ] ; then
          echo usage: ${ARG0} 0 _SYS_ [system] [file]
      else
      
          file_name_ext=$(basename "$FILE_SRC")
          file_name_only="${file_name_ext%.*}"
          file_ext="${file_name_ext##*.}"
          file_path="${FILE_SRC%/*}"
      
          file_dest="${file_path}${DELIMITER_PATH}${file_name_only}${DELIMITER_PATH}${file_name_only}${DELIMITER_EXT}${file_ext}"
          file_dest=$(echo $file_dest | sed -e "s/$PATH_FIND/$PATH_REPLACE/g")
      
          cmd_base="/opt/retropie/supplementary/runcommand/runcommand.sh "
      
          # starts runcommand with given parameters and replaced filename
          /bin/bash ${cmd_base} ${ARG1} ${ARG2} ${ARG3} "${file_dest}"
      fi
      mituM 1 Reply Last reply Reply Quote 0
      • mituM
        mitu Global Moderator @hanone
        last edited by

        @hanone said in ReDirect - Solution for CUE/BIN Problem:

        imho is the display of cue/bin systems in frontends not solved.

        What exactly do you mean by that ? Emulationstation will show only the .cue files, the .bin files are not shown for quite some time.

        1 Reply Last reply Reply Quote 0
        • hanoneH
          hanone
          last edited by

          Sorry for my weird explanation ;)

          I'll try it with another one.

          For system "psx" the roms are stored in:
          /home/pi/RetroPie/roms/psx/

          The path for e.g. Tomb Raider (USA) is

          /home/pi/RetroPie/roms/psx/Tomb Raider (USA)/Tomb Raider (USA).cue

          In case of Tomb Raider, the .bin file has the same name as the cue file, but other systems do not have only .bin files but have also .wav files with different names (e.g. "Track 01.wav").

          In es_systems.cfg you will select "home/pi/RetroPie/roms/psx/" for your roms folder.

          If you have cd/dvd roms stored in folders you will see a list of folders and have to enter the folder you like (e.g. "Tomb Raider (USA)" - and then select "Tomb Raider (USA)" again.

          If you have your cd/dvd roms stored in the psx folder, it will work, but you get a messed folder and your roms are not in original order. Other systems even don't allow to put all files in one folder, because many cd/dvd use same filenames llike "Track 01.wav".

          Therefore the script "ReDirect" fixes this problem.

          mituM 1 Reply Last reply Reply Quote 0
          • mituM
            mitu Global Moderator @hanone
            last edited by

            @hanone The problem appears only if you store your files in sub-folders, you can just as well copy the cue/bin files in the psx folder directly and you'll not have problems in Emulationstation - only the .cue file will be added to the playlist.

            hanoneH 1 Reply Last reply Reply Quote 0
            • hanoneH
              hanone @mitu
              last edited by

              @mitu Of cours, but then you mess up your rom set.

              On the other hand some systems or naming conventions use rom sets which have names which are not unique. (I don't find one at the moment, but i saw such discs)

              e.g.
              "<Game>.cue"
              "Track1.bin"
              "Track2.bin"

              1 Reply Last reply Reply Quote 0
              • First post
                Last post

              Contributions to the project are always appreciated, so if you would like to support us with a donation you can do so here.

              Hosting provided by Mythic-Beasts. See the Hosting Information page for more information.