Commit Graph

24719 Commits

Author SHA1 Message Date
Markus Wick 4ca05810be
Merge pull request #7144 from lioncash/cast
ActionReplay: Use Common::BitCast instead of reinterpret_cast in Subtype_AddCode()
2018-06-21 09:56:05 +02:00
Markus Wick 966cc5bc01
Merge pull request #7142 from lioncash/shadow
Common/MemoryPatches: Silence variable shadowing warnings
2018-06-21 09:52:47 +02:00
Markus Wick 9f03d8ca6a
Merge pull request #7139 from lioncash/tb
PowerPC: Add functions to read/write the full timebase value
2018-06-21 09:52:13 +02:00
Markus Wick 235a01c976
Merge pull request #7131 from JosJuice/android-case-insensitive-sort
Android: Use case insensitive sorting in game list
2018-06-21 09:29:41 +02:00
Markus Wick 3816e825c9
Merge pull request #7135 from JosJuice/cant-load-state
Only show savestate version mismatch OSD message when relevant
2018-06-21 09:28:47 +02:00
Lioncash 540bb1a1b0
Software: Don't link against X11 libraries
The software backend doesn't actually use X11 in any capacity directly.
2018-06-21 01:47:37 -04:00
Lioncash d0fbba9ac1 Interpreter_SystemRegisters: Handle mtspr to HID1 and PVR properly
Despite both being documented as read-only registers, only one of them
is truly read-only. An mtspr to HID1 will steamroll bits 0-4 with
bits 0-4 of whatever value is currently in the source register, the rest
of the bits are not modified as bits 5-31 are considered reserved, so
these ignore writes to them.

PVR on the other hand, is truly a read-only register. Attempts to write
to it don't modify the value within it, so we model this behavior.
2018-06-20 18:50:33 -04:00
Lioncash 7eb86cdb67 BTEmu: Add helper function for accessing WiimoteDevice instances by index
This makes it much more straightforward to access WiimoteDevice
instances and also keeps the implementation details of accessing those
instances in one spot.

Given as all external accesses to the WiimoteDevice instances go through
this function, we can make the other two private.
2018-06-20 17:05:54 -04:00
Lioncash 0e437c41e5 ActionReplay: Use Common::BitCast instead of reinterpret_cast in Subtype_AddCode()
Using reinterpret_cast (or a C-styled equivalent) to reinterpret
integers as floating-point values and vice-versa invokes undefined
behavior. Instead, use BitCast, which does this in a well-defined
manner.
2018-06-20 16:38:30 -04:00
Lioncash e4b6d7626b WiimoteDevice: Make Callback_WiimoteInterruptChannel() accept its data as a u8* rather than void*
All current usages of the function pass in either u8 arrays or pointers,
so we can make this part of the function a concrete type.
2018-06-20 16:04:10 -04:00
Lioncash 2b60fe684c BTEmu: Make m_WiiMotes private
We can already utilize the public interface to access the necessary
instance without exposing a private data member.
2018-06-20 15:15:05 -04:00
spycrab 583ddfa8f0 Qt/GCMemcardManager: Update free blocks when a memcard is changed 2018-06-20 12:33:14 +02:00
spycrab ce126f1cfe Qt/Mapping: Remove "Iterative Input" everywhere 2018-06-20 12:33:14 +02:00
yourWaifu 63f03455f3 Discord Rich Presence CMake integration
I have no idea if this works or not. Hopefully the build bot will tell me.
2018-06-19 22:43:03 -04:00
Lioncash dddac76b8c Common/MemoryPatches: Silence variable shadowing warnings 2018-06-19 21:33:50 -04:00
Léo Lam bdfc6de9fd
Merge pull request #7137 from lioncash/copy
GameFile: Avoid copying map pairs in GetLanguages()
2018-06-19 22:57:29 +02:00
Léo Lam de0b153867
Merge pull request #7136 from lioncash/unused
GameFile: Remove unused variable within GetUniqueIdentifier()
2018-06-19 22:57:00 +02:00
Léo Lam e728c0c948
Merge pull request #7132 from lioncash/table
BTEmu: Make read-only arrays const
2018-06-19 22:56:10 +02:00
Lioncash 6066ca30b2 DolphinQt2/RegisterWidget: std::move std::function instances in AddRegister()
These can be moved into the RegisterColumn constructor, which avoids
potential allocations in the case a std::function would otherwise need
to allocate to hold all of it's captured data.

Also tidy up the inclusion order while we're at it.
2018-06-19 13:40:22 -04:00
Lioncash 562d2a700b PowerPC: Add functions to read/write the full timebase value
Allows us to get rid of a silly pointer cast and deduplicate some code
from the front-end when it comes to reading the value.
2018-06-19 13:26:08 -04:00
Lioncash d3ed750c9d GameFile: Avoid copying map pairs in GetLanguages()
We can just reference the pairs instead of taking them by value,
avoiding copying std::string instances.
2018-06-19 12:25:16 -04:00
Lioncash 1e4f3607c3 GameFile: Remove unused variable within GetUniqueIdentifier() 2018-06-19 12:18:09 -04:00
JosJuice 860a89b943 Only show savestate version mismatch OSD message when relevant
We used to show it for all failed savestate loads, no matter what the
failure reason was. Fixes https://bugs.dolphin-emu.org/issues/9815
2018-06-19 16:15:18 +02:00
8times9 33691d2992 Qt: Add Vulkan to graphics backend description 2018-06-19 08:38:48 -05:00
spycrab 18c3e0302f
Merge pull request #7127 from Techjar/patch-4
Qt/GameCubePane: Fix issues with changing memcard slots while game is running
2018-06-19 13:50:25 +02:00
spycrab 113f9767dd Qt/FilesystemWidget: Remove "Whats this?" button from extraction dialog 2018-06-19 10:30:32 +02:00
Lioncash 9c3c92329e DSPAssembler: Remove commented out code
This is just dead line noise sitting around, so we can get rid of it.
2018-06-18 16:24:38 -04:00
Lioncash 549bedd30b BTEmu: Make read-only arrays const
Several arrays within this source file are only ever read from, so the
data can be made immutable.
2018-06-18 16:03:05 -04:00
Lioncash b36cdbdda5 DSPAssembler: Convert typedef into a using alias 2018-06-18 15:45:59 -04:00
Lioncash af41a8efba DSPAssembler: Make member variable naming consistent
Previously the class was intermixing m_ prefixed variables and
non-prefixed ones, which can be misleading. Instead, we make the
prefixing consistent across the board.
2018-06-18 15:44:13 -04:00
Lioncash 1389bf35bd DSPAssembler: In-class initialize members where applicable
Avoids repeating ourself in the initializer list and makes the class
have a predictable initial state.
2018-06-18 15:35:58 -04:00
JosJuice d1a82182ac Android: Use case insensitive sorting in game list 2018-06-18 19:11:58 +02:00
JosJuice 091efcc41d
Merge pull request #7125 from lioncash/enum
ConfigManager: Convert GPUDeterminismMode into an enum class
2018-06-18 18:22:31 +02:00
Lioncash 78eba28975 DSPTool: Factor out behavior from main()
Keeps all behavior localized in their own functions, making it a tiny
bit nicer to read.
2018-06-17 18:21:33 -04:00
Lioncash eb76dc9600 DSPCore: Make ExceptionType an enum class
Makes the values strongly typed and avoids polluting the DSP namespace.
2018-06-17 17:42:54 -04:00
Lioncash 8459d2bc5d DSPCore: Make DSPCore_SetException() take an enum type instead of a u8
Makes it more immediately indicative which values are intended to be
passed to this function.
2018-06-17 16:02:56 -04:00
Techjar 7778859b55 Qt/GameCubePane: Fix issues with changing memcard slots while game is running
Selecting Dummy or Memory Card would pass wrong values to EXI::ChangeDevice and not work as expected
Changing path had no effect until device was changed as it didn't call EXI::ChangeDevice at all
2018-06-17 14:04:37 -04:00
spycrab e3f7b0274c Qt/HotkeyScheduler: Fix 3D Mode hotkeys not behaving properly 2018-06-16 21:38:14 +02:00
spycrab b5e6cd9725
Merge pull request #7122 from spycrab/qt_table_perf
Qt/GameList: Greatly improve performance (List view)
2018-06-16 12:40:13 +02:00
Lioncash de9c5fd375 ConfigManager: Convert GPUDeterminismMode into an enum class
Makes the values strongly-typed and gets more identifiers out of the
global namespace.

We are forced to use anything that is not "None" to mean none, because
X11 is garbage in that it has:

\#define None 0L

Because clearly no one else will ever want to use that identifier for
anything in their own code (and is why you should prefix literally
any and all preprocessor macros you expose to library users in public
headers).
2018-06-15 14:45:30 -04:00
Léo Lam bd85d63c62
Merge pull request #7120 from Ebola16/313
Update Android Gradle to 3.1.3 and minor improvements
2018-06-15 19:54:49 +02:00
Léo Lam 0ee9b884ca
Merge pull request #7123 from lioncash/enum
DSPCore: Convert core type enum into an enum class
2018-06-15 19:52:57 +02:00
Lioncash 6f473b96d0 PowerPC: Convert CPUCore enum into an enum class
Makes the enum values strongly-typed and prevents the identifiers from
polluting the PowerPC namespace. This also cleans up the parameters of
some functions where we were accepting an ambiguous int type and
expecting the correct values to be passed in.

Now those parameters accept a PowerPC::CPUCore type only, making it
immediately obvious which values should be passed in. It also turns out
we were storing these core types into other structures as plain ints,
which have also been corrected.

As this type is used directly with the configuration code, we need to
provide our own overloaded insertion (<<) and extraction (>>) operators
in order to make it compatible with it. These are fairly trivial to
implement, so there's no issue here.

A minor adjustment to TryParse() was required, as our generic function
was doing the following:

N tmp = 0;

which is problematic, as custom types may not be able to have that
assignment performed (e.g. strongly-typed enums), so we change this to:

N tmp;

which is sufficient, as the value is attempted to be initialized
immediately under that statement.
2018-06-15 10:27:59 -04:00
Lioncash 161dffe2f9 DSPCore: Rename JIT core type to JIT64
This changes the identifier to represent the x86-64 DSP emitter. If any
other JITs for the DSP are added in the future, they all can't use the
same generic identifier.
2018-06-15 07:59:05 -04:00
Lioncash 98af5e4c10 DSPCore: Convert core type enum into an enum class
Prevents pollution of the surrounding scope and makes the values
strongly-typed.
2018-06-15 07:55:31 -04:00
spycrab daebbabb35 Qt/GameList: Greatly improve performance (List view) 2018-06-15 12:05:11 +02:00
Ryan Meredith 31b3647d73 Android: Add Emulated CPU Clock description and minor cleanup 2018-06-14 23:15:39 -04:00
Léo Lam 58606702f7
Merge pull request #7107 from lioncash/mac
Common/Network: Get rid of out parameters for MAC address utilities
2018-06-14 19:44:09 +02:00
Léo Lam c7280707ec
Merge pull request #7113 from lioncash/mask
Gekko: Centralize bitmasking of the FPSCR within UReg_FPSCR
2018-06-14 18:28:11 +02:00
Léo Lam 59cd9a5af7
Merge pull request #7118 from lioncash/hotkey-str
HotkeyManager: Minor changes
2018-06-14 18:26:03 +02:00
Lioncash 189d277cfc Common/Random: Add convenience template for simple arithmetic values
In cases where we just want a random value for a primitive arithmetic
type, we can wrap this in a template to allow convenient direct
assignment instead of keeping declaration and initialization separate
(making it more difficult to use values uninitialized). This also allows
the use of Common::Random with functions such as std::generate, making
it more flexible in how random values can be generated.
2018-06-14 10:31:13 -04:00
spycrab e69c6cdaab
Merge pull request #7114 from Techjar/patch-3
Qt/GameCubePane: Fix memcard browsing starting in working directory instead of User/GC/ directory
2018-06-14 16:13:21 +02:00
Lioncash 410792d922 HotkeyManager: Add missing s_ prefixes to internally-linked file-scope variables
Previously there was an intermixing of no prefixing and prefixing. This
makes the notation consistent.
2018-06-14 10:07:22 -04:00
Lioncash d22d32372e HotkeyManager: Use std::array where applicable 2018-06-14 10:07:01 -04:00
Lioncash aae06f1cf7 HotkeyManager: Move HotkeyGroupInfo struct into the cpp file
This is only ever used internally. Also change the std::string name over
to a const char*, so that we don't need to potentially allocate anything
on the heap at immediate runtime.
2018-06-14 09:12:19 -04:00
Techjar 027fc6efd5 Qt/GameCubePane: Fix memcard browsing starting in working directory instead of User/GC/ directory 2018-06-14 09:11:54 -04:00
Lioncash d459470fee HotkeyManager: Convert file-scope std::string array to constexpr const char* array
Previously, a total of 114 std::string instances would need to construct
(allocating on the heap for larger strings that can't be stored with
small string optimizations). We can just use an array of const char*
strings instead, which allows us to avoid this.
2018-06-14 09:04:57 -04:00
Markus Wick 1f49a9c87c
Merge pull request #7116 from lioncash/log
JitCommon/JitBase: Rename x86-specific logging define to be platform agnostic
2018-06-14 15:00:34 +02:00
Lioncash 065aba43e2 JitBase: Remove unused rewriteStart data member from JitState 2018-06-14 08:46:34 -04:00
Lioncash ace24c2932 JitCommon/JitBase: Rename x86-specific logging define to be platform agnostic
Given JitBase shouldn't include platform specifics, we can generalize this
preprocessor define and allow any JIT to use it to indicate that generated code should be logged.

While we're at it, also move these defines beneath the includes with the
rest of the defines.
2018-06-14 08:35:35 -04:00
spycrab e8c1e5af63
Merge pull request #7112 from spycrab/qt_macos_layout
Qt/macOS: Make configuration layout consistent with other platforms
2018-06-14 12:29:24 +02:00
Sintendo 78bc9690e2 Eliminate branch in ConvertDoubleToSingle 2018-06-13 23:02:50 +02:00
degasus 03c88c83ac CachedInterpreter: Implement breakpoints.
There were missed on the initial implementation of the cached interpreter.
2018-06-13 08:33:57 +02:00
spycrab 09df03382d
Merge pull request #7094 from spycrab/qt_fs_fixes
Qt: Fix multiple fullscreen issues
2018-06-12 22:46:29 +02:00
Lioncash 0049ef3a2a Gekko: Centralize bitmasking of the FPSCR within UReg_FPSCR
Rather than introduce this handling in every system instruction that modifies
the FPSCR directly, we can instead just handle it within the data structure
instead, which avoids duplicating mask handling across instructions.

This also allows handling proper masking from the debugger register
windows themselves without duplicating masking behavior there either.
2018-06-12 14:15:50 -04:00
spycrab f2c6a97916 Qt/macOS: Make configuration layout consistent with other platforms 2018-06-12 15:45:33 +02:00
spycrab 4d55cb745c UnitTests: Fix MSVC compilation 2018-06-12 15:28:59 +02:00
spycrab ccf9ecbb03 UnitTests/VertexLoaderTest: Fix compilation on newer GTest versions 2018-06-12 14:59:57 +02:00
Léo Lam f3a18db9e0
Merge pull request #7106 from lioncash/name
WiimoteDevice: Amend variable naming
2018-06-11 11:12:08 +02:00
Lioncash 59846378b3 BTReal: Handle case where a link key may be invalid within LoadLinkKeys()
This can only occur if a user purposely corrupts their config file, but
still, we may as well protect users from themselves.
2018-06-10 16:11:36 -04:00
Lioncash ce69201f33 Common/Network: Get rid of out parameters for MAC address utilities
Given we have std::array and std::optional, we can use these in
conjunction with one another to avoid the need for out parameters.
2018-06-10 15:43:26 -04:00
Mat M b6592723a7
Merge pull request #7103 from leoetlino/master
BTReal: Fix unsafe reinterpret_casts
2018-06-10 14:27:19 -04:00
Lioncash 925348cdd1 WiimoteDevice: Amend variable naming for class member variables
Gets rid of inconsistencies related to class variables concerning casing
and the lack of prefixes on some variables, while others contain them.
2018-06-10 14:23:36 -04:00
Lioncash eaace415d3 WiimoteDevice: Amend variable naming for non-class member variables
This file is quite out of sync when it comes to our naming conventions,
this brings it back in line with it.
2018-06-10 14:23:31 -04:00
Markus Wick 70417c8d16
Merge pull request #7096 from lioncash/jit-buffer
JitBase: Centralize location of code buffer
2018-06-10 17:59:41 +02:00
Lioncash 0d0f58005b WiimoteDevice: Make channel reference const qualified
This is only used for reading data, not modifying it, so make the type
system enforce that.
2018-06-10 09:08:33 -04:00
Lioncash 5548316d32 WiimoteDevice: Remove unnecessary cast in ExecuteL2capCmd()
pData is already a u8*, so a cast isn't necessary here.
2018-06-10 09:04:42 -04:00
Léo Lam 69f079b371
Merge pull request #7098 from Ebola16/ElfDolMessage
Android: Add AlertDialog for files without Game IDs in Game Settings
2018-06-10 14:36:46 +02:00
Léo Lam fca6d80740
Merge pull request #7101 from lioncash/ios
WiimoteDevice: Minor changes
2018-06-10 14:35:41 +02:00
Léo Lam 8bb08d1ca6 BTReal: Fix unsafe reinterpret_casts
Using reinterpret_cast like that is possibly UB.
Replace them with structs/memcpy calls where applicable.
2018-06-09 23:04:04 +02:00
Lioncash c825eecbc9 ChunkFile: Remove unnecessary includes
ChunkFile doesn't use any of the file utilities, so we can drop these
headers to avoid pulling in unnecessary dependencies. This also
uncovered a few indirect inclusions.
2018-06-09 16:49:59 -04:00
Lioncash 647da59679 WiimoteDevice: Move channel state booleans into a struct
These were essentially duplicated for both channels, when they could be
implemented in terms of a struct, which allows for simplifying the reset
case.
2018-06-09 16:35:32 -04:00
Lioncash 94fd8505d6 WiimoteDevice: Make DoesChannelExist() a const member function
This only queries internal class state, it doesn't modify it.
2018-06-09 16:35:32 -04:00
Lioncash f906785e88 WiimoteDevice: Make EventPagingChanged() a const member function
This only queries internal state, it doesn't modify it. With minor
adjustments to BTEmu, this also allows us to make its usage instance a
constant reference.
2018-06-09 16:35:32 -04:00
Lioncash 38d155f993 WiimoteDevice: Make ConnectionState enum an enum class
Avoids polluting class scope and makes it strongly typed.
2018-06-09 16:35:27 -04:00
Léo Lam f564c28040
Merge pull request #7099 from lioncash/compiler
Common: Add Compiler.h header for compiler-specifics
2018-06-09 20:19:49 +02:00
Lioncash b5d89294f7 WiimoteHIDAttr: Make file-scope packet data arrays immutable
Given these are only ever returned from a function as const u8*, we can
go ahead and make these fully immutable.
2018-06-09 13:46:28 -04:00
Lioncash 7b11ce3dd2 Compiler: Use [[maybe_unused]] in the Windows DOLPHIN_UNUSED macro
The required version of MSVC already supports [[maybe_unused]], so we
can utilize this here. When GCC 7 and clang 3.9 become hard
requirements, we can eliminate this macro entirely and replace it with
[[maybe_unused]].
2018-06-09 12:20:29 -04:00
Lioncash d8f6d60189 Compiler: Rename UNUSED macro to DOLPHIN_UNUSED
UNUSED is quite a generic macro name and has potential to clash with
other libraries, so rename it to DOLPHIN_UNUSED to prevent that, as well
as make its naming consistent with the force inline macro
2018-06-09 12:20:29 -04:00
Lioncash 3f210836ad Compiler: Rename __forceinline define to DOLPHIN_FORCE_INLINE
This is much better as prefixed double underscores are reserved for the
implementation when it comes to identifiers. Another reason its better,
is that, on Windows, where __forceinline is a compiler built-in, with
the previous define, header inclusion software that detects unnecessary
includes will erroneously flag usages of Compiler.h as unnecessary
(despite being necessary on other platforms). So we define a macro
that's used by Windows and other platforms to ensure this doesn't
happen.
2018-06-09 12:20:25 -04:00
Lioncash 03414e8e84 Common: Add header for compiler-specifics
Instead of globbing things under an ambiguous Common.h header, move
compiler-specifics over to Compiler.h. This gives us a dedicated home
for anything related to compilers that we want to make functional across
all compilers that we support.

This moves us a little closer to eliminating Common.h entirely.
2018-06-09 12:10:05 -04:00
Ryan Meredith fb3ae94acb Android: Add AlertDialog for files without Game IDs in Game Settings 2018-06-09 11:30:20 -04:00
Lioncash e18824e3f3 PPCAnalyst: get rid of code buffer size variable
Rather than have a separate independent variable that we need to keep
track of in conjunction with the JIT code buffer size itself, amend the
analyst code to use the code buffer constant in JitBase.

Now if the size ever changes, then the analyst will automatically adjust
to handle it.
2018-06-09 08:17:17 -04:00
Lioncash a3f2941173 JitBase: Centralize location of code buffer
Given the code buffer is something truly common to all JIT
implementations, we can centralize it in the base class and avoid
duplicating it all over the place, while still allowing for differently
sized buffers.
2018-06-09 08:16:53 -04:00
Léo Lam 1d87584d69
Merge pull request #7097 from lioncash/dsp-disas
DSPDisassembler: Remove unnecessary includes
2018-06-09 07:58:39 +02:00
Lioncash 61ff11c266 DSPDisassembler: Remove unnecessary includes
Gets rid of an inclusion dependency with the DSP interpreter, as well as
a header-based dependency on the DSP opcode tables. This also uncovered
an indirect inclusion on the logger within DSPSymbols.cpp
2018-06-08 18:55:57 -04:00
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