Commit graph

16911 commits

Author SHA1 Message Date
Lioncash
1fa81f24d3 VertexManagerBase: Make CreateNativeVertexFormat return a unique_ptr
Much safer as opposed to just returning raw allocated memory.
2017-02-18 03:16:24 -05:00
Matthew Parlane
5814d23fd9 Merge pull request #4926 from lioncash/net
IOS Network: Split ncd/manage code and wd/command code into their own source files
2017-02-18 21:13:24 +13:00
Matthew Parlane
4da7164f66 Merge pull request #4596 from ligfx/updateffmpeg
AVIDump: Updates to avoid deprecation warnings
2017-02-18 21:12:37 +13:00
Lioncash
a8eb2e2a8f IOS Network: Split wd/command code into its own source files 2017-02-18 02:35:53 -05:00
Stenzek
e2ddb3853e DriverDetails: Set BUG_PRIMITIVE_RESTART for AMD drivers 2017-02-18 15:07:35 +10:00
Stenzek
50fa135594 Vulkan: Handle BUG_PRIMITIVE_RESTART 2017-02-18 15:07:34 +10:00
Stenzek
4094268009 Vulkan: Use TRIANGLE_LIST when primitive restart is not supported 2017-02-18 15:07:33 +10:00
Stenzek
6965dc0481 Vulkan: Don't enable primitive restart on list topologies 2017-02-18 15:07:32 +10:00
Lioncash
ec298d9ea9 IOS Network: Split ncd/manage code into its own source files 2017-02-17 23:55:33 -05:00
Chris Burgener
8bfe2671b2 Remove IsReadOnly check when stop recording 2017-02-17 23:23:42 -05:00
Mat M
82734fffaa Merge pull request #4910 from lioncash/netsplit
IOS Network: Move net/ip/top code into its own source files
2017-02-17 22:42:28 -05:00
degasus
674e7430d0 JitArm64: Extract block exit link area generation.
Always use 3 instructions on linking.
2017-02-17 23:07:28 +01:00
Sepalani
5f7002da5c HLE: More printf floating point types handled 2017-02-17 10:51:10 +00:00
Léo Lam
aa9ed91bc8 IOS: Add constants for IOS40
This adds memory constants for IOS40.

We should now support every system menu, courtesy of Bent82:
https://github.com/dolphin-emu/dolphin/pull/4907#issuecomment-280433023
2017-02-16 20:50:02 +01:00
Phil Christensen
34b0b1b9d6 wxWidgets expects non-const
revert my previous change to these files and instead create a named temporary.
2017-02-15 21:20:29 -08:00
Phil Christensen
2ed61b0ee1 C++ conformance fixes (MSVC /permissive-)
We (the Microsoft C++ team) use the dolphin project as part of our "Real world code" tests.
I noticed a few issues in windows specific code when building dolphin with the MSVC compiler
in its conformance mode (/permissive-).  For more information on /permissive- see our blog
https://blogs.msdn.microsoft.com/vcblog/2016/11/16/permissive-switch/.

These changes are to address 3 different types of issues:

1) Use of qualified names in member declarations

    struct A {
        void A::f() { } // error C4596: illegal qualified name in member declaration
                        // remove redundant 'A::' to fix
    };

2) Binding a non-const reference to a temporary

    struct S{};
  
    // If arg is in 'in' parameter, then it should be made const.
    void func(S& arg){}
  
    int main() {
      //error C2664: 'void func(S &)': cannot convert argument 1 from 'S' to 'S &'
      //note: A non-const reference may only be bound to an lvalue
      func( S() );
   
      //Work around this by creating a local, and using it to call the function
      S s;
      func( s );
    }

3) Add missing #include <intrin.h>

Because of the workaround you are using in the code you will need to include
this.  This is because of changes in the libraries and not /permissive-
2017-02-15 20:37:04 -08:00
Michael Maltese
88f7056a41 Remove include Xlib.h from X11Utils.h 2017-02-15 16:49:21 -08:00
JosJuice
f80f7b6f9c Merge pull request #4883 from JosJuice/dvd-timing-address-translation-2
DVDInterface: Translate Wii partition offsets for timing purposes
2017-02-15 21:12:42 +01:00
JosJuice
339f6e353d Merge pull request #4907 from leoetlino/ios-constants
IOS: Add constants for some missing IOSes
2017-02-15 21:09:42 +01:00
Lioncash
92e17d2eb8 IOS: Move net/ip/top code to its own source files 2017-02-15 14:42:43 -05:00
Lioncash
245de3fa4f IOS: Move network MAC utilities to their own source files
All three implementations within Net.cpp currently rely on these
functions.
2017-02-15 13:38:52 -05:00
Lioncash
0da963c32c NetKDRequest: Make lookup maps const 2017-02-15 11:50:37 -05:00
Mat M
6f272b3a4c Merge pull request #4862 from lioncash/compile
CPU Backends: Make instruction table initialization private
2017-02-15 11:44:37 -05:00
Mat M
8fd16db80d Merge pull request #4778 from leoetlino/update-mbedtls
Externals: Update mbedtls to 2.4.1
2017-02-15 11:30:18 -05:00
Mat M
5a53763c1a Merge pull request #4892 from lioncash/control
Control: Convert raw pointer parameter into unique_ptr
2017-02-15 11:26:53 -05:00
Mat M
3d1f00e98d Merge pull request #4874 from ligfx/movie_magic_number
Movie: replace magic number 8 with sizeof(ControllerState)
2017-02-15 11:25:26 -05:00
Mat M
28a6575244 Merge pull request #4900 from lioncash/netkd
IOS: Separate net/kd code out from Net.cpp
2017-02-15 11:21:01 -05:00
Mat M
30ee4dfcdf Merge pull request #4908 from leoetlino/apostrophe
Remove C++14 optional digit separator
2017-02-14 11:06:08 -05:00
Markus Wick
032b6252a0 Merge pull request #4875 from degasus/ABI
JitArm64: Optimize GPR register push/pop and fix the FPR one.
2017-02-14 17:02:17 +01:00
Léo Lam
089f45212e IOS: Add constants for some missing IOSes
This adds memory values for IOS11, 20, 30, 50, 51, 52, 60 and 70.

Unfortunately, IOS40 (in its working version) is not present on NUS, so
constants for that one are still missing.
2017-02-14 12:18:58 +01:00
Anthony
f966354044 Merge pull request #4898 from RisingFog/stop_recording_dtm
Add Stop Play/Recording Input Menu
2017-02-13 14:10:23 -08:00
Mat M
f68955502a Merge pull request #4905 from JosJuice/rename-copy-wii-save
Rename "Copy Wii Save" to "Load Wii Save"
2017-02-13 09:55:54 -05:00
Léo Lam
1aae7fb9c8 Remove C++14 optional digit separator
It confuses GitHub and localization tools. And some people as well.
2017-02-13 14:25:14 +01:00
Matthew Parlane
d1ade5de22 Merge pull request #4904 from JosJuice/oh0-usb-state-warning
Don't show savestate USB warning when not using USB passthrough
2017-02-13 14:36:26 +13:00
JosJuice
fc798ca410 Rename "Copy Wii Save" to "Load Wii Save"
That netplay uses a separate NAND isn't obvious,
so what "copy" means might not be clear.
2017-02-12 18:40:54 +01:00
JosJuice
8a6b8f7b53 Don't show savestate USB warning when not using USB passthrough 2017-02-12 18:16:26 +01:00
Pierre Bourdon
047394c099 Merge pull request #4903 from leoetlino/usb-kbd-stub
IOS/USB_KBD: Re-add the Write stub handler
2017-02-12 16:33:02 +01:00
Léo Lam
5add8c23ee IOS/USB_KBD: Re-add the Write stub handler
This is something I removed by mistake. It didn't break anything in
most titles, but the Mii Channel *requires* write requests to
/dev/usb/kbd to succeed before exiting, so this commit readds the stub.
2017-02-12 16:00:50 +01:00
Mat M
da5683cf27 Merge pull request #4880 from ligfx/windowsmanifest
Use .manifest file for apps on Windows
2017-02-12 08:44:38 -05:00
JosJuice
5e799fd469 Merge pull request #4902 from lioncash/unused
Boot: Remove unused game ID string
2017-02-12 14:20:05 +01:00
Lioncash
921ab22cb7 Boot: Remove unused game ID string 2017-02-12 07:55:49 -05:00
Léo Lam
b8dd3e690f Externals: Update mbedtls to 2.4.1
The latest version has tons of security fixes (which is expected for a
library such as mbedtls).

Updating also allows getting rid of a few deprecation warnings.
2017-02-12 10:29:02 +01:00
JosJuice
49ec22bc42 DVDInterface: Translate Wii partition offsets for timing purposes
Until now, Dolphin has been using the wrong values
for calculating DVD timing for decrypted Wii reads
(which Wii games essentially always use).
2017-02-12 09:37:39 +01:00
Lioncash
40cea773bc IOS: Separate net/kd code out from Net.cpp
Net.cpp is just a huge glob of network related things, this separates the
KD portion out to make things a little more manageable.
2017-02-11 23:09:08 -05:00
Lioncash
1a99e70ed7 Force: Use std::array for m_swing 2017-02-11 20:22:50 -05:00
Lioncash
df3a4580ea Tilt: Use std::array for m_tilt 2017-02-11 20:22:42 -05:00
Mat M
0e961776e6 Merge pull request #4879 from orbea/llvm
CMake: Fix LLVM error
2017-02-11 20:07:34 -05:00
Mat M
3e016ecc1d Merge pull request #4888 from leoetlino/good-bye-singleton
Get rid of a singleton for NAND shared contents
2017-02-11 20:02:52 -05:00
Mat M
9cdb07b2ef Merge pull request #4886 from leoetlino/no-prefix
FileIO: Minor cleanup
2017-02-11 20:00:58 -05:00
Mat M
295600c86e Merge pull request #4884 from leoetlino/wii-connect-on-boot
Fix connecting Wii remotes on boot
2017-02-11 19:59:50 -05:00
Chris Burgener
28c9f2a44d Add Stop Play/Recording Input Menu 2017-02-11 19:59:19 -05:00
Anthony
bb82586a3d Merge pull request #4897 from JosJuice/correct-es-comment
Correct the comment about the number of ES devices
2017-02-11 10:27:35 -08:00
JosJuice
aaa8ad330a Correct the comment about the number of ES devices 2017-02-11 17:13:42 +01:00
JosJuice
c96bcace2f VolumeWiiCrypted: Use constant naming style for constants 2017-02-11 12:56:48 +01:00
JosJuice
d19aabb55b Merge pull request #4895 from lioncash/const
ControllerEmu: Add const to UpdateReferences() first reference parameter
2017-02-11 09:27:37 +01:00
JosJuice
e568d57022 Merge pull request #4894 from lioncash/private
Cursor: Make m_z private
2017-02-11 09:26:30 +01:00
Léo Lam
81b1425b52 Remove useless Wiimote reconnect code on ES_Launch
Turns out it is completely unneeded and it actually works better
*without* it.

Just try launching the system menu from the HBC; in current master, it
will disconnect the remote and not connect it automatically again. With
this change, it will.
2017-02-11 09:02:32 +01:00
Léo Lam
c14becd575 Fix connecting Wii remotes on boot
The recent IOS initialization changes caused the Bluetooth device to
no longer exist before "starting" IOS (as it should be…), which meant
that Core could not activate Wii remotes during the boot process
anymore.

But that is actually completely useless, because we can just have the
emulated Bluetooth code itself activate Wii remotes as appropriate,
at the right moment.
2017-02-11 08:58:47 +01:00
Lioncash
98145d2160 ControllerEmu: Add const to UpdateReferences() first reference parameter
None of these parameters are modified.
2017-02-11 00:31:49 -05:00
Lioncash
e4bdc88494 Cursor: Make m_z private
This isn't used directly anywhere (and really shouldn't be public
anyways).
2017-02-10 23:57:50 -05:00
orbea
6913e8c3ac Fix LLVM error 2017-02-10 19:07:30 -08:00
Lioncash
fda235b6e3 Buttons: Use a delegating constructor
Basic code deduplication
2017-02-10 19:52:15 -05:00
Lioncash
d07d9f3110 Control: Convert raw pointer parameter into unique_ptr
Raw pointers shouldn't be used as boundaries in scenarios where ownership
is being taken.
2017-02-10 19:35:02 -05:00
Michael Maltese
2b65e41d97 NetWindow: explicitly tell wxWidgets to clean up Windows macros
wxWidgets headers don't play well with some of the macros defined in
Windows headers and perform their own magic to fix things, as long as
they're included entirely either before or after any Windows headers.

This file can cause a conflict in other DolphinWX files because NetPlay
headers directly include ENet headers, which leak Windows header macros.
To fix this, explicitly tell wxWidgets here that it needs to re-clean
macros.
2017-02-10 16:14:25 -08:00
degasus
8829af62cb JitArm64: Fix for stack push/pop ABI. 2017-02-11 00:59:12 +01:00
degasus
6aa54a029e JitArm64: Optimize GPR register push/pop. 2017-02-11 00:59:12 +01:00
Michael Maltese
715170759c Use .manifest file for apps on Windows
Works with CMake, and also adds DPI awareness to DolphinQt2 (which
wasn't enabled before).
2017-02-10 14:18:45 -08:00
Léo Lam
850802ea88 Get rid of a singleton for NAND shared contents
This also allows shared contents to be installed to the configured root
when installing a WAD.
2017-02-10 22:46:38 +01:00
Léo Lam
f96d71ce81 FileIO: Simplify Seek()
We can return early from invalid conditions, which allows getting rid
of quite a few levels of indentation.

And let's not duplicate the new_position > file_size check.
2017-02-10 21:06:23 +01:00
Léo Lam
ca4d2969a0 Remove the HLE_IPC prefix from some functions
Those were left over during the namespacing.
2017-02-10 20:58:41 +01:00
Lioncash
68dcb0f195 ControlReference: Add missing virtual destructor
ControllerEmu::Control instances have a unique_ptr<ControlReference>
member, which is passed either an InputReference or OutputReference.

Without this virtual destructor, deleting a derived class through a
pointer to the base class is undefined behavior.
2017-02-10 13:58:44 -05:00
Mat M
f6d364e37b Merge pull request #4873 from lioncash/controller-emu
ControllerEmu: Separate ControlGroup from ControllerEmu
2017-02-10 13:50:33 -05:00
Anthony
8f81051df3 Merge pull request #4882 from leoetlino/elf-fix
Fix booting Wii DOLs
2017-02-10 10:21:08 -08:00
Léo Lam
328359118c Fix booting Wii DOLs
We did not set up any kind of constants in memory for Wii DOLs or even
initialize IOS, so a lot of homebrew would just crash when opening ES.
2017-02-10 19:14:34 +01:00
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