Commit graph

21484 commits

Author SHA1 Message Date
Lioncash
d1e278218e Common/CMakeLists: Link in libraries privately for traversal_server
Without this, CMake script errors can occur, as explicit linkage
specifiers and non-explicit specifier commands aren't compatible with
one another.
2018-06-08 17:40:44 -04:00
spycrab
0273cae3a2 Qt: Restore fullscreen resolution when regaining focus 2018-06-08 20:47:15 +02:00
spycrab
6c19b5947b Qt: Fix exclusive fullscreen not being entered on startup 2018-06-08 19:59:41 +02:00
Léo Lam
48b7cfa75c
Merge pull request #7062 from robopilot99/master
Add auto-hide option to Wii IR pointer
2018-06-08 14:04:03 +02:00
JosJuice
ca3d68cee5
Merge pull request #7076 from JosJuice/android-gamelist-uicommon
Use UICommon's game list code on Android
2018-06-08 13:59:45 +02:00
Léo Lam
d23c3e9524
Merge pull request #7093 from lioncash/log
Interpreter_SystemRegisters: Change PanicAlert to INFO_LOG in mtspr()
2018-06-07 19:01:39 +02:00
Lioncash
5db2137538 Interpreter_SystemRegisters: Change PanicAlert to INFO_LOG in mtspr()
As peculiar as this may be, decrementer exceptions by means of setting
the decrementer's zeroth bit from 0 to 1 is valid behavior by software
(and is defined in Programming Environments for 32-bit Microprocessors
in section 2.3.14.1 -- Decrementer operation). Given it's valid behavior,
it doesn't necessarily make sense to use a panic alert and halt, as this
isn't a condition where everything should be considered in a critical
state.

Instead, change it to an info log, so we still make note of it, but
without potentially tearing down state or halting emulation.
2018-06-07 12:14:46 -04:00
Pierre Bourdon
de0fe0e210
Merge pull request #6928 from leoetlino/random
Common: Add Random utilities
2018-06-08 00:41:08 +09:00
Léo Lam
b51fbaa5b0
Merge pull request #7084 from lioncash/mask
Interpreter_SystemRegisters: Ensure FPSCR modifying instructions don't set bit 20
2018-06-07 16:51:36 +02:00
Léo Lam
34d6a49842
Merge pull request #7088 from Ebola16/TFD
Give "Dump TEV Stages" and "Dump Texture Fetches" descriptions
2018-06-07 16:50:15 +02:00
Léo Lam
ca32b4127e
Merge pull request #7089 from spycrab/qt_refresh_hotkey
Qt: Implement "Refresh Game List" hotkey
2018-06-07 16:49:09 +02:00
Léo Lam
18d5ba30d6
Merge pull request #7085 from master0fdisaster/Add-Volume-Hotkeys-OSD-Message
Add OSD message for Volume Hotkeys
2018-06-07 16:46:19 +02:00
Léo Lam
dd7c558be3
Merge pull request #7092 from JosJuice/wii-devkit
Set 0x0000002C to NDEV 2.1 when running a debug-signed Wii disc
2018-06-07 15:52:07 +02:00
JosJuice
af5d9f693a Set 0x0000002C to NDEV 2.1 when running a debug-signed Wii disc
This fixes the The Last Story prototype that GerbilSoft was testing,
because the apploader is a bit more lenient with the max size of DOL
sections when it detects that you're using a devkit console.
2018-06-07 10:14:32 +02:00
Sleepy Flower Girl
57bd13a0ce Use new config system for Discord Rich Presence option
This doesn't feel like a mirror change to me.
2018-06-07 00:59:31 -04:00
spycrab
23394164de Qt: Implement "Refresh Game List" hotkey 2018-06-06 18:30:46 +02:00
Ryan Meredith
5fcb509702 Give "Dump TEV Stages" and "Dump Texture Fetches" descriptions 2018-06-06 11:59:29 -04:00
JosJuice
1c027bc148 Use UICommon's game list code on Android
Deduplicates code, and gets rid of some problems the old code had
(such as: bad performance when calling native functions, only one
disc showing up for multi-disc games, Wii banners being low-res,
unnecessarily much effort being needed for adding more metadata).
2018-06-06 17:34:07 +02:00
master0fdisaster
7a90ea2752 Add OSD message for Volume Hotkeys
This pr adds an OnScreenDisplay message when you use the Volume hotkeys.
Just to have visual feedback.
2018-06-06 17:11:43 +02:00
Léo Lam
c93210155f
Merge pull request #7075 from Ebola16/DumpObjects
Software Renderer "Dump Objects" needs dedicated folder and tooltip
2018-06-06 15:20:14 +02:00
Ryan Meredith
7340935b38 QT: Use brackets for description arrays 2018-06-06 09:05:18 -04:00
Ryan Meredith
45b9b7d211 Give Dump Objects dedicated folder and tooltip 2018-06-06 08:42:41 -04:00
spycrab
ee479260d0 Qt: Add option to disable auto-refresh 2018-06-06 13:49:45 +02:00
Markus Wick
3860219899 VideoCommon: Flush the GPU pipeline on async requests. 2018-06-06 09:22:01 +02:00
8times9
70b7e852f8 Qt: Remove Dolphin prefix from NetPlay window titles
This makes the NetPlay window titles consistent with other window titles in Dolphin.
2018-06-05 22:27:07 -05:00
Mat M
0dfd0cfa24
Merge pull request #7083 from leoetlino/consistency
ES: Return ReturnCode in DiVerify for consistency
2018-06-05 17:24:17 -04:00
Lioncash
11a35d47ef Interpreter_SystemRegisters: Ensure FPSCR modifying instructions don't set bit 20
Bit 20 is defined as being reserved and attempts to set it are ignored
by hardware, so we should be doing the same thing.
2018-06-05 16:27:10 -04:00
Léo Lam
85baca386a ES: Return ReturnCode in DiVerify for consistency
No reason to return a s32 instead of an IOS return code (like every
other function in the ES API)
2018-06-05 22:07:59 +02:00
Anthony
36ff2a20d5
Merge pull request #6954 from degasus/coherent
OGL/Streambuffer: Use coherent mapping by default.
2018-06-05 12:06:17 -07:00
spycrab
e3e451b34e Qt/InfoWidget: Don't prefix maker id with '0x' 2018-06-05 20:25:15 +02:00
Léo Lam
f422b88ed9
Merge pull request #7078 from spycrab/qt_gc_adapter_fix
Qt/GCPadWiiUConfigDialog: Fix settings not being loaded properly
2018-06-05 19:37:56 +02:00
spycrab
08561b4b43
Merge pull request #7079 from spycrab/qt_open_remember
Qt/MainWindow: Remember last directory in "Open" prompt
2018-06-05 19:02:17 +02:00
spycrab
8a24eac0de Qt/GCPadWiiUConfigDialog: Fix settings not being loaded properly 2018-06-05 19:00:51 +02:00
spycrab
c6704b1323 Qt/MainWindow: Remember last directory in "Open" prompt 2018-06-05 18:56:21 +02:00
Léo Lam
21d0d6711f
Merge pull request #7073 from leoetlino/fix
WiiSave: Fix the way paths are handled
2018-06-05 18:32:13 +02:00
Léo Lam
bfbd890caa
Merge pull request #7080 from spycrab/qt_noprop_elfdol
Qt/GameList: Don't show certain options when a DOL/ELF is selected.
2018-06-05 15:57:11 +02:00
spycrab
07b26f8bca Qt/GameList: Don't show certain options when a DOL/ELF is selected. 2018-06-05 13:28:16 +02:00
spycrab
63460834a5 Qt/CheatCodeEditor: Don't accept rich text 2018-06-05 12:45:08 +02:00
spycrab
8675fa09b8
Merge pull request #7071 from spycrab/qt_gamelist_refresh
Qt: Add Refresh button
2018-06-05 04:29:23 +02:00
robopilot99
ab02499ce7 Add auto-hide option to Wii IR pointer 2018-06-04 17:58:21 -05:00
Léo Lam
b7a8deda96
Merge pull request #7074 from lioncash/paired
Interpreter_LoadStorePaired: Simplify type aliases in QuantizeAndStore() and LoadAndDequantize()
2018-06-05 00:08:00 +02:00
Léo Lam
226f88bcb6
Merge pull request #7069 from leoetlino/player-id
PadMappingDialog: Show player ID in player dropdown
2018-06-05 00:02:04 +02:00
Lioncash
25d38c0a23 Interpreter_LoadStorePaired: Simplify type aliases in QuantizeAndStore() and LoadAndDequantize()
These can just use the _t variant of make_unsigned, which eliminates the
need to pull the type from the ::type member type.
2018-06-04 17:57:05 -04:00
Léo Lam
d1e2cc7b92
Merge pull request #7070 from spycrab/qt_prop_width
Qt/PropertiesDialog: Fix tabs being cut off due to small window size
2018-06-04 23:49:28 +02:00
spycrab
4415417deb Qt: Add Refresh button 2018-06-04 23:44:53 +02:00
Léo Lam
14d37e0493 WiiSave: Fix the way paths are handled
All paths in SaveFile are relative to the title data directory, not
absolute. Fixes an accidental regression from 5.0-7988 (PR #7059).
2018-06-04 23:31:00 +02:00
Léo Lam
8fe7f8d80d
Merge pull request #7072 from lioncash/emitter
DSPEmitter: Make m_unresolved_jumps private
2018-06-04 22:26:24 +02:00
Léo Lam
d797bf2ee7 PadMappingDialog: Show player ID in player dropdown
Makes it easier to differentiate players that have the same name.
2018-06-04 22:24:35 +02:00
JosJuice
5e0da225ee
Merge pull request #7068 from lioncash/const
DSPAccelerator: const qualify pointer parameter for Read()
2018-06-04 22:05:26 +02:00
Lioncash
bbd2fd080e DSPEmitter: Make m_unresolved_jumps private
By making the jitted function a private static function of DSPEmitter,
we can allow access to data members within the context of the function
without making them public overall.

This finally makes all data members for the x64 DSP emitter private.
2018-06-04 15:46:08 -04:00
spycrab
b3c3b58aec Qt/PropertiesDialog: Fix tabs being cut off due to small window size 2018-06-04 21:11:55 +02:00
Léo Lam
5f29e891d3
Merge pull request #7063 from lioncash/fifr
Interpreter: Unset FPSCR.FI and FPSCR.FR for QNaN and infinity input operands
2018-06-04 20:53:58 +02:00
Léo Lam
6ce9c96d91
Merge pull request #7027 from leoetlino/cleanup
Use some C++17 features available since GCC 6
2018-06-04 20:50:50 +02:00
Lioncash
1e3e11d0f5 DSPAccelerator: const qualify pointer parameter for Read()
The data pointed to is only ever read, so make this explicit.
2018-06-04 14:50:42 -04:00
Léo Lam
2a89ad9c39
Merge pull request #7066 from spycrab/qt_fs_exit
Qt: Always return to windowed when confirming exit
2018-06-04 20:48:22 +02:00
spycrab
53ed455d76 Qt: Always return to windowed when confirming exit
If we don't do this the prompt *may* appear behind the fullscreened window
and thus cause confusion. This happens both with exclusive fullscreen and
borderless fullscreen (e.g. for OpenGL).
2018-06-04 20:32:36 +02:00
Léo Lam
9b43180731
Merge pull request #7040 from JMC47/enableadouble2single
[JIT] Enable Accurate Double to Single Conversion
2018-06-04 20:29:15 +02:00
spycrab
afc2c51e34
Merge pull request #7065 from spycrab/qt_pause_exit
Qt: Fix emulation still not being paused when confirming exit
2018-06-04 19:16:16 +02:00
spycrab
b13cf2e16e Qt: Fix emulation still not being paused when confirming exit 2018-06-04 18:13:05 +02:00
Michael M
932ca644aa Add hotplug support to SDL2 controller backend 2018-06-04 17:50:08 +02:00
Michael M
7062967b5b SDLJoystick: store name on creation
Otherwise, Dolphin will crash when the joystick is removed.
2018-06-04 17:49:21 +02:00
Michael M
0eb47e1071 CMake: make SDL a private dep of InputCommon 2018-06-04 17:49:21 +02:00
JMC47
2795376b61 Enable Accurate Double to Single Conversion 2018-06-04 11:49:12 -04:00
Léo Lam
8e0ea92ec3
Merge pull request #7058 from JosJuice/move-titledatabase-usage
Don't store custom names from TitleDatabase in GameFileCache
2018-06-04 14:59:05 +02:00
Léo Lam
8074192a85
Merge pull request #7057 from leoetlino/string
Config/StringUtil/IniFile: Get rid of some duplicated code
2018-06-04 12:44:57 +02:00
JosJuice
85e94cc510 Don't store custom names from TitleDatabase in GameFileCache
This saves us from having to update the GameFileCache when the
TitleDatabase changes (for instance when the user changes language).
2018-06-04 07:45:22 +02:00
Lioncash
9068109b3e Interpreter: Unset FPSCR.FI and FPSCR.FR for QNaN and infinity input operands
This hardware behavior makes sense, as the FI bit is used to signify an
inexact result. An inexact result is a form of value that results during
the rounding phase of denormalization. If any bits of the significand
are lost during said rounding, then the result is considered to be
inexact.

However NaN and infinity are not classed as subnormals and therefore
don't undergo the denormalization step, making loss of precision not
possible (in NaN's case, numerically rounding something that is
literally Not a Number doesn't even make sense).

FR is set to indicate whether or not the last arithmetic or rounding and
conversion instruction that rounded the intermediate result incremented
the fractional portion of the result. Given neither input types would be
affected by this, this should also be unset.

This corrects more of the exceptional case handling for these values to
match hardware.
2018-06-03 18:15:47 -04:00
Léo Lam
0ecec33567 WiiRoot: Use a namespace alias for FS to reduce noise 2018-06-03 21:37:28 +02:00
Sleepy Flower Girl
f25d833dbd Fixed issue Discord RPC library not clearing presence during shutdown 2018-06-03 15:37:27 -04:00
Sleepy Flower Girl
e1a9cf3b44 Add option to disable Discord Presence in WX UI 2018-06-03 15:29:28 -04:00
Sleepy Flower Girl
ae2337aff6 Add option to disable Discord Presence in Qt UI 2018-06-03 15:29:25 -04:00
Sleepy Flower Girl
d9351a5b45 Added INI setting for Discord Rich Presence 2018-06-03 15:29:21 -04:00
Sleepy Flower Girl
678f8da95b Moved Discord RPC library's source code to external 2018-06-03 15:29:01 -04:00
Sleepy Flower Girl
d5303ddf0b Add Discord Rich Presence support 2018-06-03 15:27:20 -04:00
Léo Lam
c1428b6da0 WiiRoot: Use new filesystem interface
This gets rid of remaining direct accesses to the Wii filesystem
in WiiRoot by using WiiSave to copy saves and the FS interface
2018-06-03 21:21:32 +02:00
Léo Lam
8fce18e4ff
Merge pull request #7059 from leoetlino/fs-wiisave
WiiSave: Use new filesystem interface
2018-06-03 21:05:22 +02:00
Léo Lam
6b9aef7042 FS: Add a struct for modes
As suggested here: https://dolp.in/pr7059#pullrequestreview-125401778

More descriptive than having a std::tuple of FS::Mode, and lets us
give names to known triplets of modes (like in ES). Functions that
only forward mode arguments are slightly less verbose now too.
2018-06-03 20:45:35 +02:00
Lioncash
06056d4f45 Gekko: Make register constructors explicit where applicable
Prevents implicit conversions to types and requires explicitly
specifying them in order to construct instances of them. Given these are
used within emulation code directly, being explicit is always better
than implicit.
2018-06-03 12:37:17 -04:00
Léo Lam
d1a8661709 WiiSave: Save and restore files and banner with correct mode 2018-06-03 17:23:40 +02:00
Léo Lam
fd3472442d WiiSave: Use new filesystem interface
Converts WiiSave to the new filesystem interface.
2018-06-03 17:01:14 +02:00
Léo Lam
c22205cd7e
Merge pull request #7053 from lioncash/frfi
Interpreter_FPUtils/FloatingPoint/Paired: Amend cases where FPSCR.FR and FPSCR.FI should be unset
2018-06-03 15:36:12 +02:00
Léo Lam
83324fe77d StringUtil: Remove ValueToString(std::string)
Doesn't make a lot of sense to have a function that gives the string
representation for a string.
2018-06-03 15:11:59 +02:00
Léo Lam
7e79bf97ab IniFile: Use templates for Get()
Gets rid of duplicated code.
2018-06-03 14:53:56 +02:00
Léo Lam
cba32b12e7 IniFile: Use templates for Set() 2018-06-03 14:53:56 +02:00
Lioncash
3e63d71046 Gekko: Add helper function for clearing both FPSCR.FI and FPSCR.FR 2018-06-03 08:27:18 -04:00
Léo Lam
fc0193c4b1 Move Config ValueToString to StringUtil
An identical implementation is used by IniFile, so move those functions
to StringUtil. A future commit will modify IniFile to use them.
2018-06-03 14:10:52 +02:00
spycrab
0cc20e95fe Qt/HotkeyWindow: Always show debugging tab 2018-06-03 13:40:57 +02:00
spycrab
9c26a1a458 Qt/Hotkeys: Implement missing "Other State Management" tab 2018-06-03 12:44:02 +02:00
Léo Lam
1e51e263e0
Merge pull request #6988 from leoetlino/wii-save-refactor
WiiSave: Refactor the import/export code
2018-06-03 12:05:43 +02:00
Léo Lam
86368fcd4d
Merge pull request #6499 from Ebola16/SettingsGroup
Android: Initial implementation of Interface submenu
2018-06-03 12:02:56 +02:00
Lioncash
d6bafbfaaf Interpreter_Paired: Handle signaling NaNs within ps_res and ps_rsqrte
Like regular fres and frsqrte, these also signal whether or not either
of the inputs are signaling NaNs.
2018-06-02 20:47:18 -04:00
Lioncash
d05c2ef90d Interpreter_Paired: Unset FPSCR.FI and FR in ps_res and ps_frsqrte in exceptional cases
If invalid operation exceptions or zero divide exceptions occur in
either of these instructions, FI and FR are supposed to be unset.
2018-06-02 20:42:47 -04:00
Lioncash
83774f72ad Interpreter_FloatingPoint: Unset FPSCR.FI and FPSCR.FR if a division by zero exception occurs in fres and frsqrte
Within the programming environments manual, part of the behavior of a
zero divide exception condition is that FI and FR be cleared.
2018-06-02 20:26:20 -04:00
Lioncash
468efb7243 Interpreter_FPUtils: Unset FPSCR.FI and FPSCR.FR if an invalid operation occurs in NI_* functions
If an invalid operation occurs, FI and FR bits are defined to be cleared
to zero for arithmetic operations.
2018-06-02 20:18:51 -04:00
Anthony
0f7370a22c
Merge pull request #7051 from lioncash/frsqrte
Interpreter_FloatingPoint: Don't store to destination in frsqrte if VE or ZE is set and a relevant exception occurs
2018-06-02 13:49:09 -07:00
spycrab
ba471c3214
Merge pull request #7048 from spycrab/qt_fs_size
Qt/FilesystemWidget: Add size column
2018-06-02 21:45:02 +02:00
Léo Lam
396810c450
Merge pull request #7050 from lioncash/ptr
WiimoteDevice: Get rid of pointer casting in CBigEndianBuffer
2018-06-02 21:35:43 +02:00
Lioncash
21add26b71 Interpreter_FloatingPoint: Clear FPSCR.FI and FPSCR.FR in invalid operation cases
As explained within 179d73ac0d, the table
within the Programming Environments Manual for PowerPC lists the FI and
FR bits as cleared for invalid operation cases. So, we amend the
relevant cases here in order to be accurate to hardware.
2018-06-02 15:30:56 -04:00
Lioncash
b71a9e658f Interpreter_FloatingPoint: Don't store to destination in frsqrte if VE or ZE is set and a relevant exception occurs
As explained within commit a08ad82ace, if
an invalid exception occurs and VE is set, then the destination register
should remain unchanged. Ditto for when ZE is set and a zero divide
exception occurs.
2018-06-02 15:27:14 -04:00
Lioncash
f6c4c05d93 WiimoteDevice: Make CBigEndianBuffer's constructor explicit
Prevents implicit construction of buffers.
2018-06-02 15:10:51 -04:00
Lioncash
4601136b08 WiimoteDevice: Get rid of pointer casting in CBigEndianBuffer
Gets rid of more places where we can violate alignment requirements and
aliasing rules.
2018-06-02 15:02:03 -04:00
Lioncash
13e828fd4d WiimoteDevice: Move CBigEndianBuffer to the cpp file
This is only used internally, so we don't need to expose it in the
header. This also allows getting rid of inclusion of the byte swapping
utilities in the header as well.
2018-06-02 14:55:05 -04:00
Anthony
8d1b2f9cae
Merge pull request #7045 from lioncash/fres
Interpreter_FloatingPoint: Don't store to destination in fres if VE or ZE is set and a relevant exception occurs
2018-06-02 11:42:34 -07:00
Lioncash
b1c7ce75e4 EXI_DeviceIPL: Replace superfluous virtual with override on destructor 2018-06-02 14:18:49 -04:00
Lioncash
0d89650950 EXI_DeviceIPL: Use std::array where applicable 2018-06-02 14:18:02 -04:00
Lioncash
bf4775f95f EXI_DeviceIPL: Normalize variable names
Makes naming consistent with our coding style.
2018-06-02 14:14:08 -04:00
Lioncash
b6203c66c2 EXI_DeviceIPL: In-class initialize data members where applicable 2018-06-02 14:08:01 -04:00
spycrab
f6865117e4 Qt/FilesystemWidget: Add size column 2018-06-02 18:59:56 +02:00
Léo Lam
62fdef0e6c
Merge pull request #7046 from lioncash/priv
EXI_DeviceMic: Make data members of CEXIMic private
2018-06-02 11:53:07 +02:00
Stenzek
bc96557ec4 Externals: Update glslang to upstream commit 32d3ec3 2018-06-02 07:34:31 +00:00
spycrab
0e8db9fd1d Analytics: Report update track 2018-06-02 05:59:03 +02:00
Lioncash
3906859984 EXI_DeviceMic: Remove unimplemented StreamLog function prototype 2018-06-01 20:43:28 -04:00
Lioncash
9e068ad2c4 EXI_DeviceMic: Make data members of CEXIMic private
Given they were only made public so that the callback could access class
state, we can simply make the callback a private static function of
CEXIMic, which allows access to members from the callback function
without making all of said members public.
2018-06-01 20:43:28 -04:00
Lioncash
179d73ac0d Interpreter_FloatingPoint: Clear FPSCR.FI and FPSCR.FR if an SNaN is an input to fres
In the PEM manual, within Table 3-12, which lists what should occur for
invalid operation exceptions, the FPSCR.FI and FPSCR.FR bits are listed
as "Cleared" for when FPSCR.VE is unset and set. So we clear these bits
as well to match hardware behavior.
2018-06-01 20:21:13 -04:00
Lioncash
a08ad82ace Interpreter_FloatingPoint: Don't store to destination in fres if VE or ZE is set and a relevant exception occurs
In the PowerPC Microprocessor Family: The Programming Environments
Manual for 32 and 64-bit Microprocessors, in section 3.3.6.1, Table
3-12 lists what should occur if an invalid operation exception occurs in
situations where VE is set and when VE is not set. In the case where VE
is set, it lists the frD as "Unchanged". It also lists the FPRF flags as
"Unchanged".

Further down in Table 3-13, the listings for what should occur when zero
divide exceptions occur is listed, both for when ZE is set, and when it
isn't. When ZE is set, it lists frD as "Unchanged". It also lists the
FPRF flags as "Unchanged" as well.

This also alters the code so that we don't even calculate the result if
we don't need to compute it, making it a little bit less wasteful.
2018-06-01 20:21:09 -04:00
Léo Lam
69abaf3ec4 WiiSave: Merge Header and DataBinHeader to reduce noise
DataBinHeader is not used anywhere in the code other than via Header,
so let's merge them to reduce noise when accessing header fields
(currently we have to do header.hdr which looks silly).
2018-06-01 23:45:58 +02:00
Léo Lam
210377816d WiiSave: Get rid of some magic numbers
It would make sense for 0x80 and 0xf0c0 to be respectively
sizeof(BkHeader) and sizeof(Header) as Nintendo is signing anything
that comes after the header, including the BkHeader.
2018-06-01 23:44:24 +02:00
Léo Lam
8eafd1928e WiiSave: Move user interaction to UI frontends 2018-06-01 20:46:35 +02:00
Léo Lam
4df266f943 WiiSave: Use the correct length for paths
Paths can never exceed 0x40 characters as this is the maximum length
that is allowed by IOS (and probably the common FS library too).
2018-06-01 20:46:35 +02:00
Léo Lam
8af16fdd28 WiiSave: Use an enum class for save file type 2018-06-01 18:58:34 +02:00
Anthony
a9684b5c67
Merge pull request #7041 from spycrab/qt_dbg_bselect
Qt/MemoryWidget: Allow operating on columns
2018-06-01 09:05:52 -07:00
Anthony
d935f78692
Merge pull request #7043 from JosJuice/gamefile-includes
GameFile: Include necessary DiscIO headers
2018-06-01 09:05:10 -07:00
spycrab
3b59ebb226 Qt: Exit exclusive fullscreen on confirmation prompt 2018-06-01 17:40:07 +02:00
JosJuice
533a49460a GameFile: Include necessary DiscIO headers 2018-06-01 14:19:16 +02:00
Léo Lam
94953670f2 WiiSave: Move overwrite prompt to Import
WriteHeader should just write the header and not do anything else.
2018-06-01 00:14:48 +02:00
spycrab
5f5b05f3dc Qt/MemoryWidget: Allow operating on columns 2018-05-31 22:07:05 +02:00
Léo Lam
a46a8dd378 WiiSave: Refactor import/export code
The current WiiSave code is extremely messy, as it exposes all kinds of
implementation details in the header (including internal struct
definitions and magic numbers that don't have to be).

The read/write code is intermingled, so it's hard to tell which members
are used, or when/where they are set at all.

It also implicitly relies on some functions being called in a specific
order since it doesn't seek manually every time, which makes the code
even more fragile.

The logic is also hardcoded to only support bin->nand or nand->bin,
even though it would be useful to support nand->nand (for the
Movie save copying code, for example).

This commit attempts to solve these problems by getting rid of the
WiiSave class:

* Read/write code is moved to new Storage classes (NandStorage and
  DataBinStorage) with small, clear functions that do one and only
  one thing.

* The import/export logic was refactored into a generic Copy function
  that takes two storages as parameters.

* The existing import and export functions are now just small wrappers
  that call Copy with the appropriate storages.
2018-05-31 20:52:01 +02:00
Léo Lam
60dd2553c6
Merge pull request #7033 from lioncash/jitarm
JitArm64_BackPatch: Correct usage of an invalidated iterator after a std::map erase() call in HandleFastmemFault()
2018-05-31 18:05:47 +02:00
Léo Lam
fff1db9730 Common: Add Random utilities
This makes it easier to generate random numbers or fill a buffer with
random data in a cryptographically secure way.

This also replaces existing usages of RNG functions in the codebase:

* <random> is pretty hard to use correctly, and std::random_device does
  not give enough guarantees about its results (it's
  implementation-defined, non cryptographically secure and could be
  deterministic on some platforms).
  Doing things correctly is error prone and verbose.

* rand() is terrible and should not be used especially in crypto code.
2018-05-31 17:54:43 +02:00
Anthony
a9a03d1565
Merge pull request #7034 from lioncash/override
JitArm64/Jit_Util: Add missing override specifiers
2018-05-31 08:48:35 -07:00
Mat M
dd77ace56a
Merge pull request #7005 from lioncash/div
Interpreter_FPUtils: Correct setting the FPSCR's zero divide exception flag in the 0/0 case in NI_div()
2018-05-31 11:22:45 -04:00
Mat M
f1b7259446
Merge pull request #6978 from lioncash/fcti
Interpreter_FloatingPoint: Handle NaN flag setting within fctiw and fctiwz
2018-05-31 11:22:04 -04:00
spycrab
8e5a96fcfc Qt/GeneralWidget: Show tooltip when adapters are not supported by the backend 2018-05-31 03:52:18 +02:00
spycrab
d453dc2342 Qt/MemoryWidget: Fix sidebar items being stretched out 2018-05-30 23:23:02 +02:00
spycrab
390fb37a29
Merge pull request #7032 from spycrab/qt_macos_mpbtn_round
Qt/macOS: Fix mapping buttons not being round
2018-05-30 22:45:15 +02:00
spycrab
d1db841ada
Merge pull request #7035 from spycrab/qt_macos_info_width
Qt/macOS: Fix InfoWidget fields being too narrow
2018-05-30 19:13:08 +02:00
spycrab
5f9d4d625f Qt/macOS: Fix InfoWidget fields being too narrow 2018-05-30 17:26:37 +02:00
Lioncash
bffcaf3218 JitArm64_BackPatch: Correct usage of an invalidated iterator after a std::map erase() call in HandleFastmemFault()
Given the iterator gets invalidated within the erase() call, just keep a
temporary around to store the pointer address.
2018-05-30 11:08:11 -04:00
Lioncash
ba6c371746 JitArm64/Jit_Util: Add missing override specifiers 2018-05-30 10:50:11 -04:00
Markus Wick
6c7e9f73da
Merge pull request #7030 from lioncash/emitter
x64Emitter: Amend parameter ordering for WriteModRM()'s prototype
2018-05-30 16:39:26 +02:00
spycrab
102d469f9e Qt/macOS: Fix mapping buttons not being round 2018-05-30 16:39:07 +02:00
Markus Wick
f02b2f0cad
Merge pull request #7031 from lioncash/naming
AudioInterface: Minor changes
2018-05-30 16:38:18 +02:00
Lioncash
038bb9b3e1 AudioInterface: Use member initializers where applicable for unions
Migrates more code to the initialization capabilities available since C++11
2018-05-30 09:49:28 -04:00
Lioncash
b59cda1435 AudioInterface: Amend variable naming
Normalizes variable names to conform to our coding conventions.
Previously we were signifying some variables as externally linked
globals, which wasn't the case.
2018-05-30 09:47:08 -04:00
Lioncash
81e11b2406 x64Emitter: Amend parameter ordering for WriteModRM()'s prototype
The definition of the function uses the ordering {mod, reg, rm}, which
is correct. Match the prototype to this, so that the parameter list
isn't misleading.
2018-05-30 09:30:24 -04:00
Léo Lam
bdfd331355
Merge pull request #7028 from lioncash/obsolete
GeneralPane: Replace usages of obsolete QString member function sprintf
2018-05-30 15:02:41 +02:00
Lioncash
f845818cfe VolumeWii: Shorten padding checking code within CheckIntegrity()
We can just use std::any_of here to collapse the checking code down to a
single assignment as opposed to a loop. This also slightly improves on
the existing code, as this won't continue to iterate through the cluster
metadata if an entry that's non-zero is encountered.
2018-05-30 08:42:32 -04:00
Lioncash
bd585f7389 GeneralPane: Replace usages of obsolete QString member function sprintf
sprintf is listed as obsolete within the documentation for Qt 5. Instead,
it recommends using the asprintf member function, arg(), or QTextStream.
2018-05-30 06:50:59 -04:00
Léo Lam
4fb2d580d8
Merge pull request #7026 from lioncash/name
JitAsmCommon: Normalize member variable names within CommonAsmRoutinesBase
2018-05-30 12:02:08 +02:00
Léo Lam
fb124c2eb0 Use nested namespaces for IOS HLE
Pretty much all of the source files contain the following:

    namespace IOS
    {
    namespace HLE
    {
    namespace <name>
    {
    // actual code here
    }  // namespace <name>
    }  // namespace HLE
    }  // namespace IOS

which is really verbose boilerplate, because most of the files inside
of Core/IOS are for IOS HLE.

This commit replaces that with a more concise `namespace IOS::HLE`
or `namespace IOS::HLE::(name)`.
2018-05-30 11:40:05 +02:00
Léo Lam
5b90aba624 ChunkFile: Replace macro with a variable template
Note that std::is_trivially_copyable_v cannot be used yet (C++17 only).
2018-05-30 11:39:30 +02:00
Lioncash
986d644a01 JitAsmCommon: Make CommonAsmRoutinesBase a struct
This is just used as a means of carting around routines. It's not meant
to directly have functionality embedded within it--this is the job of
the inheriting data structure--so we can just make this a basic struct.

Particularly given all the data members were public to begin with.
2018-05-30 05:22:41 -04:00
Lioncash
f5f4c10fd1 JitAsmCommon: Amend member variable names for CommonAsmRoutinesBase 2018-05-30 05:22:36 -04:00
Léo Lam
8a00a9e149 Remove old GCC version checks 2018-05-30 10:59:15 +02:00
Lioncash
efabfc0b54 VolumeWii: Use ReadSwapped for retrieving the partition data size in CheckIntegrity()
Also make this a little more robust by handling the failure case for
the read as well.
2018-05-30 04:34:57 -04:00
Lioncash
7bef470136 VolumeGC/VolumeWii: Dehardcode sizes where applicable
We can just use the relevant array to derive these sizes instead of hardcoding
them directly.
2018-05-30 04:14:42 -04:00
Markus Wick
4bebd52850
Merge pull request #7017 from lioncash/arm
Arm64Emitter: Use Common::BitCast where applicable
2018-05-30 09:50:59 +02:00
Lioncash
66122f037e Volume/VolumeGC/VolumeWii: Amend variable naming
Drops prefixed underscores and normalizes names to follow our coding
style.
2018-05-30 03:33:12 -04:00
JosJuice
ae4aa0b25c
Merge pull request #7010 from leoetlino/can-of-worms
Don't switch to blank NAND in the middle of emulation
2018-05-30 08:00:15 +02:00
JosJuice
243f353688
Merge pull request #7016 from lioncash/mem
MemoryPatches: Minor changes
2018-05-30 07:45:34 +02:00
JosJuice
6cb81ca851
Merge pull request #7015 from lioncash/pcap
PcapFile: Namespace code under the Common namespace
2018-05-30 07:45:09 +02:00
JosJuice
2f561dafd9
Merge pull request #7014 from lioncash/const
DSPEmulator: Make the IsLLE() member function const-qualified
2018-05-30 07:40:44 +02:00
Mat M
1825e231a3
Merge pull request #7013 from degasus/double2single
Jit64: Fix MORE_ACCURATE_DOUBLETOSINGLE.
2018-05-29 21:01:47 -04:00
spycrab
c07b89792d Qt/GeneralWidget: Add icon and title to the backend switch confirm dialog 2018-05-30 01:19:31 +02:00
spycrab
a729c375f3
Merge pull request #7011 from spycrab/qt_jit_instant
Qt/MenuBar: Fix JIT Menu options not being applied instantly
2018-05-30 00:53:20 +02:00
Lioncash
6fd7a79b93 Arm64Emitter: Use Common::BitCast where applicable
Gets rid of the need to set up memcpy boilerplate to reinterpret between
floating-point and integers.

While we're at it, also do a minor bit of tidying.
2018-05-29 18:19:01 -04:00
Lioncash
397b27e665 MemoryPatches: In-class initialize is_enabled state for MemoryPatch instances
Given this is what occurs in both constructors (as one just passes
through to another), we can just initialize the member directly.

While we're at it, amend the struct to follow the general ordering
convention of:

<new types>
<functions>
<variables>
2018-05-29 18:04:06 -04:00
Lioncash
4c33bb8dda MemoryPatches: std::move std::vector in the constructor
We can avoid copying the vector contents in this instance.
2018-05-29 18:01:16 -04:00
Lioncash
97c5a840db PcapFile: Namespace code under the Common namespace
Brings more common code under the Common namespace.
2018-05-29 17:56:15 -04:00
Lioncash
a7de492696 DSPEmulator: Make the IsLLE() member function const-qualified
This function only queries state and doesn't modify it, so this can be
made a const member function
2018-05-29 17:45:07 -04:00
degasus
bde65d8b42 Jit64: Fix MORE_ACCURATE_DOUBLETOSINGLE.
This is broken since 3d12849967.
2018-05-29 23:25:30 +02:00
spycrab
a1f15050a1 Qt/Mapping: Include "Always connected" option 2018-05-29 19:34:35 +02:00
spycrab
d98affbf47 Qt/MenuBar: Fix JIT Menu options not being applied instantly 2018-05-29 16:40:05 +02:00
Léo Lam
a4ec3ddef1 Don't switch to blank NAND in the middle of emulation
Switching to blank NAND when emulation is running is an extremely bad
idea. It's akin to opening up a Wii and replacing the NAND chip while
you're playing a game on it.

Except we're not even replacing it with a NAND that has the same
contents. The blank NAND has nothing in it except the save file for
the current game, which is likely to result in the emulated software
getting inconsistent results and possibly even crashing depending on
how it caches title information.

An example of games that check the saves for other games is
Mario Kart Wii -- it checks the filesystem for Super Mario Galaxy saves
to decide whether to unlock characters. With this 'switch NAND
while emulation is active' misfeature, this will likely break.
And that's the main problem: it encourages sloppy emulation and no one
really knows how many things it can break.

Just don't let the user do horrible things like that during emulation.
If they want to use a blank NAND, they can do so by starting input
recording before launching a game. It's likely they will want to do
this if they plan to share their DTM anyway.
2018-05-29 15:41:11 +02:00
Léo Lam
60c38d7781
Merge pull request #7007 from spycrab/qt_gecko_sort
Qt/GeckoCodeWidget: Autosort list and fix accessing the wrong element
2018-05-29 14:48:32 +02:00
Léo Lam
00d91db2ec
Merge pull request #7008 from spycrab/ddos_sux
Fix "Download Codes" hitting DDOS protection
2018-05-29 14:42:24 +02:00
Léo Lam
86bbf540cf
Merge pull request #7009 from lioncash/dsp
DSPEmulator: Default destructor in the cpp file
2018-05-29 14:16:50 +02:00
Lioncash
c33228e466 DSPEmulator: Default destructor in the cpp file
This gets rid of a -Wweak-vtables warning
2018-05-29 07:54:39 -04:00
spycrab
c086f894b1 Core/GeckoCodeConfig: Circumvent DDOS protection 2018-05-29 03:56:28 +02:00
spycrab
44784cf363 Common/HttpRequest: Add option to set cookies 2018-05-29 03:56:28 +02:00
spycrab
a00250bfe6 Qt/GeckoCodeWidget: Autosort list and fix accessing the wrong element 2018-05-29 03:36:35 +02:00
spycrab
e6273b177f Qt/MappingWindow: Fix profile saving not working when the index is not null 2018-05-29 01:32:07 +02:00
spycrab
5829ad21b7 Qt/MappingWidget: Fix profiles not loading properly 2018-05-29 01:21:42 +02:00
spycrab
75e87a8a0d
Merge pull request #6945 from spycrab/qt_sighandler
Qt/Unix: Implement signal handler
2018-05-28 22:05:52 +02:00
Lioncash
7bfeffe32f Interpreter_FPUtils: Unset FPSCR.FI and FPSCR.FR when FPSCR.ZX is set in NI_div()
Another bit of behavior that we weren't performing correctly is the
unsetting of FPSCR.FI and FPSCR.FR when FPSCR.ZX is supposed to be set.
This is supported in PEM's section 3.3.6.1 where the following is
stated:

"
When a zero divide condition occurs, the following actions are taken:

- Zero divide exception condition bit is set FPSCR[ZX] = 1.
- FPSCR[FR, FI] are cleared.
"

And so, this fixes that behavior.
2018-05-28 16:03:59 -04:00
Lioncash
3deadd1fff Interpreter_FPUtils: Correct setting the FPSCR's zero divide exception flag in the 0/0 case
FPSCR[ZX] is the bit defined to represent the zero divide exception
condition bit, and is defined as (according to PowerPC Microprocessor
Family: The Programming Environments Manual for 32 and 64-bit
Microprocessors, which will be referred to as "PEM" for the rest of this
commit message) at section 3.3.6.1:

"
A zero divide exception condition occurs when a divide instructions is
executed with a zero divisor value and a finite, nonzero dividend value
or when a floating reciprocal estimate single (fres) or a floating
reciprocal square root estimate (frsqrte) instruction is executed with a
zero operand value.
"

Note that it states the divisor must be zero and the dividend must be
nonzero in order for ZX to be set. This means that the interpreter was
performing the wrong behavior for the case where 0/0 (with any sign on
the zeros) is performed. We would incorrectly set the ZX bit when only
the VXZDZ bit should be set.

It's also worth pointing out that N/0 (where N is any finite nonzero
value) and 0/0 are not within the same exception class. N/0 is a zero
divide exception case, while 0/0 is considered an invalid operation
exception case, which is also indicated in the PEM section 3.3.6.1 as
well where it lists the criteria for invalid operation exceptions.

Therefore we should only be setting the VXZDZ bit in the 0/0 case, not
VXZDZ and ZX. This was also verified via hardware tests to ensure that
this behavior indeed holds.
2018-05-28 16:00:23 -04:00
spycrab
112a174ae1 Qt/Unix: Implement signal handler 2018-05-28 21:47:46 +02:00
JosJuice
b2d8d2a398
Merge pull request #7004 from lioncash/bp
BPMemory: Silence a -Wmissing-braces warning
2018-05-28 21:16:28 +02:00
Léo Lam
f05eb10026
Merge pull request #7003 from lioncash/host
Common: Move host communication enum to Host.h
2018-05-28 20:57:34 +02:00
Lioncash
72feeb4d18 BPMemory: Silence a -Wmissing-braces warning
Fairly trivial to resolve, we just initialize the std::array with two
sets of braces (one set to create the array, the other to start and end the
aggregate data that we'll end up returning)
2018-05-28 14:52:59 -04:00
Lioncash
4288bfe0f9 Common: Move host communication enum to Host.h
Given this is actually a part of the Host interface, this should be
placed with it.

While we're at it, turn it into an enum class so that we don't dump its
contained values into the surrounding scope. We can also make
Host_Message take the enum type itself directly instead of taking a
general int value.

After this, it'll be trivial to divide out the rest of Common.h and
remove the header from the repository entirely
2018-05-28 14:34:59 -04:00
Lioncash
78a934bb12 Interpreter_FloatingPoint: Handle cases when FPSCR.VE is set and exceptions occur in fctiw and fctiwz
If invalid operation exceptions are enabled and an invalid operation
occurs, then the destination value remains untouched. This fixes issues
that may arise when using these two instructions where the destination
gets steamrolled by an infinity or NaN value.
2018-05-28 14:05:12 -04:00
Lioncash
8c4aa133ca Interpreter_FloatingPoint: Handle NaN flag setting within fctiw and fctiwz
If a NaN of any type is passed as the operand to either of these
instructions, we shouldn't go down the regular code path, as we end up
potentially setting the wrong flags. For example, we wouldn't set the
FPSCR.VXCVI bit properly. We'd also set FPSCR.FI, when in actuality it
should be unset.

If an SNaN is passed as an operand, we also need to set the FPSCR.VXSNAN
bit as well.

The flag setting behavior for these can be found in Appendix C.4.2 in
PowerPC Microprocessor Family: The Programming Environments Manual for
32 and 64-bit Microprocessors.
2018-05-28 14:05:08 -04:00
Lioncash
0125d9b099 Interpreter_FloatingPoint: Factor out common code from fctiw and fctiwz
fctiwz functions in the same manner as fctiw, with the difference being
that fctiwz always assumes the rounding mode being towards zero. Because
of this, we can implement fctiwz in terms of fctiw's code, but modify it
to accept a rounding mode, allowing us to preserve proper behavior for
both instructions.

We also move Helper_UpdateCR1 to a temporary home in
Interpreter_FPUtils.h for the time being. It would be more desirable to
move it to a new common header for all the helpers, so that even JITs
can use them if they so wish, however, this and the following changes
are intended to only touch the interpreter to keep changes minimal for
fixing instruction behavior.

JitCommon already duplicates the Helper_Mask function within
JitBase.cpp/.h, and the ARM JIT includes the Interpreter header in order
to call Helper_Carry. So a follow up is best suited here, as this
touches two other CPU backends.
2018-05-28 13:28:44 -04:00
Léo Lam
a9f022a067
Merge pull request #6993 from lioncash/nan
Interpreter_FPUtils: Set VXSNAN if any input operands are a signaling NaN in remaining NI_* functions
2018-05-28 18:49:13 +02:00
spycrab
42bd1a91a6 Qt/AdvancedPane: Show seconds in custom RTC 2018-05-28 13:37:46 +02:00
Léo Lam
bda668925a
Merge pull request #6989 from lcsondes/fix-vector-assert
UICommon: fix m_cached_files pruning.
2018-05-28 12:41:22 +02:00
Léo Lam
0cba9bb218
Merge pull request #7000 from lioncash/wii-extension
WiimoteEmu: Get rid of pointer casting in extension GetState() functions
2018-05-28 12:39:01 +02:00
Markus Wick
cddc2d52c2
Merge pull request #6965 from stenzek/d3d-feature-level-10
D3D: Don't emit uint outputs when logic op is unsupported
2018-05-28 09:52:07 +02:00
Markus Wick
9e102e1584
Merge pull request #6943 from lioncash/overflow
Interpreter/Jit64/JitArm64: Correct negative overflow handling for divw
2018-05-28 09:49:19 +02:00