summaryrefslogtreecommitdiff
path: root/Source/Core/DiscIO/VolumeGC.cpp
AgeCommit message (Collapse)Author
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.
2016-06-28VolumeGC: Set m_banner_loaded when banner loading failsJosJuice
If banner loading fails once, it will very likely fail again. Setting m_banner_loaded to true when banner loading fails prevents LoadBannerFile from wasting time if it's called again. Banner loading requires loading the file system, which takes a noticeable amount of time, so this matters.
2016-06-26GCVolume: supports reading all opening.bnr informationRukai
DQT2: Game properties dialog contains info tab giving information about the selected iso.
2016-06-24Reformat all the things. Have fun with merge conflicts.Pierre Bourdon
2015-09-29Merge pull request #3099 from lioncash/bannerflacs
VolumeGC: Get rid of banner pointer casts
2015-09-28VolumeGC: Get rid of banner pointer castsLioncash
Prefer reading the data into the reified struct instead.
2015-09-27DiscIO: Add a way to get blob typeJosJuice
2015-09-27Merge pull request #3092 from JosJuice/compressed-blobsflacs
Display all compressed formats in blue in GUI
2015-09-26Common: Remove other Common prefixed headers from Common.hLioncash
2015-09-26Display all compressed formats in blue in GUIJosJuice
In the past, only GCZ was shown as compressed, not CISO and WBFS.
2015-09-12Merge pull request #2829 from JosJuice/fix-wii-fst-size-2Lioncash
Fix reading Wii FST size (for real this time)
2015-09-11Partially revert "General: Toss out PRI macro usage"Lioncash
2015-09-05VolumeGC: Initialize a variableLioncash
Silences an uninitialized variable warning
2015-08-31VolumeCreator: Use a unique_ptr in CreateVolumeFromFilenameLioncash
2015-08-10Fix reading Wii FST size (for real this time)JosJuice
04fcb72 fixed an issue with reading the Wii FST size, but I found a second issue when working on PR #2820 - the size must be shifted left by 2. DiscScrubber and Boot already do this correctly using separate code.
2015-06-18Volume: Use DecodeString moreJosJuice
DecodeString handles the case where there is no trailing null byte, so using it lets the code be a bit simpler.
2015-06-08Volume: Add prefer_long parameter to GetNamesJosJuice
GC games with long names store two variations of the name in opening.bnr. This makes the shorter of those names available. For volumes other than GC discs, prefer_long is ignored.
2015-06-07Merge pull request #2512 from JosJuice/bnr-size-matchRyan Houdek
VolumeGC: Check that opening.bnr size matches type