mickelson / attract

A graphical front-end for command line emulators that hides the underlying operating system and is intended to be controlled with a joystick or gamepad.
http://attractmode.org
GNU General Public License v3.0
393 stars 113 forks source link

Support roms in subdirectories #737

Closed spilinek closed 1 year ago

spilinek commented 1 year ago

Allows use of [name] in rompath. This is necessary when using subdirectories and multiple extensions are in use. I tried using \

extension, but this would only allow use of one extension. For example it would work with .cue, but I couldn't also use .m3u for multi-disc games.

This submission will replace [name] with the romname in the path. I added logging before and after to confirm the substitution.

First here's relevant lines from emulator file:

executable           retroarch
args                 --fullscreen -L mednafen_psx_libretro.so "[romfilename]"
rompath              $HOME/roms/psx/[name]

Console output when launch .cue with logging:

Path Before: /home/user/roms/psx/[name]/
Path After: /home/user/roms/psx/Adventures of Lomax, The (USA)/
*** Running: retroarch --fullscreen -L mednafen_psx_libretro.so "/home/user/roms/psx/Adventures of Lomax, The (USA)/Adventures of Lomax, The (USA).cue"

Console output when launch .m3u with logging:

Path Before: /home/user/roms/psx/[name]/
Path After: /home/user/roms/psx/Final Fantasy IX (USA)/
*** Running: retroarch --fullscreen -L mednafen_psx_libretro.so "/home/user/roms/psx/Final Fantasy IX (USA)/Final Fantasy IX (USA).m3u"

I know I'm not the only one to run into this issue. This was also discussed on the forum

mickelson commented 1 year ago

Thanks!