Commit graph

18454 commits

Author SHA1 Message Date
Leo Lam
3fe8e102fc Merge pull request #5648 from leoetlino/qt-shutdown
Qt: Fix emulation stopped signal
2017-06-20 21:14:13 +02:00
Léo Lam
3613f33c9b IOS/ES: Make sure all contents are imported
This adds a check to ImportTitleDone to make sure all required contents
that are listed in the TMD have been imported before allowing to finish
the import. Not checking for this could allow titles to be left in an
inconsistent state.
2017-06-20 20:12:50 +02:00
Léo Lam
4d08e90f26 IOS/ES: Block ImportTitleDone if there's a content import 2017-06-20 11:57:00 +02:00
Anthony
b584d2797f Merge pull request #5508 from ligfx/qtresizerenderwidget
DolphinQt2: allow resizing RenderWidget/fix fullscreen
2017-06-19 12:26:18 -07:00
Léo Lam
fb135c99e3 Qt: Fix emulation stopped signal
Same old bug as in WX. The core is not shut down until the on stopped
callback is invoked.
2017-06-19 21:24:32 +02:00
shuffle2
74cab88a8c Merge pull request #5618 from lioncash/fifo
FifoRecorder: Don't allocate ~100.7MB on program startup
2017-06-19 08:02:51 -07:00
Leo Lam
1be10e7ebc Merge pull request #4940 from sjnewbury/wiimote-connect
Retry opening of wiimote channels on initial failure
2017-06-19 10:56:09 +02:00
Steven Newbury
e9a696b160 Retry opening of wiimote channels on initial failure #5997
There seems to be a race condition between a peripheral device
connecting to the bluetooth controller and it being ready to use.
It's very short and it depends upon the controller, some appear to
connect synchronously and block until the device is ready, others
report the device upon discovery but do not allow communication straight
away. I don't know which is the correct behaviour, or whether it depends
on the peripheral, controller or both. Anyway, Dolphin waits for a
remote to appear and immediately attempts to open the communication
channels, this can fail because the device isn't ready yet, delay, try
again, and it works.

There are other (unlikely) chances the device is busy at random
moments after this initial race condition so it loops around try to
reconnect.

This was inspired by an earlier patch, see here:
https://bugs.dolphin-emu.org/issues/5997#note-20

I can confirm that it works perfectly for me on a bluetooth
controller where otherwise it's impossible to connect (Dell 380
Bluetooth 4.0).
2017-06-19 09:22:04 +01:00
Starsam80
5399311a13
NANDImporter: Improve certificate extraction 2017-06-19 01:23:58 -06:00
Lioncash
82c66e2bab FifoRecorder: Don't allocate ~100.7MB on program startup
So, a FifoRecorder instance is instantiated as a file-local variable and
used as a singleton (ugh). Most users likely don't regularly use the
FIFO player/FIFO recorder, so this is kind of a substantial waste of
memory.

FifoRecorder's internal RAM and ExRAM vectors are 33554432 and 67108864
bytes respectively, which is around 100.66MB in total.

Just on the game list view on a clean build with nothing loaded, this
knocks debug build memory usage down from ~232.4MB to ~137.5MB, and
release build memory usage down from ~101MB to ~5.7MB.
2017-06-19 02:47:26 -04:00
Lioncash
59a947d41d AbstractTexture: Return config by const reference
Returning by const value isn't really necessary (and usually an indicator const reference was intended).
2017-06-18 23:38:42 -04:00
Lioncash
07cddf6f7f AbstractTexture: Add missing includes (and remove unnecessary ones) 2017-06-18 23:29:22 -04:00
Lioncash
0c57543205 VideoCommon: Fix VS filter for AbstractTexture.cpp
This would cause failures when building with VS.
2017-06-18 22:58:02 -04:00
shuffle2
f06e233d49 Merge pull request #5616 from ligfx/qtfocuseventtowindowactivation
DolphinQt2: FocusEventFilter -> WindowActivationEventFilter
2017-06-18 16:34:03 -07:00
shuffle2
b59eb76786 Merge pull request #5641 from leoetlino/analytics-timeout
Analytics: Set the timeout to 5 seconds
2017-06-18 16:33:18 -07:00
Michael Maltese
f7e2b8dab7 DSPCore: replace 'GC' with 'GameCube' in messages 2017-06-18 15:43:02 -07:00
Michael Maltese
9de2934aae DSPCore: remove message that the free ROM doesn't work with IPL
The GameCube IPL sounds the same when using the free ROM as it does when
using the official ROM (and in Audacity, I couldn't visually distinguish
between the waveforms). It has a reference to an unimplemented function
at 0x8644 which seems to only be used in an inlined version of the CARD
ucode.
2017-06-18 15:43:02 -07:00
Michael Maltese
84808d2e35 DSPCore: update free DSP ROM message for GBA ucode support
The GBA ucode is supported as of #5524 / d51be94.
2017-06-18 15:43:02 -07:00
shuffle2
98b751f810 Merge pull request #5643 from leoetlino/fix-memcpy
IOS/ES: Fix bug in ImportTicket ioctlv handler
2017-06-18 15:37:08 -07:00
Léo Lam
29e8988c90 Analytics: Set the timeout to 5 seconds
3 seconds is sometimes not enough.
2017-06-18 23:16:03 +02:00
Leo Lam
9a1503a75c Merge pull request #5642 from lioncash/chrono
HttpRequest: Use std::chrono for indicating time periods
2017-06-18 23:13:52 +02:00
Léo Lam
961c85bf7c IOS/ES: Fix bug in ImportTicket ioctlv handler 2017-06-18 23:09:30 +02:00
Léo Lam
7222ce78ff SysConf: Don't set "config done" flags by default
This allows the user to go through the Wii Menu first boot setup
screen when they launch the System Menu for the first time.

Most useful on a clean profile, after doing a full system update,
to configure settings like the console country.
2017-06-18 22:32:56 +02:00
shuffle2
5072f4e5c3 Merge pull request #5638 from leoetlino/sysconf
Rewrite SysConf handling
2017-06-18 13:19:11 -07:00
shuffle2
e63c337830 Merge pull request #5305 from iwubcode/abstract_texture
Abstract Texture
2017-06-18 12:57:05 -07:00
Lioncash
251de89b5c HttpRequest: Use std::chrono for indicating time periods
Allows the use of chrono time points, on top of being more indicative of
time periods used at call sites, if custom timeouts are specified.
2017-06-18 15:48:37 -04:00
Léo Lam
d86f020e81 Rewrite SysConf handling
This rewrites the SysConf code for several reasons:

* Modernising the SysConf class. The naming was entirely cleaned up.
  constexpr for constants.

* Exposing less stuff in the header.

* Probably less efficient parsing and writing logic, but much simpler
  to understand and use in my opinion. No more hardcoded offsets.
  No more duplicated code for the initial SYSCONF generation.

* More flexibility. It is now possible to add and remove entries,
  since we rebuild the file. This allows us to stop spamming
  "section not found" panic alerts; we can now use and insert
  default entries.
2017-06-18 16:17:05 +02:00
Tillmann Karras
9a2bef97da JitCache: use SymbolDB names as JIT block names 2017-06-18 06:58:44 +01:00
shuffle2
e9c0535519 Merge pull request #5632 from sepalani/file
File/IOFile: Check _tfopen_s properly
2017-06-17 15:03:10 -07:00
Léo Lam
e1990e2645 IOS/ES: Fix title ordering
On a real Wii, the title list is not in any particular order. However,
because of how the flash filesystem works, titles such as 1-2 are
*never* in the first position. We must keep this behaviour, or some
versions of the System Menu may break.
2017-06-17 22:39:08 +02:00
Stenzek
68fef47aef Merge pull request #5314 from stenzek/revert-efb-source-truncation
TextureConversionShader: Use integer math for truncating EFB format
2017-06-17 15:21:48 +10:00
Stenzek
adebe2239e TextureConversionShader: Use integer math for truncating EFB format 2017-06-17 12:17:09 +10:00
Sepalani
b359d82890 File/IOFile: Check _tfopen_s properly 2017-06-17 02:16:58 +01:00
Leo Lam
10beb2aea1 Merge pull request #5628 from JosJuice/updatetitle-encoding
DolphinWX: Fix encoding errors in UpdateTitle
2017-06-16 18:37:59 +02:00
Leo Lam
bc9c9b9fe4 Merge pull request #5594 from MerryMage/phack
Cleanup Projection Hack
2017-06-16 18:36:39 +02:00
Leo Lam
cc9bd0b0f0 Merge pull request #5625 from leoetlino/fileutil-fixes
FileUtil fixes
2017-06-16 18:31:50 +02:00
JosJuice
4bee7b7605 DolphinWX: Fix encoding errors in UpdateTitle
An implicit conversion from std::string to wxString
was to blame, as usual. Fixes issue 10341.
2017-06-16 17:20:13 +02:00
Léo Lam
6249244c90 IOS/ES: Fix formatting 2017-06-16 16:17:38 +02:00
Léo Lam
6503a9f538 Allow the user to ignore signature issues during WAD import
Improves usability with signature checks.
2017-06-16 16:17:38 +02:00
Léo Lam
c08806d107 IOS/ES: Verify containers in GetTMDStoredContents 2017-06-16 16:17:38 +02:00
Léo Lam
d77b7ac90e IOS/ES: Verify containers in SetUpStreamKey 2017-06-16 16:17:38 +02:00
Léo Lam
36c5caacf4 IOS/ES: Verify containers in ImportTmd 2017-06-16 16:17:37 +02:00
Léo Lam
54025da00f IOS/ES: Add note about verification in DiVerify
We probably don't want to verify containers there because it might
result in patched/custom games failing the check.
2017-06-16 16:17:37 +02:00
Léo Lam
8a49e1f7db IOS/ES: Verify containers in ImportTitleInit 2017-06-16 16:17:37 +02:00
Léo Lam
719af1aff4 IOS/ES: Verify containers in ImportTicket 2017-06-16 16:17:37 +02:00
Léo Lam
07d83ada39 IOS/ES: Create missing directories at boot
Something that IOS does and that Dolphin doesn't, for whatever reason.
2017-06-16 16:17:37 +02:00
Léo Lam
f3bf1d626c IOS/ES: Add helper function ReadCertStore 2017-06-16 16:17:37 +02:00
Léo Lam
88348e2903 IOS/ES: Add VerifyContainer
Will be used from several functions to verify the signatures for
different containers (TMDs, tickets, device signed blobs).

An option was added to disable signature checks, because that could be
useful for people trying to import unsigned stuff.
2017-06-16 16:17:37 +02:00
Léo Lam
34c9bf391e IOS: Correct ES return code names about signatures
-1027 is used when ES cannot find the issuer of a certificate.

-1012 is used when the signature type is invalid.
2017-06-16 15:49:40 +02:00
Shawn Hoffman
1ada68aecd windows: fix handle leak when using continuous scan 2017-06-16 04:00:32 -07:00
Léo Lam
01faa5c852 FileUtil: Use errno for printing errors in IsDirectory
stat() returns an error code in errno on both POSIX compliant
platforms and Windows.

This means we should always use errno instead of GetLastErrorMsg
which uses GetLastError() (Win32) on Windows.
2017-06-16 12:43:41 +02:00
Léo Lam
aa63199977 FileUtil: Don't manually strip trailing slashes
POSIX allows one or more trailing slashes for directories.

From POSIX.1-2008, section 3.271 (Base Definitions / Pathname):

> A pathname can optionally contain one or more trailing <slash>
> characters. Multiple successive <slash> characters are considered to
> be the same as one <slash>, except for the case of exactly two
> leading <slash> characters.

On Windows, the extra trailing slashes are ignored for directories too.
2017-06-16 12:31:26 +02:00
Leo Lam
405d2e28ad Merge pull request #5621 from Orphis/d3d_include
d3d: Add missing include
2017-06-16 10:53:56 +02:00
Shawn Hoffman
f469d86467 cmake/win32: add CompatPatches 2017-06-15 21:26:40 -07:00
Shawn Hoffman
1210c74955 [windows]: Apply compatibility patches to problematic gamepad vibration drivers.
Move ucrtFreadWorkaround to use the new LdrWatcher.
2017-06-15 21:21:01 -07:00
Florent Castelli
0b504fa046 d3d: Add missing include 2017-06-16 05:52:01 +02:00
Shawn Hoffman
e51071a9c5 msbuild: put pugixml in Externals solution filter; fix project reference. 2017-06-15 19:06:16 -07:00
Michael Maltese
5b3b6b7f3d DolphinQt2: FocusEventFilter -> WindowActivationEventFilter 2017-06-15 16:12:05 -07:00
Lioncash
dd4203bec8 Core: Remove unnecessary includes
Also moves a cpp file's related header file to the top of the inclusions if it isn't already there.
2017-06-15 18:52:22 -04:00
Lioncash
b003108b8b Core: Add WiimoteCommon headers to the VS project 2017-06-15 18:38:21 -04:00
Leo Lam
8f460a1cda Merge pull request #5611 from JosJuice/reorganize-file-namespace
Reorganize File namespace
2017-06-15 23:28:36 +02:00
JosJuice
cf94ce6305 Add a namespace to OpenFStream
For consistency with the other functions in FileUtil.h.
2017-06-15 21:34:04 +02:00
JosJuice
f09ceaa735 Move IOFile to a separate file
Reduces the number of files that need to be recompiled
when making changes to FileUtil.h.
2017-06-15 21:33:50 +02:00
Leo Lam
9bc1b652fe Merge pull request #5601 from leoetlino/esformats-additions
ESFormats additions and fixes
2017-06-15 21:32:44 +02:00
Leo Lam
743284d39d Merge pull request #5606 from leoetlino/include
NoGUI: Fix a missing include for Xlib
2017-06-15 21:31:21 +02:00
Leo Lam
09c0a3caaf Merge pull request #2820 from JosJuice/filesystem
Filesystem redesign and performance improvements
2017-06-15 21:24:42 +02:00
MerryMage
f8a99ca192 VertexShaderManager: Rename projection hack variables 2017-06-15 16:38:10 +01:00
MerryMage
44f2420517 GraphicsSettings: PH_ZNear and PH_ZFar are std::strings 2017-06-15 16:38:06 +01:00
Léo Lam
a370ad5f6d IOS/ESFormats: Fix content map writing
On Windows, this would fail because the file handle wasn't closed.
2017-06-14 23:13:46 +02:00
Léo Lam
8865208571 IOS/ESFormats: Add ParseCertChain
This will be used to avoid duplicating cert chain parsing code.
2017-06-14 22:45:30 +02:00
Léo Lam
e29f6e383f IOS/ESFormats: Add CertReader 2017-06-14 22:45:30 +02:00
Léo Lam
90280b3f84 IOS/ESFormats: Remove unused TMDReader function
The ES function that used to make use of it was changed to be more
sane, so GetRawHeader() is now unused and useless.
2017-06-14 22:45:29 +02:00
Léo Lam
6c3069be97 IOS/ESFormats: Use SignedBlobReader for TMDs and tickets 2017-06-14 22:45:29 +02:00
Léo Lam
2ec04675c9 IOS/ESFormats: Add SignedBlobReader
Allows common signature parsing code to not be duplicated.
2017-06-14 22:45:29 +02:00
Anthony
335f54cac6 Merge pull request #5609 from leoetlino/qt-user-path
Qt: Support custom user profile paths
2017-06-14 13:40:37 -07:00
JosJuice
583406d900 Filesystem: Make destructors = default 2017-06-14 15:26:04 +02:00
JosJuice
0b7d2e7c68 Filesystem: Modernize variable names 2017-06-14 15:25:09 +02:00
JosJuice
e3a2cd827a Filesystem: Do more validity checking in the constructor
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-14 15:25:05 +02:00
JosJuice
ee27be06d7 Filesystem: Add a cache for finding file info by disc offset
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-14 15:25:02 +02:00
JosJuice
87916fe099 Filesystem: Replace GetFileList()
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-14 15:23:48 +02:00
Léo Lam
a9630727fe Qt: Support custom user profile paths
Pretty much the most important option to support, even for a UI
frontend that's still a WIP. It's essential for testing.
2017-06-14 14:31:30 +02:00
Leo Lam
40a9e585a7 Merge pull request #5604 from sepalani/wx-rm-path
PathConfigPane: Prevent an invalid index assert
2017-06-14 13:30:15 +02:00
Sepalani
2a349f8e49 PathConfigPane: Prevent an invalid index assert 2017-06-14 12:07:25 +01:00
Leo Lam
c71cb9ac49 Merge pull request #5608 from Starsam80/qt-should-be-like-wx
Qt/MappingWindow: Update layout to match WX
2017-06-14 11:14:34 +02:00
Leo Lam
54e882941c Merge pull request #5600 from leoetlino/xml-library
Externals: Add zeux/pugixml@38edf25
2017-06-14 11:13:32 +02:00
Leo Lam
36efcc9f39 Merge pull request #5599 from leoetlino/http-request
Common: Add HttpRequest to simplify HTTP requests
2017-06-14 11:12:56 +02:00
Starsam80
e023cc124b
Qt/MappingWindow: Update layout to match WX 2017-06-13 22:42:53 -06:00
JosJuice
ee2b88ebb6 Filesystem: Store pointer to beginning of FST in file infos
Needed for the next commit.
2017-06-13 22:44:15 +02:00
JosJuice
1262f08ac1 Filesystem: Better validity checking
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-13 22:44:11 +02:00
JosJuice
afe2bc60f6 Filesystem: Initialize everything in constructor
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-13 22:44:07 +02:00
JosJuice
d6ee7ec32c Filesystem: Read the entire FST in one go
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-13 22:43:41 +02:00
JosJuice
f49b64caff Filesystem: Rewrite finding file info by path for performance
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-13 22:41:02 +02:00
JosJuice
7c45afecb2 Filesystem: Use file info in arguments instead of path
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-13 22:40:57 +02:00
JosJuice
3d5ef948d0 Filesystem: Make FindFileInfo public 2017-06-13 22:40:53 +02:00
JosJuice
07d3a39aeb Filesystem: Replace file info's full path with name
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-13 22:38:31 +02:00
JosJuice
5021b4a567 Filesystem: Replace FileInfo struct with interface
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-13 22:37:43 +02:00
Leo Lam
38c60156ce Merge pull request #5479 from spycrab/qt_mapping_io_win
Qt: Implement advanced mapping I/O windows
2017-06-13 21:09:45 +02:00
Léo Lam
0d58a0bfe2 HttpRequest: Add support for custom timeouts 2017-06-13 19:17:11 +02:00
spycrab
50c13c1902 Qt: Implement advanced mapping I/O windows 2017-06-13 17:16:41 +02:00
JosJuice
95bc57cff3 DiscScrubber: Use FileInfo::IsDirectory instead of bit magic 2017-06-13 17:01:39 +02:00