libretro / libretro-lutro

An experimental lua game framework for libretro following the LÖVE API
https://lutro.libretro.com
MIT License
156 stars 46 forks source link

System Directory access #247

Open RobLoach opened 6 months ago

RobLoach commented 6 months ago

Started work on a BIOS checker in Lutro: https://github.com/RobLoach/lutro-bioscheck

Found that while Lutro can get libretro's system directory, it doesn't have access to the files...

local systemDirectory = love.filesystem.getAppdataDirectory()
print("System Directory: " .. systemDirectory)

print("File: " .. systemDirectory .. "/5200.rom")
local exists = love.filesystem.exists(systemDirectory .. "/5200.rom")
print("Exists: " .. tostring(exists))

While 5200.rom exists, it outputs false.

RobLoach commented 6 months ago

Found that all paths are being prefixed with the gamedir, which breaks all absolute paths.

char fullpath[PATH_MAX_LENGTH];
strlcpy(fullpath, settings.gamedir, sizeof(fullpath));
strlcat(fullpath, path, sizeof(fullpath));