-
Notifications
You must be signed in to change notification settings - Fork 2.4k
Use the libretro VFS interface in libretro builds #21092
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
That looks more complicated than I was expecting. Don't mind me just posting to get subscribed to notifications in the mobile GitHub interface |
|
It's because the original code depends on library functions that themselves use stdio functions in a few places. I rewrote them to be more agnostic of what file system API is being used.
The file_stream_transforms.h header file that redirects the remaining stdio calls made from directly inside of the PPSSPP codebase also doesn't like it when you write Also, I've consolidated the various platform-dependent methods of seeking files into |
|
Pretty impressive! Yeah, this is probably really the only way to go about it. I kicked off the CI. Will give it some light testing later before merge. |
|
As you can see in the CI reports, there are some build issues for non-libretro builds. |
|
Triggered a new build. Since this is your first PR, CI needs manual triggering. I'll try to keep up reasonably. |
|
Thanks for the fixes! Will do a final review tomorrow, I think we'll be able to get this in shortly. |
|
Running on Android, there seems to be some pointer truncation problem in the new libpng code: |
|
Actually, that's not the root cause. It just fails to load all pngs from assets on Android. Assets are read from the APK as a zip file, and something is wrong with that. pngLoadPtr does need |
|
Yeah, the zipfilereader is not functioning correctly, it reads garbled data. Not sure why. |
|
Same happens on standalone in Windows - the zipfilereader is busted. On Windows, we don't use the zipfilereader for assets, so the app starts. But if you try to install something from the homebrew store, it blows up. It's clear you didn't test this. |
The zip file will be closed automatically when the `ZipContainer` goes out of scope, or when `.close()` is called on the `ZipContainer`.
…ipContainer` constructor
|
Should be fixed for installing games from the homebrew store, but the Android app is still broken. I'm working on fixing that now. |
|
Okay, the non-libretro Android builds should work again. |
|
Hm. PPSSPP never really has any need to access 4GB+ files (as PSP ISOs are a lot smaller than that, even the largest "combined" ISOs like the Final Fantasy Type-0 translation). Combining fseek and lseek like that looks super scary, and I'm not sure if we shouldn't just do a plain old fseek there instead. |
|
Alright, I've changed that code path to use normal fseek and ftell. |
hrydgard
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Did a quick check on Windows and Android again, things seem fine, and the code looks alright.
Let's get it in.
|
Yo. I'm loving the feature but I think there might be a specific bug report in the future you might want to either ignore or fix now.
From what I read fseek only actually supports 2^31 (2147483648) not 2^32 (4294967296) because of the sign bit of normal long. The FF type zero hack\translation is 3158917120 bytes I think you can see the problem. I think this game in particular is the exact reason this code was done weird like this. Now I'm not saying you should support a weird hack that should have limited itself to not merge CDs (does it even RUN in a PSP?) but I think you should be aware if you're breaking it on purpose. Now the internet may be completely wrong and/or modern fseek actually has the full range unsigned long so this is something you should verify (somehow). |
|
As far as I know, FF: Type-0 (including the hack) runs fine in PPSSPP standalone as-is. Let me know if that's not the case. |
|
No no that was a auto corrupt typo. I was asking if the translation hack works on a psp with however you load homebrew there because it's larger than 2^31. I suspect that right now in PPSSPP it will break sometime when cd 2 files are addressed in the single merged disc but I don't have time to play it until cd 2 areas. I did try to load it with the recent code (on WebDAV in RETROARCH) so I know it loads and goes to the tutorial in game with this code, just worried about the later areas. |
|
Generally if this wasn't the only translation of FF type 0 that isn't a official one on the PS4 or Xbox one I wouldnt even bother saying anything because supporting this kind of feels like a hack if the original psp wouldn't be able to address a 3gb game in a 3gb UMD if one existed. If only the translator had the good sense of releasing a version in two discs too, I wouldn't say anything either. |
|
There are a bunch of saves in this page: https://gamefaqs.gamespot.com/psp/951986-final-fantasy-type-0/saves I'll try to load one of the last chapter ones in retroarch. |
|
Ok I tested out the last chapter start save until the end credits and some of the videos in the "history" (log) of the game. No problems Im in android and the game is being served from Apache WebDAV in a 32 bits Linux computer so I think that until further notice of someone opening a real bug in type 0 (or another weird large game) it's fine. |
Allows, for example, loading games from the Storage Access Framework when using the libretro core in the RetroArch Android app.
I removed the duplicate header files in the libretro directory in this repository that are already present in libretro-common, by the way, because this pull request relies on libretro-common which in turn relies on libretro-common's versions of the duplicated header files. I see no reason to have two copies of the libretro-common header files anyways.