Commit graph

35551 commits

Author SHA1 Message Date
Sepalani
6e2a081cb9 BBA/HLE: Loop over network_ref once 2024-04-06 21:43:48 +04:00
Sepalani
9e0bf29329 BBA/HLE: Move GetSlot methods 2024-04-06 21:43:48 +04:00
Sepalani
5388f35cc4 BBA/HLE: Add NetworkRef::Clear method 2024-04-06 21:43:48 +04:00
Sepalani
e915f990bb BBA/HLE: Make network_ref into a class 2024-04-06 21:43:48 +04:00
Admiral H. Curtiss
d3073353a7
Merge pull request #12555 from sepalani/bba-connecting
BBA/HLE: Don't assume connect is successful
2024-04-05 21:29:10 +02:00
Admiral H. Curtiss
ad331205d1
Merge pull request #12684 from Pokechu22/invalid-vertex-component
Fix out of bounds accesses for invalid vertex component formats
2024-04-04 22:10:18 +02:00
Pokechu22
a3951dc2d7 Fix out of bounds accesses for invalid vertex component formats
On all platforms, this would result in out of bounds accesses when getting the component sizes (which uses stuff from VertexLoader_Position.h/VertexLoader_TextCoord.h/VertexLoader_Normal.h). On platforms other than x64 and ARM64, this would also be out of bounds accesses when getting function pointers for the non-JIT vertex loader (in VertexLoader_Position.cpp etc.). Usually both of these would get data from other entries in the same multi-dimensional array, but the last few entries would be truly out of bounds. This does mean that an out of bounds function pointer can be called on platforms that don't have a JIT vertex loader, but it is limited to invalid component formats with values 5/6/7 due to the size of the bitfield the formats come from, so it seems unlikely that this could be exploited in practice.

This issue affects a few games; Def Jam: Fight for New York (https://bugs.dolphin-emu.org/issues/12719) and Fifa Street are known to be affected.

I have not done any hardware testing for this PR specifically, though I *think* I previously determined that at least a value of 5 behaves the same as float (4). That's what I implemented in any case. I did previously determine that both Def Jam: Fight for New York and Fifa Street use an invalid normal format, but don't actually have lighting enabled when that normal vector is used, so it doesn't change rendering in practice.

The color component format also has two invalid values, but VertexLoader_Color.h/.cpp do check for those invalid ones and return a default value instead of doing an out of bounds access.
2024-04-04 12:50:34 -07:00
Admiral H. Curtiss
4312840a4b
Merge pull request #12678 from JosJuice/no-getpointer-part-2
HW: Remove calls to GetPointer
2024-04-04 21:43:57 +02:00
Admiral H. Curtiss
db8b2942aa
Merge pull request #12683 from LillyJadeKatrin/retroachievements-submodule-update
Update rcheevos submodule to newest master.
2024-04-04 21:14:44 +02:00
Admiral H. Curtiss
0aa92f7a56
Merge pull request #12685 from JosJuice/get-pointer-for-range-zero-size
Memmap: Don't show panic alert for 0 length range
2024-04-04 21:08:53 +02:00
JosJuice
fad57b648f Memmap: Don't show panic alert for 0 length range
IOS::HLE::IOCtlVRequest::Dump sometimes tries to call GetPointerForRange
with an address of 0 and a size of 0. Address 0 is valid, but we were
mistakenly also trying to check that address 3FFFFFFF is valid, which it
isn't.

Fixes https://bugs.dolphin-emu.org/issues/13514.
2024-04-04 18:56:17 +02:00
LillyJadeKatrin
225a6da074 Update rcheevos submodule to newest master. 2024-04-03 15:03:36 -04:00
OatmealDome
4421cc471d
Merge pull request #12631 from jordan-woyak/remove-osx-input-leftovers
InputCommon: Remove some IOKit leftovers.
2024-04-01 17:05:13 -04:00
Dentomologist
ac4fd2297f CheatsManager: Allow making the window smaller
Move CheatManager's child widgets into scroll areas to allow making the
window smaller than the default.

In CheatSearchWidget, enable word wrapping for the label describing the
address space and search type to help it fit better inside a narrower
window.
2024-03-31 13:17:56 -07:00
JosJuice
ad43b03253 HW: Remove calls to GetPointer
Typically when someone uses GetPointer, it's because they want to read
from a range of memory. GetPointer is unsafe to use for this. While it
does check that the passed-in address is valid, it doesn't know the size
of the range that will be accessed, so it can't check that the end
address is valid. The safer alternative GetPointerForRange should be
used instead.

Note that there is still the problem of many callers not checking for
nullptr.

This is part 2 of a series of changes removing the use of GetPointer
throughout the code base. After this, VideoCommon is the one major part
of Dolphin that remains.
2024-03-31 21:58:05 +02:00
Admiral H. Curtiss
a5e410df11
Merge pull request #12671 from JosJuice/no-getpointer-part-1
IOS: Remove calls to GetPointer
2024-03-31 21:16:19 +02:00
JosJuice
9873bcfb2b IOS: Remove calls to GetPointer
Typically when someone uses GetPointer, it's because they want to read
from a range of memory. GetPointer is unsafe to use for this. While it
does check that the passed-in address is valid, it doesn't know the size
of the range that will be accessed, so it can't check that the end
address is valid. The safer alternative GetPointerForRange should be
used instead.

Note that there is still the problem of many callers not checking for
nullptr.

This is the first part of a series of changes that will remove the usage
of GetPointer in different parts of the code base. This commit gets rid
of every GetPointer call from our IOS code except for a particularly
tricky one in BluetoothEmuDevice.
2024-03-31 10:22:02 +02:00
Admiral H. Curtiss
dcae03a112
Merge pull request #12665 from Pokechu22/dsp-hle-asnd-2024
DSPHLE: Implement 2024 libasnd uCodes
2024-03-31 06:42:59 +02:00
Admiral H. Curtiss
1331332d38
Merge pull request #12656 from jordan-woyak/texture-dump-no-dups
VideoCommon: Scan texture dumping directory + subdirectories to not re-dump existing files.
2024-03-31 06:40:04 +02:00
Admiral H. Curtiss
f3bf5d175e
Merge pull request #12609 from JosJuice/aspect-ratio-description
DolphinQt: Tweak the aspect ratio setting description
2024-03-31 06:39:36 +02:00
Admiral H. Curtiss
a2074a8583
Merge pull request #12645 from mitaclaw/ppc-symbols-signal
DolphinQt: A Ubiquitous Signal For When Symbols Change
2024-03-31 06:36:09 +02:00
Admiral H. Curtiss
6e5f8d6692
Merge pull request #12640 from jordan-woyak/sdl-cleanup
SDL: Cleanups
2024-03-31 06:33:50 +02:00
Jordan Woyak
86102e7ce9
Merge pull request #12670 from mitaclaw/branchwatch-fileutil-copy-paste
FileUtil: Fix BranchWatch User Path
2024-03-29 13:46:20 -05: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
JosJuice
fbc3539b4e
Merge pull request #12666 from Matt-Swift/master
Add tapserver BBA and Modem Adapter UI options to Android
2024-03-29 15:37:57 +01:00
JosJuice
f30d3c9092
Merge pull request #12662 from JosJuice/jitarm64-imm-rc0-sxtw
JitArm64: Skip SXTW in ComputeRC0(u64)
2024-03-29 15:36:33 +01:00
JosJuice
5f6a054ffc
Merge pull request #12661 from Sintendo/arm64divwux
JitArm64: Optimize divwux
2024-03-29 15:36:18 +01:00
mitaclaw
6e6b298030 Core::RunOnCPUThread: Avoid Global System Accessor 2024-03-28 10:10:03 -07:00
JMC47
aea1f64873
Merge pull request #12659 from mitaclaw/qt-debug-font
DolphinQt Settings: Signal Debug Font By Const Reference
2024-03-28 13:04:39 -04:00
JMC47
aa9601a563
Merge pull request #12658 from mitaclaw/core-global-system-2b
Core: Remove RunAsCPUThread
2024-03-28 13:04:08 -04:00
mitaclaw
b52a08d533 DolphinQt: A Ubiquitous Signal For When Symbols Change
There were three distinct mechanisms for signaling symbol changes in DolphinQt: `Host::NotifyMapLoaded`, `MenuBar::NotifySymbolsUpdated`, and `CodeViewWidget::SymbolsChanged`. The behavior of these signals has been consolidated into the new `Host::PPCSymbolsUpdated` signal, which can be emitted from anywhere in DolphinQt to properly update symbols everywhere in DolphinQt.
2024-03-28 09:57:22 -07:00
Matt
39f5597089 Add tapserver BBA and Modem Adapter UI config to Android
This PR simply exposes the tapserver options in Serial Port 1 on Android. They already exist and work, but are not selectable. I've tested the tapserver options myself with Phantasy Star Online Episode I & II and they work fine.
2024-03-25 17:37:29 +00:00
JosJuice
06329ecfc7 Core: Fix IPL device m_cursor overflow
Not sure if the behavior I'm implementing here is what real hardware
does, but since this is a buffer overflow, I'd like to get it fixed
quickly. Hardware verification can happen later.

https://bugs.dolphin-emu.org/issues/13506
2024-03-25 18:31:36 +01:00
JosJuice
d57c68a625 Core: Get rid of IPL device macros
Having to look up macros that are defined elsewhere makes the code
harder to reason about. The macros don't remove enough repetition to
justify their existence in my opinion.
2024-03-25 17:55:13 +01:00
Pokechu22
cd5f6ddd9b DSPHLE: Implement 2024 libasnd uCodes 2024-03-24 11:59:32 -07:00
Pokechu22
c85f5f8023 DSPHLE: Redefine asnd SwapLeftRight to apply to old versions 2024-03-24 11:58:04 -07:00
JosJuice
28da3160c3 DolphinQt: Tweak the aspect ratio setting description
With this, I intend to make it clearer that Auto, Force 4:3, Force 16:9
and Custom are really the same thing, just with the aspect ratio of the
simulated TV being selected in a different way. I also extended the
introduction in a way I feel will clarify things but which you are
welcome to bikeshed :)

I was thinking of this during the review of 41b19e262f, but wanted to
put it in a separate PR as to avoid blocking it on bikeshedding.

I'm a bit unsure what to do about the word "analog" in "analog TV". I
felt that repeating it for each of these options would be too
repetitive. I suppose there's a reason why we used the word originally,
but digital TVs do give you basically the same aspect ratio for GC/Wii
games as analog TVs. (Of course, whether it's 4:3-like or 16:9-like
depends on what aspect ratio you set in the TV's settings, but that's
the case for widescreen CRTs too.)
2024-03-24 15:18:58 +01:00
Bram Speeckaert
2580837c60 JitArm64: Optimize divwux
When the divisor is a constant value, we can emit more efficient code.
For powers of two, we can use bit shifts. For other values, we can
instead use a multiplication by magic constant method.

- Example 1 - Division by 16 (power of two)
Before:
mov    w24, #0x10                ; =16
udiv   w27, w25, w24

After:
lsr    w27, w25, #4

- Example 2 - Division by 10 (fast)
Before:
mov    w25, #0xa                 ; =10
udiv   w27, w26, w25

After:
mov    w27, #0xcccd              ; =52429
movk   w27, #0xcccc, lsl #16
umull  x27, w26, w27
lsr    x27, x27, #35

- Example 3 - Division by 127 (slow)
Before:
mov    w26, #0x7f                ; =127
udiv   w27, w27, w26

After:
mov    w26, #0x408               ; =1032
movk   w26, #0x8102, lsl #16
umaddl x27, w27, w26, x26
lsr    x27, x27, #38
2024-03-23 20:13:15 +01:00
Bram Speeckaert
749ee2ff5e Jit64: Refactor divwux
Now that we've moved the logic to DivUtils, refactor the Jit64 code to
use it.
2024-03-23 20:13:15 +01:00
Bram Speeckaert
825a10616c DivUtils: Add unsigned division magic function
Takes the logic from Jit64 and moves it into DivUtils, so it can be
reused by other backends as well.
2024-03-23 20:13:15 +01:00
JosJuice
9f0a7c9875 JitArm64: Skip SXTW in ComputeRC0(u64)
MOVI2R can set the upper bits to ones for free by using MOVN instead of
MOVZ.
2024-03-23 14:30:00 +01:00
mitaclaw
73f9904f2a Core: Remove RunAsCPUThread
It's a fine function, but CPUThreadGuard is more vogue. Also, its potential for being confused with RunOnCPUThread will not be missed.
2024-03-23 03:33:26 -07:00
mitaclaw
ae5da02cde DolphinQt Settings: Signal Debug Font By Const Reference 2024-03-22 07:52:52 -07:00
Admiral H. Curtiss
3948ac9513
Merge pull request #12606 from mitaclaw/state-global-system
State: Avoid Global System Accessor
2024-03-22 04:27:12 +01:00
Admiral H. Curtiss
f814dc58b5
Merge pull request #12620 from mitaclaw/jit-interface-cpu-thread-guard
JitInterface::ClearCache: Modernize With CPUThreadGuard
2024-03-22 04:17:33 +01:00
Admiral H. Curtiss
f8fdaf9b94
Merge pull request #12648 from mitaclaw/core-global-system
Core: Avoid (Some) Global System Accessor
2024-03-22 04:13:01 +01:00
Admiral H. Curtiss
4f3b4471f2
Merge pull request #12654 from jordan-woyak/gcadapter-timeout
GCAdapter: Adjust libusb transfer timeout to 100ms.
2024-03-22 02:55:30 +01: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
Admiral H. Curtiss
f535b61d5d
Merge pull request #12652 from iwubcode/json_util_update
Common: add even more json utility functions
2024-03-22 02:45:58 +01:00
Jordan Woyak
550e008774 VideoCommon: Scan texture dumping directory + subdirectories to not re-dump existing files. 2024-03-21 20:27:34 -05:00