Commit graph

16831 commits

Author SHA1 Message Date
Léo Lam
7a1f676ef4 Always use configured root when installing WAD
This prevents Dolphin from writing to /sys/uid.sys (on the host; root
partition) when installing a WAD before starting emulation, because
the session root is not initialized at that moment.

Incidentally, this also gets rid of a singleton.
2017-02-10 19:12:08 +01:00
Lioncash
1ce1304d0f CPU Backends: Make each CPU backend responsible for initializing its own
instruction tables

Previously, all of the internals that handled how the instruction tables
are initialized were exposed externally. However, this can all be made
private to each CPU backend.

If each backend has an Init() function, then this is where the instruction
tables should be initialized, it shouldn't be the responsibility of
external code to ensure internal validity.

This allows for getting rid of all the table initialization shenanigans
within JitInterface and PPCTables.
2017-02-10 13:08:14 -05:00
Lioncash
5da7d700ca JIT: Make compilation functions a part of the JIT classes 2017-02-10 13:05:44 -05:00
Anthony
96e83b5d54 Merge pull request #4764 from aldelaro5/crash-fix-inputconfig
InputConfigDialog pass the device_cbox to the wiimote extension dialogs
2017-02-09 21:50:44 -08:00
degasus
4d3883a756 JitArm64: Handle stack faults. 2017-02-10 00:32:21 +01:00
degasus
40b7cc9252 JitArm64: Use a custom stack with proper guard pages. 2017-02-10 00:32:17 +01:00
Lioncash
6a75ea5653 ControllerEmu: Separate ControlGroup from ControllerEmu
ControllerEmu, the class, is essentially acting like a namespace for
ControlGroup. This makes it impossible to forward declare any of the
internals. It also globs a bunch of classes together which is kind of a
pain to manage.

This splits ControlGroup and the classes it contains into their own source
files and situates them all within a namespace, which gets them out of
global scope.

Since this allows forward declarations for the once-internal classes, it
now requires significantly less files to be rebuilt if anything is changed
in the ControllerEmu portion of code.

It does not split out the settings classes yet, however, as it
would be preferable to make a settings base class that all settings derive
from, but this would be a functional change -- this commit only intends to
move around existing code. Extracting the settings class will be done in
another commit.
2017-02-09 18:18:52 -05:00
Michael Maltese
31e3424367 Movie: replace magic number 8 with sizeof(ControllerState)
(Bonus points for rhyming commit message)
2017-02-09 15:07:47 -08:00
JosJuice
657639899f Merge pull request #4872 from lioncash/scan
GameListCtrl: Separate some scanning code into functions
2017-02-09 20:56:29 +01:00
Lioncash
ea6e75d45f GameListCtrl: Separate some scanning code into functions
Several of the things done while performing a scan are logically their own
behavior (e.g. loading a titles file, checking if an entry should be added, etc).
2017-02-09 14:50:20 -05:00
Lioncash
56531a0b7f ControllerEmu: Fix incorrect default radius being set in AnalogStick
The three parameter AnalogStick constructor takes an internal name, a
display name, and a default radius argument. The delegated constructor is
the one that calls the ControlGroup constructor, setting the group type,
so passing the group type here is a logic bug.

The only reason this appeared to work despite this bug is because
GROUP_TYPE_STICK has a value of 1, and the default radius value used for
attachment sticks is 1.0.
2017-02-08 23:08:13 -05:00
Mat M
73382852b7 Merge pull request #4502 from ligfx/extractcontrolreference
InputCommon: Extract ControlReference from ControllerInterface
2017-02-08 20:01:18 -05:00
Pierre Bourdon
17e4b450fb Merge pull request #4784 from leoetlino/mios
IOS: Implement MIOS functionality
2017-02-09 01:57:16 +01:00
JosJuice
01073946b4 Fix default audio backend on Android being "No audio output"
People who already have encountered the problem will need to
manually change the audio backend (or delete the config INI).
2017-02-08 21:29:27 +01:00
Lioncash
90273191da Boot: Add missing includes 2017-02-08 10:57:24 -05:00
Lioncash
3b41d4806c Boot_BS2Emu: Get rid of unnecessary headers 2017-02-08 10:57:16 -05:00
Lioncash
57d543b10a ElfReader: Get rid of unnecessary includes 2017-02-08 10:57:10 -05:00
Lioncash
95a918b9f8 Boot_WiiWAD: Get rid of unnecessary includes 2017-02-08 10:43:50 -05:00
Léo Lam
a085cd431d Adjust event times after a PPC clock change
This likely doesn't change much, but it makes events trigger at the
correct time after a clock change.
2017-02-08 16:22:27 +01:00
Lioncash
e6ffce3ac9 ElfReader: Make constructor explicit
Allowing implicit conversions here is definitely not desirable.
2017-02-08 10:20:06 -05:00
Léo Lam
fdfe57a49b IOS: Implement MIOS functionality
This implements MIOS's PPC bootstrapping functionality, which enables
users to start a GameCube game from the Wii System Menu.

Because we aren't doing Starlet LLE (and don't have a boot1), we can
just jump to MIOS when the emulated software does an ES_LAUNCH or uses
ioctlv 0x25 to launch BC.

Note that the process is more complex on a real Wii and goes through
several more steps before getting to MIOS:

* The System Menu detects a GameCube disc and launches BC (1-100)
  instead of the game. [Dolphin does this too.]

* BC, which is reportedly very similar to boot1, lowers the Hollywood
  clock speed to the Flipper's and then launches boot2.

* boot2 sees the lowered clock speed and launches MIOS (1-101) instead
  of the System Menu.

MIOS runs instead of IOS in GC mode and has an embedded GC IPL (which
is the code actually responsible for loading the disc game) and a PPC
bootstrap code. To get things working properly, we simply need to load
both to memory, then jump to the bootstrap code at 0x3400.

Obviously, because of the way this works, a real MIOS is required.
2017-02-08 15:07:34 +01:00
Léo Lam
4662e25cbb DolphinWX: Fix overclock slider clock display 2017-02-08 15:07:34 +01:00
Léo Lam
fd49a1b2d5 Get rid of GetUsbPointer for emulated Bluetooth
It held a raw pointer to a IOS::HLE::Device::BluetoothEmu that is not
guaranteed to exist (and of course, nothing checked that it wasn't
nullptr), but what is more, it's totally unnecessary because we have
IOS::HLE::GetDeviceByName().

Since we cannot always inform the host that Wii remotes are
disconnected from ES, that is now done in BluetoothEmu's destructor.
2017-02-08 15:07:33 +01:00
Léo Lam
5fd5eeb82a IOS/ES: Don't write anything to the request after ES_Launch
Unless IOS failed at ES_Launch, it doesn't appear to write anything
back to the request after a launch, because the request is never
actually replied to in the normal way.

So let's just drop the writes to make things less confusing.
2017-02-08 15:07:33 +01:00
Léo Lam
9e6f5b203e IOS/ES: Implement ioctlv 0x25 (ES_LaunchBC)
This ioctlv is used to launch BC. Not sure if that's useful,
since only the system menu is known to launch BC and it does that
through a regular ES_LAUNCH; but let's implement it anyway.

(Implementation based on IOS59.)
2017-02-08 15:07:32 +01:00
Léo Lam
ab38be1ee2 IOS: Clarify Init, Reinit, Reset, Shutdown
Some minor changes to make things slightly less confusing:

* Reinit doesn't actually init anything. It just adds static devices to
  the map, so let's give it an actually descriptive name. And let's not
  expose it in the header when it should not be.

* Reset's parameter name was changed from "force" -- which totally does
  not describe what it does -- to "clear_devices".

* Add a reload function which handles the reload process properly
  (reset all devices, set up memory values, re-add devices) and
  without publicly exposing implementation details.
2017-02-08 15:07:29 +01:00
Matt Mastracci
961f84b767 DVD read chunking
Splits DVD reads up into smaller chunks so that data is available
before the final interrupt is triggered. This better simulates the DMA
that happens on a real device, which some games will take advantage of -
by either playing back data as it is loading or by using data that is
going to be overwritten shortly by an outstanding read.
2017-02-08 14:18:55 +01: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
Markus Wick
027719d8e2 Merge pull request #4711 from lioncash/tables
JIT Instruction Tables: Eliminate JIT global usages
2017-02-08 09:39:50 +01:00
Michael Maltese
2d51bf579f ControlReference: put parsed_expression in a unique_ptr 2017-02-07 22:59:29 -08:00
Michael Maltese
492d5b6ac7 ControlReference: hide parse_error behind GetParseStatus() 2017-02-07 22:59:26 -08:00
Michael Maltese
9a632ea7b9 ControlReference: hide is_input behind function 2017-02-07 22:59:21 -08:00
Michael Maltese
813a725f68 ControlReference: move function bodies out of header 2017-02-07 22:59:14 -08:00
Michael Maltese
a509f56116 InputCommon: Extract ControlReference from ControllerInterface
Better separation of concerns. Relegates `ControllerInterface` to
enumerating input controls, and the new `ControlReference` deals with
combining inputs and configuration expression parsing.
2017-02-07 22:59:10 -08:00
Matthew Parlane
e2706b4381 Merge pull request #4860 from lioncash/lock
FifoPlayerDlg: Use std::lock_guard instead of manual mutex locking/unlocking
2017-02-08 18:59:28 +13:00
Matthew Parlane
f838d16b0c Merge pull request #4546 from RisingFog/tas_wii_nand
Copy Wii save for current game for Netplay and TAS
2017-02-08 18:58:28 +13:00
Lioncash
399757a771 FifoPlayerDlg: Use std::lock_guard instead of manual mutex locking/unlocking
Same thing, but less error prone.
2017-02-08 00:26:32 -05:00
Matthew Parlane
4b7dd1f638 Merge pull request #4846 from aldelaro5/fix-symbols-newline
Fix symbols name from maps taking 2 lines instead of one
2017-02-08 18:18:56 +13:00
Matthew Parlane
7b3b8f26a3 Merge pull request #4789 from lioncash/input
InputCommon: Move ControllerEmu to its own directory
2017-02-08 18:16:14 +13:00
Matthew Parlane
dac6a66252 Merge pull request #4769 from lioncash/settingshandler
SettingsHandler: Minor cleanup
2017-02-08 18:15:37 +13:00
Matthew Parlane
f456fcec48 Merge pull request #4840 from lioncash/net
NetWindow: Eliminate usages of the main_window global
2017-02-08 18:12:56 +13:00
Matthew Parlane
691abc223b Merge pull request #4859 from lioncash/opcodedecoder
OpcodeDecoding: Convert #defines into enum constants
2017-02-08 18:12:11 +13:00
Matthew Parlane
5b7c0d86cd Merge pull request #4850 from lioncash/redundant
Core: Remove redundant returns in FifoPlayerThread() and CpuThread()
2017-02-08 18:11:30 +13:00
Matthew Parlane
f91290d702 Merge pull request #4857 from lioncash/global
DSPCore: Make g_cycles_left a regular member variable of DSPEmitter
2017-02-08 18:10:59 +13:00
Matthew Parlane
b41921935c Merge pull request #4854 from lioncash/constant
PowerPC: Convert #defines into typed constants
2017-02-08 18:10:11 +13:00
Matthew Parlane
a027aadb24 Merge pull request #4851 from leoetlino/fix-wifi-scanning
IOS: Fix Wi-Fi scanning in system menu
2017-02-08 18:09:12 +13:00
Lioncash
d9d069e024 OpcodeDecoding: Convert #defines into enum constants
Gets several constants out of global scope.
2017-02-08 00:05:17 -05:00
Florent Castelli
2bc3ffe07d DolphinWX: Add missing include for no-PCH builds 2017-02-08 05:24:46 +01:00
Lioncash
31f037b187 InputCommon CMakeLists: Normalize whitespace
Tabs -> Spaces
2017-02-07 22:15:53 -05:00
Lioncash
3a66f2c008 ControllerEmu: Move into its own directory
ControllerEmu is a massive class with a lot of nested public classes.

The only reason these are nested is because the outer class acts as a
namespace. There's no reason to keep these classes nested just for that.

Keeping these classes nested makes it impossible to forward declare them, which leads to quite a few includes in other headers, making compilation take
longer.

This moves the source files to their own directory so classes can be
separated as necessary to their own source files, and be namespaced under the
ControllerEmu namespace.
2017-02-07 22:12:06 -05:00
Lioncash
4260afc848 DSPCore: Make g_cycles_left a regular member variable of DSPEmitter
Gets rid of a global within the DSP core.
2017-02-07 21:56:57 -05: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
Florent Castelli
8c82607c95 cmake: Don't use unqualified target_link_libraries
You can't mix unqualified and qualified link libraries (PUBLIC / PRIVATE).
Use the modern form.
2017-02-08 03:07:43 +01:00
Lioncash
13f70d4597 PowerPC: Convert #defines into typed constants 2017-02-07 20:17:15 -05:00
Florent Castelli
428d1624fa cmake: Move BlueZ detection to Core 2017-02-08 01:08:33 +01:00
Léo Lam
e7b6b87ffe IOS: Fix Wi-Fi scanning in system menu
The second output vector should not be written to for
IOCTLV_NCD_READCONFIG. If it is, the system menu will never attempt
to open /dev/net/wd/command and request a Wi-Fi scan.
2017-02-08 00:43:38 +01:00
Lioncash
06f6ca8d81 Core: Remove redundant returns in FifoPlayerThread() and CpuThread()
There's no need to explicitly return at the end of a void function.
2017-02-07 17:59:03 -05:00
Florent Castelli
c1dcd06043 cmake: Move PulseAudio detection to AudioCommon 2017-02-07 23:35:44 +01:00
Matthew Parlane
22fbcc67fc Merge pull request #4773 from lioncash/ucode
UCodes: Eliminate unnecessary includes in header
2017-02-08 10:54:12 +13:00
Matthew Parlane
47ccf52c5e Merge pull request #4845 from ligfx/addbraces
JitIL/IR.cpp: add braces around std::array initalizers
2017-02-08 09:42:48 +13:00
Matthew Parlane
2112acf500 Merge pull request #4847 from lioncash/exi
EXI_DeviceAD16: Minor changes
2017-02-08 09:40:59 +13:00
Lioncash
31dc2b9cc1 GCPadEmu: Make constructor explicit 2017-02-07 15:12:15 -05:00
Lioncash
a2a188533a GCKeyboardEmu: Make constructor explicit 2017-02-07 15:11:49 -05:00
Lioncash
9f8177c9ac UCodes: Eliminate unnecessary includes in header 2017-02-07 15:08:57 -05:00
Michael Maltese
64405f26a8 lint JitILCommon/IR.cpp 2017-02-07 12:08:25 -08:00
Lioncash
1f14b7f907 EXI_DeviceAD16: Amend variable naming
Drops Hungarian Notation type prefixing and prefixed underscores.
2017-02-07 14:58:23 -05:00
Lioncash
2f74a6f552 EXI_DeviceAD16: In-class initialize member variables
Same thing, less code.
2017-02-07 14:54:54 -05:00
Mat M
3cda4e1d9c Merge pull request #4822 from ligfx/copysys
CMake: add CMAKE_CONFIGURE_DEPENDS on Data/Sys
2017-02-07 10:41:25 -05:00
Mat M
db9720d038 Merge pull request #4842 from ligfx/fix_prix64_es
ES: use PRIx64 to print m_addtitle_tmd.GetTitleId()
2017-02-07 10:39:29 -05:00
aldelaro5
9dc9033b76 Fix symbols name from maps taking 2 lines instead of one
Symbols map may not only end with a \n, but they may also end with \r\n and only the \n would get removed.  This is the case with the Super Mario Sunshine map file which resulted in a weird looking symbols list and thus made it harder to scroll through it.  This removes the \r after the \n has been removed if it's present.
2017-02-07 09:56:19 -05:00
Michael Maltese
8048716efb JitIL/IR.cpp: add braces around std::array initalizers
Fixes the following warnings on macOS Clang:

```
Building CXX object Source/Core/Core/CMakeFiles/core.dir/PowerPC/JitILCommon/IR.cpp.o
Source/Core/Core/PowerPC/JitILCommon/IR.cpp:1374:9: warning: suggest braces around initialization of subobject [-Wmissing-braces]
        LoadCR,    LoadLink, LoadMSR,  LoadGReg,          LoadCTR, InterpreterBranch,
        ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Source/Core/Core/PowerPC/JitILCommon/IR.cpp:1378:9: warning: suggest braces around initialization of subobject [-Wmissing-braces]
        StoreLink,
        ^~~~~~~~~~
Source/Core/Core/PowerPC/JitILCommon/IR.cpp:1419:9: warning: suggest braces around initialization of subobject [-Wmissing-braces]
        BranchCond,
        ^~~~~~~~~~~
3 warnings generated.
```
2017-02-07 01:10:43 -08:00
Michael Maltese
fc0d88817f CMake: make option ENABLE_SDL work again
Broken in PR #4755 / commit f978765
2017-02-06 20:59:58 -08:00
Michael Maltese
58f01e60d6 ES: use PRIx64 to print m_addtitle_tmd.GetTitleId()
Fixes a warning on macOS with Clang.
2017-02-06 20:31:28 -08:00
Florent Castelli
d1eaa59a8e cmake: Move detection of OpenAL to AudioCommon 2017-02-07 03:42:43 +01:00
Florent Castelli
cbb7e4072a cmake: Move AO detection to AudioCommon 2017-02-07 03:42:43 +01:00
Léo Lam
b6d526ba2e IOS: Do not init libusb unless passthrough is enabled 2017-02-07 00:47:21 +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
db7ee668ff Notify user that USB won't work if libusb init fails 2017-02-07 00:47:21 +01:00
Lioncash
c41f587c29 Frame: Hide functions that don't need to be exposed
Any functions left exposed are used elsewhere through the main_window
global. May as well prevent any more functions from being used in that
manner where possible.
2017-02-06 18:29:26 -05:00
Lioncash
ead076d335 NetWindow: Get rid of direct use of the main_window global
Utilizes the event system (which is what should have been done here
initially), in order to prevent coupling between two different window frames.

This also makes booting games more versatile using the UI event system,
as the event can just act as a carrier for the filename, making directly
calling boot functions unnecessary. All that's needed is for the event to
propagate to the frame.
2017-02-06 18:29:20 -05:00
Michael Maltese
1fd1620e4e CMake: add CMAKE_CONFIGURE_DEPENDS on Data/Sys
Since files from Data/Sys are collected and added to a built macOS .app
bundle using GLOB, any new files won't get picked up until the next time
CMake is run. Tell CMake it should re-run itself every time the directory
is touched.
2017-02-06 13:55:35 -08:00
Léo Lam
f5a3aac8e1 IOS: Check if libusb can be used instead of asserting
This prevents panic alerts from showing up three times when starting
Wii emulation whenever libusb could not be initialized. The user has
already seen a warning at startup -- no need to warn them 3 more times.
2017-02-06 22:09:43 +01:00
Markus Wick
eb3c172b95 Merge pull request #4618 from Helios747/bounding_box_check
[Video] Warn when booting a bounding box game on an unsupported GPU
2017-02-06 21:58:19 +01:00
Matthew Parlane
d244597b42 Merge pull request #4408 from leoetlino/usb
IOS: USB support (OH0, USB_VEN, USB_HID)
2017-02-07 09:17:05 +13:00
Matthew Parlane
2835cfde52 Merge pull request #4836 from lioncash/enum
DSPCore: Convert the DSPCoreState enum into an enum class
2017-02-07 09:14:22 +13:00
Anthony
0c7d9bbb73 Merge pull request #4837 from lioncash/npd
NetWindow: Make chat messages queue private
2017-02-06 10:20:29 -08:00
Lioncash
2597d2b69b NetWindow: Make chat messages queue private
This doesn't need to be publicly accessable.
2017-02-06 13:03:35 -05:00
Mat M
f978765bf0 Merge pull request #4755 from Orphis/cmake_sdl
cmake: Modernize SDL discovery
2017-02-06 11:55:03 -05:00
Lioncash
063e4df5a1 DSPCore: Convert the DSPCoreState enum into an enum class 2017-02-06 11:47:19 -05:00
Mat M
e4c17f126c Merge pull request #4835 from ligfx/configurefilescmrev
CMake: use configure_file to generate scmrev.h
2017-02-06 11:14:08 -05:00
Michael Maltese
acc8dae2b3 CMake: use configure_file to generate scmrev.h
The built-in `configure_file` command correctly handles the case where
none of the variables change and scmrev.h doesn't need to be rebuilt.
This saves a full re-link of Dolphin any time CMake is re-run.
2017-02-05 22:26:49 -08:00
Lioncash
259f827e34 Core: Actually make the State enum an enum class
It helps if I actually make it a strongly typed enum.
2017-02-06 01:13:07 -05:00
Matthew Parlane
b9fc79020d Merge pull request #4817 from sepalani/debug_print_case
Handle another case with HLE_GeneralDebugPrint
2017-02-06 17:40:44 +13:00
Matthew Parlane
abe7081337 Merge pull request #4818 from ligfx/bundleutilities
CMake: use BundleUtilities to fix up Dolphin.app
2017-02-06 17:39:46 +13:00
Matthew Parlane
d022913fb3 Merge pull request #4828 from lioncash/state
Core: Convert State enum into an enum class
2017-02-06 17:38:46 +13:00
Matthew Parlane
516ddc1d0c Merge pull request #4820 from JosJuice/translate-swedish
Translate Swedish in example strings to English
2017-02-06 17:36:41 +13:00
Florent Castelli
a7c4fd9bf0 cmake: Move discovery of SDL to InputCommon 2017-02-06 05:02:45 +01:00
Chris Burgener
5224771dac Copy Wii save for current game for Netplay and TAS 2017-02-05 13:17:05 -05:00
Mat M
1f1a232546 Merge pull request #4629 from JosJuice/es-movie-title-id
Don't call Movie::SetTitleId from ES
2017-02-05 09:26:08 -05:00