kodi-game / game.libretro

Libretro compatibility layer for the Kodi Game API
GNU General Public License v2.0
37 stars 26 forks source link

Add libretro VFS support #58

Closed garbear closed 2 years ago

garbear commented 4 years ago

Description

This PR adds support for version 1 of the libretro VFS API (https://github.com/libretro/RetroArch/pull/5664). It's a straightforward translation between the libretro side and the Kodi side.

How has this been tested?

Time is short, so I haven't started testing yet. It compiles against Matrix and visibly appears correct. I'm PRing now to get some visibility and keep track of this task for later.

Hedda commented 4 years ago

Do you think that this will make it into Kodi's "Matrix" release?

garbear commented 4 years ago

The clock is ticking down, but we still have a couple months before Matrix's feature freeze. It just depends on time, and this PR is a rather low priority. I'm happy to test and merge if someone finishes the work though.

garbear commented 3 years ago

I added support for libretro v2 and v3 VFS API.

The code compiles, but I don't have time to test currently.

@Hedda can you help generate test procedures, like what games and cores should we test?

Hedda commented 3 years ago

what games and cores should we test?

@garbear Do you know where updated info is upstream about which game cores support libretro VFS and version of its VFS?

https://kodi.wiki/view/Game_add-ons#Libretro_cores

Does not look like libretro VFS support and version information is available in all cores today?

https://github.com/libretro/gambatte-libretro/search?q=vfs

Maybe metadata information about VFS and VFS version should be addon.xml for each Kodi Game Addon?

https://github.com/kodi-game/game.libretro.gambatte/tree/master/game.libretro.gambatte

That way the information would be available in downstream and easily accessible to Kodi RetroPlayer end-users for testing?

garbear commented 3 years ago

what games and cores should we test?

@garbear Do you know where updated info is upstream about which game cores support libretro VFS and version of its VFS?

https://kodi.wiki/view/Game_add-ons#Libretro_cores

The "VFS support" in the article is something different than this PR - it specifies whether a core can load from memory. As you can see, clearly games that accept entire disc images can't support loading from memory.

The support in this PR is about passing a path, even if "VFS support" is no, to the core, and the core uses Kodi's VFS API.

We can only detect if the libretro core supports loading from memory (VFS support in the core), but we can't detect if the core uses Kodi's VFS API, except by manual code inspection.

Does not look like libretro VFS support and version information is available in all cores today?

https://github.com/libretro/gambatte-libretro/search?q=vfs

834 results? https://github.com/search?q=org%3Alibretro+vfs&type=code

Maybe metadata information about VFS and VFS version should be addon.xml for each Kodi Game Addon?

https://github.com/kodi-game/game.libretro.gambatte/tree/master/game.libretro.gambatte

That way the information would be available in downstream and easily accessible to Kodi RetroPlayer end-users for testing?

Manual code inspection just isn't scalable, and has to be re-performed often as cores are updated to use frontend VFS.

garbear commented 2 years ago

We might as well merge this to allow for testing. @AlwinEsch should I target Matrix because that's what we're developing on? Do we later forward-port everything to Nexus and leave Matrix behind?

AlwinEsch commented 2 years ago

Would be OK, but think that a Matrix and Nexus should remain largely the same. As long as nothing has changed in the API for Kodi.

garbear commented 2 years ago

So we merge into Matrix?