Commit Graph

687 Commits

Author SHA1 Message Date
Markus Wick 25a584626f Merge pull request #3127 from JosJuice/read-return
DiscIO: Improve error handling for reading integers
2015-12-15 18:16:40 +01:00
Markus Wick e4b83d17bf Merge pull request #3270 from JosJuice/more-translations
Mark more strings for translation
2015-12-15 18:13:26 +01:00
JosJuice cbfab2a754 DiscIO: Improve DiscScrubber::ReadFromVolume error handling 2015-12-14 10:01:38 +01:00
JosJuice bd67333da9 DiscIO: Improve CBlobBigEndianReader error handling 2015-12-14 09:56:44 +01:00
JosJuice c01265db34 DiscIO: Unify CBlobBigEndianReader 2015-12-14 09:38:23 +01:00
JosJuice c7e747d775 DiscIO: Improve IVolume::Read32 error handling
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-12-14 09:38:21 +01:00
Rohit Nirmal 5a7e0aba70 Fix building with PCH disabled. 2015-12-08 16:57:37 -06:00
Lioncash 6295297ab3 DiscIO: Get rid of a few explicit deletes 2015-12-08 04:35:56 -05:00
Lioncash edbbf493f8 DiscIO: Make factory methods return unique_ptrs
Rather than rely on the developer to do the right thing,
just make the default behavior safely deallocate resources.

If shared semantics are ever needed in the future, the
constructor that takes a unique_ptr for shared_ptr can
be used.
2015-12-07 05:57:37 -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
Tony Drake 941125699c Added info for Rodea The Sky Soldier 2015-11-21 11:40:03 -05:00
JosJuice 74ea765427 Mark more strings for translation 2015-11-20 11:33:47 +01:00
Markus Wick 584ea8b320 Merge pull request #3206 from JosJuice/limit-filesystem-size-2
Limit size of loaded file systems
2015-11-18 10:43:47 +01:00
JosJuice 3a9e382661 DiscIO: Small VolumeDirectory simplifications 2015-11-17 10:09:54 +01:00
Scott Mansell eddea7f15f Merge pull request #3181 from JosJuice/scrub-directories
Don't reserve space for directories when scrubbing
2015-11-17 10:37:09 +13:00
Tillmann Karras df79398445 DiscIO: drop unused stuff 2015-11-10 17:03:08 +01:00
JosJuice 6dce8b4deb DiscScrubber: Add another nullptr check 2015-11-01 20:30:49 +01:00
JosJuice 6c25c63301 Limit size of loaded file systems
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-28 21:47:19 +01:00
JosJuice 4d77d12f01 Remove length parameter from DiscScrubber::ReadFromVolume
The function only makes sense when the length is 4. All current callers
use the length 4, so this change doesn't affect any behavior.
2015-10-18 09:24:31 +02:00
JosJuice 618ccf6109 Remove DiscScrubber::GetDOLSize in favor of IFileSystem::GetBootDOLSize
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-10-17 20:52:26 +02:00
JosJuice 1ec9c6393a Don't reserve space for directories when scrubbing
The offset in a directory FileInfo is an FST offset, not a disc offset.
Treating it as a disc offset doesn't make sense. Directories don't take
up space outside of the FST, so they don't need to be marked as used. The
old behavior may have prevented some scrubbable areas from being scrubbed.
2015-10-17 17:30:23 +02:00
flacs 05e339a605 Merge pull request #3139 from JosJuice/fix-wii-root
Mark which Wii root to use in the NAND path code
2015-10-16 16:49:34 +02:00
comex c22d1d68ab Mark which Wii root to use in the NAND path code.
It's used by both the GUI to do things like install WADs and check up on
the system menu, in which case the global root should be used, and by
/dev/es, in which case the local one should.  The latter isn't
*terribly* useful today, since no contents will ever be installed in
temporary roots (although it's still relevant for data directories), but
converting the whole thing makes sense because then it will Just Work
once the entire NAND is synced.

Because it would have been a bit of work to split it up (but I can if
desired), this commit also contains some basic cleanup of
NANDContentLoader:

(1) The useless interface class INANDContentLoader is removed and the
    methods are changed to just return CNANDContentLoader (the only
    implementation);
(2) CNANDContentManager is changed to use unique_ptr and cleaned up a
    bit.
2015-10-16 09:10:39 +02:00
Tillmann Karras 00aefa5e08 DolphinWX: decompress discs to calculate MD5 hash 2015-10-12 02:35:43 +02:00
Tillmann Karras efe71e686b DiscIO: implement CISOBlob::GetDataSize()
This is a best-effort approach, since the CISO format does not save the
original file size.
2015-10-12 02:33:38 +02:00
Tillmann Karras 1a8e2e16e3 DiscIO: implement WbfsBlob::GetDataSize() 2015-10-12 02:33:04 +02:00
Tillmann Karras a92b4bda95 DiscIO: fix reading the last sector in WBFS
Instead of rounding down, round up.
2015-10-12 02:31:51 +02:00
Tillmann Karras 3a2efc9f4f DiscIO: merge initial WBFS reads 2015-10-12 02:31:51 +02:00
Tillmann Karras f416106eec DiscIO: pre-swap WLBA 2015-10-12 02:31:51 +02:00
Tillmann Karras b1100e4aa0 DiscIO: use std::min() in WBFS 2015-10-12 02:31:51 +02:00
Lioncash 5f181957b3 NANDContentLoader: Replace a string rbegin() call with a back() call 2015-10-07 09:47:26 -04:00
shuffle2 a6f04b0e15 Merge pull request #3091 from Tilka/mbedtls
Update mbed TLS (PolarSSL)
2015-10-03 18:00:58 -07:00
Lioncash 5464e698fc Merge pull request #3102 from rohit-n/build-pch
Fix building with PCH disabled.
2015-10-03 13:30:51 -04:00
flacs d5ec7124e4 Merge pull request #3099 from lioncash/banner
VolumeGC: Get rid of banner pointer casts
2015-09-29 03:49:08 +02: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
Rohit Nirmal 3b75f45cf6 Fix building with PCH disabled. 2015-09-28 11:51:08 -05:00
Lioncash 7317dd4be2 VolumeGC: Get rid of banner pointer casts
Prefer reading the data into the reified struct instead.
2015-09-28 04:31:43 -04: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 cc036ca86c Common: Remove other Common prefixed headers from Common.h 2015-09-26 18:51:58 -04: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 94ee720a07 Rename IsCompressedBlob to IsGCZBlob for clarity
GCZ is just one of the several compressed formats that Dolphin supports.
2015-09-26 14:46:53 +02:00
Tillmann Karras ac5f56df7e mbedTLS: adapt Dolphin's Visual Studio files 2015-09-25 03:46:41 +02:00
Tillmann Karras 063446c46f mbedTLS: run rename.pl script and fix errors 2015-09-25 03:46:41 +02:00
Lioncash 4b9b82e000 DiscIO: Do swapping in GetTitleID implementations
Gets rid of external swaps at every usage.
2015-09-22 13:50:35 -04:00
Lioncash 113cc119de Merge pull request #2829 from JosJuice/fix-wii-fst-size-2
Fix reading Wii FST size (for real this time)
2015-09-12 00:50:00 -04:00
Lioncash 19459e827f Partially revert "General: Toss out PRI macro usage" 2015-09-11 09:49:00 -04:00
Lioncash 623df9b5ca DiscIO/VS: Remove an empty filter 2015-09-06 13:23:33 -04:00
Scott Mansell be4caa3dc0 Merge pull request #2961 from lioncash/printf
General: Toss out PRI macro usage
2015-09-06 21:02:22 +12:00
Lioncash 4a2e680ed2 VolumeGC: Initialize a variable
Silences an uninitialized variable warning
2015-09-05 23:05:28 -04:00
Lioncash 633be0387d General: Remove unimplemented function prototypes 2015-09-05 22:01:07 -04:00
Lioncash 8fdb013d54 General: Toss out PRI macro usage
Now that VS supports more printf specifiers, these aren't necessary
2015-09-05 16:02:35 -04:00
Shawn Hoffman aa7208e270 [windows] Update projects to vs2015. 2015-09-03 04:23:01 -07:00
Lioncash 222b33f0a3 VolumeCreator: Fix a typo in VolumeKeyForPartition's name 2015-08-31 20:01:51 -04:00
Lioncash 1db1a8aacf VolumeCreator: Use a unique_ptr in CreateVolumeFromFilename 2015-08-31 20:01:44 -04:00
Anthony Serna faedf1bc5c Implemented .elf and .dol support in gamelist
Fixed a TON of structuring, formatting.

removed README.txt files from themes at MaJoR's request

Added platform icon for ELFs/DOLs
2015-08-28 11:10:03 -07:00
Markus Wick 3469694b46 Merge pull request #2676 from Stevoisiak/SpellingCorrections
Minor spelling corrections
2015-08-15 18:36:56 +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 7ee0e75633 Remove unnecessary virtual keywords 2015-07-30 10:33:08 -04:00
skidau a12a4520d8 Merge pull request #2684 from TraceBullet/master
DiscIO: Check if m_Disc is null in ParsePartitionData()
2015-07-14 10:56:12 +10:00
Scott Mansell dc25277a2f Merge branch 'stable' into 'master' 2015-07-13 12:40:38 +12:00
JosJuice 9018b546c7 WbfsBlob: Don't enter an infinite loop when reading beyond end of disc
read_size remained 0 when the "Read beyond end of disc" error occurs,
which made the while (nbytes) loop never end. As a fix, SeekToCluster
now explicitly sets available to 0 when the error occurs, and Read
checks for it.
2015-07-06 15:41:37 +02:00
Trace Bullet 64bd20aba7 DiscIO: Check if m_Disc is null in ParsePartitionData() 2015-07-02 11:45:22 -04:00
Stevoisiak 7248f9b524 Minor spelling corrections 2015-06-29 14:51:21 -04:00
Lioncash daa205990f Use emplace() instead of insert() where applicable for maps. 2015-06-28 19:52:40 -04:00
Markus Wick 156fb82117 Merge pull request #2620 from JosJuice/more-decodestring
Volume: Use DecodeString more
2015-06-18 14:57:10 +02:00
JosJuice a825c7ddfe Volume: Use DecodeString more
DecodeString handles the case where there is no trailing null byte,
so using it lets the code be a bit simpler.
2015-06-18 14:45:26 +02:00
yerejm fff81fecb1 Reinstate format string.
Avoid the consequences in the unlikely event the path includes a %.
2015-06-14 16:49:35 +10: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
Ryan Houdek a81d1c250a Merge pull request #2512 from JosJuice/bnr-size-match
VolumeGC: Check that opening.bnr size matches type
2015-06-07 23:20:54 -04: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
JosJuice 95a2abc1ce Use PanicAlertT instead of PanicAlert when appropriate
I tried to change messages that contained instructions for users,
while avoiding messages that are so technical that most users
wouldn't understand them even if they were in the right language.
2015-06-04 13:25:06 +02:00
JosJuice 78b6ed0218 VolumeGC: Check that opening.bnr size matches type
The old code would accept files with BNR1 length and BNR2 type, which
can be a problem when GetNames tries to read the extra BNR2 strings.
2015-06-03 11:35:05 +02:00
comex 349f9d5493 Merge pull request #2484 from JosJuice/volume-return-types
Volume: Use more appropriate types for some returned values
2015-06-02 20:29:08 -04:00
comex 2ae6fb9240 Merge pull request #2338 from JosJuice/getfilelist-return
Filesystem: Return file list reference instead of modifying argument
2015-06-02 20:28:25 -04:00
comex a3b3f0522b Merge pull request #1556 from comex/project-moration
Rudimentary version of Wii IPC determinism.  Ported from my old udpnet branch.
2015-06-02 18:38:19 -04:00
JosJuice 301218a103 Volume: Use more appropriate types for some returned values
Disc number is changed from bool to u8, and revision is changed from
int to u16 (WADs can use all 16 bits, but discs can only use 8 bits).
2015-05-29 21:14:02 +02:00
JosJuice 9a000f4085 Volume: Mark ReadWiiNames parameter as const
I forgot it when I added the method.
2015-05-29 20:19:11 +02:00
Lioncash ac26f8e79f Pass strings by const reference where possible 2015-05-28 20:54:55 -04:00
comex dc91e8b607 Add a mode to use a dummy Wii NAND.
Eventually, netplay will be able to use the host's NAND, but this could
still be useful in some cases; for TAS it definitely makes sense to have
a way to avoid using any preexisting NAND.

In terms of implementation: remove D_WIIUSER_IDX, which was just WIIROOT
+ "/", as well as some other indices which are pointless to have as
separate variables rather than just using the actual path (fixed, since
they're actual Wii NAND paths) at the call site.  Then split off
D_SESSION_WIIROOT_IDX, which can point to the dummy NAND directory, from
D_WIIROOT_IDX, which always points to the "real" one the user
configured.
2015-05-28 19:14:42 -04: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
Ryan Houdek 5911dd528a Merge pull request #2361 from JosJuice/filesystem-read32
Remove CFileSystemGCWii::Read32
2015-05-25 23:40:28 -04:00
Ryan Houdek 4ba430951a Merge pull request #2439 from JosJuice/company-from-id
Use an ID-to-name map when volume has no company string
2015-05-25 23:32:55 -04:00
Ryan Houdek 1d6375b71f Merge pull request #2339 from JosJuice/fix-wii-fst-size
Fix reading Wii FST size
2015-05-25 23:27:25 -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 d2e6adb045 Use an ID-to-name map when volume has no company string
This is written so that the result of GetCompanyFromID never is cached
(except on Android?). Caching is unnecessary because the string can be
obtained quickly at runtime, and not caching it means that the cache
doesn't have to be invalidated when GetCompanyFromID is edited.
2015-05-24 17:41:53 +02:00
Lioncash 383b104af0 WiiWad: Use correct form of delete for arrays 2015-05-22 17:52:54 -04: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 2d5d5fa83e Read opening.bnr to get names from Wii discs
This makes Dolphin display the same names as the Disc Channel.
2015-05-03 15:58:35 +02:00
JosJuice 272f9d3cbc FileSystemGCWii: Allow reading files partially 2015-05-03 15:44:24 +02:00
JosJuice 0d9ca081bb Remove CFileSystemGCWii::Read32
A function that does the same thing was added to IVolume in 4cd00e3.
2015-05-03 11:39:20 +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 04fcb72e0b Fix reading Wii FST size 2015-04-28 17:20:33 +02:00
JosJuice d43a920924 Filesystem: Return file list reference instead of modifying argument 2015-04-28 12:48:05 +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