PCSX2 / pcsx2

PCSX2 - The Playstation 2 Emulator
https://pcsx2.net
GNU General Public License v3.0
11.37k stars 1.58k forks source link

host directory support #2274

Closed Volkanite closed 2 years ago

Volkanite commented 6 years ago

working on host directory support to go along with "Enable Host Filesystem" as a few important functions (mkdir, dopen, dread) aren't implemented as yet. I've made some progress so far, you can check https://github.com/Volkanite/pcsx2/tree/hostdir but am having some problems in regards to portability. More specifically, i am looking for a more portable way to work with directories as the current implementation is mostly Windows-centric but that's because Windows seem to not properly support standard functions such as opendir()? dirfd()? open(O_DIRECTORY)? Just needed a little help/advice on how to move forward from here. Do i use compiler directives? Should i create two directory classes (one for Windows and one for Linux and variants)?

Right now it works well in Windows. I am able to browse my entire drive with uLaunchELF in PCSX2 (which is actually quite fun for some reason).

Any advice is appreciated. And sorry if this isn't the proper place to discuss this.

astrelsky commented 4 years ago

Any updates on this? I was about to open an issue regarding this feature. This would be quite useful for developing homebrew among other things.

Volkanite commented 4 years ago

Wow it's been a while. As i said it was functioning fine for me on Windows. I rarely use Linux so you're on your own there. Maybe some time in the near future I'll review/cleanup the code and create a PR because it's been such a long time and I expect PCSX2 to have had many changes since then.

see https://github.com/Volkanite/pcsx2/commit/6df00e8210e7f4a39f1c38d2a2051d298909e065

astrelsky commented 4 years ago

Wow it's been a while. As i said it was functioning fine for me on Windows. I rarely use Linux so you're on your own there. Maybe some time in the near future I'll review/cleanup the code and create a PR because it's been such a long time and I expect PCSX2 to have had many changes since then.

see Volkanite@6df00e8

I'll give it a shot this weekend and see if there are any problems. Seems to be a fairly straightforward implementation.

astrelsky commented 4 years ago

@Volkanite trying to run the gsKit textstream example results in the following

HLE Host: Set 'host:' root path to: C:\Users\{user}\{wsl_path}\rootfs\home\astre\Documents\ps2\gsKit\examples\texstream\
-snip-
open name host:texstream.png flag 1 data 41278
Unknown device 'host'
Known devices are  tty:(CONSOLE)  rom:(ROM/Flash)  cdrom:(CD-ROM ) 
open fd = -19
Failed to load PNG file: host:texstream.png
Loading Failed!
sudonim1 commented 4 years ago

So something you should know if you don't, which is the reason I didn't go ahead and implement this initially, is that different versions of the iop modules use a different stat struct and thus a different dirent struct. I used to know what version extended the stat struct by 24 bytes compared to what you implemented, but don't any more without reinvestigating.

fjtrujy commented 3 years ago

Hello @Volkanite, I have resumed your original work. My changes are here: #4372 It ideally now is working as well for Windows and Linux.

Thanks!

Volkanite commented 3 years ago

@fjtrujy Well thank you! I don't think I'd ever get to resume work on it so kudos to you. I'll close this issue when your PR is properly merged. Whomever moderates the issues can feel free to close it as well.

astrelsky commented 3 years ago

This is actually already implemented in the master branch and is just hidden away. I forget how I enabled it but it is somewhere in the settings and/or the ini files.

RedDevilus commented 3 years ago

This is for expanding the current Host filesystem, not the option enabled. It used to be disabled in the past.

F0bes commented 2 years ago

I'll close this issue when your PR is properly merged. Whomever moderates the issues can feel free to close it as well.

A bit late but #4372 has been merged.