summaryrefslogtreecommitdiff
path: root/Source/Core/DiscIO/FileSystemGCWii.cpp
AgeCommit message (Collapse)Author
2020-06-25DiscIO: Deduplicate some VolumeGC/VolumeWii codeJosJuice
2019-07-18DiscIO: Add functions CreateDisc and CreateWADJosJuice
...in addition to the existing function CreateVolume (renamed from CreateVolumeFromFilename). Lets code easily add constraints such as not letting the user select a WAD file when using the disc changing functionality.
2019-05-29DiscIO: Avoid copies when comparing FileSystemGCWii file namesJosJuice
2019-05-29DiscIO: Use std::string_view in FileSystem::FindFileInfoJosJuice
...and in the functions that call it.
2019-05-06Reformat repo to clang-format 7.0 rulesTechjar
2017-09-15DiscIO: Remove m_partition and m_volume from FileSystemJosJuice
The last commit made m_partition unnecessary, and m_volume has been unnecessary ever since the PR that added DiscExtractor.
2017-08-23Merge pull request #5864 from JosJuice/directoryblob-disccontentcontainerJosJuice
DirectoryBlob: Improve ReadInternal
2017-08-02DiscIO: Add a Volume::ReadSwappedAndShifted functionJosJuice
This is a fairly common operation, so let's make a utility function for it to cut down on code duplication.
2017-08-01FileSystemGCWii: Don't add 0-size files to m_offset_file_info_cacheJosJuice
This is done in order to reduce the risk of files not being added due to them having the same end offset as another file.
2017-07-16Use find_first_not_of in FileSystemGCWii::FindFileInfoJosJuice
2017-07-04Drop unnecessary check from FileSystemGCWii::FindFileInfoJosJuice
If the current file_info is a file, the ranged for loop will run 0 times, and we'll reach the last line of the function.
2017-07-04Support leading slashes in FileSystemGCWii::FindFileInfoJosJuice
2017-06-28FileSystemGCWii: Use DiscExtractor's FST offset/size functionsJosJuice
2017-06-28DiscIO: Move parts of Filesystem to the new file DiscExtractorJosJuice
2017-06-24FileSystemGCWii: Use case insensitive comparison in FindFileInfoJosJuice
This was a regression in f49b64c. Some games seem to name the banner file OPENING.BNR instead of opening.bnr. Should fix https://bugs.dolphin-emu.org/issues/10354
2017-06-15Merge pull request #5611 from JosJuice/reorganize-file-namespaceLeo Lam
Reorganize File namespace
2017-06-15Move IOFile to a separate fileJosJuice
Reduces the number of files that need to be recompiled when making changes to FileUtil.h.
2017-06-14Filesystem: Make destructors = defaultJosJuice
2017-06-14Filesystem: Modernize variable namesJosJuice
2017-06-14Filesystem: Do more validity checking in the constructorJosJuice
This makes it possible to catch errors earlier so that file systems simply fail to load instead of behaving oddly. It also makes it possible to check for errors that weren't checkable before, like the end of a directory being after the end of the parent directory.
2017-06-14Filesystem: Add a cache for finding file info by disc offsetJosJuice
FileMonitor calls this every time a read happens, and there's no code that only calls this a small number of times, so having a cache is worthwhile.
2017-06-14Filesystem: Replace GetFileList()JosJuice
Instead of expecting callers to know how the size of directory file infos relates to which files are in which directories, filesystems now offer a GetRoot() method, and file infos offer a way to get their children. As a bonus, m_FileInfoVector no longer has to be created and kept around in RAM. Only the file info objects that actually are used are created.
2017-06-13Filesystem: Store pointer to beginning of FST in file infosJosJuice
Needed for the next commit.
2017-06-13Filesystem: Better validity checkingJosJuice
Now that the FST in read in the constructor, m_Valid can be set to false when there are errors in the FST.
2017-06-13Filesystem: Initialize everything in constructorJosJuice
Not initializing until the filesystem is used is good when a filesystem is constructed and then never used, but nobody does that. This simplifies the code a little and lets all methods be const.
2017-06-13Filesystem: Read the entire FST in one goJosJuice
Instead of using lots of small scattered reads to read the FST, only one big read is used, which is more efficient. This also means that the FST only allocates memory once and stores all strings close to each other - good for the CPU cache. The file info objects use pointers to this FST memory of containing data themselves. Keeping around the big m_FileInfoVector containing objects with only pointers is a bit unnecessary, but that will be fixed soon.
2017-06-13Filesystem: Rewrite finding file info by path for performanceJosJuice
Instead of calling GetPathFromFSTOffset for every file info, FindFileInfo now only looks at names in directories that are included in the path. For the common case of searching for "opening.bnr", this means that only root-level files and directories have to be searched through.
2017-06-13Filesystem: Use file info in arguments instead of pathJosJuice
Some callers already have the file info, making the relatively slow FindFileInfo calls unnecessary. Callers that didn't have the file info will now need to call FindFileInfo on their own.
2017-06-13Filesystem: Make FindFileInfo publicJosJuice
2017-06-13Filesystem: Replace file info's full path with nameJosJuice
Some callers (i.e. ISOProperties) don't want the full path, so giving them it is unnecessary. Those that do want it can use GetPathFromFSTOffset. Not storing full paths everywhere also saves a small bit of RAM and is necessary for a later commit. The code isn't especially pretty right now (callers need to use FST offsets...) but it'll become better later.
2017-06-13Filesystem: Replace FileInfo struct with interfaceJosJuice
GC/Wii filesystem internals shouldn't be exposed to other classes. This change isn't especially useful by itself, but it opens up the way for some neat stuff in the following commits.
2017-06-07DiscIO: Use the correct offset shift for DOL exportsLéo Lam
2017-06-07DiscIO: Fix formattingLéo Lam
2017-06-06DiscIO: Remove C/I/S prefixes from class namesJosJuice
These prefixes were inconsistent with the rest of Dolphin. I'm also renaming VolumeWiiCrypted to VolumeWii because of 1113b13.
2017-06-05DiscIO: Use std::optional in Volume and BlobJosJuice
2017-05-22Fix indirect includesLéo Lam
2017-05-16FileSystemGCWii: Replace m_Wii with m_offset_shiftJosJuice
I replaced m_OffsetShift with m_Wii in bb93336 to support the decrypt parameter for read functions. Doing that is no longer necessary, so m_offset_shift is now used like before.
2017-05-16VolumeWiiCrypted: Replace ChangePartition with a partition parameterJosJuice
By removing mutable state in VolumeWiiCrypted, this change makes partition-related code simpler. It also gets rid of other ugly things, like ISOProperties's "over 9000" loop that creates a list of partitions by trying possible combinations, and DiscScrubber's volume swapping that recreates the entire volume when it needs to change partition.
2016-09-18Filesystem: Return strings from GetFileName without the const qualifierLioncash
This is mostly pointless and can inhibit move construction
2016-06-24Reformat all the things. Have fun with merge conflicts.Pierre Bourdon
2015-12-14DiscIO: Improve IVolume::Read32 error handlingJosJuice
Callers can now check whether reads fail, either by checking the return value or by setting the buffer to a known bad value and seeing if it stays untouched. I've added error checks to FileSystemGCWii and Boot_BS2Emu, but not to Boot since it doesn't check any of its other reads either.
2015-11-18Merge pull request #3206 from JosJuice/limit-filesystem-size-2Markus Wick
Limit size of loaded file systems
2015-11-10DiscIO: drop unused stuffTillmann Karras
2015-10-28Limit size of loaded file systemsJosJuice
If a disc image is malformed in a specific way, Dolphin will try to allocate a lot of memory, making it crash. To avoid that, this change adds an artificial limit for the size of file systems that Dolphin will try to load.
2015-10-17Remove DiscScrubber::GetDOLSize in favor of IFileSystem::GetBootDOLSizeJosJuice
IFileSystem::GetBootDOLSize acts the same. The only difference is that it reads the DOL offset on its own, but this change makes that optional.
2015-09-26Common: Remove other Common prefixed headers from Common.hLioncash
2015-09-11Partially revert "General: Toss out PRI macro usage"Lioncash
2015-09-05General: Toss out PRI macro usageLioncash
Now that VS supports more printf specifiers, these aren't necessary
2015-06-02Merge pull request #2338 from JosJuice/getfilelist-returncomex
Filesystem: Return file list reference instead of modifying argument
2015-05-25Merge pull request #2361 from JosJuice/filesystem-read32Ryan Houdek
Remove CFileSystemGCWii::Read32