libretro / mame

MAME - Multiple Arcade Machine Emulator
Other
62 stars 72 forks source link

Mame.ini rom path ignored if game is launched externally. #240

Open Bitwolfies opened 3 years ago

Bitwolfies commented 3 years ago

All mame.ini settings work if launched through say, launchbox, but the roms directory resets to where launchbox got its rom from. This would be fine if I didn't keep chds in a separate folder, and need to add both folders to the .ini. Can it be changed so that the mame.ini rom path is always loaded no matter what?

sonninnos commented 10 months ago

Is this still really needed?

MistyDreams commented 10 months ago

I still use this feature and it works fine on linux. You need to enable read configuration and have mame ini paths on in your options. Youll need to look at the source code where this mame ini path is set on the platform your using though.

https://github.com/libretro/mame/blob/b187489b66dff418d326ec2a49e04d1c67ef37a2/src/osd/libretro/retromain.cpp#L90C1-L100C1

linux and macosx have sane paths but the windows build uses the directory its launched from which is inline with standalone behaviour.

sonninnos commented 10 months ago

Is that INI_PATH even actually used anywhere, since I'm not seeing mentions of that Windows version path anywhere, not in launch log or in the created files under system.

Regardless, all platforms should use same paths under system in libretro version. And practically they do, since .;ini is the only thing that really should and could matter there. So those differences shouldn't prevent anything from working.

And if the option exists and works, then this can be closed.

MistyDreams commented 10 months ago

yes it is I use it for linux. I havent checked the actual code path of whats used since linux sets ~/.mame as the path anyway but the code here certainly add the functionality I require.

https://github.com/libretro/mame/blob/b187489b66dff418d326ec2a49e04d1c67ef37a2/src/osd/libretro/libretro-internal/retro_init.cpp#L514

its also referenced in the lua script

https://github.com/libretro/mame/blob/b187489b66dff418d326ec2a49e04d1c67ef37a2/scripts/src/osd/retro.lua#L22-L25

https://github.com/libretro/mame/blob/b187489b66dff418d326ec2a49e04d1c67ef37a2/scripts/src/osd/retro_cfg.lua#L17C1-L21

and finally it used here.

https://github.com/libretro/mame/blob/b187489b66dff418d326ec2a49e04d1c67ef37a2/src/osd/libretro/retromain.cpp#L115C18-L115C18

sonninnos commented 10 months ago

Ok so it is supposed to be the base default when normal launch does not set paths.

But it occured to me while outside defragging my brain, that the current INI_PATH mess is utterly wrong. . is the RA executable path, which isn't acceptable or usable in any case. And libretro shouldn't also search for any other paths outside of libretro paths. So it should be hardcoded to system/mame/ini in all cases.

MistyDreams commented 10 months ago

Thats simply not true people share there mame and and libretro configs that can co exist together. This option only activates when you select the core option for it and enable readconfig, else it uses the libretro paths set. It an option to share mame config windows is the only platform that would have issues since there is no sane homepath.

sonninnos commented 10 months ago

Makes no sense to me to mix same configs and access any "home" path stuff there. It is indeed completely useless in Windows at the moment, since nobody should put that stuff directly under RA dir.

Perhaps then the other platform dependent paths can be allowed to stay, but the common relative parts should be replaced with a direct and absolute libretro path.

MistyDreams commented 10 months ago

Well not everyone wants to put there chd roms and sw all in one directory. You can do what you like to be honest. I would just not use it I wont be moving all my roms , software and chd into one directory. Its a libretro core at the end of the day and I can use alternatives for my case use to be honest.

sonninnos commented 10 months ago

I don't get it, chds are read by default from a subdir named like the zip, not from the same dir. And how does one even set a different dir for chds..? Why make things more complicated than they need to be?

MistyDreams commented 10 months ago

currently that what we use mame ini for you just add the new directory to the rom path same for software list. Keeping your roms and chd updated in a torrent for example would delete the stuff not in the torrent. Also its sets up the base mame system for floppy sounds, crosshair, artwork, plugins ect. I do get its a libretro port so you can change as you see in fit.

Just realise there is people that do rely on case uses beyond your setup and it could put them off using the core. People including me will just need to deal with a new way of setting up or move on to something else that fits better. Im just putting a case use for the optional way to boot we currently have. Keep in mind you have to turn the mame ini option on to use it in the first place.

edit: to answer why its needed chds in there own directory wont find the bios since the they are in roms folder. If mame doesnt have both paths the failure happens.