Commit Graph

224 Commits

Author SHA1 Message Date
Lioncash 50a476c371 Assert: Uppercase assertion macros
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).
2018-03-14 22:03:12 -04:00
JosJuice 1f1dae367d Unify ISOFile (wx) with GameFile (Qt) and put it in UICommon
The original reason I wanted to do this was so that we can replace
the Android-specific code with this in the future, but of course,
just deduplicating between DolphinWX and DolphinQt2 is nice too.

Fixes:

- DolphinQt2 showing the wrong size for split WBFS disc images.

- DolphinQt2 being case sensitive when checking if a file is a DOL/ELF.

- DolphinQt2 not detecting when a Wii banner has become available
after the game list cache was created.

Removes:

- DolphinWX's ability to load PNGs as custom banners. But it was
already rather broken (see https://bugs.dolphin-emu.org/issues/10365
and https://bugs.dolphin-emu.org/issues/10366). The reason I removed
this was because PNG decoding relied on wx code and we don't have any
good non-wx/Qt code for loading PNG files right now (let's not use
SOIL), but we should be able to use libpng directly to implement PNG
loading in the future.

- DolphinQt2's ability to ignore a cached game if the last modified
time differs. We currently don't have a non-wx/Qt way to get the time.
2018-03-09 13:08:38 +01:00
spycrab 0dd52ca7ab UICommon: Move screensaver code to UICommon 2018-01-03 12:38:33 +01:00
JosJuice b3b7aef09a Android: Extract Sys to a different folder than the User folder 2017-12-26 09:53:32 +01:00
Ryan Meredith 1f226ec14f Update Readme.md and various fixes 2017-12-20 10:54:51 +01:00
Léo Lam 05c8d229af Config: Handle unknown system strings better
Currently, a simple typo in the system name will trigger an assert
message that complains about a "programming error". This is not
user friendly and misleading.

So this changes GetSystemFromName to return an std::optional, which
allows for callers to check whether the system exists and handle
failures better.
2017-11-26 18:24:01 +01:00
Léo Lam 653977cec7 UICommon: Fix unsafe usage of optparse::Values::all
The const-qualified all() member method triggers undefined behaviour
if the option passed to it is not set.
2017-11-26 18:18:49 +01:00
Léo Lam 60afb1d1b4 WX: Fix argument parsing
Manually convert each argument to a UTF-8 std::string, because the
implicit conversion for wxCmdLineArgsArray to char** calls ToAscii
(which is obviously undesired).

Fixes https://bugs.dolphin-emu.org/issues/10274
2017-11-26 18:18:48 +01:00
MerryMage 4c24629b95 Config: Flatten structures
Originally, Layer contained a std::map of Sections, which containted a std::map
containing the (key, value) pairs. Here we flattern this structure so that only
one std::map is required, reducing the number of indirections required and
vastly simplifying the code.
2017-11-15 18:04:40 +00:00
MerryMage f3b52c07d7 CommandLineParser: Use ConfigLocation 2017-11-15 18:04:40 +00:00
Léo Lam 4b4a9a6486 UI: Implement a command line option to boot NAND title 2017-10-24 11:41:55 +02:00
Ryan Meredith f8b89b7b1a Update -d argument help message 2017-09-10 12:28:53 +02:00
Lioncash 696e1b40b5 Common: Move version strings to their own header
Ideally Common.h wouldn't be a header in the Common library, and instead be renamed to something else, like PlatformCompatibility.h or something, but even then, there's still some things in the header that don't really fall under that label

This moves the version strings out to their own version header that doesn't dump a bunch of other unrelated things into scope, like what Common.h was doing.

This also places them into the Common namespace, as opposed to letting them sit in the global namespace.
2017-09-09 19:28:10 -04:00
Jonathan Hamilton d2d355bb50 Buildfix for X11 where HAVE_XRANDR is disabled
The "X.h" header *just* contains protocol constants, not functions or
typedefs - so stuff like "Display" and "Window" are not defined unless
you include "Xlib.h".

"Xrandr.h" happens to include "Xlib.h" itself, so enabling xrandr
effectively worked around this issue.
2017-09-09 11:49:20 -07:00
Léo Lam f5fd183571 Config: Fix the loader Load() being called twice
The Config::AddLoadLayer functions call Load on the layer
explicitly, but Load is already called in the constructor,
so they'd cause the loader's Load function to be called twice,
which is potentially expensive considering we have to read an INI
from the host filesystem.

This commit removes the Config::AddLoadLayer functions because
they don't appear to be necessary.
2017-07-31 22:32:05 +08:00
Michael Maltese 28d6c61e34 LogManager: use layered config 2017-07-09 16:28:54 -07:00
spycrab 4d37190327 Make Visual Studio happy 2017-06-28 20:42:01 +02:00
spycrab 7c97c14eba UICommon: Move Wx Graphics Settings functions 2017-06-28 20:13:37 +02:00
Léo Lam 0c7b9570b4 Move WiiUtils to Core
Allows reusing the WAD import logic more easily, whereas UICommon
code can only be used from UICommon and UI.

And managing what's on the NAND is the Core's responsability, not UI.
2017-06-28 11:22:10 +02:00
spycrab 2de31317e9 UICommon: Move TriggerSTMPowerEvent() from Wx 2017-06-26 16:28:39 +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 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 6c3069be97 IOS/ESFormats: Use SignedBlobReader for TMDs and tickets 2017-06-14 22:45:29 +02:00
JosJuice b2af07a7b7 DiscIO: Remove C/I/S prefixes from class names
These prefixes were inconsistent with the rest of Dolphin.

I'm also renaming VolumeWiiCrypted to VolumeWii because of 1113b13.
2017-06-06 12:31:59 +02:00
shuffle2 c8166951a0 Merge pull request #5418 from MerryMage/config-again-and-again
VideoConfig: Port to layered configuration system
2017-06-05 21:11:04 -07:00
Shawn Hoffman 7431dd3dce msbuild: make Externals inclusion methods uniform 2017-06-03 18:20:41 -07:00
Shawn Hoffman a6c102ba5c msbuild: remove extra zlib include from UICommon 2017-06-03 18:20:41 -07:00
Shawn Hoffman a3caa14ade remove duplicate code in msbuild files 2017-06-03 18:20:40 -07:00
MerryMage 41afe78a44 Config: Integrate 2017-06-03 18:11:57 +01:00
BhaaL 072c161445 upgrade to Windows SDK 10.0.15063.0
this is required for /permissive- to work, because some headers in the
Windows SDK use Microsoft extensions that are not allowed in standards mode
2017-05-28 13:37:31 +02:00
Pierre Bourdon d592bdd4d4 Migrate to Visual Studio 2017.
Auto-generated by the IDE, I'll trust it knows what it's doing.
2017-05-25 15:58:59 -07:00
Léo Lam c8bffb0153 Reuse the IOS code for WAD installation
* Less code and logic duplication.

* Fixes a bug with the data dir not being created, steps being done in
  the wrong order.
2017-05-14 15:30:42 +02:00
spycrab c8d0b647ac Qt: Add controller (overview) window 2017-05-09 18:49:10 +02:00
Léo Lam 32a1b5068a Revert "Use a single libusb context"
This reverts commit c8a6dc6c23.

libusb on Windows isn't really safe to use from different threads
with a single context.
2017-03-26 15:58:30 +02:00
Léo Lam 3028158873 UICommon: Don't print --version option twice
cpp-optparse already has the --version option built-in, so having our
own version option results in --version being shown twice.
2017-03-21 22:29:01 +01:00
Markus Wick ae0f9c200d Merge pull request #5038 from vladfi1/separate-nogui
Separate nogui
2017-03-10 10:50:08 +01:00
Vlad Firoiu 6a89cf0201 Moved X11Utils into UICommon. 2017-03-08 01:24:10 -08:00
Ryan Houdek 94d35ab7cb Implement command line option setting 2017-03-05 15:47:23 +01:00
Lioncash 13757b7d35 UICommon: Make GetNewDisassembler() return a unique_ptr
Much better than just returning raw memory.
2017-03-02 21:26:17 -05:00
Lioncash ee61bd6f2e CMakeLists: Normalize whitespace
Normalizes tabs to spaces to follow our codebase's indentation style.
2017-03-01 14:53:23 -05:00
Ryan Houdek f61363a791 Add command line parsing to UICommon. 2017-02-16 17:24:58 +01:00
Ryan Houdek 77c7fa836f Add the cpp-optparse project to Externals.
From https://github.com/weisslj/cpp-argparse
2017-02-16 14:09:13 +01:00
orbea 6913e8c3ac Fix LLVM error 2017-02-10 19:07:30 -08:00
JosJuice 99492c22a6 Merge pull request #4839 from leoetlino/better-warnings
Be less annoying when usbdk is not installed
2017-02-08 14:00:12 +01:00
Florent Castelli 9ca4037ed9 UICommon: Rename HAS_LLVM to HAVE_LLVM 2017-02-08 03:30:38 +01:00
Florent Castelli f649e26655 cmake: Move LLVM import to UICommon
To use it, with a modern LLVM (3.9+), set your CMAKE_PREFIX_PATH
to point to the LLVM install folder or to a LLVM build folder.
We're linking ALL of LLVM libs since I don't really know which ones we need.
LTO will take care of sliming the binary size...
2017-02-08 03:30:38 +01:00
Léo Lam 6a0bf24e0b Move libusb context initialization to on first use
This prevents libusb warnings from showing up even when the user is
not using Bluetooth or USB passthrough, or the Wii U GC adapter.
2017-02-07 00:47:21 +01:00
Léo Lam c8a6dc6c23 Use a single libusb context
libusb on Windows is limited to only a single context. Trying to open
more than one can cause device enumerations to fail randomly.

libusb is thread-safe and we don't use the manual polling support (with
`poll()`) so this should be safe.
2017-02-05 11:36:48 +01:00
Léo Lam 69a13a12e2 Add USB passthrough setting and USBUtils
This adds a USB passthrough setting to ConfigManager and everything
needed for the UI to show and manage the whitelist properly.
2017-02-05 11:36:46 +01:00
Neui 6da062eb6a UICommon: Use $DOLPHIN_EMU_PATH for the user directory, if set 2016-12-20 21:21:31 +01:00
Léo Lam 39fd6dcd5b Fix missing includes
Aren't indirect includes great?
2016-10-07 23:46:41 +02:00
shuffle2 f121fa07c2 Merge pull request #2868 from sepalani/dolphin_ssl
Dolphin new Dump SSL features
2016-10-03 06:16:49 -07:00
Rukai f42350e719 portable.txt enables portable configuration on linux, README updated to
show how to build a portable and a local dolphin on linux.
2016-07-04 19:39:10 +10:00
Sepalani 529ca245d7 Added: more SSL features, plus SSL dump folder
Dump: rootca, peercert
2016-07-01 14:33:54 +04:00
Pierre Bourdon 3570c7f03a Reformat all the things. Have fun with merge conflicts. 2016-06-24 10:43:46 +02:00
degasus 0c92603fd5 Merge VideoBackendHardware into VideoBackend.
And rename it to VideoBackendBase because of conflicts within the backends itself.
2016-01-12 23:18:58 +01:00
Ryan Houdek 6e503bebc4 Add a stubbed GCAdapter namespace.
This cleans up a bunch of #ifdef checks in places.
2016-01-06 00:57:08 -06:00
Ryan Houdek 371e9f4fae Move SI_GCAdapter over to InputCommon 2016-01-05 13:44:37 -06:00
Emmanuel Gil Peyrot e20b08491c UICommon: Respect XDG Base Directory Specification on POSIX systems. 2015-11-10 21:53:29 +00:00
Shawn Hoffman aa7208e270 [windows] Update projects to vs2015. 2015-09-03 04:23:01 -07:00
Ryan Houdek 988c4f1de8 Have the disassembler show the PC next to host instructions. 2015-08-07 02:43:54 -05:00
Lioncash 7387914529 UICommon: Fix a leak/bug in Disassembler retrieval 2015-08-04 14:28:32 -04:00
Lioncash df30910b06 UICommon: Pass string by const reference for HostDisassemblerLLVM 2015-07-28 22:32:34 -04:00
degasus c375111076 Options: merge SCoreStartupParameter into SConfig 2015-06-12 19:07:45 +02:00
comex 36b554613c Merge pull request #2494 from Sonicadvance1/common_disassembler
Break out the disassembler code from the WXWidgets UI.
2015-06-02 20:26:26 -04:00
Ryan Houdek d0ae3f7d24 Break out the disassembler code from the WXWidgets UI.
This cleans up some of the code between core and UI for disassembling and dumping code blocks.
Should help the QT UI in bringing up its debug UI since it won't have to deal with this garbage now.
2015-05-31 18:16:59 -05: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
Tillmann Karras cefcb0ace9 Update license headers to GPLv2+ 2015-05-25 13:22:31 +02:00
Ryan Houdek aaf04aeaca Fix user directories at times doing stupid things.
With my previous changes Dolphin would fail to create the user directory if it didn't exist, and would dump all the configuration options in to the cwdir.
This was a bit more complicated to fix in a clean fashion, so I took to moving around code concerning user directories.
Instead of having GetUserPath serve a dual purpose of both getting and setting our user directories, break out to a new SetUserPath function.

GetUserPath will know only get the configured user path.
SetUserPath will set our user paths and setup the internal user path state.

This ending up being a lot cleaner overall, which is nice. Also less mind bending when attempting to read the code.

So now we won't dump all of our configuration in to the cwdir if ~/.dolphin-emu isn't found.

Fixes issue 8371.
2015-03-15 09:19:48 -05:00
Ryan Houdek db06f058e4 Move user directory detection location to UICommon.
The UI should decide on where it wants the user directory, not our core system.
This is in anticipation of some upcoming work on Android which will need proper user directory setting.
2015-02-25 03:31:59 -06:00
Jules Blok 262c3b19ec PostProcessing: Add support for user-supplied anaglyph shaders.
There are lots of different anaglyph glasses out there and there may be even more creative uses for stereoscopic post-processing shaders.
2015-01-25 22:07:03 +01:00
skidau 8d4a47d40c Added GameCube Adapter support.
The libusb driver must be installed on the adapter (e.g. zadig can be used to install the driver in Windows).  GameCube pad controllers are supported and will override the current input device assigned to the port.  GameCube controller buttons are auto-configured and cannot be re-assigned.  Rumble is supported.  Hotplug is supported while playing a game.  If a controller is unplugged from the adapter, Dolphin will fallback to using the host input device on that port.  If a port on the adapter is unused, Dolphin will use the host input device for that port, allowing a mixture of host input devices and controllers connected to the adapter.

The adapter support can be disabled in the Controllers config if the OS driver is preferred (allowing the pad buttons to be reconfigured).

One adapter per system is supported.
2014-12-10 20:45:45 +11:00
Augustin Cavalier 19109e2d01 Migrate global init stuff into UICommon.
This avoids code duplication in a bunch of places .
I also moved the NVIDIA Optimus export into VideoCommon.
2014-10-05 20:47:37 -04:00