summaryrefslogtreecommitdiff
path: root/Source/Core/DiscIO/VolumeGC.cpp
AgeCommit message (Collapse)Author
2022-08-04DiscIO: Replace IsDataSizeAccurate with GetDataSizeTypeJosJuice
Previously, we had WBFS and CISO which both returned an upper bound of the size, and other formats which returned an accurate size. But now we also have NFS, which returns a lower bound of the size. To allow VolumeVerifier to make better informed decisions for NFS, let's use an enum instead of a bool for the type of data size a blob has.
2022-07-26introduce wrapper for SHA1 functionalityShawn Hoffman
2022-03-15DiscIO: Don't return GameTDB ID for any Datel discJosJuice
DTLX01 can be either a Freeloader or Action Replay, so it's inappropriate to always use the same title and cover for it.
2022-03-12DiscIO: Treat game ID DTLX01 as a Datel discJosJuice
Needed for the disc mentioned in the previous commit.
2021-07-05treewide: convert GPLv2+ license info to SPDX tagsPierre Bourdon
SPDX standardizes how source code conveys its copyright and licensing information. See https://spdx.github.io/spdx-spec/1-rationale/ . SPDX tags are adopted in many large projects, including things like the Linux kernel.
2021-03-09DiscIO: Move some code from DiscExtractor to new file DiscUtilsJosJuice
2020-10-22DiscIO: Migrate logging over to fmtLioncash
Eliminates quite a bit of the PRI* macros used for handling 64-bit values.
2020-08-02Make netplay's "same game" check more robustJosJuice
Instead of comparing the game ID, revision, disc number and name, we can compare a hash of important parts of the disc including all the aforementioned data but also additional data such as the FST. The primary reason why I'm making this change is to let us catch more desyncs before they happen, but this should also fix https://bugs.dolphin-emu.org/issues/12115. As a bonus, the UI can now distinguish the case where a client doesn't have the game at all from the case where a client has the wrong version of the game.
2020-07-04DiscIO: Add Volume::IsDatelDiscJosJuice
2020-07-04Revert "Return nothing from VolumeWii::GetGameTDBID if Datel"JosJuice
This reverts commit f9705fd1176432755df3dba0ef5c50f505193371. GameTDB.com has covers for non-GNHE5d Datel discs.
2020-06-25DiscIO: Deduplicate some VolumeGC/VolumeWii codeJosJuice
2020-06-07Show an OSD message when running a disc image with a large block sizeJosJuice
This is intended to catch WIA files which have been created using wit's default parameters (40 MiB block size), once the WIA PR is merged. The check does however also work for GCZ files – not that I think anyone has a GCZ file with a block size that large.
2019-10-30Return nothing from VolumeWii::GetGameTDBID if DatelJosJuice
RedumpVerifier relies on this.
2019-05-06Reformat repo to clang-format 7.0 rulesTechjar
2019-03-30DiscIO: Make Korean GC checks in Enums.cpp less fragileJosJuice
2019-03-30DiscIO: Add way of checking whether blob data size is accurateJosJuice
2019-02-25Keep track of GameTDB ID separately from game IDJosJuice
The difference between Dolphin's game IDs and GameTDB's game IDs is that GameTDB uses four characters for non-disc titles, whereas Dolphin uses six characters for all titles. This fixes: - TitleDatabase considering Datel discs to be NHL Hitz 2002 - Gecko code downloading not working for discs with IDs starting with P - Cover downloading mixing up discs with channels (e.g. Mario Kart Wii and Mario Kart Channel) and making extra HTTP requests. (Android was actually doing a better job at this than DolphinQt!)
2018-10-12DiscIO: Rename RegionSwitch/CountrySwitchJosJuice
Callers don't need to know that these functions are implemented with a switch statement.
2018-10-08DiscIO: Move the Korean GC mess out of VolumeGCJosJuice
2018-10-05DiscIO: Merge RegionSwitchGC and RegionSwitchWiiJosJuice
2018-05-30VolumeGC/VolumeWii: Dehardcode sizes where applicableLioncash
We can just use the relevant array to derive these sizes instead of hardcoding them directly.
2018-05-30Volume/VolumeGC/VolumeWii: Amend variable namingLioncash
Drops prefixed underscores and normalizes names to follow our coding style.
2018-05-27ColorUtil: Amend function name casingLioncash
Makes the function names conform to our coding style.
2018-05-27ColorUtil: Namespace code under the Common namespaceLioncash
Given this is within Common, it should be in the Common namespace itself.
2018-05-20Reimplement custom PNG banners in game listJosJuice
Fixes https://bugs.dolphin-emu.org/issues/10938 and makes PNG banners available in DolphinQt2 for the first time.
2018-03-31DiscIO: Don't use all uppercase for enum valuesJosJuice
Also removing some prefixes that we don't need now that we're using enum classes instead of plain enums.
2018-03-14Assert: Uppercase assertion macrosLioncash
Macros should be all upper-cased. This is also kind of a wart that's been sticking out for quite a while now (we avoid prefixing underscores).
2017-11-19VolumeGC: Correct printf specifier in LoadBannerFile()Lioncash
Gets rid of a warning when compiling on macOS.
2017-09-15VolumeGC: Add a default constructor for ConvertedGCBannerLéo Lam
Without this, it fails to build with the following error in g++ 7.2.0: > constructor required before non-static data member has been parsed
2017-09-15DiscIO: Use Common::Lazy for loading GC bannersJosJuice
2017-09-15DiscIO: Use Common::Lazy for loading filesystemsJosJuice
This simplifies FileMonitor a lot and also lets us clean up FilesystemPanel.
2017-07-16Ensure that Volume::GetRegion doesn't return invalid enum valuesJosJuice
2017-07-16Detect Korean GC releases as Korean when possibleJosJuice
According to http://scanlines16.com/en/blog-3/retro-gaming/game-cube/gamecube-korean-master-list/, Korean GC releases use the following country codes: - E or W for games in English - K for games in Korean - Unknown value for games in Japanese (my guess is that they might have made the discs bit-for-bit identical to Japanese releases because the regions of these games are already set to NTSC-J) As far as I know, the GC has no Taiwanese releases, which is what the W country code is used for on the Wii. But I could be wrong. A small note: The country_byte == 'K' check in the code isn't actually necessary as long as RegionSwitchGC returns NTSC_J for 'K', but I thought it would be better to not rely on that.
2017-07-16Detect GC region based on the actual region valueJosJuice
The county code isn't 100% reliable for detecting the region. For instance, some games released in Korea have the country code E even though they're region-locked to NTSC-J consoles. This commit makes the GC disc region detection match the Wii disc region detection (apart from the region value being in a different place on the disc).
2017-06-28DiscIO: Move parts of Filesystem to the new file DiscExtractorJosJuice
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: 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-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-06-04Don't show FST size in game propertiesJosJuice
Normal users don't care about it. In fact, people care so little about it that the Wii implementation of it was broken starting from when it was implemented (eb65601) to 7 years later (e0a47c1), apparently without anyone reporting it.
2017-05-16Check file system validity before reading opening.bnrJosJuice
This happened to work without any problems because the only way for a file system to be invalid was to not have the right GC/Wii magic word in the unencrypted area, and a volume could not be created without having the right GC/Wii magic word there. Now that file systems read the magic word from a partition instead, a fix is needed.
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.
2017-03-25DiscIO: make sure to initialize out args to ReadSwappedMichael Maltese
Fixes warnings: ``` ../Source/Core/DiscIO/VolumeGC.cpp: In member function 'virtual u8 DiscIO::CVolumeGC::GetDiscNumber() const': ../Source/Core/DiscIO/VolumeGC.cpp:178:10: error: 'disc_number' may be used uninitialized in this function [-Werror=maybe-uninitialized] return disc_number; ^ ../Source/Core/DiscIO/VolumeWiiCrypted.cpp: In member function 'virtual u8 DiscIO::CVolumeWiiCrypted::GetDiscNumber() const': ../Source/Core/DiscIO/VolumeWiiCrypted.cpp:258:10: error: 'disc_number' may be used uninitialized in this function [-Werror=maybe-uninitialized] return disc_number; ^ ../Source/Core/DiscIO/VolumeWiiCrypted.cpp: In member function 'virtual IOS::ES::TMDReader DiscIO::CVolumeWiiCrypted::GetTMD() const': ../Source/Core/DiscIO/VolumeWiiCrypted.cpp:123:20: error: 'tmd_address' may be used uninitialized in this function [-Werror=maybe-uninitialized] tmd_address <<= 2; ^ ```
2017-03-13FileMonitor redesignJosJuice
Advantages: * Simpler code in general * No extra volume objects created * Now actually notices if the disc or partition gets changed while the core is running * No longer picks up on disc access done by the GUI (it used to do so as long as the core was running) * Gets rid of a Core dependency in DiscIO There are two performance disadvantages: * FileMonitor is now a bit slower when used with VolumeDirectory because FileMonitor now always uses the FileSystemGCWii code for finding filenames instead of VolumeDirectory finding the filename on its own and directly hooking into FileMonitor. But this isn't such a big deal, because it's happening on the DVD thread, and my currently unmerged file system PR will make FileSystemGCWii's file finding code about as fast as VolumeDirectory's. * FileMonitor's creation of the file system object is now done on the CPU thread instead of the DVD thread, and it will be done even if FileMonitor logging is disabled. This will be fixed in the next commit.
2017-03-13Remove Blob nullptr checks from Volume codeJosJuice
There's no point in creating a volume without a blob, since essentially all the functionality of a volume requires a blob to be used. Also, VolumeCreator doesn't support creating volumes without blobs (it can't even figure out the volume type unless it gets a blob), so it's currently impossible for a volume to be created without a blob.
2017-03-09Volume: Use ReadSwapped moreJosJuice
Most of the Volume code was written before this convenience function was added. Let's use it more. Also deleting m_pReader nullptr checks that are unnecessary because of Read (which ReadSwapped calls) already having a nullptr check.
2017-01-02DiscIO: Add GetRegion function and Region enumJosJuice
Instead of needing different switch cases for converting countries to regions in multiple places, we now only need a single country-to-region switch case (in DiscIO/Enums.cpp), and we get a nice Region type.
2016-10-29DiscIO/SConfig: Rename GetUniqueID to GetGameIDJosJuice
We call this "game ID" everywhere else, and it's not actually completely unique.
2016-10-03Merge pull request #3963 from JosJuice/banner-loaded-failureshuffle2
VolumeGC: Set m_banner_loaded when banner loading fails
2016-07-13Move DiscIO enums to a new fileJosJuice
At first there weren't many enums in Volume.h, but the number has been growing, and I'm planning to add one more for regions. To not make Volume.h too large, and to avoid needing to include Volume.h in code that doesn't use volume objects, I'm moving the enums to a new file. I'm also turning them into enum classes while I'm at it.