Show: Today's Messages :: Show Polls :: Message Navigator |
Any better way to stop Mednafen from updating mednafen.cfg when passing settings via command line? [message #6873] | Tue, 11 April 2023 05:41 | |||
| ||||
I've been using Mednafen with a VR headset to play Virtual Boy games in 3D, so I've set up a batch file for launching Virtual Boy games via drag-and-drop. Since there's currently no way to manually load custom config files (as far as I can tell, at least - I couldn't find anything in the documentation), this batch file passes settings manually via command line arguments:%~dp0mednafen -vb.3dmode sidebyside -vb.sidebyside.separation 43 -vb.stretch 0 -vb.xscalefs 3 -vb.yscalefs 6 -video.fs 1 %1 However, it seems that Mednafen takes these arguments and updates mednafen.cfg with them. It makes the whole point of passing settings via command line kind of useless, and a real pain. I'm currently working around this issue by backing up the config to a backup folder ("cfgbak") before running Mednafen, and then restoring the config file after I'm done playing, like so: copy %~dp0mednafen.cfg %~dp0cfgbak %~dp0mednafen -vb.3dmode sidebyside -vb.sidebyside.separation 43 -vb.stretch 0 -vb.xscalefs 3 -vb.yscalefs 6 -video.fs 1 %1 pause copy %~dp0cfgbak\mednafen.cfg %~dp0 That said, there's a few solutions that would make this a lot better.
| ||||
|
Re: Any better way to stop Mednafen from updating mednafen.cfg when passing settings via command lin [message #6874 is a reply to message #6873 ] | Tue, 11 April 2023 14:03 | ||||
| |||||
Not manually load but per-system override configuration is possible. Just create a file named vb.cfg with your settings. This allows to override mednafen.cfg and it will not be written by Mednafen. See documentation.
I don't use Windows but... isn't it easier to set mednafen.cfg file as read-only? [Updated on: Tue, 11 April 2023 14:06] | |||||
|
Re: Any better way to stop Mednafen from updating mednafen.cfg when passing settings via command lin [message #6875 is a reply to message #6874 ] | Wed, 12 April 2023 06:31 | ||||||||
| |||||||||
I did see this, but unfortunately it doesn't fit my needs. I only need these custom settings for VR play, I have a different set of settings for normal use. And it turns out, using "vb.cfg" causes it to override any settings that I try to pass as command line arguments.
You'd think so, but no! This was the first thing I tried, and for whatever reason, Mednafen throws this error: Failed to load settings from "mednafen.cfg": Error opening file "mednafen.cfg": Permission denied [Updated on: Wed, 12 April 2023 20:10] | |||||||||
|
Re: Any better way to stop Mednafen from updating mednafen.cfg when passing settings via command lin [message #6876 is a reply to message #6873 ] | Wed, 12 April 2023 09:14 | ||||
| |||||
the suggestion of Amatcoder by using a per-console config is your solution. The per-console config do not touch your mednafen config. mednafen gives priority to per-game config, per-console config and at the and to main mednafen config. You need to create a vb.cfg and put this into it: vb.3dmode sidebyside vb.sidebyside.separation 43 vb.stretch 0 vb.xscalefs 3 vb.yscalefs 6 video.fs 1 All parameters not listed on custom config will be read from main mednafen.cfg. [Updated on: Wed, 12 April 2023 09:16] | |||||
|
Re: Any better way to stop Mednafen from updating mednafen.cfg when passing settings via command lin [message #6877 is a reply to message #6873 ] | Wed, 12 April 2023 10:02 | |||
| ||||
It seems that Lollie wants to play the same game with two different settings (one regular, other with VR headset) so a per-system or per-game config is not useful there. Additionally:
True . This was changed on 1.27.x version. From changelog: -- 1.27.0-UNSTABLE: -- [...] Open the main settings file for both reading+writing on startup instead of just reading, to allow file locking to work over NFS, and as a quick check to make sure the file is writeable before it's too late upon exit. So you are doomed to use a batch file or two instances of Mednafen in separate folders. [Updated on: Wed, 12 April 2023 10:06] | ||||
|
Re: Any better way to stop Mednafen from updating mednafen.cfg when passing settings via command lin [message #6878 is a reply to message #6877 ] | Wed, 12 April 2023 20:09 | |||
| ||||
Hah, good spotting, so read-only would've worked a few versions ago. Oh well, relying on a batch file isn't the end of the world, what I've set up is working for me. I was mostly curious to see if there was something I was overlooking! | ||||
|
Previous Topic: | New Version Planned? |
Next Topic: | Saturn debugging on mednafen |