barbudreadmon / fbalpha-backup-dontuse-ty

Deprecated port of Final Burn Alpha to Libretro (v0.2.97.43).
61 stars 43 forks source link

Starting games does not work without full paths. #67

Closed orbea closed 8 years ago

orbea commented 8 years ago

OS: Slackware64-current RetroArch-1.3.2-x86_64-2_SBo libretro-fba-a71055b_2016.04.25_master-x86_64-1_git

When starting a game from a terminal with out specifying a path to the game nothing happens, no error messages or anything. RetroArch just immediately quits, this is not expected behavior in any other libretro core I have tried.

What does not work:

What does work:

andres-asm commented 8 years ago

I don't see how this would be an issue... there is no way for retroarch to divine the path for a game. Is somegame.zip in CWD when you run it like this? retroarch -L /usr/lib64/libretro/fba_libretro.so somegame.zip

orbea commented 8 years ago

These commands were all run from the directory containing somegame.zip, retroarch does not need to know the path.

Alcaro commented 8 years ago

With or without ./ really should not make any difference.

hizzlekizzle commented 8 years ago

I can confirm the behavior and the error it gives is: RetroArch [libretro INFO] :: [FBA] Archive: ssf2t RetroArch [libretro ERROR] :: [FBA] Failed to find archive: /ssf2t I think the issue is in this bit: https://github.com/libretro/libretro-fba/blob/master/src/burner/libretro/libretro.cpp#L799

Alcaro commented 8 years ago

Likely fix:

static void extract_directory(char *buf, const char *path, size_t size)
{
   strncpy(buf, path, size - 1);
   buf[size - 1] = '\0';

   char *base = strrchr(buf, '/');
   if (!base)
      base = strrchr(buf, '\\');

   if (base)
      *base = '\0';
   else
-      buf[0] = '\0';
+   {
+      buf[0] = '.';
+      buf[1] = '\0';
+   }
}

Someone test it for me, I'm lazy to dig up a FBA ROM. Or figure out whether FBA ROMs are called ROMs or something else.

orbea commented 8 years ago

Yes, that does it, after applying the below patch I can now I can start games with any of the methods. Thanks!

diff -urN a/libretro-fba/src/burner/libretro/libretro.cpp b/libretro-fba/src/burner/libretro/libretro.cpp
--- a/libretro-fba/src/burner/libretro/libretro.cpp 2016-05-01 12:41:12.441863279 -0700
+++ b/libretro-fba/src/burner/libretro/libretro.cpp 2016-05-01 12:42:44.598717305 -0700
@@ -1425,7 +1425,10 @@
    if (base)
       *base = '\0';
    else
-      buf[0] = '\0';
+    {
+      buf[0] = '.';
+      buf[1] = '\0';
+    }
 }

 bool retro_load_game(const struct retro_game_info *info)
orbea commented 8 years ago

Since this was committed I will close this issue, thanks for the quick resolution! https://github.com/libretro/libretro-fba/commit/e5a6ea94f878d84645587159e5d6fc75b29d57c3