mamedev / mame

MAME
https://www.mamedev.org/
Other
7.89k stars 1.97k forks source link

UI ignores "-snapname" string stored in .ini files, only outputs default "%g/%i" UNLESS "-ui" is set to "simple" #11312

Open ghost opened 1 year ago

ghost commented 1 year ago

MAME version

0.255

System information

Windows 10 Home, 64-bit, version 22H2, USA, US English Installed RAM 8.00 GB AMD A6-5200 APU with Radeon(TM) HD Graphics 2.00 GHz

INI configuration details

mame -cc

Emulated system/software

UI only, commandline is not affected

Incorrect behaviour

Mame when run from the UI (double-click the exe) will only output snapshots to a directory matching the built-in default "%g/%i" string. Saving different values in any .ini file, whether it is

will not matter, they will be ignored UNLESS mame is run from the commandline, OR you set -ui simple first.

Expected behaviour

snapname values in .ini files should be respected by the UI, not ignored.

Steps to reproduce

  1. create fresh mame.ini mame -cc
  2. open mame.ini with a text editor, change snapname %g/%i to snapname testINImame/%g/%i and save the file.
  3. run mame on commandline with any game, I'll use mame sf2 for this example.
  4. press F12 a few times to take some snapshots.
  5. exit the game and check your snap directory, there should be "testINImame" folder with a "sf2" folder inside full of the images you just made.
  6. Okay now delete that folder.
  7. run mame again by double-clicking the mame.exe file, and run the same game again.
  8. take some snapshots again.
  9. exit the game and check your snap directory, you'll find just the "sf2" folder and the images you just made, but no "testINImame" folder.
  10. Empty your snap directory one more time.
  11. open mame.ini and change ui cabinet to ui simple and save the file.
  12. run mame.exe and the same game one last time.
  13. take more snapshots.
  14. exit the game and you should have the same results as step 5.

Additional details

This one keeps tripping me up every once in a while, and I think it never worked right from the UI anyway? I prefer the string "%g/%g%i" to create files like "snap/sf2/sf20001.png" and so on, and noticed this going back to the UI for a bit because files were saving as just indexed 4 digit numbers.

I might need to check some random softlist stuff and see how those are managed, so for now this is affecting all the arcade stuff.

Can anyone explain the difference between using the forward and back slashes? They do the same thing when I interchange them and your docs don't clarify either, unless those are typos?: https://docs.mamedev.org/commandline/commandline-all.html#mame-commandline-snapname

Example 1: mame robby -snapname foo\%g%i Snapshots will be saved as snaps\foo\robby0000.png, snaps\foo\robby0001.png and so on.

Example 2: mame nes -cart robby -snapname %g\%d_cart Snapshots will be saved as snaps\nes\robby.png.

Example 3: mame c64 -flop1 robby -snapname %g\%d_flop1/%i Snapshots will be saved as snaps\c64\robby\0000.png.

ghost commented 1 year ago

Made a new discovery here with the UI. This issue goes away if you open the mame.ini file and change this line under CORE MISC OPTIONS: ui cabinet to ui simple

Seems like the cabinet ui is not playing nice. Updating the title and description now.

yves-le-berre commented 9 months ago

Same behavior on Linux (Debian Sid, kernel 6.5.0-3-amd64, X.org 1.21.1.9, Nvidia 525.125.06) with mame version 0.260.