Browse filesystem of selected ROM
Miss-Inputs opened this issue · 5 comments
Well, this would be accessible from the menu in the main window, but also the view individual file dialog of course.
This could be pretty useful, being able to see a full directory structure and also extract files from it (it'd pop up in a separate window with "Extract all" and "Extract selected" options). Also, to finish implementing the PSP handler so it can read UMD dumps, we'll need to implement ISO9660 more or less completely anyway.
Gamecube's filesystem would be a decent place to start since I've half-implemented it already to find the banner anyway, I can't remember if Wii uses the same thing or if it uses a slightly different filesystem implementation? And then DS, and ISO9660 (since PSP as mentioned uses that, and many CD based systems like Mega CD (IIRC) as well). Anyway yeah, stuff and things.
So the first thing we'd need implementation-wise is a function in Handler that returns bool and indicates if the given system actually has a filesystem or not.
This would of course need to take a ROMFile as parameter, as some ROMs for a given system might have filesystems when some don't. This could be because they're a different format (raw executables on a system which usually uses optical discs), or something like a DS ROM that just doesn't (homebrew never seems to use NitroFS when commercial ROMs always do).
As for the functions we'll have to add to Handler to actually do the thing:
byte[] getFile(string filename)
string[] listDir(string filename) //returns names of filenames and subdirectories as a relative path
string[] getPartitions() //This will usually only return a single element which might not even need a name, but it'll have multiple for stuff like Wii
There's probably more that I'll only realise once I actually start programming the thing. Anyway, those three should allow for a usable GUI to easily be constructed.
Actually, might put those things in a FilesystemHandler interface (or some other good name?), so that one can initialize the filesystem for a single ROM just once and that should all work. Probably? Also, need a bool hasFile(string filename)
Actually, not Handler, we'll make it part of ROMInfo. Otherwise, this should work. Probably. Maybe?
I'm doing the thing! Woohoo!
Gonna try and get extraction of files happening at some point this weekend if not tonight.