libretro-mirrors / scummvm

ScummVM with libretro backend.
http://www.scummvm.org/
GNU General Public License v2.0
22 stars 31 forks source link

File extension ".scummvm" must mandatorily contain at least one upper case character. #189

Closed DrUm78 closed 2 years ago

DrUm78 commented 3 years ago

Hardware: FunKey S (SoC V3s ARM Cortex A7-A clocked @ 1.2GHz). Frontend: SDLRetro from https://github.com/FunKey-Project/sdlretro.

File extension ".scummvm" must mandatorily contain at least one upper case character (any of them), otherwise the core won't load the game and this error will be returned: [03-18 19:33:26 E] The core was unable to load /mnt/SCUMMVM/TENTACLE/TENTACLE.scummvm This issue only occurs with this core btw.

Workaround: Put at least one upper case character in the file extension ("TENTACLE.SCUMMVM" for example).

Steps to reproduce:

  1. Name one of your launcher file extension with lower case only (for instance "TENTACLE.scummvm")
  2. Try to launch it
  3. Notice that it failed and read the error message
hizzlekizzle commented 3 years ago

Does it also happen to this alternate, updated libretro core? https://github.com/diablodiab/scummvm

eku commented 3 years ago

Which file system is used here? Is it perhaps case-sensitive?

DrUm78 commented 3 years ago

@hizzlekizzle Yes it actually occurs with official Libretro repo AND diablodiab's own Libretro wrapper (from which my repo is based). @eku you mean for the .SCUMMVM file? That's a simple empty text file I create for each of my ScummVM games. Other than that, the games are stored on a FAT32 partition, managed by a custom Linux for the FunKey S device (armv7).

But once again, that does not happen with any of the other Libretro cores I play.

i30817 commented 2 years ago

Besides the obvious risk of buffer overflow, which is 'situation as normal' for terrible C, this is the line for the .scummvm extension in the core:

https://github.com/libretro/scummvm/blob/2e7b84f566fda63646ae7d4be344b9cbfe194235/backends/platform/libretro/libretro.cpp#L302

strstr 'search for a substring in string'. Are you by any chance hiding your extensions by mistake and then had '.scummvm.scummvm' unknowingly? That's the only reason i can think for this to fail such that renaming it '.Scummvm.scummvm' would make it work.

strstr seems like a overflowing fountain of bugs in retroarch because some coders keep using it as a way to check for things that are supposed to be at the end or start of a string, not the middle.

DrUm78 commented 2 years ago

Yeah I saw that line and I see no difference with other cores code. Of course all my file extensions are visible under my OS (Windows 11) and that bug occurs only for ScummVM and all my games for it among all my Libretro cores.

DrUm78 commented 2 years ago

Forgot to post my update: it was simply because I left the file empty whereas the game id should be inside according to the Libretro doc: https://docs.libretro.com/library/scummvm/#running-a-game. Thanks. Closed.

i30817 commented 2 years ago

@DrUm78 , next time you can use my tool https://github.com/i30817/libretro-mkscumm to make these files with the right contents.

It's a fucking mess making these files without something like this, especially if you want to make the scummvm core live to a fraction of its potential (i have 260 ags games + ≃180 interactive fiction + 185 'others' in my ScummVM playlists and i don't have all the games scummvm supports there and it's always adding more as the engines get more work - soon wintermute will have 3d support).

It's much easier to start the core, mass scan the directories, remove those that you don't want (or don't work, scummvm scanner isn't perfect yet - you can detect these visually with repeated game entries from a single game directory or names that don't match) with the delete key and then run the tool, than look up the individual names of the engine and copy that to files hundreds of times (and that doesn't even work without the scummvm.ini already made anyway so you don't save even that, mostly because the names are not all of the story of those configs the config file entries are what's important and the base engine game name is often not enough).