Commit graph

3581 commits

Author SHA1 Message Date
Léo Lam
bcc14d32b8
Merge pull request #10482 from Dentomologist/remove_redundant_statement
FileUtil: Remove redundant statement
2022-03-02 12:27:21 +01:00
JMC47
ea116fbbdf
Merge pull request #9834 from AdmiralCurtiss/fastmem-reserve-region-linux
MemArena: Keep fastmem memory region mapped on Linux to ensure nothing allocates within the fastmem space.
2022-02-28 12:46:34 -05:00
Dentomologist
01bd5e15ba FileUtil: Remove redundant statement 2022-02-25 21:16:07 -08:00
JosJuice
128fa8aec3
Merge pull request #10388 from Dentomologist/android-fix-unused-variable-warning
[Android] Fix unused variable warning
2022-02-20 18:56:50 +01:00
JosJuice
35b436bd6b
Merge pull request #10377 from Pokechu22/warning-fixes-jan-2022
Fix several compile warnings on GCC
2022-02-18 21:05:42 +01:00
Merry
be81fe86e1 JitRegister: Use fmt
Prefer fmt to printf-style formatting.
2022-02-16 20:09:38 +00:00
Admiral H. Curtiss
ffbe6cb21f
MemArena: Keep fastmem region mapped on Linux. 2022-02-14 22:14:41 +01:00
Admiral H. Curtiss
4a9553bf6d
MemArena: Load UnmapViewOfFileEx dynamically to restore Windows 7 support. 2022-02-14 21:57:18 +01:00
Admiral H. Curtiss
3a4de2b306
MemArena: Use Common::DynamicLibrary for m_api_ms_win_core_memory_l1_1_6_handle. 2022-02-14 21:57:15 +01:00
Pokechu22
15f80f7234 MathUtil: Mark lo in SaturatingCast as [[maybe_unused]]
It's unused in the case that T is unsigned and dest is signed (e.g. SaturatingCast<int, size_t> which appears SetIsoPaths in MainSettings.cpp)
2022-02-13 14:38:59 -08:00
JosJuice
989bdb8d6d Common/CodeBlock: Call ResetCodePtr when decreasing region_size
Fixes https://bugs.dolphin-emu.org/issues/12827.

A description of what was going wrong:

JitArm64::Init first calls CodeBlock::AllocCodeSpace, after which
CodeBlock and Arm64Emitter consider us to have 96 MB of code space
available. JitArm64::Init then calls AddChildCodeSpace, which is
supposed to take 64 MiB of that space and give it to m_far_code.
CodeBlock's view of how much space there is gets updated from 96 MiB
to 32 MiB, but due to the missing call, Arm64Emitter keeps thinking
that it has 96 MiB of space available.

The last thing JitArm64::Init does is to call ResetFreeMemoryRanges.
This function asks Arm64Emitter how much code space is available and
stores a range of that size in m_free_ranges_near, meaning that
m_free_ranges_near ends up being backed by both nearcode and farcode!
This is a ticking time bomb; as soon as we grab memory from
m_free_ranges_near which is backed by farcode, we're in trouble.
The crash I ran into in my testing was caused by fastmem code being
allocated in farcode (our backpatch handler only handles accesses made
from nearcode), but you may as well get errors caused by code intended
for nearcode overwriting code intended for farcode or vice versa.

So why did NBA Live 2005 crash when most games had no problems,
and why was the bug bisected to the commit that increased the size
of far code from 16 MiB to 64 MiB? Well, as long as we're only
using the first 32 MiB of the big 96 MiB range, everything works.
What happens with NBA Live 2005 (I have not investigated exactly
through what mechanism this happens) is that at some point the range
in m_free_ranges_near gets split into two ranges, one which is
backed by nearcode and one which is backed by farcode. Dolphin
prefers to select the biggest range available (we don't want to
pick a tiny 1 KiB range that may not be able to fit the whole block
we're about to emit, after all), and after increasing the size of
farcode to 64 MiB, farcode is bigger than nearcode.
2022-02-12 17:51:32 +01:00
Admiral H. Curtiss
79405de103
MemArena: Use placeholders on Windows. 2022-02-06 18:06:04 +01:00
Admiral H. Curtiss
a336c4386c
IOFile: Rename Clear() to ClearError() for clarity. 2022-01-29 06:49:22 +01:00
Admiral H. Curtiss
36cfcb530f
IOFile: Make origin parameter to Seek() an enum class. 2022-01-29 06:49:21 +01:00
Dentomologist
d3ae1bd415 [Android] Fix unused variable warning
Add [[maybe_unused]] attribute to ConsoleListener's m_use_color
2022-01-25 14:15:18 -08:00
JosJuice
7b8e846d0a
Merge pull request #10367 from Pokechu22/fmt-8.1.1
Update to fmt 8.1.1
2022-01-20 21:14:41 +01:00
Pokechu22
6e5f4125e3 Use Common::ToLower and Common::ToUpper 2022-01-16 17:00:12 -08:00
Pokechu22
aaec64501a Create Common::ToLower and Common::ToUpper 2022-01-16 16:56:53 -08:00
Pokechu22
fefde0481d Use EnumFormatter to generate names for EXI devices
This simplifies the code in GameCubePane, and allows us to use the EXIDeviceType enum in error messages.
2022-01-14 20:24:53 -08:00
Léo Lam
83c5446d85
Fix static initialisation order fiasco issue for Version variables
Fixes a crash that could occur if the static constructor function for
the MainSettings.cpp TU happened to run before the variables in
Common/Version.cpp are initialised. (This is known as the static
initialisation order fiasco.)

By using wrapper functions, those variables are now guaranteed to be
constructed on first use.
2022-01-14 00:04:22 +01:00
Pokechu22
fd04f4f32d Replace use of of unsigned char* with fmt
Using unsigned char* or signed char* results in a deprecation warning, which is treated as an error.  It needs to be casted to regular char* for it to work.
2022-01-13 11:11:08 -08:00
Pokechu22
1a92699455 Cast to int for enums that are not formattable 2022-01-13 11:11:08 -08:00
Pokechu22
ac46b91673 Make all fmt::formatter constructors constexpr 2022-01-13 11:11:08 -08:00
Pokechu22
78e43a4404 Make all custom fmt::formatter's format functions const
fmt 8.0.0 requires this.
2022-01-13 11:11:08 -08:00
Pokechu22
cc592ab814 Use fmt::runtime in FmtFormatT
This format string is by definition dynamic and can't be checked at compile time.  There are other similar strings in the log handler and in asserts, but they use vformat and thus don't need fmt::runtime.  We might be able to do a similar thing where the untranslated string is compile-time checked, but FmtFormatT is used in so few places that I don't want to handle that in this PR.
2022-01-13 11:11:08 -08:00
Pokechu22
54cf8d030c Add fmt/xchar includes where wstring is used 2022-01-13 11:11:08 -08:00
Pokechu22
140c8217f6 Common: Create HRWrap
HRWrap now allows HRESULT to be formatted, giving useful information beyond "it failed" or a hex code that isn't obvious to most users.  This commit does not add any uses of it, though.
2022-01-09 12:44:15 -08:00
Pokechu22
c296c34e00 Common/MsgHandler: Use caller's file and line number in log messages
This will assist with finding the source of a panic alert based on logs; before, Common\MsgHandler.cpp:113 (or similar) was always used.
2022-01-09 12:44:14 -08:00
Pokechu22
f55571ee5d Common/MsgHandler: Fix PanicAlertFmtT not actually being translated 2022-01-09 12:44:14 -08:00
Pokechu22
2a5016c2f8 Common/MsgHandler: Remove use of lambda, as it breaks __func__
Specifically, this meant that __func__ in macros (namely ASSERT) would always be evaluate to "operator ()".
2022-01-09 12:44:14 -08:00
Pokechu22
558de04cfc Common/Assert: Actually use the ASSERT_MSG's log type parameter
Since it was unused, nonexistent values were used in a few places.  I've replaced them.
2022-01-09 12:44:14 -08:00
Pokechu22
bab3ff0157 Common/MsgHandler: Remove non-format variants of PanicAlert
They're no longer used.
2022-01-09 12:44:14 -08:00
Pokechu22
44e93e91d7 Common/Assert: Switch to fmt 2022-01-09 12:43:11 -08:00
Pokechu22
1c0ca09e6f Common/Assert: Include the condition and function in the message 2022-01-09 12:43:11 -08:00
JosJuice
804f78e0e4 Android: Mark s_android_send_report as static
Fixes a compiler warning.
2022-01-06 12:20:09 +01:00
Mai M
7bd14c5d9f
Merge pull request #10338 from Pokechu22/natvis-improvements
Natvis improvements
2022-01-06 04:01:25 -05:00
JMC47
9a914d33d5
Merge pull request #9414 from DevJPM/master
Fix CPU Core Count detection and Enable Parallel Shader Compilation
2022-01-04 10:15:12 -05:00
Pokechu22
8e2b06906b Create EnumMap natvis 2022-01-02 15:36:47 -08:00
Pokechu22
b96297f2ee Improve BitField natvis
Now, enums are properly displayed, and BitFieldArray is also displayed nicely.  Signed values also work correctly, and 1-bit fields are not treated as bools unless the bitfield is explicitly marked as a bool.
2022-01-02 14:39:34 -08:00
Pokechu22
301bc49efe Common: Remove MD5.h
It uses DiscIO, and Common shouldn't depend on DiscIO.  Instead, put this code in NetPlayClient.cpp.
2022-01-01 11:52:53 -08:00
Pokechu22
0c19f895d3 Replace remaining uses of zlib crc32 with Common/Hash.h 2022-01-01 10:36:38 -08:00
Pokechu22
2652aed85c Common: Merge CRC32.h into Hash.h
This makes it easier to find the relevant functions.
2022-01-01 10:36:38 -08:00
Léo Lam
9a61514073
Merge pull request #10241 from AdmiralCurtiss/user-dir-consistency
Ensure user paths are stored in a consistent manner.
2022-01-01 02:32:24 +01:00
JMC47
1c8a7f1867
Merge pull request #10277 from AdmiralCurtiss/memarena-cleanup
MemArena: Cleanup & interface changes for safer memory mapping.
2021-12-29 19:06:47 -05:00
Admiral H. Curtiss
319b00f1fd
Config: Allow unregistering callbacks. 2021-12-25 23:32:49 +01:00
Admiral H. Curtiss
e54657254a
Core: Make format of D_WIIROOT_IDX consistent with the rest of the user directories. 2021-12-25 20:21:32 +01:00
Admiral H. Curtiss
3e1511ce98
Common/FileUtil: Ensure consistency for custom user paths. 2021-12-25 20:21:32 +01:00
Admiral H. Curtiss
1554128560
MemArena: Prepare interface for proper memory reservation. 2021-12-25 20:20:36 +01:00
Admiral H. Curtiss
812cc8b632
MemArena: Split into three separate files for each OS. 2021-12-25 20:20:36 +01:00
Pokechu22
95e0f833f9 Fifo analyzer: Display equations for color/alpha combiners 2021-12-18 15:21:48 -08:00
Pokechu22
2025763420 Treewide: Adjust order of includes 2021-12-10 14:49:57 -08:00
Pokechu22
8cf841ecc7 Fix saving RGBA images
PNG_FORMAT_RGB and PNG_COLOR_TYPE_RGB both evaluate to 2, but PNG_FORMAT_RGBA evaluates to 3 while PNG_COLOR_TYPE_RGBA evaluates to 6; the bit indicating a palette is 1 while the bit indicating alpha is 4.
2021-11-24 14:56:12 -08:00
Pokechu22
99e589cc98 Log libpng warnings and errors 2021-11-24 14:56:12 -08:00
Léo Lam
aa5cb35c86
Merge pull request #10143 from Pokechu22/png-compression-level
Add option for setting the PNG zlib compression level
2021-11-23 16:40:34 +01:00
JMC47
e5a4a86672
Merge pull request #10055 from JosJuice/jitarm64-reuse-memory
JitArm64: Codegen space reuse
2021-11-20 17:35:24 -05:00
DevJPM
61cfd8696e Fix CPU Core Count detection and Enable Parallel Shader Compilation
This does this following things:

- Default to the runtime automatic number of threads for pre-compiling shaders
- Adds a distinct automatic thread count computation for pre-compilation  (which has less other things going on
and should scale better beyond 4 cores)
- Removes the unused logical_core_count field from the CPU detection
- Changes the semantics of num_cores from maximaum addressable number of cores to actually available CPU cores
(which is also how it was actually used)
- Updates the computation of the HTT flag now that AMD no longer lies about it for its Zen processors
- Background shader compilation is *not* enabled by default
2021-11-20 16:08:10 +01:00
Pokechu22
94ccf765af Add option for setting the PNG zlib compression level 2021-11-18 13:10:22 -08:00
Pokechu22
d2041b4c2a VideoCommon: Add signed version of BitfieldExtract 2021-11-17 20:04:33 -08:00
JosJuice
3e84279919
Merge pull request #10208 from thatSteveFan/patch-1
Minor comment fix in Matrix.cpp
2021-11-13 15:09:28 +01:00
Shawn Hoffman
4008188654 msvc: update to vs2022 and windows sdk 10.0.22000 2021-11-11 08:01:26 -08:00
thatSteveFan
834a59d89b
Minor comment fix in Matrix.cpp
Fix comment to say (NxM times MxP).
2021-11-08 15:30:39 -08:00
Mai M
6c72e6814d
Merge pull request #10169 from leoetlino/fmt-localtime
Use fmt::localtime instead of thread-unsafe std::localtime
2021-11-07 00:08:14 -04:00
Merry
7c2b09e156 Arm64Emitter: Add FRINTI instruction 2021-11-06 19:15:26 +00:00
Emmanuel Gil Peyrot
3d662e746b Core: Fix a -Wshadow warning in gcc 11
This moves the only direct call to zlib’s crc32() into its own
translation unit, but that operation is cold enough that this won’t
matter in the slightest.  crc32_z() would be more appropriate, but
Android has an older zlib version…
2021-11-02 13:50:21 +01:00
Pokechu22
04d8cdfe88 Convert LOG_TYPE and LOG_LEVELS to enum class 2021-10-24 11:48:36 -07:00
Pokechu22
ba107819ec Create EnumMap 2021-10-24 11:48:36 -07:00
Admiral H. Curtiss
a4da56e5e6
CommonPaths: Add a Riivolution subfolder in Load. 2021-10-24 00:09:06 +02:00
Admiral H. Curtiss
f972ddf32f
Common/FileUtil: Fix incorrect (32-bit) stat struct being used on Windows, which was hidden by a define in CommonFuncs.h. 2021-10-23 03:50:47 +02:00
Léo Lam
fd7df2ccae
Use fmt::localtime instead of thread-unsafe std::localtime
fmt::localtime is also less awkward to use compared to std::localtime.
2021-10-15 22:49:13 +02:00
Léo Lam
7855e5f73b
Turn MAX_LOGLEVEL into a true constant (and fix self-comparison warning)
This replaces the MAX_LOGLEVEL define with a constexpr variable
in order to fix self-comparison warnings in the logging macros
when compiling with Clang. (Without this change, the log level check
in the logging macros is expanded into something like this:
`if (LINFO <= LINFO)`, which triggers a tautological compare warning.)
2021-10-15 21:51:01 +02:00
JosJuice
44beaeaff5 Arm64Emitter: Check end of allocated space when emitting code
JitArm64 port of 5b52b3e.
2021-10-13 21:52:16 +02:00
Pokechu22
78bfd25964 Fix all uninitialized variable warnings (C26495) 2021-10-13 12:32:16 -07:00
Pokechu22
aacc1a5e49 IOFile: Add std::array functions 2021-10-13 11:44:28 -07:00
Léo Lam
f19da1cf92
Merge pull request #10118 from lioncash/messageid
NetPlayProto: Remove lots of casts to MessageId when inserting enum values into packets
2021-10-13 02:27:52 +02:00
JMC47
3bfb3fa52b
Merge pull request #9884 from JosJuice/jitarm64-paired-loadstore-addr
JitArm64: Improve psq_l/psq_st address checking
2021-10-11 16:49:26 -04:00
Pokechu22
ec9db320d3 Fix AbortOnPanicAlert with PanicAlertFmt
PR #10066 added functionality to call std::abort when a panic alert occurs; however, that PR only implemented it for MsgAlert and not MsgAlertFmtImpl, meaning that the functionality was not used with PanicAlertFmt (only PanicAlert, which is not used frequently).
2021-10-02 17:24:09 -07:00
Lioncash
07af775afa SFMLHelper: Add stream insertion overload helpers for enum types
Will be used in future changes to eliminate the need to cast when
inserting various message IDs
2021-09-22 15:42:01 -04:00
Léo Lam
6129290d31
Merge pull request #10057 from JosJuice/jitarm64-divwx
JitArm64: Optimize divwx
2021-09-20 15:37:57 +02:00
Léo Lam
b43cee8fe4
Merge pull request #10098 from AdmiralCurtiss/scan-dir-tree-trailing-slash
Common/FileUtil: Strip trailing path separator in ScanDirectoryTree().
2021-09-20 14:50:11 +02:00
Pokechu22
b8f4a4ae44 GLInterface: Remove unneeded wglShareLists call
When RenderDoc is attached, wglShareLists fails for some reason (see baldurk/renderdoc#2361).  wglCreateContextAttribsARB has a parameter for the share context, so there's no reason to use a separate wglShareLists call.

Co-authored-by: baldurk <baldurk@baldurk.org>
2021-09-14 10:55:33 -07:00
Admiral H. Curtiss
f76aaf65f6 Common/FileUtil: Strip trailing path separator in ScanDirectoryTree(). 2021-09-14 17:39:38 +02:00
JosJuice
de21dc5fd9 JitArm64: Add bitset constants for caller saved registers 2021-09-08 21:26:05 +02:00
Léo Lam
e091c2e817
Add an option to abort when a panic alert occurs
Prompted by https://dolphin.ci/#/builders/24/builds/985

A 1-character typo in a recent PR caused FifoCI builds to break
horribly and spew millions of panic alerts until buildbot crashed.

This PR adds a new config option -- defaulting to off -- that allows
Dolphin to abort early on when a panic alert occurs instead of
continuing forever.
2021-08-29 02:02:07 +02:00
JosJuice
9889e7eb33 JitArm64: divwx - Optimize power-of-two divisors
Power-of-two divisors can be done more elegantly, so handle them
separately.
2021-08-26 15:04:55 +02:00
JosJuice
09cdb076a3 JitArm64: divwx - Optimize constant dividend
When the dividend is known at compile time, we can eliminate some
of the branching and precompute the result for the overflow case.
2021-08-26 14:50:01 +02:00
OatmealDome
e5a80995dc Bump minimum macOS to 10.13 High Sierra 2021-08-17 16:27:22 -04:00
JosJuice
a90b0a1c93 JitArm64: Implement mtfsfx
The sixth and final part of implementing the FPSCR system register
instructions.
2021-07-31 23:50:20 +02:00
Dentomologist
f5e5e8553c StringUtil: Remove unused function BuildCompleteFilename 2021-07-21 12:39:00 -07:00
JMC47
a1e806ed76
Merge pull request #9600 from Bonta0/mgba-pr
Full GBA Controllers Integration with mGBA
2021-07-21 02:36:43 -04:00
Dentomologist
fe670a3e68 FileUtil: Remove duplication in FileInfo constructor 2021-07-19 11:50:17 -07:00
Shawn Hoffman
8bddd8c675 remove SetRoundMode
we only care about SSE rounding mode, and set
that manually in SetSIMDMode
2021-07-17 19:29:22 -07:00
Tilka
3c90b657f3
Merge pull request #9907 from shuffle2/roundmode-bitfield
make FPSCR.RN an enum
2021-07-18 03:12:28 +01:00
Shawn Hoffman
197075293d make FPSCR.RN an enum 2021-07-17 18:55:06 -07:00
Shawn Hoffman
c89ae53677 msvc: remove warning disables which no longer fire 2021-07-17 18:24:36 -07:00
Shawn Hoffman
f5b05ae080 remove an outdated comment
seems to have been solved 5 years ago by
b707e199c2
2021-07-17 17:46:57 -07:00
Bonta
45f2461a53 NetPlay: GBA Support 2021-07-13 16:43:59 +02:00
Bonta
110887435c Config: GBA settings 2021-07-13 16:41:18 +02:00
Bonta
44aaf108d1 Externals: Integrate mGBA as a submodule 2021-07-13 16:39:29 +02:00
Léo Lam
162af2a7bb
Merge pull request #9870 from OatmealDome/ui-thread
macOS: Move UI API calls to the main thread
2021-07-13 03:29:49 +02:00
JosJuice
8af5095ff4 JitArm64: Stop using hand-encoded logical immediates 2021-07-12 22:25:49 +02:00