### Author Topic: Relative paths problem for portable mode ?!  (Read 1957 times)

#### Sebiohazard

• Full Member
• Posts: 55
##### Relative paths problem for portable mode ?!
« on: August 20, 2021, 07:31:05 AM »
Hello everyone !

There is a great mystery that I would like to elucidate in Attract, I will explain this to you

For now I have two emulators one for the SNES & the other for the Radio Shack TRS-80 here are the configuration files for each of them:

For Snes9x:

Code: [Select]
`executable           emulators\snes9x\snes9x.exeargs                 -fullscreen "[romfilename]"rompath              ..\..\..\..\attract\games\snesromext               .smcexit_hotkey          Escapeartwork    boxart          menu-art\boxart\snesartwork    cartart         menu-art\cartart\snesartwork    marquee         menu-art\marqueeartwork    snap            menu-art\snap\snesartwork    wheel           menu-art\wheel\snes`
For TRS80GP:

Code: [Select]
`executable           emulators\trs80gp\trs80gp.exeargs                 -vf -d0 "[romfilename]"rompath              ..\..\games\trs-80romext               .dskexit_hotkey          Escapeartwork    boxart          menu-art\boxart\trs-80artwork    cartart         menu-art\cartart\trs-80artwork    marquee         menu-art\marqueeartwork    snap            menu-art\snap\trs-80artwork    wheel           menu-art\wheel\trs-80`
1. Why is the "games" directory not recognized like other directories ? Attract does not recognize newly created directories as relative path ?!

2. Why for the Snes9x emulator the relative path is ..\..\..\..\attract\games\snes & for the TRS80GP emulator the relative path is ..\..\games\trs-80 while the games are placed in the same place in the folder tree i.e. in attract\games\

3. How do I tell Attract the location of new directories created with the relative path ?!

Greetings !

#### progets

• Global Moderator
• Hero Member
• Posts: 1186
##### Re: Relative paths problem for portable mode ?!
« Reply #1 on: August 20, 2021, 08:14:23 PM »

What's you full SNES rompath?

What's you full TRS-80 rompath?

#### Sebiohazard

• Full Member
• Posts: 55
##### Re: Relative paths problem for portable mode ?!
« Reply #2 on: August 20, 2021, 10:23:33 PM »
Hello !

The full path for my SNES games is:

h:\Attract\games\snes

& the full path for my TRS-80 games is:

h:\Attract\games\trs-80

I would like to make a portable version of Attract Mode, how do I get the games folder to be recognized like the other folders (emulators or menu-art for example) ?

Greetings !

#### progets

• Global Moderator
• Hero Member
• Posts: 1186
##### Re: Relative paths problem for portable mode ?!
« Reply #3 on: August 20, 2021, 11:30:06 PM »
You didn't tell us the path to your attract-mode install. I'll assume it's h:\Attract based on the information you provided.

Try these to see if they work.

Code: [Select]
`rompath              games\snes`
Code: [Select]
`rompath              games\trs-80`
or

Code: [Select]
`rompath              .\games\snes`
Code: [Select]
`rompath              .\games\trs-80`
or

Code: [Select]
`rompath              \attract\games\snes`
Code: [Select]
`rompath              \atrract\games\trs-80`

#### Sebiohazard

• Full Member
• Posts: 55
##### Re: Relative paths problem for portable mode ?!
« Reply #4 on: August 21, 2021, 05:32:59 PM »
Hello !

I tried the solutions you offer unfortunately they do not work...

There must be a solution to make Attract Mode portable & place the root folder anywhere on the HDD ?!

Why are the other folders recognized in relative path ?! Example the " emulators " & " menu-art " folders
are recognized in relative path ?! How to make my " games " folder in relative path ?!

Greetings !

#### progets

• Global Moderator
• Hero Member
• Posts: 1186
##### Re: Relative paths problem for portable mode ?!
« Reply #5 on: August 21, 2021, 06:55:25 PM »
Tell us the full path to your attract.exe.

You can also run attract-console.exe to see what's going wrong.

#### Sebiohazard

• Full Member
• Posts: 55
##### Re: Relative paths problem for portable mode ?!
« Reply #6 on: August 21, 2021, 10:11:52 PM »
I do not understand your question

The full path is:

h:\Attract\attract.exe

The problem is that my USB drive letter might change if I connect another drive, that's why I want Attract to be in portable mode.

#### progets

• Global Moderator
• Hero Member
• Posts: 1186
##### Re: Relative paths problem for portable mode ?!
« Reply #7 on: August 21, 2021, 11:01:43 PM »
That was the answer I was looking for. Knowing this, each of the options above should have worked for you.

To troubleshoot your issue you should open the command line and run attract-console.exe and then try running your games. You can then see in the command line window what attract-mode is trying to do and what is going wrong.

You can also try running the games and look at (or post here) the contents of your h:\attract\last_run.log to see the issue.

#### zpaolo11x

• Hero Member
• Posts: 1087
##### Re: Relative paths problem for portable mode ?!
« Reply #8 on: August 22, 2021, 04:00:26 AM »
There’s something wrong in the relative paths: if attract.exe is in the H:/Attract/ folder and game ROMs are in the H:/Attract/games subfolders, the rom path should just be games/etc without the need to go up one level with ../ Unless the “up” portion is used to navigate up from the executable of the emulator, not of attract, but then you should ad ../ in the command line of the emulator launch, not of the romlist path

#### Sebiohazard

• Full Member
• Posts: 55
##### Re: Relative paths problem for portable mode ?!
« Reply #9 on: August 22, 2021, 03:34:40 PM »
There’s something wrong in the relative paths: if attract.exe is in the H:/Attract/ folder and game ROMs are in the H:/Attract/games subfolders, the rom path should just be games/etc without the need to go up one level with ../ Unless the “up” portion is used to navigate up from the executable of the emulator, not of attract, but then you should ad ../ in the command line of the emulator launch, not of the romlist path

Hello yes I think there is a bug in Attract Mode because I repeat it the folders that are originally present in Attract are recognized with the relative path but not the folders that are newly created !!!

It is for this reason that I ask you how to indicate to Attract the new created folders ?! There must be a setting file to edit & indicated in it the new created folders ?!

Greetings !
« Last Edit: August 22, 2021, 03:36:14 PM by Sebiohazard »

#### mentat

• Newbie
• Posts: 9
##### Re: Relative paths problem for portable mode ?!
« Reply #10 on: August 23, 2021, 04:49:27 AM »
Hello.

I use attract mode in portable way (with an extern usb harddrive) like you.
I use the \$PROGDIR (which does not work under OSX it seems) to start from attract mode directory.

If you have all yours directory under the attract mode directory, I think you can use :
\$PROGDIR/games/snes for example.

Best regards

#### progets

• Global Moderator
• Hero Member
• Posts: 1186
##### Re: Relative paths problem for portable mode ?!
« Reply #11 on: August 23, 2021, 11:44:14 PM »
There is no bug.

\$PROGDIR is a Linux variable so it's not going to help you.

Your syntax or paths in the emulator.cfg file are incorrect.

Try running the games that don't work and then post the contents of your h:\attract\last_run.log file here.
« Last Edit: August 23, 2021, 11:46:23 PM by progets »

#### Sebiohazard

• Full Member
• Posts: 55
##### Re: Relative paths problem for portable mode ?!
« Reply #12 on: August 24, 2021, 06:32:09 AM »
Your syntax or paths in the emulator.cfg file are incorrect.

I'm sorry but my arguments are perfectly correct since I can run my games from command line with the Windows console (CMD) so it's Attract that has a bug !!!
« Last Edit: August 24, 2021, 07:19:09 AM by Sebiohazard »

#### dmmarti

• Full Member
• Posts: 90
##### Re: Relative paths problem for portable mode ?!
« Reply #13 on: August 24, 2021, 08:20:47 AM »
I'm guessing you also have your emulators located here:

h:\Attract\emulators\emulators\snes9x

Have you tried this version of the line?

executable           emulators\snes9x\snes9x.exe
args                 -fullscreen "[romfilename]"
rompath              ..\games\snes

I haven't seen mention of the rompath line above yet (with 2 dots and the \ in it) .. so see if that works.

==========

I can say that relative paths DO work great on a Windows PC as that's what I use.  However, my HDD looks like this:

H:\Attract
H:\Emulators
H:\Roms

and I use relative paths in all of my AM emulator.cfg files for both emulators and rom folder locations.

Here's my SNES emulators.cfg file:

executable           ..\..\Emulators\RetroArch\retroarch.exe
args                 -L cores\snes9x_libretro.dll "[romfilename]"
rompath              ..\..\Roms\snes\

To me, it seems that the AM emulator.cfg files "starting location" is the directory which the emulator.cfg files reside in.  In my case its "H:\Attract\emulators" .. so going up 2 directories is "H:" and then navigating down 2 directories to "H:\Roms\snes" works.

#### Sebiohazard

• Full Member
• Posts: 55
##### Re: Relative paths problem for portable mode ?!
« Reply #14 on: August 24, 2021, 11:22:34 AM »
I finally have the incomplete solution but we are moving forward !!!

Here are my config files for the SNES:

Code: [Select]
`executable           emulators\snes9x\snes9x.exeargs                 -fullscreen "[romfilename]"rompath              \attract\games\snesromext               .smcexit_hotkey          Escapeartwork    boxart          menu-art\boxart\snesartwork    cartart         menu-art\cartart\snesartwork    marquee         menu-art\marqueeartwork    snap            menu-art\snap\snesartwork    wheel           menu-art\wheel\snes`
& the one for the TRS-80:

Code: [Select]
`executable           emulators\trs80gp\trs80gp.exeargs                 -vf -d0 "[romfilename]"rompath              \attract\games\trs-80romext               .dskexit_hotkey          Escapeartwork    boxart          menu-art\boxart\trs-80artwork    cartart         menu-art\cartart\trs-80artwork    marquee         menu-art\marqueeartwork    snap            menu-art\snap\trs-80artwork    wheel           menu-art\wheel\trs-80`
It works but if we change the name of the root folder (Attract) it will break the path & nothing will work anymore! So this is a partial solution it is not yet a real portable mode !!!

Greetings !