Commit Graph

29821 Commits

Author SHA1 Message Date
Skyler Saleh 38861f6782 Apple M1: x86_64 MAP_JIT
- Enabled MAP_JIT on x86_64 after confirming that pthread_jit* calls are only
required for MAP_JIT pages on Apple Silicon
2021-05-22 15:25:18 -07:00
Skyler Saleh 4ff429266a Apple M1: MacOS 11.2 mprotect restrictions
In MacOS 11.2 mprotect can no longer change the access protection settings of
pages that were previously marked as executable to anything but PROT_NONE. This
commit works around this new restriction by bypassing the mprotect based write
protection and instead relying on the write protection provided by MAP_JIT.
2021-05-22 15:25:18 -07:00
Skyler Saleh 8cb86e7ae0 Apple M1: Enable hardened runtime
- Fixed error that was causing the hardened runtime from being enabled
- Refactored BuildMacOSUniversalBinary.py based on code style recommendations
2021-05-22 15:25:18 -07:00
Skyler Saleh 61448a9b2f Apple M1: Refactor ArmCPUDetect.cpp
Merges two nested #ifndefs into a single #if around hw cap includes.
2021-05-22 15:25:17 -07:00
Skyler Saleh 4542038cd0 Apple M1: OS version checking for MAP_JIT
- Added MacOS version checking around MAP_JIT to prepare code for x86 MAP_JIT
2021-05-22 15:25:17 -07:00
Skyler Saleh 948764d37b Apple M1: Build, Analytics, and Memory Management
Analytics:
- Incorporated fix to allow the full set of analytics that was recommended by
  spotlightishere

BuildMacOSUniversalBinary:
- The x86_64 slice for a universal binary is now built for 10.12
- The universal binary build script now can be configured though command line
  options instead of modifying the script itself.
- os.system calls were replaced with equivalent subprocess calls
- Formatting was reworked to be more PEP 8 compliant
- The script was refactored to make it more modular
- The com.apple.security.cs.disable-library-validation entitlement was removed

Memory Management:
- Changed the JITPageWrite*Execute*() functions to incorporate support for
  nesting

Other:
- Fixed several small lint errors
- Fixed doc and formatting mistakes
- Several small refactors to make things clearer
2021-05-22 15:25:17 -07:00
Skyler Saleh 4ecb3084b7 Apple M1 Support for MacOS
This commit adds support for compiling Dolphin for ARM on MacOS so that it can
run natively on the M1 processors without running through Rosseta2 emulation
providing a 30-50% performance speedup and less hitches from Rosseta2.

It consists of several key changes:

- Adding support for W^X allocation(MAP_JIT) for the ARM JIT
- Adding the machine context and config info to identify the M1 processor
- Additions to the build system and docs to support building universal binaries
- Adding code signing entitlements to access the MAP_JIT functionality
- Updating the MoltenVK libvulkan.dylib to a newer version with M1 support
2021-05-22 15:25:17 -07:00
JosJuice f9b0225b69
Merge pull request #9725 from Techjar/netplay-sync-allow-sd-write
NetPlay: Add some missing synced settings
2021-05-22 23:32:12 +02:00
Scott Mansell 610613ee76 Use correct mask for Fake VMem
Shouldn't have any behaviour change for regular usage as both masks are 32MB
by default.
But fixes theoretical buffer overrun when memory size override is used.
2021-05-23 05:54:02 +12:00
Mai M 77e5d79354
Merge pull request #9736 from Techjar/bbox-pixel-quads
VideoCommon: Account for pixel quads in bounding box calculation
2021-05-22 13:14:07 -04:00
JosJuice 68a5fc55d2 Interpreter: Fix fctiwx rounding
The interpreter implementation of fctiwx was treating rounding
mode 0 as "round to nearest, ties towards zero", which is not
an actual IEEE-754 rounding mode. The IBM document mentioned
in a comment at the top of the function, on the other hand,
treats rounding mode 0 as "round to nearest, ties to even",
which makes more sense.

This fixes one of JMC's console-recorded F-Zero GX replays on
JitArm64. (JitArm64 uses an interpreter fallback for fctiwx.)
2021-05-22 17:28:04 +02:00
Techjar be6b000bec VideoCommon: Account for pixel quads in bounding box calculation
The GC/Wii GPU rasterizes in 2x2 pixel groups, so bounding box values
will be rounded to the extents of these groups, rather than the exact
pixel. To account for this, we'll round the top/left down to even and
the bottom/right up to odd. I have verified that the values resulting
from this change exactly match a real Wii.
2021-05-22 05:58:52 -04:00
Techjar 0f17990137 VideoCommon: Split BBox* functions into common and backend implementation variants
This will allow for some aspects of bounding box to be handled in
VideoCommon instead of individual backends.
2021-05-22 01:11:57 -04:00
Techjar 42d1658c50 VideoCommon/TextureInfo: Restore old mipmap detection logic 2021-05-22 00:35:43 -04:00
JosJuice 99dc97c377 DolphinQt: AutoUpdate.cpp should use scm_rev_git_str
27cc0b5 regression.
2021-05-21 17:36:43 +02:00
Mai M 7d8c3ff7d2
Merge pull request #9732 from JosJuice/avoid-including-scmrev
Avoid including scmrev.h except in Version.cpp
2021-05-21 11:25:38 -04:00
JosJuice 27cc0b539a Avoid including scmrev.h except in Version.cpp
Any file which includes scmrev.h must be rebuilt when scmrev.h
is regenerated. By not including scmrev.h from any file other
than Version.cpp, incremental builds become a little faster.
2021-05-21 17:03:01 +02:00
JosJuice 1d3b9fdec2 Fix perf query regression
When trying to do a small optimization in 8a0f5ea, I failed to
take into account that WeakFlush and FlushOne update m_query_count.

Only D3D11 and OGL had this problem, not D3D12 and Vulkan.
2021-05-21 13:39:59 +02:00
Techjar a47fcdcbec NetPlay: Add some missing synced settings 2021-05-20 15:13:41 -04:00
Mai M 1d175e7e13
Merge pull request #9728 from JosJuice/android-get-shader-list
Android: Use JNI for getting post-processsing shaders
2021-05-20 11:16:08 -04:00
Mai M 9312e45cbe
Merge pull request #9687 from Dentomologist/fix_config_descriptions_grammar
Fix config descriptions grammar
2021-05-20 11:15:25 -04:00
JosJuice 69626f1726 Android: Remove getDolphinInternalDirectory
I was going to rename this to getSysDirectory to make it clearer
what the returned path actually is, but it turns out we're not
actually using this for anything anymore.
2021-05-20 16:48:33 +02:00
JosJuice b7ba126db0 Android: Use JNI for getting post-processsing shaders
The Java implementation of getting the list of post-processing
shaders only looked in the Sys folder and not the User folder.
This could be fixed in the Java implementation, but it's
simpler to just call the C++ implementation instead.
2021-05-20 16:43:03 +02:00
Mai M 1054abc9cc
Merge pull request #9712 from JosJuice/jitarm64-fmul-rounding
JitArm64: Fix fmul rounding issues
2021-05-20 10:25:02 -04:00
Mai M 5949a19fe6
Merge pull request #9714 from JosJuice/jitarm64-convert-fmov
JitArm64: Prefer using FMOV when doing single/double conversion
2021-05-20 10:24:36 -04:00
Mai M 6958df5967
Merge pull request #9695 from JosJuice/jitarm64-fres
JitArm64: Implement fres and frsqrte
2021-05-20 10:23:49 -04:00
Mai M 539c2cb00e
Merge pull request #9667 from Sintendo/jit64divwx2
Jit64: Minor divwx optimizations
2021-05-20 10:22:54 -04:00
Mai M c5e8c8420d
Merge pull request #9722 from Dentomologist/add_4x_nobanner_image
Gamelist: Add 4x resolution nobanner image
2021-05-20 10:21:14 -04:00
Mai M 8b81481920
Merge pull request #9710 from JosJuice/volatile-begone
Remove all remaining volatile qualifiers
2021-05-20 10:20:22 -04:00
Mai M fb43aaf513
Merge pull request #9720 from Techjar/move-netsettings
NetPlay: Move NetSettings initialization to backend
2021-05-20 10:19:03 -04:00
JosJuice 25c4c64ae4 Fixes to translatable strings, take 2
Sorry, the fix I made to the empty string in a29660a was not
actually sufficient, as DolphinQt will call tr on the string
regardless of whether it's marked with _trans. The proper fix
is to use nullptr, which DolphinQt has a special check for.
2021-05-20 15:53:30 +02:00
JosJuice a29660a2c7 Fixes to translatable strings
Sending an empty string to the translation system will not
result in getting an empty string back, but rather a description
of the currently loaded translations file. So empty strings
should not be marked as translatable.

Also adding some i18n comments and rewording a string I thought
was hard to understand.
2021-05-20 11:35:01 +02:00
Dentomologist 4f31eaadc5 GameList: Minor improvements to android and low res nobanner images
Center @2x and android banners, and adjust @1x banner to improve
consistency with other resolutions while maintaining sharpness.

Images created by MayImilae
2021-05-19 12:43:55 -07:00
Filoppi 379ffc268d IMUGyroscope: make GetState update optional (on by default), fix const, clean code
My future PRs will split the UI state from the Emulation State of some of these emulated
controller values and this readies the code for it.
2021-05-19 20:51:35 +03:00
Filoppi a19a0096db InputCommon: improve code that returns a controller attachment index
casting a value to a u32 when it's originally an int, and it's exposed as int to users,
could end up in cases where a negative number would result as a positive one.
This doesn't really affect the value range of the attachment enum,
still I think the code was wrong.

Heavily tested.
2021-05-19 20:51:34 +03:00
Filoppi d43a06ff6a IMUAccelerometer: consistency of BoundCount checks
Similar to the guitar, only control[0] was checked, and that felt random.
2021-05-19 20:51:34 +03:00
Filoppi 7f5b6ed788 Guitar: consistency of BoundCount check
only control[0] was checked, and not one, which seems random.
Either both or none should be checked.
2021-05-19 20:51:34 +03:00
Techjar 171aad50cc NetPlay: Move NetSettings initialization to backend
It doesn't really belong in frontend code, and this change will make it
easier to eventually support NetPlay on other UI frameworks.
2021-05-19 06:34:24 -04:00
JMC47 736de8abf6
Merge pull request #9527 from sepalani/watch-items
WatchWidget: Add new/delete/clear toolbar items
2021-05-18 04:08:58 -04:00
JMC47 93e9d8be86
Merge pull request #8923 from Filoppi/OSD-fixes
fixes for "On Display Messages"
2021-05-18 00:33:15 -04:00
JMC47 678e035126
Merge pull request #9678 from Filoppi/tooltips_style
Make all Qt ToolTips look similar to BalloonTips
2021-05-17 16:40:49 -04:00
Mat M eae6d91f34
Merge pull request #9717 from JosJuice/android-issettingsaveable
Fix Android controller mappings accidentally being in IsSettingSaveable
2021-05-17 13:24:29 -04:00
JMC47 8ecc89ffe1
Merge pull request #9716 from MayImilae/Onscreenbuttonsupdate
Adjust Touchscreen Controls Opacity
2021-05-17 04:44:32 -04:00
MayImilae 509d7eac2d Adjust Onscreen Buttons Opacity
Update Onscreen Buttons Opacity and Adjust Default Opacity Setting
2021-05-16 21:51:58 -07:00
Dentomologist 433b857695 DolphinQt: Add quotes around QtIncludeDir on Windows
If the path $(QtIncludeDir) has a space in it Visual Studio interprets
the first part as the full path and chokes on the second part. Quote the
path to fix the problem.
2021-05-16 20:45:19 -07:00
JosJuice 1bf6762709 Fix Android controller mappings accidentally being in IsSettingSaveable
Settings.SECTION_INI_ANDROID and Settings.SECTION_BINDINGS
both have the value "Android", but we only want the former
to be marked as being handled by the new config system.

This change fixes a problem where controller settings were
not being properly saved to Dolphin.ini.
2021-05-16 17:08:51 +02:00
Mat M b4ec550782
Merge pull request #9715 from iwubcode/qt-header-warnings
DolphinQt: ignore warnings from qt headers on buildbot
2021-05-15 17:34:57 -04:00
JosJuice 11be2314fe JitArm64: Fix fmul rounding issues
This is a port of 4f18f60 to JitArm64.
2021-05-15 23:27:34 +02:00
JosJuice 66e912a252 PPCAnalyst: Treat frspx output as single 2021-05-15 23:27:33 +02:00
JosJuice 77afb0f4c3 PPCAnalyst: Apply "bitexact" analysis to fprIsSingle
This lets us set fprIsSingle to true in more cases.
2021-05-15 23:27:33 +02:00
Mat M b3bceb2c11
Merge pull request #9713 from JosJuice/ppcanalyst-bitexact-broken
PPCAnalyst: Fix broken bitexact analysis
2021-05-15 17:09:54 -04:00
iwubcode 99a724361a DolphinQt: update visual studio qt props to ignore warnings in headers 2021-05-15 14:39:03 -05:00
iwubcode 04a635e884 DolphinQt: fix Visual Studio warning about 'assignment within conditional expression' 2021-05-15 14:39:03 -05:00
iwubcode 05b1566e3f DolphinQt: don't propagate warnings in the header to Dolphin when building with Visual Studio through CMake 2021-05-15 14:39:03 -05:00
JosJuice e5f2dcd891 JitArm64: Implement FPRF updates for fres+frsqrte 2021-05-15 19:21:17 +02:00
JosJuice 4b3fda7906 JitArm64: Implement frsqrte 2021-05-15 19:21:15 +02:00
JosJuice 85226e09f0 JitArm64: Implement fres 2021-05-15 19:16:32 +02:00
JosJuice 8c12068a03 JitArm64: Prefer using FMOV when doing single/double conversion
FMOV is faster than INS and ties UMOV. (On all CPUs I checked,
at least. It certainly shouldn't be slower, though.)
2021-05-15 18:56:40 +02:00
JosJuice b980797a16 PPCAnalyst: Fix broken bitexact analysis
`code` points to the first instruction in the block, not the
current instruction.
2021-05-15 18:19:04 +02:00
JosJuice 8a0f5ea04a Remove all remaining volatile qualifiers 2021-05-15 09:52:04 +02:00
Mat M d74a1068b8
Merge pull request #9540 from Pokechu22/better-fifo-analyzer-part-2
Fifo analyzer quality of life improvements
2021-05-14 15:51:53 -04:00
Mat M 41befc21cd
Merge pull request #9708 from JosJuice/dsp-volatile
DSP: Change external_interrupt_waiting from volatile to atomic
2021-05-14 14:34:09 -04:00
Mat M 964fed77c5
Merge pull request #9707 from JosJuice/remove-atomic-header
Remove Atomic.h
2021-05-14 14:33:24 -04:00
JMC47 16e91172b1
Merge pull request #9668 from leoetlino/windows-cmake-fixes
CMake: minor Windows fixes
2021-05-14 08:22:11 -04:00
Scott Mansell 9f91fb6447
Merge pull request #9688 from Filoppi/input_cleanup
Input cleanup
2021-05-14 20:51:33 +12:00
JosJuice d17341572d DSP: Change external_interrupt_waiting from volatile to atomic
Making this volatile accomplishes... Well, nothing in practice.
Making it atomic, on the other hand, lets us enforce a memory ordering.
2021-05-14 09:28:10 +02:00
JosJuice b93983b50a Remove Atomic.h
The STL has everything we need nowadays.

I have tried to not alter any behavior or semantics with this
change wherever possible. In particular, WriteLow and WriteHigh
in CommandProcessor retain the ability to accidentally undo
another thread's write to the upper half or lower half
respectively. If that should be fixed, it should be done in a
separate commit for clarity. One thing did change: The places
where we were using += on a volatile variable (not an atomic
operation) are now using fetch_add (actually an atomic operation).

Tested with single core and dual core on x86-64 and AArch64.
2021-05-13 18:56:27 +02:00
Mat M 7a72a5b997
Merge pull request #9703 from Filoppi/fix_expression_serialization
Fix serialization of control expressions with line breaks
2021-05-13 06:47:38 -04:00
Mat M d034c830ac
Merge pull request #9681 from iwubcode/texture-info
VideoCommon: move all texture calculations to a "TextureInfo" class
2021-05-13 06:44:08 -04:00
Mat M 0ef88d4ecb
Merge pull request #9705 from Leseratte10/master
Socket: Fix AF_INET6 on non-Windows systems
2021-05-13 06:42:44 -04:00
Mat M 24b9a64c11
Merge pull request #9690 from Sintendo/jit64divwux
Jit64: divwux - Prefer three-operand IMUL
2021-05-13 06:42:14 -04:00
Mat M 80ac36a712
Merge pull request #9701 from sspacelynx/master
Android: bump gradle & dependencies version
2021-05-13 06:41:01 -04:00
Mat M 8d7b0004b9
Merge pull request #9698 from JosJuice/android-settings-charsequence
Android: Use CharSequence for SettingsItem name/description
2021-05-13 06:40:30 -04:00
Mat M 725ea3d9c1
Merge pull request #9637 from JosJuice/jitarm64-fprf
JitArm64: Implement FPRF updates
2021-05-13 06:39:28 -04:00
JosJuice 25dc059f6f JitArm64: Add FPRF unit test 2021-05-13 11:51:00 +02:00
JosJuice bfe8b1068d JitArm64: Implement FPRF updates 2021-05-13 11:51:00 +02:00
JosJuice 749db94dec Arm64Emitter: Implement more variants of FMOV 2021-05-13 10:13:59 +02:00
Jordan Woyak bf16f77402
Merge pull request #9657 from lioncash/wiimote-mode
DataReport: Amend conditional test for data reports in IsValidMode
2021-05-12 17:23:17 -05:00
Dentomologist 5a688b74a7 GeneralWidget: Fix Backend description grammar
Unify Backend description string for Windows and other platforms.
2021-05-12 10:50:10 -07:00
Dentomologist b9c1f4921c GeneralWidget: Fix Log Rendertime description grammar 2021-05-12 10:50:10 -07:00
Filoppi f3ffac0058 Qt: add tooltip to MappingBool
Tooltip code is identical to MappingDouble and the tooltips (UI description)
are present in the underlying setting object.
2021-05-12 18:27:24 +03:00
Filoppi 26f6648421 StickGate: add custom clamp value
Works exactly as before by default.
It will be used by my upcoming input PRs.
2021-05-12 18:27:24 +03:00
Filoppi 5f74d0e08f InputCommon: follow coding conventions 2021-05-12 18:27:24 +03:00
Filoppi 4625359a4f InputCommon: clamp the attachment setting max to its actual enum max
NumericSettings support a max, so let's use it.
It might not do much now, but the max and min values will be used to give visual feeback
in the UI in one of my upcoming input PRs
2021-05-12 18:27:24 +03:00
Filoppi f4fec42165 Add mixed comments to input code, make some tooltip clearer 2021-05-12 18:27:23 +03:00
Filoppi 574477866f InputCommon: fix serialization of control expression with line breaks
The control expression editor allows line breaks, but the serialization was
losing anything after the first line break (/r /n).
Instead of opting to encode them and decode them on serialization
(which I tried but was not safe, as it would lose /n written in the string by users),
I opted to replace them with a space.
2021-05-12 18:25:56 +03:00
iwubcode 182dfc38e6 VideoCommon: move all texture calculations to a "TextureInfo" class. This ever so slightly improves readability and allows for the full texture name to be generated outside of the hires texture cache 2021-05-11 22:58:36 -05:00
Florian Bach c21e9909ab Socket: Fix AF_INET6 on non-Windows systems 2021-05-11 17:00:02 +02:00
Filoppi 0d23acc831 Qt: simplify the preview of control mappings/expressions by removing their device path
and replacing it with a ":" prefix. Also remove white spaces and \n \t \r.

bugfix: fix EmulatedController::GetStateLock() not being aquired when reading the
expression reference
bugfix: MappingButton::UpdateIndicator() calling State(0) on outputs, breaking ongoing
rumbles if a game was running
Improvement: make expressions previews appear in Italic if they failed to parse correctly
2021-05-11 12:20:37 +03:00
Filoppi e9e41b925b InputCommon: follow coding conventions and rename GetState() to UpdateState()
And remove useless include
2021-05-10 23:48:10 +03:00
Filoppi a261e61e9e InputCommon: add a ton of missing consts
fix some related grammar errors
only the ButtonManager required code changes
2021-05-10 23:48:10 +03:00
sspacelynx ac77f8207e Android: bump gradle & dependencies version
jecenter() is EOL, so swap that out with mavenCentral()
2021-05-10 12:35:50 +02:00
JMC47 eb5cd9be78
Merge pull request #9694 from iwubcode/xfb-tcache-hash
VideoCommon: update TextureCache logic for finding oversized XFBs
2021-05-09 15:20:53 -04:00
JosJuice c5491e8205 Android: Remove CheckBoxSettingViewHolder's log setting name hack 2021-05-09 17:11:37 +02:00
JosJuice a8f48feddb Android: Use CharSequence for SettingsItem name/description 2021-05-09 17:02:22 +02:00
iwubcode 6fd7867c56 VideoCommon: simplify TextureCacheBase by comparing a xfb's hash against a newly calculated one. This fixes games like Teenage Mutant Ninja Turtles (Wii) which use oversized textures where the stride doesn't match the BytesPerRow and that resulted in a different hash algorithm being used. By not hashing the texture before, we improve performance by hashing at most once in all direct XFB lookup scenarios. 2021-05-08 01:29:48 -05:00
Pokechu22 e1d45e9ba6 UberShaderPixel: always run indirect stage logic
Hardware testing has confirmed that fb_addprev and wrapping both run even when the indirect stage is disabled.
2021-05-07 16:37:47 -07:00
Pokechu22 b5844ab195 PixelShaderGen: always run indirect stage logic
Hardware testing has confirmed that fb_addprev and wrapping both run even when the indirect stage is disabled.
2021-05-07 16:37:47 -07:00
Pokechu22 5e3360c2cc UberShaderPixel: Fix OOB tex coord indices
Previously we set the texture coordinate to zero, now we set
the texture coordinate *index* to zero. This fixes the ripple
effect of the Mario painting in Luigi's Mansion.
2021-05-07 16:37:47 -07:00
Pokechu22 ed02034967 UberShaderPixel: Return fixed-point values from selectTexCoord
This change should have no behavioral differences itself, but allows for changing the behavior of out of bounds tex coord indices more easily in the next commit.  Without this change, returning tex0 for out of bounds cases and then applying the fixed-point logic would use the wrong tex dimension info (tex0 with I_TEXDIMS[1] or such), which is inaccurate.
2021-05-07 16:37:10 -07:00