Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: upstream merge to 5.0-21088 #16

Merged
merged 2,163 commits into from
Feb 15, 2024
Merged

Conversation

NikhilNarayana
Copy link
Member

lioncash and others added 30 commits December 22, 2023 14:19
…rupts()

Now that the system instance is passed through, this is no longer necessary.
We don't need to specify the type of the mutex being passed in.
VideoCommon/PixelEngine: Passthrough system instance in constructor
"When interacting with DocumentUI or the built-in Android System Internal Files Manager app and performing Create, Rename, and Delete operations, DocumentsUI will not automatically refresh the changes.
Previously, users had to manually pull down from the top to refresh the changes. This commit aims to fix this issue by automatically notifying the system that changes have occurred and triggering a requery."
This  will make DocumentUI or the built-in Android System Internal Files Manager app showing Thumbnail of Image file instead of image type icon.
Explicitly shut down work queues in NetKDRequestDevice's destructor to
prevent their threads from accessing members after they've been freed.

This crash would occur sporadically if NetKDRequestDevice's periodic
download or mail checks happened to overlap with emulation shutdown in
the wrong way.

An example sequence of events that could cause the crash:
* m_scheduler_timer_thread queues a periodic Download event in
  m_scheduler_work_queue, then waits for m_shutdown_event.
* A request to stop emulation results in s_ios being reset by the CPU
  thread. This triggers NetKDRequestDevice's destructor which sets
  m_shutdown_event and joins m_scheduler_timer_thread.
* m_scheduler_timer_thread wakes from m_shutdown_event and returns from
  its thread function, ending the thread.
* The CPU thread resumes execution at the end of NetKDRequestDevice's
  destructor and begins destroying NetKDRequestDevice's members in
  reverse declaration order.
* m_http is declared after m_scheduler_work_queue and is therefore
  destroyed earlier.
* m_scheduler_work_queue's destructor calls its Shutdown function, which
  by default finishes the work items in the queue.
* The queued Download event calls KDDownload which calls m_http.Get()
  which calls Fetch() which passes garbage data from the freed m_curl
  into curl_easy_setopt().
* Curl promptly crashes.

Shutting down the work queues manually in the destructor prevents the
above because m_http and the other members don't get freed until after
the queue threads finish.
Keep a shared_ptr to NetKDTimeDevice inside NetKDRequestDevice.

This allows the KDDownload task to finish its work without potentially
trying to dereference nullptr, which can potentially come from either
GetIOS() or GetDeviceByName() if EmulationKernel's destructor has
started running.
Socket: Fix a nullptr dereference when operations are pending
…evice_fix_crashes

NetKDRequestDevice: Fix sporadic crashes during emulation shutdown
Fix sharp bilinear using ceil instead of floor
This fixes an issue where the game specific graphics backend would be saved as the global setting after playing a game.

This also now displays the currently running graphics backend when looking in the graphics configuration window.
VideoCommon: apply "force 24-bit color" to EFB-to-VRAM copies as well
DSPHLE/Zelda: fix use of wrong reverb buffer
These messages can be localized, so we can't just assume it's all ASCII.
…-encoding

Common: Fix encoding handling in GetWin32ErrorString
…x_v2

Input: Improve Controller Interface devices threading
DolphinQt/Mapping: Add "Use Mouse Controlled Pointing" button.
…vert-linkage

Common/StringUtil: Use internal linkage for codepage conversion functions.
Seems like this was missed in the conversion to Kotlin in 001089d.
This comment hasn't really made sense since 23bebc5 commented out
the relevant line.
lioncash and others added 20 commits February 1, 2024 23:02
Ensures that these go into the ro section.
We can remove the long qualifying on some ResponseType instances to
lessen the amount of reading.
These perform a default comparison, which is the same as using the
equality operators.
This way we don't need to do any validity checking aside from the
initial setting of the callback. Also cuts down on line noise.
We can just use brace initialization to zero these out. Smaller to
write and a little quicker to read.
This isn't used anywhere, so it can be removed.
CustomPipeline: Resolve unused variable warning
VertexLoaderManager: Remove unused entry struct
…ees-1

CheatSearch: Remove redundant lambdas
AchievementManager: Minor cleanup
By having getters for this information, other code that needs access to
the same information can call the getters instead of duplicating the
information.
After reading the previous commit, you might think "hold on, what's the
difference between GetProfileName and GetProfileDirectoryName"? These
two are being used for the exact same thing - figuring out where
profiles are stored - yet they return different values for certain
controllers like GC keyboards! As far as I can tell, the existing code
has been broken for GC keyboards since they were introduced a decade
ago. The GUI (and more recently, also InputCycler) would write and read
profiles in one location, and our code for loading profiles specified in
a game INI file would read profiles in another location.

This commit gets rid of the set of values used by the game INI code in
favor of the other set. This does breaking existing setups where a
GCKey profile has been configured in a game INI, but I think the number
of working such setups is vanishingly small. The alternative would make
existing GCKey profiles go missing from the profile dropdown in the GUI,
which I think would be more disruptive. The alternative would also force
new GCKey profiles into the same directory as GCPad profiles.

This commit also fixes a regression from d6c0f8e. The Android GUI was
using GetProfileName to figure out what key to use in the game INI,
which made it use incorrect game INI entries for GameCube controller
profiles but not Wii Remote profiles. Now the Android GUI uses
GetProfileKey for this, fixing the problem.
Because the last commit made us use separate folders for GCPad and
GCKey profiles, we should also use separate game INI keys for them.
Otherwise setting e.g. PadProfile1 in a game INI will make both GCPad
and GCKey try to load it, typically with one of them succeeding and the
other one showing a panic alert due to the profile not existing in its
folder.

Better do this breaking change for GCKeys in the same PR as the other
breaking change rather than later.
InputCommon: Fix profile path inconsistencies
@NikhilNarayana NikhilNarayana force-pushed the upstream-merge-2024-02-09 branch 2 times, most recently from 944c157 to b1b804e Compare February 13, 2024 16:39
@NikhilNarayana NikhilNarayana force-pushed the upstream-merge-2024-02-09 branch from b4e88db to df9305c Compare February 13, 2024 22:09
@NikhilNarayana NikhilNarayana merged commit bdd9005 into slippi Feb 15, 2024
13 checks passed
NikhilNarayana pushed a commit that referenced this pull request Jun 9, 2024
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, dolphin-emu#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, dolphin-emu#38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.