libretro / flycast

Flycast is a multiplatform Sega Dreamcast emulator. NOTE: No longer actively developed, use upstream repo for libretro from now on - https://github.com/flyinghead/flycast
http://reicast.com
GNU General Public License v2.0
152 stars 77 forks source link

arcade board settings (<rom>.zip.nvmem*) not loading when using forward slash "/" via command on Windows #1114

Closed patrici0 closed 2 years ago

patrici0 commented 2 years ago

Libretro Flycast on RetroArch for Windows seems to get confused when using a forward slash right before the rom name to load it via command line. This only applies to arcade board settings that are changed via service menu, which are stored under (RetroArch dir)\saves\reicast. Save states stored under (RetroArch dir)\states\ are unaffected. Additionally, when using a forward slash to load the rom, any arcade board settings changed via service menu during this session will not stick.

To reproduce issue: retroarch directory -> "c:\emu\attract\emulators\RetroArch" content directory -> "c:\emu\attract\emulators\RetroArch\roms\Atomiswave"

c:\emu\attract\emulators\RetroArch>retroarch.exe -L cores/flycast_libretro.dll roms/Atomiswave/dolphin.zip

(It doesn't matter which way the slashes go in all instances except the one right before the rom filename. i.e: /dolphin.zip. I get the same result)

Snip with errors from retroarch log:

[libretro INFO] core/hw/holly/sb.cpp:150 N[SH4]: SB/HOLLY: System reset requested
[libretro ERROR] core/hw/flashrom/flashrom.cpp:42 E[FLASHROM]: Cannot save flash/nvmem to file 'c:\emu\Attract\emulators\RetroArch\saves\reicast\roms/Atomiswave/dolphin.zip.nvmem'
[libretro ERROR] core/hw/flashrom/flashrom.cpp:42 E[FLASHROM]: Cannot save flash/nvmem to file 'c:\emu\Attract\emulators\RetroArch\saves\reicast\roms/Atomiswave/dolphin.zip.nvmem2'
[INFO] [Overrides]: Configuration overrides unloaded, original configuration restored.
[INFO] [Core]: Content ran for a total of: 00 hours, 00 minutes, 23 seconds.
[INFO] Saving runtime log file: c:\emu\Attract\emulators\RetroArch\playlists\logs\Flycast\dolphin.lrtl
[INFO] [Core]: Unloading game..
[libretro ERROR] core/hw/flashrom/flashrom.cpp:42 E[FLASHROM]: Cannot save flash/nvmem to file 'c:\emu\Attract\emulators\RetroArch\saves\reicast\roms/Atomiswave/dolphin.zip.nvmem'
[libretro ERROR] core/hw/flashrom/flashrom.cpp:42 E[FLASHROM]: Cannot save flash/nvmem to file 'c:\emu\Attract\emulators\RetroArch\saves\reicast\roms/Atomiswave/dolphin.zip.nvmem2'
[INFO] [Core]: Unloading core..
[INFO] [Core]: Unloading core symbols..
[INFO] [Core Options]: Saved game-specific core options to "c:\emu\Attract\emulators\RetroArch\config\Flycast\dolphin.opt"

Complete session log can be found at https://pastebin.com/nH3zAiQ0

This issue can be mitigated by using a backward slash before the rom filename when loading the content via command line. However, some front ends (i.e. Attract Mode) append a forward slash at the end of the content directory when using front end-provided variables, such as [romfilename] or [rompath] (replaced to c:\emu\Attract\emulators\RetroArch\roms\Atomiswave/dolphin.zip and c:\emu\Attract\emulators\RetroArch\roms\Atomiswave/ respectively).

Snip from Attrach Mode log:

*** Initializing display: 'Atomiswave'
 - Loaded master romlist 'Atomiswave' in 1 ms (12 entries kept, 0 discarded)
 - Constructed 2 filters in 0 ms (24 comparisons)
Attract-Mode Version: v2.6.1
Screen aspect ratio: 16x9
Resolution: 3200x1800
Shader GLSL available: 1
OS: Windows
        using settings[16x9][aspectDepend][res_x] : 1920
        using settings[16x9][aspectDepend][res_y] : 1080
        using settings[16x9][aspectDepend][maskFactor] : 1.9
 - Loaded layout: c:\emu\Attract\layouts/At-The-Arcade Atomiswave/ (layout.nut)
 - Working directory: c:\emu\Attract\emulators\RetroArch/
*** Running: c:\emu\Attract\emulators\RetroArch\retroarch.exe -L cores\flycast_libretro.dll "c:\emu\Attract\emulators\RetroArch\roms\Atomiswave/dolphin.zip"

Other specs: OS Windows 10 RetroArch 1.9.13 (Git 02898a4)

patrici0 commented 2 years ago

Commit 4cbf19c has fixed this issue.