Commit graph

64 commits

Author SHA1 Message Date
JosJuice
104faa9fb3 VolumeDirectory: Use case-insensitive comparison when sorting
This fixes a regression from 5.0-1556, but I don't know why
the regression occurred or why this fixes it. (Many games
failed to fully boot - I tried Metroid Prime and Twilight
Princess (both GC), and they never got to the title screen.)
2017-01-25 15:07:07 +01:00
JosJuice
66ea9f5cc1 DiscIO: Add GetRegion function and Region enum
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.
2017-01-02 20:57:11 +01:00
JosJuice
8e4a781974 VolumeDirectory: Modernize variable names 2016-12-26 11:45:22 +01:00
JosJuice
00aa2d37e9 VolumeDirectory: Don't use references inappropriately
Integers should be passed as pointers when a function
modifies them (to make it clear that they get modified).
2016-12-26 09:52:18 +01:00
Mat M
9c8e27e3bb Merge pull request #4558 from JosJuice/volumedirectory-fst-sort
VolumeDirectory: Sort the FST
2016-12-25 17:38:58 -05:00
JosJuice
3196f697bb VolumeDirectory: Use a range-based for loop in ComputeNameSize 2016-12-25 23:01:42 +01:00
JosJuice
f3987d13ea VolumeDirectory: Make m_totalNameSize a local variable
After BuildFST finishes executing, it's never needed again.
2016-12-25 22:57:14 +01:00
JosJuice
a502f069e8 VolumeDirectory: Sort the FST
We can't rely on the OS returning files and directories
in a deterministic order, so we should sort them on our own
if we want VolumeDirectory to work for movies and netplay.
2016-12-25 22:35:38 +01:00
Léo Lam
31ccfffd38 Common: Add alignment header
Gets rid of duplicated alignment code.
2016-12-06 20:33:53 +01:00
JosJuice
1081497cad DiscIO/SConfig: Rename GetUniqueID to GetGameID
We call this "game ID" everywhere else, and it's not
actually completely unique.
2016-10-29 15:24:02 +02:00
JosJuice
0a15aaaa12 Move DiscIO enums to a new file
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-07-13 17:29:27 +02:00
JosJuice
1878605d77 Undo some comment formatting changes from b5104a7 2016-06-25 18:07:10 +02:00
Rukai
b5104a79f1 GCVolume: supports reading all opening.bnr information
DQT2: Game properties dialog contains info tab giving information about the selected iso.
2016-06-26 00:03:59 +10:00
Pierre Bourdon
3570c7f03a Reformat all the things. Have fun with merge conflicts. 2016-06-24 10:43:46 +02:00
Markus Wick
c310b3f0e6 Merge pull request #3309 from JosJuice/reload-banner-without-volume
Don't read from volume when reloading Wii banners
2015-12-15 18:48:49 +01:00
Markus Wick
2990df3f59 Merge pull request #3265 from JosJuice/volumedirectory-simplifications
DiscIO: Small VolumeDirectory simplifications
2015-12-15 18:36:49 +01:00
Lioncash
6295297ab3 DiscIO: Get rid of a few explicit deletes 2015-12-08 04:35:56 -05:00
JosJuice
a0cd753060 Don't read from volume when reloading Wii banners
Should make loading cached Wii games that lack banners slightly faster.
2015-12-03 17:29:59 +01:00
JosJuice
f9af58a388 DiscIO: Don't use PlainFileReader in VolumeDirectory
Blobs are not for regular file reading.
2015-11-28 09:18:22 +01:00
JosJuice
3a9e382661 DiscIO: Small VolumeDirectory simplifications 2015-11-17 10:09:54 +01:00
flacs
aaa48e19fe Merge pull request #3097 from JosJuice/blob-type
Fix blob type detection for game right-click menu
2015-09-29 03:46:29 +02:00
JosJuice
be7e0554d2 DiscIO: Add a way to get blob type 2015-09-27 20:54:31 +02:00
Scott Mansell
ce493b897d Merge pull request #2271 from revel8n/fixes
Fix for alignment of zero-length files within directory based virtual disk
2015-09-28 05:28:38 +13:00
flacs
34c020352f Merge pull request #3092 from JosJuice/compressed-blobs
Display all compressed formats in blue in GUI
2015-09-27 12:57:19 +02:00
revel8n
d4c2ca46a4 - Fix for alignment of 0-length files when volume directory is created from directory on disk
Updating constant value representation

Explicitly state data type in std:max usage
2015-09-26 18:29:29 -05:00
Lioncash
19ac565e0d Common: Move asserts to their own header 2015-09-26 18:51:27 -04:00
JosJuice
6935d28112 Display all compressed formats in blue in GUI
In the past, only GCZ was shown as compressed, not CISO and WBFS.
2015-09-26 15:24:29 +02:00
JosJuice
e0a47c11f5 Fix reading Wii FST size (for real this time)
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-08-10 16:35:23 +02:00
Lioncash
daa205990f Use emplace() instead of insert() where applicable for maps. 2015-06-28 19:52:40 -04:00
JosJuice
ec0370d2d1 Volume: Add prefer_long parameter to GetNames
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-08 12:00:34 +02:00
JosJuice
0ed3118141 Volume: Return volume type as an enum
ISOFile and GameFile were using IsWiiDisc() and IsWadFile() to set
an enum value. The volume might as well return an enum directly.

I increased the Qt CACHE_REVISION because m_platform now is saved as u32
instead of int, but increasing the wx CACHE_REVISION is not necessary.
2015-06-04 16:26:36 +02:00
comex
a225426510 Rewrite FileSearch and improve ScanDirectoryTree.
- FileSearch is now just one function, and it converts the original glob
  into a regex on all platforms rather than relying on native Windows
  pattern matching on there and a complete hack elsewhere.  It now
  supports recursion out of the box rather than manually expanding
  into a full list of directories in multiple call sites.

  - This adds a GCC >= 4.9 dependency due to older versions having
  outright broken <regex>.  MSVC is fine with it.

- ScanDirectoryTree returns the parent entry rather than filling parts
  of it in via reference.  The count is now stored in the entry like it
  was for subdirectories.

- .glsl file search is now done with DoFileSearch.

- IOCTLV_READ_DIR now uses ScanDirectoryTree directly and sorts the
  results after replacements for better determinism.
2015-05-28 19:14:42 -04:00
Tillmann Karras
30ebb2459e Set copyright year to when a file was created 2015-05-25 13:22:31 +02:00
Tillmann Karras
cefcb0ace9 Update license headers to GPLv2+ 2015-05-25 13:22:31 +02:00
JosJuice
bad09fc358 Volume: Rename GetName to GetInternalName
This is intended to better separate it from GetNames and to clarify
that this name originally wasn't meant to be shown to users.
The ISOProperties GUI is also updated, mainly because labeling
the long banner name "short name" was confusing.
2015-05-11 11:19:30 +02:00
JosJuice
ee694e327a Get rid of banner loaders and move their functionality to volumes
Having some data available in banner loaders and some other data
data available in volumes gets messy, especially with GetNames(),
which is available in both but returns different results
depending on which one is used. This change drops support
for reading names and descriptions from Wii save data.
2015-04-28 23:44:29 +02:00
JosJuice
235ecfbed7 Return GetNames languages, to avoid hardcoded language lists in callers
This makes the code cleaner and also leads to some user-visible changes:

The wx game properties will no longer let the user
select WAD languages that don't have any names.

The Qt game list will now display names using the languages
set in the configuration instead of always using
English for PAL GC games and Japanese for WADs.

If a WAD doesn't have a name in the user's preferred language,
English is now selected as a fallback before Japanese.
2015-04-23 08:14:39 +02:00
JosJuice
4cd00e366c Get rid of VolumeHandler
VolumeHandler is basically just a wrapper around a single IVolume object.
This change moves that object to DVDInterface, moves the Read32
function to IVolume, and gets rid of the rest of VolumeHandler.
2015-04-05 10:09:48 +02:00
Stevoisiak
eff924e9e2 General Formatting 2015-02-28 19:33:27 -05:00
Stevoisiak
06cb85991e De-capitalized CountryCode 2015-02-26 16:57:31 -05:00
Ryan Houdek
f9fc9d47c0 Merge pull request #1895 from JosJuice/isvolumewiidisc
Don't read from disk when checking volume type
2015-01-21 13:45:28 -06:00
skidau
6f61f90dab Merge pull request #1777 from JosJuice/filemonitor-volumedirectory
Add FileMonitor support for VolumeDirectory
2015-01-20 12:32:42 +11:00
JosJuice
ace060748b Don't read from disk when checking volume type
Should be faster than relying on the OS to cache the magic words.
Also gets rid of the odd recursive call in VolumeDirectory.
2015-01-17 13:21:02 +01:00
JosJuice
358183e34a Fix 4.0-4901 VolumeDirectory stack overflow
I actually fixed this once, but then I broke it in a
failed attempt to optimize. VolumeHandler::IsWii calls
CVolumeDirectory::Read(0x18, 4, &MagicWord, false);
2015-01-09 22:50:07 +01:00
JosJuice
bb93336ecf DiscIO: Replace "raw" functions with "decrypt" parameters
This is intended to make decryption look less implicit in the code.
2014-12-28 10:35:48 +01:00
JosJuice
7f04a23e23 Add FileMonitor support for VolumeDirectory 2014-12-27 20:13:31 +01:00
JosJuice
72f8f243c7 Never decrypt data when using DI command 0xA8
CleanRip relies on this when ripping Wii discs.
2014-12-27 13:49:25 +01:00
Lioncash
f14f0caea6 DiscIO: Remove some explicit deletes 2014-12-04 11:39:20 -05:00
Lioncash
56bc58b9f4 VolumeDirectory: Pass std::string by reference for SetUniqueID/SetName 2014-10-28 14:18:54 -04:00
skidau
4cb25633e1 Merge pull request #1048 from lioncash/discio
DiscIO: Minor changes to VolumeDirectory.
2014-09-12 11:31:29 +10:00