Commit graph

15993 commits

Author SHA1 Message Date
Morph
aa79ca7a7a kernel: KLightConditionVariable: Update implementation to 12.x
Updates the implementation of KLightConditionVariable to FW 12.x
2021-06-11 00:58:04 -04:00
Markus Wick
6755025310 Fix GCC undefined behavior sanitizer.
* Wrong alignment in u64 LOG_DEBUG -> memcpy.
* Huge shift exponent in stride calculation for linear buffer, unused result -> skipped.
* Large shift in buffer cache if word = 0, skip checking for set bits.

Non of those were critical, so this should not change any behavior.
At least with the assumption, that the last one used masking behavior, which always yield continuous_bits = 0.
2021-06-10 21:07:27 +02:00
bunnei
781c85b951 hle: service: sm: Remove redundant session reservation, etc.
- We were double-reserving, causing us to run out of sessions in Pokemon Sword & Shield.
2021-06-10 11:34:41 -07:00
bunnei
fa8a0065ca
hle: service: Increase arbitrary max sessions limit.
- Pokemon Sword/Shield are still hitting this for some reason, causing an svcBreak.
2021-06-10 00:08:09 -07:00
bunnei
b259e95c09 hle: kernel: KClientPort: Add an assert for session count.
- Prevents us from over decrementing num_sessions.
2021-06-09 22:36:42 -07:00
bunnei
ec5674a6ad hle: service: sm: Fix GetService setup of session & port. 2021-06-09 22:29:18 -07:00
bunnei
2aa6a8d889 hle: service: Use correct size for ServerSessionCountMax. 2021-06-09 22:04:36 -07:00
bunnei
b2971b48ed hle: kernel: KServerSession: Fix client disconnected.
- Prevents a cloned session's handler from being overwritten by another disconnected session.
- Fixes session handler nullptr asserts with Pokemon Sword & Shield.
2021-06-09 21:37:11 -07:00
bunnei
c63ea608aa kernel: svc: Add missing error check to CancelSynchronization.
- Avoids a potential crash if the handle is invalid, and also makes this code accurate to real kernel behavior.
2021-06-09 15:24:46 -07:00
Mai M
5857067a18
Merge pull request #6436 from liushuyu/master
src/common/CMakeLists.txt: fix variable escaping
2021-06-09 15:38:56 -04:00
bunnei
2d32fc2318
hle: service: Increase arbitrary max sessions limit.
- Pokemon Sword/Shield are still hitting this for some reason, causing an svcBreak.
2021-06-09 11:59:34 -07:00
bunnei
75a4ac12c6
Merge pull request #6413 from Kewlan/limitable_input_dialog_limit
limitable_input_dialog: Implement character limiter
2021-06-09 11:55:36 -07:00
liushuyu
eb9deffab6
src/common/CMakeLists.txt: fix variable escaping 2021-06-09 02:20:55 -06:00
Morph
15483c07c6
Merge pull request #6435 from lioncash/nodisc2
common/fs/path_util: Remove [[nodiscard]] from function with void return
2021-06-09 02:44:41 -04:00
bunnei
f9c3e2e872
Merge pull request #6434 from lioncash/tcontext
configure_ui: Add translation context for file-scope strings
2021-06-08 19:36:44 -07:00
bunnei
3c621d37f0
Merge pull request #6428 from bunnei/service-thread-crash-fix
hle: kernel: Remove service thread manager and use weak_ptr.
2021-06-08 16:43:55 -07:00
Lioncash
dd8577e91d common/fs/path_util: Remove [[nodiscard]] from function with void return
We can't make use of the return value here, since we don't a return
value to work with.
2021-06-08 19:36:09 -04:00
Lioncash
b3eb08254b configure_ui: Add translation context for file-scope strings
Allows for these strings to show up in the translation files.
2021-06-08 19:33:23 -04:00
Mai M
f09c9b5fcc
Merge pull request #6426 from lat9nq/context-menu-start
yuzu qt: Start games from context menu
2021-06-08 17:09:25 -04:00
bunnei
b8fb9b3f11 hle: kernel: KServerSession: Work-around scenario where session is closed too early. 2021-06-08 13:39:20 -07:00
bunnei
08d798b6fe hle: kernel: hle_ipc: Ensure SessionRequestHandler is valid. 2021-06-07 21:55:37 -07:00
bunnei
3b5673daca
Merge pull request #6412 from clementgallet/yuzu-cmd-window-gl
yuzu-cmd: Fix OpenGL rendering
2021-06-07 21:12:17 -07:00
bunnei
a493ab2678 hle: kernel: Remove service thread manager and use weak_ptr.
- We no longer need to queue up service threads to be destroyed.
- Fixes a race condition where a thread could be destroyed too early, which caused a crash in Pokemon Sword/Shield.
2021-06-07 21:10:51 -07:00
lat9nq
5ac018d1df yuzu qt: Start games from context menu
This connects the BootGame function to the context menu. In addition,
there is an option to boot without using the custom configuration.
2021-06-07 20:27:51 -04:00
bunnei
df91c9f5e6
Merge pull request #6410 from lat9nq/avoid-oob
decoders: Avoid out-of-bounds access
2021-06-07 10:51:17 -07:00
Clément Gallet
f611506dca Various suggestions by v1993 and lioncash 2021-06-07 12:51:59 +02:00
bunnei
28eb8c83d4
Merge pull request #6414 from bunnei/fix-service-threads
hle: kernel: Refactor to allocate a ServiceThread per service handler.
2021-06-06 22:52:07 -07:00
bunnei
9db569b2d9 hle: kernel: KServerSession: Use ASSERT_MSG where appropriate. 2021-06-06 22:09:25 -07:00
bunnei
ada4242c01 hle: kernel: k_server_session: Return service thread by strong pointer. 2021-06-06 17:54:06 -07:00
bunnei
93f93cb8bc hle: kernel: k_server_session: Ensure service thread is valid before dereference. 2021-06-06 17:03:36 -07:00
bunnei
afd0e2eb0b
Merge pull request #6400 from ameerj/disable-uniform-simplify
buffer_cache: Simplify uniform disabling logic
2021-06-06 15:42:20 -07:00
bunnei
384cbe3829 hle: kernel: hle_ipc: Use default destructor for SessionRequestManager. 2021-06-06 15:41:16 -07:00
bunnei
6119836795 hle: kernel: KAutoObjectWithListContainer: Use boost::instrusive::rbtree.
- Fixes some crashes introduced by our common intrusive red/black tree impl.
2021-06-06 15:39:11 -07:00
Clément Gallet
df8a2e3ad8 Add sdl2 audio description in the yuzu-cmd config file 2021-06-06 11:29:02 +02:00
Clément Gallet
c7c99905f4 Add SDL2 audio backend 2021-06-06 11:28:38 +02:00
Kewlan
058196a089 limitable_input_dialog: Implement character limiter
When using GetText() you can now choose what set of characters the user can't enter.
2021-06-06 09:07:55 +02:00
Clément Gallet
2e1c58b905
Avoid -Wshadow warning
Co-authored-by: Mai M. <mathew1800@gmail.com>
2021-06-05 18:43:10 +02:00
Lioncash
25b73e135f result: Add [[nodiscard]] specifiers where applicable
The result code classes are used quite extensively throughout both the
kernel and service HLE code. We can mark these member functions as
[[nodiscard]] to prevent a few logic bugs from slipping through.
2021-06-05 06:09:07 -04:00
bunnei
fefc76e5da
Merge pull request #6362 from lat9nq/reset-to-defaults
yuzu qt: Add settings reset button to general configuration
2021-06-04 21:07:39 -07:00
Mai M
07f6646f7f
Merge pull request #6411 from clementgallet/yuzu-cmd-touch-button
yuzu-cmd: Add touch_from_button in config file
2021-06-04 23:21:29 -04:00
bunnei
27ce97fd42 hle: kernel: Refactor to allocate a ServiceThread per service handler.
- Previously, we would allocate a thread per session, which adds new threads on CloneCurrentObject.
- This results in race conditions with N sessions queuing requests to the same service interface.
- Fixes Pokken Tournament DX crashes/softlocks, which were regressed by #6347.
2021-06-04 19:26:48 -07:00
Clément Gallet
9ff8504452 yuzu-cmd: Fix OpenGL rendering 2021-06-04 11:39:04 +02:00
lat9nq
287a0f72a5 decoders: Break instead of continue
continue causes a memory leak in A Hat in Time.
2021-06-04 05:12:14 -04:00
lat9nq
1feefabeba decoders: Avoid out-of-bounds access
This is not a real fix, so assert here and continue before crashing.
2021-06-04 05:03:54 -04:00
bunnei
c8b3d92836
Merge pull request #6392 from german77/controller-widget
settings: Disable controller preview if controller is not active
2021-06-04 00:40:04 -07:00
bunnei
1d1f616063
Merge pull request #6389 from german77/Analog_button_fix
input_common: Analog button, use time based position
2021-06-03 21:06:38 -07:00
Maide
cb5fe12ee1
[game_list] Correct light theme loading (#6408)
Correct light theme loading

The setLayout call in game list instantiation will call resizing signals with default values in light theme, which was then being erroneously saved. setLayout doesn't seem to call resizing for any other theme, so I'm not sure why that happens.
2021-06-03 19:07:38 -04:00
Clément Gallet
166f5d1612 yuzu-cmd: Add touch_from_button in config file 2021-06-04 00:58:35 +02:00
lat9nq
ddc47e6df8 cmake: General improvements to libusb linking
Delegates libusb external communication to externals/CMakeLists.txt
Ensures an interface library `usb` for every pathway
input_common just links to the `usb` library now
externals/libusb/CMakeLists.txt sets variables to override SDL2's libusb
finding
Other minor cleanup
2021-06-03 03:49:35 -04:00
bunnei
e4fed17f59
Merge pull request #6402 from Kelebek1/UI
game_list: Stop the columns resizing on NAND install
2021-06-03 00:24:45 -07:00
bunnei
5a6d002bf0
Merge pull request #6404 from lat9nq/revert_views
yuzu qt: Revert some usages of string_view
2021-06-02 22:11:35 -07:00
Morph
b840dd9af8 fsp-srv: Replace one last instance of RESULT_SUCCESS 2021-06-02 21:40:14 -04:00
Chloe
c4c256f56a
fspsrv: Implement DisableAutoSaveDataCreation (#6355)
- Used by Mii Edit
2021-06-02 17:46:29 -07:00
lat9nq
c41451af75 yuzu qt: Revert some usages of string_view
Causes a heap-use-after free reported by AddressSanitizer. This makes
use of std::filesystem::path, but due to that we have to use their
string() function which may not work for all characters.
2021-06-02 19:50:20 -04:00
bunnei
4ea171fa5e
Merge pull request #6308 from Morph1984/result
general: Replace RESULT_NAME with ResultName
2021-06-02 15:29:09 -07:00
bunnei
d6006e9a3f
Merge pull request #6403 from Kewlan/game-list-for-loop-optimization
game_list: Minor for loop optimizations
2021-06-02 15:27:54 -07:00
Kewlan
65d42a428f game_list: Minor for loop optimizations
There's no need to check the first and last rows since they'll always be the Favorites and AddDir rows.
Also change the name of the clear_all variable for consistency.
2021-06-02 16:19:55 +02:00
Kelebek1
04e52ffed0 Stop the columns resizing on NAND install 2021-06-02 06:27:08 +01:00
Morph
a0e4c2e1fc general: Replace RESULT_UNKNOWN with ResultUnknown
Transition to PascalCase for result names.
2021-06-02 00:39:27 -04:00
Morph
12c1766997 general: Replace RESULT_SUCCESS with ResultSuccess
Transition to PascalCase for result names.
2021-06-02 00:39:27 -04:00
Morph
377cd301b3
Merge pull request #6395 from lioncash/result-move
common_funcs: Move R_ macros to result.h
2021-06-02 00:34:48 -04:00
Morph
dba7bcd489 common: fs: fs_util: Move PathToUTF8String to fs_util 2021-06-02 00:26:26 -04:00
Morph
a1eeb9908d common: fs: fs_util: Add more string conversion functions 2021-06-02 00:26:26 -04:00
bunnei
91f559a71f
Merge pull request #6361 from lat9nq/per-hb-cfg
yuzu qt: Handle per-game configs for title id 0
2021-06-01 17:24:08 -07:00
lat9nq
c17e1bd7a8 yuzu qt: Use lambda and std::function for reset callback
Also makes use of std::move, and performs a clang-format cleanup.

This addresses review comments.

Co-authored-by: LC <mathew1800@gmail.com>
2021-06-01 17:22:06 -04:00
lat9nq
4a3d57e469 yuzu: Add settings reset button to general configuration
Builds on german77's work to reset all settings back to their defaults.
This include UISettings and Settings values structs, but does not affect
save profiles, input profiles, and game directories.

This works from a button input in configure_general. When activated, it
calls a callback to close the whole configure dialog, then GMainWindow
deletes the old configuration, both on disk and in memory, and
reinitalizes a new one. It also resets a portion of the UI and calls the
telemetry window prompt.
2021-06-01 17:22:04 -04:00
fearlessTobi
8aeb425669 configuration: Initial work to reset all settings
This commit does not compile.

Initial work to add and connect a Reset to Defaults button to the
configure_general tab.

Co-authored-by: german77 <juangerman-13@hotmail.com>
2021-06-01 17:09:33 -04:00
ameerj
859ba21f6d buffer_cache: Simplify uniform disabling logic 2021-06-01 13:26:58 -04:00
bunnei
348ca07e0d
Merge pull request #6318 from german77/dualJoycon
input_common: Add dual joycon support
2021-06-01 00:51:00 -07:00
bunnei
0a6f685ad0
Merge pull request #6367 from ReinUsesLisp/vma-host
vulkan_memory_allocator: Allow textures to be allocated in host memory
2021-05-31 23:35:11 -07:00
Lioncash
3aed797466 common_funcs: Move R_ macros to result.h
These macros all interact with the result code type, so they should
ideally be within this file as well, so all the common_funcs machinery
doesn't need to be pulled in just to use them.
2021-05-31 16:41:00 -04:00
bunnei
f34176996e
Merge pull request #6385 from degasus/save_memory_access
core/memory: Check our memory fallbacks for out-of-bound behavior.
2021-05-30 23:21:39 -07:00
german77
ac48e059bc settings: Disable controller preview if controller is not active 2021-05-30 10:57:20 -05:00
bunnei
a5ebba7e36
Merge pull request #6377 from lioncash/point
common: Extract Point struct into common
2021-05-30 01:35:26 -07:00
bunnei
a6cfc73cb2
Merge pull request #6387 from lioncash/class-token
k_class_token: Use variable templates where applicable
2021-05-29 23:55:17 -07:00
bunnei
90c3dd300f
Merge pull request #6386 from bunnei/shutdown-fix
video_core: gpu: WaitFence: Do not block threads during shutdown.
2021-05-29 23:52:52 -07:00
german77
a323bc5af8 input_common: Analog button, use time based position instead of frequent updates 2021-05-30 00:13:51 -05:00
Mai M
2069430baa
Merge pull request #6374 from Morph1984/swkbd-textcheck-encoding
applets/swkbd: Only read the text check message on Failure/Confirm
2021-05-29 23:34:40 -04:00
Mai M
fc708b396b
Merge pull request #6364 from german77/stub-lp2p
ldn: Add and stub lp2p:sys lp2p:app INetworkServiceMonitor INetworkService

Mario Kart Live: Home Circuit needs lp2p:sys lp2p:app INetworkServiceMonitor INetworkService to be able to progress.

Note: The game still fails to boot from unimplemented LDN and BSD services.
2021-05-29 23:33:57 -04:00
bunnei
e41c8b6780
Merge pull request #6379 from degasus/update_dynarmic
externals: Update dynarmic.
2021-05-29 03:15:13 -07:00
Lioncash
646622ccd4 k_class_token: Use variable templates where applicable
Same behavior, less code.
2021-05-29 05:25:34 -04:00
bunnei
c7c4ef9d43
Merge pull request #6384 from lioncash/virtual
kernel: Add missing override specifiers
2021-05-29 02:11:40 -07:00
bunnei
cdabc9064b
Merge pull request #6382 from lioncash/null
k_thread: Move dereference after null check in Initialize()
2021-05-29 01:17:28 -07:00
bunnei
8592f8a2b4 video_core: gpu: WaitFence: Do not block threads during shutdown.
- Fixes a hang on shutdown when NVFlinger thread is waiting on a syncpoint that will never occur.
- Commonly observed when stopping emulation in Super Mario Odyssey.
2021-05-29 01:06:04 -07:00
Markus Wick
42a7c5d017 core/memory: Check our memory fallbacks for out-of-bound behavior.
This makes it by far harder to crash yuzu.

Also implement the 48bit masking of AARCH64 while touching this code.
2021-05-29 09:28:26 +02:00
bunnei
5388e6db84
Merge pull request #6373 from bunnei/use-slabheap-tls
hle: kernel: KSlabHeap: Allow host or guest allocations.
2021-05-29 00:17:24 -07:00
Markus Wick
ddb186e61d core/arm_interface: Improve the performance of memory fallbacks.
We just create one memory subsystem. This is a constant all the time.
So there is no need to call the non-inlined parent.Memory() helper on every callback.
2021-05-29 09:02:19 +02:00
Lioncash
7b2917b4e1 kernel: Add missing override specifiers
Over the course of the kernel refactoring a tiny bit of missing
overrides slipped through review, so we can add these.

While we're at it, we can remove redundant virtual keywords where
applicable as well.
2021-05-29 02:58:32 -04:00
Markus Wick
5a8cd1b118 Fix two GCC 11 warnings: Unneeded copies.
std::move created an unneeded copy.
iterating without reference also created copies.
2021-05-29 08:57:44 +02:00
Markus Wick
d2d7a5060f externals: Update dynarmic.
The new version supports fastmem on a64.
2021-05-29 08:53:01 +02:00
Lioncash
16ff0161b3 k_thread: Move dereference after null check in Initialize()
Prevents a -Wnonnull warning on GCC.
2021-05-29 00:31:38 -04:00
bunnei
420b1f89d3
Merge pull request #6371 from degasus/drop_ExceptionalExit
core/arm_interface: Call SVC after end of dynarmic block.
2021-05-28 17:45:05 -07:00
bunnei
ee099b2697 hle: kernel: KSlabHeap: Allow host or guest allocations.
- Use host allocations for kernel memory, as this is not properly emulated yet.
- Use guest allocations for TLS, as this needs to be backed by DeviceMemory.
2021-05-28 17:42:41 -07:00
bunnei
945effcc75
Merge pull request #6356 from ogniK5377/ApplyNpadSystemCommonPolicy
hid: ApplyNpadSystemCommonPolicy
2021-05-28 10:05:20 -07:00
Lioncash
5554de3933 touchscreen: Make use of common point struct 2021-05-28 08:15:22 -04:00
Lioncash
8171ad65cd common: Extract point into a common struct
This is generic enough that it can be moved into the Common class for
reuse.
2021-05-28 08:12:49 -04:00
Lioncash
210c2c9a56 common/fs/file: Explicitly delete copy constructors
Relocates them to the same place the move equivalents are at for
consistent viewing.
2021-05-28 01:49:40 -04:00
Lioncash
6806a893bd common/fs/file: Devirtualize destructor
IOFile is a final class, so there's no need for a virtual destructor.
2021-05-28 01:47:52 -04:00
Lioncash
019bc9f6b2 common/fs/file: Default initialize IOFile members
Prevents a potential uninitialized read vector in the move constructor.
2021-05-28 01:46:30 -04:00
Morph
c68255f70f applets/swkbd: Make use of std::move where applicable
Avoids redundant string copies
2021-05-27 23:45:56 -04:00