Author Topic: Rom complete file name and path  (Read 180 times)

zpaolo11x

  • Hero Member
  • *****
  • Posts: 919
    • View Profile
    • My deviantart page
Rom complete file name and path
« on: August 21, 2020, 07:15:15 AM »
Is there a way to get the complete name of a rom file? In the romlist it seems only the filename without extension is present, so I'm wondering how does Attract Mode pass the filename parameter to the emulator?
Also is it possible to get somewhere the rom containing folder? Or maybe the only option is to parse the emulator configuration file?

In the and why I ask this? I'm playing with GB roms lately and there's a lot of them I don't need. It would be great to have a "kill button" that can remove the rom from the drive, directly from Attract Mode interface (in a proper layout of course). Adding a "hidden" tag would be a nice workaround... but the joy of deleting files from the layout hmm that has no price!

rand0m

  • Sr. Member
  • ****
  • Posts: 328
    • View Profile
Re: Rom complete file name and path
« Reply #1 on: August 22, 2020, 03:40:04 AM »
[name].[romext] would get you the complete name. You can use [rompath] for rom location.

As for deleting roms, all linked data (snaps, overviews etc) should also be removed ideally. I don't think that is possible atm but you can do something like create a text list of items you want removed (pressing the func button would list the game in text list) and use that list for easy removal.

If you only want to hide an item you can add a "#" in start of game line on romlist that would be the easiest way but would require manual removal of game + linked items.

hermine.potter

  • Hero Member
  • *****
  • Posts: 579
    • View Profile
Re: Rom complete file name and path
« Reply #2 on: August 22, 2020, 04:07:30 AM »
>romfile name, extension and so on:
have a look to your emulators list: your_AM_folder\emulators\your_emulator.txt

you can use these parameters as arguments:

C:\attract\EMU\Gameboy2\Roms\MyGame.gb

[rompath]\[name][romext]    =>    C:\attract\EMU\Gameboy2\Roms\MyGame.gb
[rompath]\     =>      C:\attract\EMU\Gameboy2\Roms\
[name]     =>     MyGame
[romext]     =>     .gb

>hidden tag:
-using filter
-tagging favourites

>deleting romfiles within AM:
different ideas here
+ use AM-Plugin UtilityMenu to start .nut file from there

Another approach:
-create an "emulator" that use delete command:
executable           cmd
args                 /c del /F /Q "[rompath]\[name][romext]"
rompath              C:\attract\EMU\Gameboy2\Roms
romext               .gb

or with working dir
executable           cmd
args                 /c del /F /Q "[name][romext]"
workdir              C:\attract\EMU\Gameboy2\Roms
rompath              C:\attract\EMU\Gameboy2\Roms
romext               .gb
AM Version : 2.6.1
Input : Mad Catz Brawlstick; Mouse; Keyboard; Xbox360 Wireless
Cabinet : Yes
OS : Windows10 Pro
System : Dell Precision T3500 ; Intel X5650 ; 12GB RAM

zpaolo11x

  • Hero Member
  • *****
  • Posts: 919
    • View Profile
    • My deviantart page
Re: Rom complete file name and path
« Reply #3 on: August 25, 2020, 03:22:19 AM »
[name].[romext] would get you the complete name. You can use [rompath] for rom location.

Interesting, these magic tokens are not documented here: https://github.com/mickelson/attract/blob/master/Layouts.md#magic , do you know if they work also as fe.get_info arguments? I'll check it out.

You are right, one should alter the romlist to make this work better, but I think I'll go a different route: I'll add an "hidden" tag in the tags menu, so one can hide the roms he doesn't need. By default the layout will not show hidden roms, but there'll be a menu for showing hidden files (maybe with a graphical difference like semi-transparent). The menu will have an option to "purge" hidden rom files, and after purging it will suggest to rebuild the romlist.

I personally don't need to purge the linked data too, because I have complete sets of snaps and artwork that are not related to the roms I actually have, so I won't touch them.