libretro / RetroArch

Cross-platform, sophisticated frontend for the libretro API. Licensed GPLv3.
http://www.libretro.com
GNU General Public License v3.0
10.32k stars 1.84k forks source link

If run from the command line, pointing to a rom, the libretro-snes9x core is not loading MSU-1 files #4380

Closed i30817 closed 5 years ago

i30817 commented 7 years ago

I didn't post this on the core repository because if the 'content' is loaded from the gui, it works. Just not from the command line, which indicates a bug before the core loads from commandline. I might be wrong ofc, so tell me to open there if so.

retroarch -v -L /usr/lib/x86_64-linux-gnu/libretro/snes9x_libretro.so Legend\ of\ Zelda\ Parallel\ Worlds.sfc

The rom file is softpatched not hardpatched, with the usual parellel worlds bps patch (but it doesn't make a difference, because i tried hardpatching and running from command line and it didn't work), and the audio data is renamed correctly (and plays from the gui).

--- Want to back this issue? **[Post a bounty on it!](https://www.bountysource.com/issues/40727631-if-run-from-the-command-line-pointing-to-a-rom-the-libretro-snes9x-core-is-not-loading-msu-1-files?utm_campaign=plugin&utm_content=tracker%2F296058&utm_medium=issues&utm_source=github)** We accept bounties via [Bountysource](https://www.bountysource.com/?utm_campaign=plugin&utm_content=tracker%2F296058&utm_medium=issues&utm_source=github).
andres-asm commented 7 years ago

can you try

retroarch -v -L /usr/lib/x86_64-linux-gnu/libretro/snes9x_libretro.so ./Legend.......

i30817 commented 7 years ago

Yeah, that worked.

andres-asm commented 7 years ago

I suspected as much... tbh not sure what to do about it. I think when loading from the CLI it doesn't set the path correctly

Alcaro commented 7 years ago

Sounds to me like something doing strrchr(thing, '/') and derping out when not finding any slash.

orbea commented 7 years ago

I can't reproduce this with snes9x-libretro. If you put the rom in its own directory with nothing else does it still happen? Maybe one of the other files in the directory is causing the problem kind of like issues https://github.com/libretro/beetle-psx-libretro/issues/149 or https://github.com/libretro/beetle-saturn-libretro/issues/1.

orbea commented 7 years ago

Also for reference, fbalpha and tyrquake used to also have this problem. https://github.com/libretro/fbalpha/issues/67 https://github.com/libretro/tyrquake/pull/17

mame2003, mame2010 and mame2014 also have this problem. https://github.com/libretro/mame2003-libretro/issues/74 https://github.com/libretro/mame2010-libretro/issues/25 https://github.com/libretro/mame2014-libretro/issues/39

i30817 commented 7 years ago

I can't reproduce this with snes9x-libretro. If you put the rom in its own directory with nothing else does it still happen?

What do you mean? This can only happen with other files in the directory, namely the external pcm music files from the parallel worlds patch (plus the bps patch obviously). If they aren't there, there is no point testing since the rom will always load the normal music.

If you meant, if i share directories for roms of the same machine, no i don't. Each game has a directory and it was the case when i tested this. Output says it was built recently too: RetroArch [INFO] :: === Build ======================================= Capabilities: MMX MMXEXT SSE1 SSE2 SSE3 SSSE3 SSE4 Built: Jan 7 2017 RetroArch [INFO] :: Version: 1.4.0

orbea commented 7 years ago

It will help in finding out if any of those files is what is causing the path problem.

i30817 commented 7 years ago

Roms load normally either way (prepended ./ or not). The problem is with the MSU-1 files. Without any other file except the rom i'm just testing if the core loads Legend of Zelda A link to the past ofc.

I'm in linux if it matters for ifdef code.

i30817 commented 7 years ago

BTW the files needed for the music patch can be got here: http://www.romhacking.net/hacks/197/ (bps patch) and here: http://www.zeldix.net/t1065-zelda-parallel-worlds-v1-2-public-beta (the msu and pcm files)

Rename all of them to the same name as the rom, except extensions and keep the '-Number' suffixes for pcm too).

orbea commented 7 years ago

Well, I still can't reproduce this. The patch seems to work, but I'm not sure if the pcm files are? Here the contents of the test directory.

Legend of Zelda Parallel Worlds-1.pcm   Legend of Zelda Parallel Worlds-27.pcm
Legend of Zelda Parallel Worlds-10.pcm  Legend of Zelda Parallel Worlds-28.pcm
Legend of Zelda Parallel Worlds-11.pcm  Legend of Zelda Parallel Worlds-29.pcm
Legend of Zelda Parallel Worlds-12.pcm  Legend of Zelda Parallel Worlds-3.pcm
Legend of Zelda Parallel Worlds-13.pcm  Legend of Zelda Parallel Worlds-30.pcm
Legend of Zelda Parallel Worlds-14.pcm  Legend of Zelda Parallel Worlds-31.pcm
Legend of Zelda Parallel Worlds-15.pcm  Legend of Zelda Parallel Worlds-32.pcm
Legend of Zelda Parallel Worlds-16.pcm  Legend of Zelda Parallel Worlds-33.pcm
Legend of Zelda Parallel Worlds-17.pcm  Legend of Zelda Parallel Worlds-34.pcm
Legend of Zelda Parallel Worlds-18.pcm  Legend of Zelda Parallel Worlds-4.pcm
Legend of Zelda Parallel Worlds-19.pcm  Legend of Zelda Parallel Worlds-5.pcm
Legend of Zelda Parallel Worlds-2.pcm   Legend of Zelda Parallel Worlds-6.pcm
Legend of Zelda Parallel Worlds-20.pcm  Legend of Zelda Parallel Worlds-7.pcm
Legend of Zelda Parallel Worlds-21.pcm  Legend of Zelda Parallel Worlds-9.pcm
Legend of Zelda Parallel Worlds-22.pcm  Legend of Zelda Parallel Worlds.bps
Legend of Zelda Parallel Worlds-23.pcm  Legend of Zelda Parallel Worlds.msu
Legend of Zelda Parallel Worlds-24.pcm  Legend of Zelda Parallel Worlds.sfc
Legend of Zelda Parallel Worlds-25.pcm
Legend of Zelda Parallel Worlds-26.pcm
i30817 commented 7 years ago

Seems legit. Are you calling it with retroarch -v -L /usr/lib/x86_64-linux-gnu/libretro/snes9x_libretro.so ./Legend\ of\ Zelda\ Parallel\ Worlds.sfc

(this for working audio, for non-working, remove ./ ) You can tell the difference on the intro already. The pcm version has a early drumroll and a significantly more rich fanfare when the title logo appears.

orbea commented 7 years ago

Yes, I tried both of these with the same result, audio works for both.

retroarch -v -L /usr/lib64/libretro/snes9x_libretro.so Legend\ of\ Zelda\ Parallel\ Worlds.sfc retroarch -v -L /usr/lib64/libretro/snes9x_libretro.so ./Legend\ of\ Zelda\ Parallel\ Worlds.sfc

However I'm not sure what difference the pcm files are supposed to cause, it sounds the same with and without them.

Additionally I am noticing this, even though it is clearly working...

RetroArch [INFO] :: Environ PERFORMANCE_LEVEL: 12.
RetroArch [INFO] :: Loading content file: ./Legend of Zelda Parallel Worlds.sfc.
RetroArch [INFO] :: Found BPS file in "./Legend of Zelda Parallel Worlds.bps", attempting to patch ...
RetroArch [INFO] :: Fatal error received in (BPS).
RetroArch [INFO] :: CRC32: 0x7a569b88 .
i30817 commented 7 years ago

That's normal, happens on all patches in retroarch (yes i also find it weird), my softpatching results in the same crc, which proves we're using the same rom and patch. But, if the rom 'sounds the same', even if you load it without the files, it's not actually working.

i30817 commented 7 years ago

Are you using linux? I believe windows has some linux posix compatibility with relative paths that might be confusing the issue (this being fixed on windows but not linux on different codepaths for example). If you actually can see the cd quality music in the intro regardless... well, it's the only way i can see it sanely happening because it sure isn't here. My build is very recent (january 7th).

orbea commented 7 years ago

Yea, I am using slackware.

andres-asm commented 7 years ago

I'm still unsure if this is a core issue or a retroarch issue...

i30817 commented 7 years ago

I'm troubled that no one said it was reproducible myself. I'm not actually inventing it for being annoying. At least i got a workaround out of the issue i guess.

orbea commented 5 years ago

@i30817 Can you still reproduce this?

i30817 commented 5 years ago

That's a problem. I can no longer find the pcm files on the net from those links or any other link. I think this should probably be closed since i no longer have the means to reproduce it.

hizzlekizzle commented 5 years ago

I'll close it then. if anything changes, feel free to reopen.