Commit Graph

4036 Commits

Author SHA1 Message Date
Admiral H. Curtiss 1805f6e381
Merge pull request #12660 from jordan-woyak/hide-makepkg
Hide branch name from title bar when there are no commits ahead of master.
2024-04-18 17:21:24 +02:00
OatmealDome dbc7e03577
Merge pull request #12709 from mitaclaw/rcheevos-posix
RetroAchievements: Put "RetroAchievements.ini" in the correct config location for POSIX
2024-04-15 01:21:43 -04:00
mitaclaw 48b38f6e9b RetroAchievements: Put "RetroAchievements.ini" in the correct config location for POSIX 2024-04-14 21:47:41 -07:00
Niel Lebeck d2b96736e0 Pass SettingsHandler buffers by const ref instead of rvalue ref 2024-04-12 18:50:21 -07:00
Admiral H. Curtiss 0c1a76398b
Merge pull request #12691 from mitaclaw/jit-profiling-restoration
JitCache: Software Profiling Restoration
2024-04-13 01:35:25 +02:00
mitaclaw 30c63fa4a6 Common: Remove Unused PerformanceCounter Code 2024-04-09 13:43:32 -07:00
mitaclaw ee8bcf2ccc JitCache: Software Profiling Restoration
Rekindle software JIT profiling with a std::chrono conversion and a config connection.
2024-04-09 13:43:31 -07:00
mitaclaw cf74c0d683 PPCCache: Avoid Global System Accessor 2024-04-08 19:49:57 -07:00
mitaclaw 88dadf81d4 FileUtil: Fix BranchWatch User Path
I mistakenly put `D_DUMP_IDX` here instead of `D_DUMPDEBUG_IDX`.
2024-03-29 11:05:45 -07:00
Jordan Woyak 02f57a4778 Replace SCM_IS_MASTER with SCM_COMMITS_AHEAD_MASTER 2024-03-23 16:48:52 -05:00
Admiral H. Curtiss b510ac89a3
Merge pull request #12355 from fuzziqersoftware/tapserver-modem-adapter
Implement tapserver-based modem adapter
2024-03-22 02:47:06 +01:00
iwubcode 146504d635 Common: add json utility functions 'ReadStringFromJson' and 'ReadBoolFromJson' to match 'ReadNumericFromJson' functionality for other data types, similarly support other data types for 'ToJsonArray' 2024-03-20 17:34:25 -05:00
iwubcode 69694494ce Common: update 'ReadNumericOrDefault' to 'ReadNumericFromJson' and have it return an optional, this provides the caller with more flexibility 2024-03-20 17:34:25 -05:00
Martin Michelsen 083116a89c rewrite tapserver interface for better error handling 2024-03-17 18:37:55 -07:00
mitaclaw 8134c8a572 BranchWatchDialog: A Total Replacement for CodeDiffDialog
With a purpose-built Branch Watch feature built into the emulated system: BranchWatchDialog, replacing CodeDiffDialog, is now better than ever!
2024-02-27 11:40:58 -08:00
Mai 27415b0ba1
Merge pull request #12587 from AdmiralCurtiss/localtime
Core: Fix crash when inspecting a savestate with a timestamp that causes localtime() to error out
2024-02-18 17:12:29 -05:00
iwubcode edbf8f1772 Common: add json utility functions for Vec3 serialization 2024-02-17 22:06:06 -06:00
Admiral H. Curtiss 52410813f2
Common: Add utility function that wraps localtime_s() or localtime_t(). 2024-02-18 04:40:25 +01:00
Peter Lafreniere 3da2e15e6b IOFile: avoid clearing errors on null file struct
When performing a default compilation with recent GCC & glibc,
the use of -Werror=nonnull causes a build error.

The error is given as IOFile::ClearError() can call std::clearerr()
with a null file, which can trigger a null-pointer dereference in libc.

Change the std::clearerr() call to be conditional on a file being open.
2024-02-11 20:55:31 -05:00
JosJuice b5c5371848 Arm64Emitter: Don't optimize ADD to MOV for SP
Unlike ADD (immediate), MOV (register) treats SP as ZR. Therefore the
ADDI2R optimization that was added in 67791d227c can't optimize ADD to
MOV when exactly one of the registers is SP.

There currently isn't any code in Dolphin that calls ADDI2R with
parameters that would trigger this case.
2024-02-06 21:58:07 +01:00
Lioncash 16d8b6e6b3 Common/HookableEvent: std::move callback instance in Register()
Potentially avoids reallocations if the capture buffer of the callback
is quite large.
2024-01-31 13:16:50 -05:00
iwubcode b37f096f4b Common: add determinant functions to Matrix33 and Matrix44 2024-01-24 23:02:57 -06:00
iwubcode b5a6225e1a VideoCommon: add function to serialize ShaderAsset to json 2024-01-23 11:58:32 -06:00
Admiral H. Curtiss 043d868841
Merge pull request #12473 from Dentomologist/bitset64_fix_iterator_incrementation
BitSet64: Fix iterator incrementation
2024-01-01 22:03:11 +01:00
Dentomologist 7dbf463ddf BitSet64: Fix iterator incrementation
Use 1 of the same type as the stored value when shifting left. This
prevents undefined behavior caused by shifting an int more than 31 bits.

Previously iterator incrementation could either hang or prematurely
report it had reached the end of the bitset.
2024-01-01 00:41:48 -08:00
Dentomologist abb484a101 BitSet: Use direct initialization instead of c-style casts 2024-01-01 00:36:13 -08:00
Admiral H. Curtiss 4f04ac5858
Common/StringUtil: Use internal linkage for codepage conversion functions. 2023-12-29 19:50:55 +01:00
JosJuice 0c7359e150 Common: Fix encoding handling in GetWin32ErrorString
These messages can be localized, so we can't just assume it's all ASCII.
2023-12-29 16:01:13 +01:00
Mai b1438c224f
Merge pull request #12439 from lioncash/sprintf
Core: Use fmt over sprintf in trivial cases
2023-12-21 17:17:21 -05:00
JosJuice d8c78f2a92 JitArm64: Fix the "do nothing" cases of ANDI2R and friends
So somehow I forgot that AArch64 uses three-operand encoding...

Fixes a regression from 6303416201 which manifested in various ways,
such as incorrect rendering of the Wind Waker title screen.
2023-12-21 20:51:32 +01:00
Lioncache affe928987 Common/TraversalServer: Make use of fmt more
We can convert printf and fprintf over to the use of fmt as well,
given that we've converted the sprintf calls over.
2023-12-18 13:08:57 -05:00
Lioncache dc85194fac Common/TraversalServer: Make use of fmt over sprintf where applicable
Resolves some deprecation warnings on macOS. This is better anyway, given fmt
has generic type formatting.
2023-12-18 13:08:57 -05:00
JosJuice dc60bc5f1e JitArm64: Improve codegen in ANDI2R and friends
The codegen for the functions themselves, not for the emitted code.

This seems to save 32 bytes per function. We also get rid of the oddity
we had before where ANDI2R would do masking for 32-bit operations but
the other functions wouldn't.
2023-12-17 18:13:32 +01:00
JosJuice a8e1e1ae48 JitArm64: Optimize additional cases of ANDI2R and friends
Now we'll never need a scratch register for values that are all zeroes
or all ones.
2023-12-17 18:13:32 +01:00
JosJuice 6303416201 JitArm64: Optimize ANDI2R and friends to no-ops when possible
This optimizes rlwnmx with mask == 0xFFFFFFFF.
2023-12-17 18:13:30 +01:00
Tilka 773ffd04b8
Merge pull request #11497 from vyuuui/debugger_assembler_ui
Built-in assembler for debugger interface
2023-12-16 21:15:31 +00:00
Admiral H. Curtiss 190c4e8cda
Merge pull request #12427 from JosJuice/jitarm64-msr-updated-logical-imm
JitArm64: Fix MSRUpdated(ARM64Reg) with FEATURE_FLAG_PERFMON set
2023-12-16 17:22:23 +01:00
JosJuice e0eb4ef5bc JitArm64: Use enum class for LogicalImm size parameter
This should prevent issues like the one fixed in the previous commit
from happening again.
2023-12-16 16:48:26 +01:00
Lioncash dbc792a3ec Common/Crypto/SHA1: Resolve -Wignored-attributes warnings
See commit 417d1310d22b11d5d724625721b5fec09eda099a for an explanation
on why we do this.
2023-12-13 13:04:53 -05:00
Lioncash bced5fac18 Common/Crypto/AES: Resolve -Wignored-attributes warnings
The alias for __m128i is typically something like:

typedef long long __m128i __attribute__((__vector_size__(16), __may_alias__));

and the part that ends up not getting preserved is the __may_alias__
attribute specifier.

So, in order to preserve that, we can just use a wrapper struct, so the
data type itself isn't being passed through the template.
2023-12-13 13:02:51 -05:00
vyuuui 38c15df464 Parser and Assembler implementations 2023-12-13 05:32:20 -08:00
Lioncash 50e4dc5dba Watches: Make use of std::erase_if 2023-12-12 13:24:40 -05:00
Admiral H. Curtiss 2c6bf2d224
Merge pull request #12394 from lioncash/compare
General: Resolve -Wsign-compare warnings
2023-12-12 03:43:12 +01:00
Lioncash f97316a1e6 TraversalClient: Resolve -Wsign-compare warning 2023-12-11 18:01:29 -05:00
Lioncash 88a973131c Common/SettingsHandler: Use std::string_view more
We don't need to enforce the use of std::string instances with
AddSetting(). We can accept views and only construct one string,
rather than three temporaries.
2023-12-11 07:54:43 -05:00
Lioncash 04b9f6c28d Common/SettingsHandler: Use std::erase in Decrypt()
Same behavior, way less verbose code.
2023-12-11 07:49:43 -05:00
Admiral H. Curtiss 3364d571cc
Common/MemArenaWin: Rewrite LazyMemoryRegion to manually map memory blocks into the large memory region as needed.
Internal details: The large region is split into individual same-sized blocks of memory. On creation, we allocate a single block of memory that will always remain zero, and map that into the entire memory region. Then, the first time any of these blocks is written to, we swap the mapped zero block out with a newly allocated block of memory. On clear, we swap back to the zero block and deallocate the data blocks. That way we only actually allocate one zero block as well as a handful of real data blocks where the JitCache actually writes to.
2023-12-09 21:11:31 +01:00
Admiral H. Curtiss eb235d6ee3
Common/MemArenaWin: Move the advanced Windows memory function address initialization into its own struct and function so it can be reused. 2023-12-09 20:58:07 +01:00
Admiral H. Curtiss 85f4a460f9
Merge pull request #12184 from noahpistilli/kd-mail-send
IOS/KD: Implement Send Mail
2023-12-02 17:15:56 +01:00
JosJuice 67791d227c JitArm64: Add special zero case to ADDI2R
This normally doesn't reduce the instruction count, but is nonetheless
useful on CPUs that can do 0-cycle moves.
2023-12-01 21:31:11 +01:00
JosJuice 25ffb0dbfc JitArm64: Mask input to 32-bit ADDI2R
In case the input was a s32 that got sign extended as part of conversion
to u64.
2023-12-01 21:26:37 +01:00
Sketch 0d908a83e7
Common/HTTP: Implement Multiform 2023-12-01 19:52:21 +01:00
Mai d85cb749c0
Merge pull request #11382 from skyfloogle/traversal-fix-2
Traversal: Use low TTL for probe packet
2023-11-30 18:03:50 -05:00
JosJuice 255ee3fdce JitArm64: Use LSL+CLS for classifying floats
This is a little trick I came up with that lets us restructure our float
classification code so we can exit earlier when the float is normal,
which is the case more often than not.

First we shift left by 1 to get rid of the sign bit, and then we count
the number of leading sign bits. If the result is less than 10 (for
doubles) or 7 (for floats), the float is normal. This is because, if the
float isn't normal, the exponent is either all zeroes or all ones.
2023-11-28 18:30:45 +01:00
Zopolis4 481bc76d8e
Remove redundant 32-bit code 2023-11-28 23:03:26 +11:00
Zopolis4 f0d2ce4683
Remove _M_X86 in favour of _M_X86_64 2023-11-28 23:03:20 +11:00
JosJuice be1e103435 Remove references to Debugger.ini
This file was only used by DolphinWX. DolphinQt uses Qt.ini instead.
2023-11-27 21:38:43 +01:00
Admiral H. Curtiss 76d605639b
Merge pull request #11881 from JosJuice/aarch64-function-call
JitArm64: Add utility for calling a function with arguments
2023-11-25 17:30:42 +01:00
Sepalani 91020ac4fa BBA/HLE: Fix random PCAP file corruption
Concurrency between RecvHandlePacket and SendFromDirectFIFO
2023-11-23 22:07:44 +04:00
Admiral H. Curtiss b181842092
Netplay: Fix building on clang 17. 2023-11-03 16:15:04 +01:00
JosJuice c248a69268 JitArm64: Add utility for calling a function with arguments
With this, situations where multiple arguments need to be moved
from multiple registers become easy to handle, and we also get
compile-time checking that the number of arguments is correct.
2023-11-01 19:01:58 +01:00
Admiral H. Curtiss ff009dd8b5
Merge pull request #12258 from skyfloogle/traversal-logging
Netplay: Don't log skippable events as errors
2023-11-01 11:56:39 +01:00
JosJuice 899d61bc7d Jit64: Recompile asm routines on cache clear
This is needed so that the checks added in the previous commit will be
reevaluated if the value of m_enable_dcache changes.

JitArm64 was already recompiling its asm routines on cache clear by
necessity. It doesn't have the same setup as Jit64 where the asm
routines are in a separate region, so clearing the JitArm64 cache
results in the asm routines being cleared too.
2023-10-31 19:43:49 +01:00
Floogle bee6d5bfb6 Netplay: Don't log skippable events as errors 2023-10-28 18:06:07 +02:00
Sintendo 3c3168706c PowerPC: Negate m_dec values in frsqrte table
This value is used in a multiplication. The result of this
multiplication is then subtracted from m_base. By negating m_dec, we are
free to use an addition instead.

On x64, this saves an instruction.
2023-10-21 21:08:21 +02:00
Admiral H. Curtiss 1b7a590b4b
Merge pull request #12209 from JosJuice/frsqrte-exp-lsb
PowerPC: Flip the order of frsqrte_expected
2023-10-10 10:38:07 +02:00
JMC47 cd366c4f46
Merge pull request #12036 from LillyJadeKatrin/deep-copy-volume
Added CopyReader to BlobReader and all subclasses
2023-10-01 11:39:37 -04:00
LillyJadeKatrin 335cf4f2db Added CopyReader to BlobReader and all subclasses
A deep-copy method CopyReader has been added to BlobReader (virtual) and all of its subclasses (override). This should create a second BlobReader to open the same set of data but with an independent read pointer so that it doesn't interfere with any reads done on the original Reader.

As part of this, IOFile has added code to create a deep copy IOFile pointer onto the same file, with code based on the platform in question to find the file ID from the file pointer and open a new one. There has also been a small piece added to FileInfo to enable a deep copy, but its only subclass at this time already had a copy constructor so this was relatively minor.
2023-10-01 09:04:06 -04:00
JosJuice 9e0fea8fc7 PowerPC: Flip the order of frsqrte_expected
This makes the the frsqrte routines one instruction shorter.
2023-09-30 11:41:27 +02:00
MattKC e16753472c
FileUtil: Don't try to retrieve size for FIFO pipe 2023-09-24 19:36:15 -07:00
get 63467559b2
fmt 10.0.0-10.1.1 compile fixes
Implicit conversion operators and enums was removed for parity with std::format (fce74caa15).
2023-09-21 01:19:23 +02:00
Admiral H. Curtiss 579ccb0710
Merge pull request #12160 from AdmiralCurtiss/achievement-log
Common/LogManager: Add logging category for Achievements.
2023-09-19 22:01:15 +02:00
Admiral H. Curtiss cc7fadfa4b
Merge pull request #12181 from JosJuice/curl-response-code-long
Common: Fix HttpRequest::GetLastResponseCode stack corruption
2023-09-16 16:48:47 +02:00
JosJuice aa4de6516f Common: Fix HttpRequest::GetLastResponseCode stack corruption
Should fix https://bugs.dolphin-emu.org/issues/13353.
2023-09-16 16:01:28 +02:00
Admiral H. Curtiss 7869abf0e6
Common/MemArena: Set MAP_NORESERVE in LazyMemoryRegion on Linux. 2023-09-10 14:52:34 +02:00
Admiral H. Curtiss 911c469cf5
Common/LogManager: Add logging category for Achievements. 2023-09-09 14:47:20 +02:00
Admiral H. Curtiss 422bc7a627
Common/MemArena: A zero-byte allocation is invalid. 2023-09-07 14:41:24 +02:00
Admiral H. Curtiss c14bc6ea4c
Common/MemArena: mmap returns MAP_FAILED on error, not nullptr. 2023-09-07 13:59:33 +02:00
Admiral H. Curtiss a20bb3e05b
Common/MemArena: Assert return value of LazyMemoryRegion::Clear()'s mmap() call. 2023-09-07 04:00:22 +02:00
Admiral H. Curtiss 143a13622f
Merge pull request #12108 from noahpistilli/kd-check-mail
IOS/KD: Implement NWC24_CHECK_MAIL_NOW
2023-09-03 19:52:26 +02:00
Sketch 2154941c2c IOS/KD: Implement NWC24_CHECK_MAIL_NOW 2023-09-03 13:05:58 -04:00
JMC47 bd57d17dee
Merge pull request #12079 from JosJuice/blr-no-fastmem
Jit: Allow BLR optimization without fastmem
2023-09-02 12:45:39 -04:00
Admiral H. Curtiss 5bd7756064
Common/MemArena: Add LazyMemoryRegion to represent a zero-initialized memory region whose pages are only allocated on first access. 2023-09-02 04:02:10 +02:00
JosJuice af2c32635a Jit: Add more error checking to ProtectStack 2023-08-29 22:46:50 +02:00
Admiral H. Curtiss 2502e412b3
Merge pull request #12117 from JosJuice/config-callback-cpu
Don't call RunAsCPUThread in config callbacks
2023-08-26 16:34:46 +02:00
Admiral H. Curtiss e876045e56
Merge pull request #12135 from Dentomologist/jitarm64_resolve_deprecated_enum_conversion_warning
JitArm64: Resolve deprecated enum conversion warning
2023-08-26 14:18:58 +02:00
Dentomologist a650a16f4c JitArm64: Resolve deprecated enum conversion warning
Resolve warning caused by using values from two different enums in a
conditional expression which was deprecated in c++20.

The warning in question is clang -Wdeprecated-anon-enum-enum-conversion
and gcc -Wenum-compare.
2023-08-23 14:38:52 -07:00
JosJuice 6e88c44d5d Move SmallVector to Common
We had one implementation of this type of data structure in Arm64Emitter
and one in VideoCommon. This moves the Arm64Emitter implementation to
its own file and adds begin and end functions to it, so that VideoCommon
can use it.

You may notice that the license header for the new file is CC0. I wrote
the Arm64Emitter implementation of SmallVector, so this should be no
problem.
2023-08-22 13:19:49 +02:00
JosJuice 7197e3abd0 Use structs for config callback IDs
This way you can't mix up regular config callback IDs and CPU thread
config callback IDs. (It would be rather bad if you did!)
2023-08-17 19:19:26 +02:00
JosJuice 2b17e89336 Config: Don't clear callbacks on shutdown
This fixes a problem that started happening in CoreTimingTest after the
previous commit. CPUThreadConfigCallback registers a Config callback
only once per run of the process, but CoreTimingTest calls
Config::Shutdown after each test, and Config::Shutdown was clearing all
callbacks, preventing the callback from running after that.
2023-08-17 19:19:25 +02:00
JosJuice 71ce8bb6f0 Don't call RunAsCPUThread in config callbacks
In theory, our config system supports calling Set from any thread. But
because we have config callbacks that call RunAsCPUThread, it's a lot
more restricted in practice. Calling Set from any thread other than the
host thread or the CPU thread is formally thread unsafe, and calling Set
on the host thread while the CPU thread is showing a panic alert causes
a deadlock. This is especially a problem because 04072f0 made the
"Ignore for this session" button in panic alerts call Set.

Because so many of our config callbacks want their code to run on the
CPU thread, I thought it would make sense to have a centralized way to
move execution to the CPU thread for config callbacks. To solve the
deadlock problem, this new way is non-blocking. This means that threads
other than the CPU thread might continue executing before the CPU thread
is informed of the new config, but I don't think there's any problem
with that.

Intends to fix https://bugs.dolphin-emu.org/issues/13108.
2023-08-17 19:19:25 +02:00
Dentomologist 9ad0d9ca6a NandPaths: Use initializer_list instead of unordered_set 2023-08-12 14:00:41 -07:00
Dentomologist 9955a06dbd NandPaths: Resolve Android tautological comparison warning
Android interprets char as unsigned char, so comparing with 0 triggers a
tautological-unsigned-char-zero-compare warning.

Casting c to an unsigned char and removing the comparison with 0
resolves the warning while needing one less comparison on all platforms.
2023-08-12 14:00:41 -07:00
JosJuice 30c4ac34b0
Merge pull request #12073 from AdmiralCurtiss/wiimote-win32error
WiimoteReal/IOWin: Use correct error type in the default case.
2023-07-29 18:54:10 +02:00
Admiral H. Curtiss cd923718c3
CommonFuncs: Add GetWin32ErrorString(). 2023-07-28 08:10:01 +02:00
Dentomologist 3c6ea825c2 GekkoDisassembler: Remove unused parameter dmode from fdabc function
With the removal of m_flags, dmode is no longer used in fdabc.
2023-07-27 10:47:46 -07:00
Dentomologist 33dc2a9e6a GekkoDisassembler: Remove unused parameter dmode from ldst function
With the removal of m_flags, dmode is no longer used in ldst.
2023-07-27 10:47:46 -07:00
Dentomologist b3c5021fc4 GekkoDisassembler: Remove unused parameter dmode from rrn function
With the removal of m_flags, dmode is no longer used in rrn.
2023-07-27 10:47:46 -07:00
Dentomologist a177c8bcb1 GekkoDisassembler: Remove unused parameter dmode from dab function
With the removal of m_flags, dmode is no longer used in dab.
2023-07-27 10:47:45 -07:00
Dentomologist a732647e5a GekkoDisassembler: Remove unused parameter dmode from nooper function
With the removal of m_flags, dmode is no longer used in nooper.
2023-07-27 10:47:45 -07:00