Commit graph

15310 commits

Author SHA1 Message Date
ReinUsesLisp 3a49c1a691 gl_texture_cache: Create base images with sRGB
This breaks accelerated decoders trying to imageStore into images with
sRGB. The decoders are currently disabled so this won't cause issues at
runtime.
2021-01-04 01:54:54 -03:00
FearlessTobi beb951770a Address review comments 2021-01-04 04:36:50 +01:00
xperia64 fd5776aac2 Delete the old log file before rotating (#5675) 2021-01-04 04:33:34 +01:00
Rodrigo Locatti 87a8925523
Merge pull request #5285 from lioncash/error-str
main: Resolve error string not displaying
2021-01-03 19:56:15 -03:00
ReinUsesLisp 974d731926 renderer_vulkan: Rename VKDevice to Device
The "VK" prefix predates the "Vulkan" namespace. It was carried around
the codebase for consistency. "VKDevice" currently is a bad alias with
"VkDevice" (only an upcase character of difference) that can cause
confusion. Rename all instances of it.
2021-01-03 17:51:48 -03:00
Rodrigo Locatti 7265e80c12
Merge pull request #5230 from ReinUsesLisp/vulkan-common
vulkan_common: Move reusable Vulkan abstractions to a separate directory
2021-01-03 17:38:29 -03:00
Lioncash 86592b274e main: Resolve error string not displaying
During the transition to make the error dialog translatable, I
accidentally got rid of the conversion to ResultStatus, which prevented
operator<< from being invoked during formatting.

This adds a function to directly retrieve the result status string
instead so that it displays again.
2021-01-03 13:18:04 -05:00
bunnei 71e18dddbe
Merge pull request #5278 from MerryMage/cpuopt_unsafe_inaccurate_nan
dynarmic: Add Unsafe_InaccurateNaN optimization
2021-01-03 03:27:29 -08:00
bunnei f64456c7e2
Merge pull request #5279 from bunnei/buffer-queue-connect
hle: service: nvflinger: buffer_queue: Do not reset id/layer_id on Connect.
2021-01-03 01:01:38 -08:00
bunnei bf8bd60ab3 Fix the old log file to work with the log parser. 2021-01-03 01:44:52 +01:00
xperia64 f478a57737 Rotate previous log file to '.old' if it exists 2021-01-03 01:44:42 +01:00
bunnei 235b5d27ae
Merge pull request #5267 from lioncash/localize
main: Make the loader error dialog fully translatable
2021-01-02 15:44:32 -08:00
bunnei beaa25d777 hle: service: nvflinger: buffer_queue: Do not reset id/layer_id on Connect.
- This behavior is a mistake, fixes Katana Zero.
2021-01-02 15:42:16 -08:00
MerryMage 57c9da1b39 dynarmic: Add Unsafe_InaccurateNaN optimization 2021-01-02 20:13:21 +00:00
Morph a745d87971 general: Fix various spelling errors 2021-01-02 10:23:41 -05:00
Fernando Sahmkow 53d92318b8 X86/NativeClock: Reimplement RTDSC access to be lock free. 2021-01-02 04:00:27 +01:00
Fernando Sahmkow d4f871cb6a X86/NativeClock: Improve performance of clock calculations on hot path. 2021-01-02 00:43:47 +01:00
bunnei 1ff341f3dc
Merge pull request #5209 from Morph1984/refactor-controller-connect
configure_input: Modify controller connection delay
2021-01-01 13:10:34 -08:00
Morph 904ac1daec configure_input: Modify controller connection delay
Increases the controller connection delay to 60ms and refactors it to attempt to disconnect all controllers prior to connecting all controllers in HID.
2021-01-01 06:39:24 -05:00
MerryMage 6d30745d77 memory: Remove MemoryHook 2021-01-01 11:34:38 +00:00
bunnei eb318ffffc
Merge pull request #5249 from ReinUsesLisp/lock-free-pages
core/memory: Read and write page table atomically
2021-01-01 02:54:01 -08:00
gal20 5dfb8743cb yuzu/main: fix mouse not showing on move and port citra-emu/citra#5476 2020-12-31 21:16:09 +02:00
Lioncash 8c27a74132 main: Make the loader error dialog fully translatable
Makes the dialog fully localizable and also adds disambiguation comments
to help translators understand what the formatting specifiers indicate.
2020-12-31 12:44:31 -05:00
Lioncash 803ac4ca59 main: Tidy up enum comparison
enum classes are comparable with one another, so these casts aren't
necessary.
2020-12-31 10:21:15 -05:00
bunnei 60121d8f28
Merge pull request #5264 from 16-Bit-Dog/patch-1
Make the coding conventions more consistant
2020-12-31 01:46:53 -08:00
bunnei fb41c82aaa
Merge pull request #5265 from german77/port5509
Port citra-emu/citra#5509 "Look at direction of analog axis travel instead of instantaneous sample"
2020-12-30 22:24:30 -08:00
bunnei 25d607f5f6
Merge pull request #5208 from bunnei/service-threads
Service threads
2020-12-30 22:06:05 -08:00
ReinUsesLisp cdbee27692 vulkan_instance: Allow different Vulkan versions and enforce 1.1
For listing the available physical devices we can use Vulkan 1.0.
Now that MoltenVK supports 1.1 we can require it for running games.

Add missing documentation.
2020-12-31 02:07:34 -03:00
ReinUsesLisp 7344a7c447 vk_device: Use an array to report lacking device limits
This makes easier to add and tune the required device limits.
2020-12-31 02:07:34 -03:00
ReinUsesLisp f687392e6f vk_device: Stop initialization when device is not suitable
VKDevice::IsSuitable was not being called. To address this issue, check
suitability before initialization and throw an exception if it fails.

By doing this, we can deduplicate some code on queue searches.
Previosuly we would first search if a present and graphics queue
existed, then on initialization we would search again to find the index.
2020-12-31 02:07:33 -03:00
ReinUsesLisp 53ea06dc17 renderer_vulkan: Remove two step initialization on VKDevice
The Vulkan device abstraction either initializes successfully on the
constructor or throws a Vulkan exception.
2020-12-31 02:07:33 -03:00
ReinUsesLisp 085adfea00 renderer_vulkan: Throw when enumerating devices fails
Report device enumeration errors with exceptions to be consistent with
other initialization related function calls. Reduces the amount of code
to maintain.
2020-12-31 02:07:33 -03:00
ReinUsesLisp 11f0f7598d renderer_vulkan: Initialize surface in separate file
Move surface initialization code to a separate file. It's unlikely to
use this code outside of Vulkan, but keeping platform-specific code
(Win32, Xlib, Wayland) in its own translation unit keeps things cleaner.
2020-12-31 02:07:33 -03:00
ReinUsesLisp dce8720780 renderer_vulkan: Catch and report exceptions
Move more Vulkan code to report errors with exceptions and report them
through a log before notifying it with an error boolean for backwards
compatibility. In the future we can replace the rasterizer two-step
initialization to always use exceptions.
2020-12-31 02:07:33 -03:00
ReinUsesLisp 47843b4f09 renderer_vulkan: Create debug callback on separate file and throw
Initialize debug callbacks (messenger) from a separate file. This allows
sharing code with different backends.

Change our Vulkan error handling to use exceptions instead of error
codes, simplifying the initialization process.
2020-12-31 02:07:33 -03:00
ReinUsesLisp 25f88d99ce renderer_vulkan: Move instance initialization to a separate file
Simplify Vulkan's backend initialization code by moving it to a separate
file, allowing us to initialize a Vulkan instance from different
backends.
2020-12-31 02:07:33 -03:00
ReinUsesLisp d1435009ed vulkan_common: Rename renderer_vulkan/wrapper.h to vulkan_common/vulkan_wrapper.h
Allows sharing Vulkan wrapper code between different rendering backends.
2020-12-31 02:07:14 -03:00
ReinUsesLisp d937421422 vulkan_common: Move dynamic library load to a separate file
Allows us to initialize a Vulkan dynamic library from different backends
without duplicating code.
2020-12-31 02:02:48 -03:00
german aa4c7687ee Port citra-emu/citra#5509 2020-12-30 22:29:20 -06:00
16-Bit-Dog fa5a1a4bfd
Make the coding conventions more consistant
lut_index had 0 added when nothing was supposed to be added

despite this, index was not added to 0 when nothing was supposed to be added...
2020-12-30 19:03:26 -05:00
Lioncash bcafef4b94 half_set: Resolve -Wmaybe-uninitialized warnings 2020-12-30 17:59:42 -05:00
Lioncash f0d9ab0717 maxwell_to_vk: Initialize usage variable in SurfaceFormat()
Silences a -Wmaybe-uninitialized warning
2020-12-30 13:25:03 -05:00
LC da07977db0
Merge pull request #5251 from ReinUsesLisp/wuninitialized
cmake: Enforce -Wuninitialized
2020-12-30 06:34:42 -05:00
ReinUsesLisp 9764c13d6d video_core: Rewrite the texture cache
The current texture cache has several points that hurt maintainability
and performance. It's easy to break unrelated parts of the cache
when doing minor changes. The cache can easily forget valuable
information about the cached textures by CPU writes or simply by its
normal usage.The current texture cache has several points that hurt
maintainability and performance. It's easy to break unrelated parts
of the cache when doing minor changes. The cache can easily forget
valuable information about the cached textures by CPU writes or simply
by its normal usage.

This commit aims to address those issues.
2020-12-30 03:38:50 -03:00
ReinUsesLisp ac2e2ebe97 cmake: Enforce -Wuninitialized 2020-12-30 02:58:58 -03:00
ReinUsesLisp 157fc2d785 service/pcie: Fix invalid initialization argument 2020-12-30 02:58:38 -03:00
ReinUsesLisp 9106ac1e6b video_core: Add a delayed destruction ring abstraction 2020-12-30 02:10:19 -03:00
ReinUsesLisp 21b18057f7 host_shaders: Add Vulkan assembler compute shaders 2020-12-30 02:03:50 -03:00
ReinUsesLisp 87ff58b1d7 host_shaders: Add helper to blit depth stencil fragment shader 2020-12-30 02:02:07 -03:00
ReinUsesLisp ae5725b709 host_shaders: Add texture color blit fragment shader 2020-12-30 02:00:48 -03:00
ReinUsesLisp 64fbf319f1 host_shaders: Add shaders to present to the swapchain 2020-12-30 01:59:12 -03:00
ReinUsesLisp 82b7daed9c host_shaders: Add shaders to convert between depth and color images 2020-12-30 01:48:44 -03:00
ReinUsesLisp dc81a90640 host_shaders: Add compute shader to copy BC4 as RG32UI to RGBA8 2020-12-30 01:47:08 -03:00
ReinUsesLisp 5169ce9fcd host_shaders: Add shader to render a full screen triangle 2020-12-30 01:44:09 -03:00
ReinUsesLisp 59c46f9de9 host_shaders: Add pitch linear upload compute shader 2020-12-30 01:41:42 -03:00
ReinUsesLisp 12d16248dd host_shaders: Add block linear upload compute shaders 2020-12-30 01:39:35 -03:00
ReinUsesLisp f20e18f60d host_shaders: Add copyright headers to OpenGL present shaders 2020-12-30 01:35:56 -03:00
ReinUsesLisp 95d156a150 video_core/host_shaders: Add support for prebuilt SPIR-V shaders
Add support for building SPIR-V shaders from GLSL and generating headers
to include the text of those same GLSL shaders to consume from OpenGL.
2020-12-30 01:29:07 -03:00
ReinUsesLisp b3587102d1 core/memory: Read and write page table atomically
Squash attributes into the pointer's integer, making them an uintptr_t
pair containing 2 bits at the bottom and then the pointer. These bits
are currently unused thanks to alignment requirements.

Configure Dynarmic to mask out these bits on pointer reads.

While we are at it, remove some unused attributes carried over from
Citra.

Read/Write and other hot functions use a two step unpacking process that
is less readable to stop MSVC from emitting an extra AND instruction in
the hot path:

 mov         rdi,rcx
 shr         rdx,0Ch
 mov         r8,qword ptr [rax+8]
 mov         rax,qword ptr [r8+rdx*8]
 mov         rdx,rax
-and         al,3
 and         rdx,0FFFFFFFFFFFFFFFCh
 je          Core::Memory::Memory::Impl::Read<unsigned char>
 mov         rax,qword ptr [vaddr]
 movzx       eax,byte ptr [rdx+rax]
2020-12-29 21:54:49 -03:00
bunnei 85cfd96f62
Merge pull request #5247 from comex/xx-concepts
k_priority_queue: Fix concepts use
2020-12-29 16:50:20 -08:00
bunnei 82e0eeed21 hle: kernel: service_thread: Make thread naming more consistent. 2020-12-29 16:46:29 -08:00
bunnei a2a0f5318d hle: kernel: Manage service threads on another thread.
- This is to allow service threads to defer destruction of themselves.
2020-12-29 16:46:29 -08:00
bunnei 69e82d01d5 common: ThreadWorker: Add class to help do asynchronous work. 2020-12-29 16:46:29 -08:00
bunnei b02464f685
Merge pull request #5246 from comex/xx-include
Add missing include of "core/hle/kernel/kernel.h"
2020-12-29 16:43:17 -08:00
bunnei c192da3f82 hle: kernel: Manage host thread IDs using TLS.
- Avoids the need to have a large map of host to guest thread IDs.
2020-12-29 15:55:30 -08:00
comex 388cf58b31 k_priority_queue: Fix concepts use
- For `std::same_as`, add missing include of `<concepts>`.

- For `std::convertible_to`, create a replacement in `common/concepts.h`
  and use that instead.

  This would also be found in `<concepts>`, but unlike `std::same_as`,
  `std::convertible_to` is not yet implemented in libc++, LLVM's STL
  implementation - not even in master.  (In fact, `std::same_as` is the
  *only* concept currently implemented.  For some reason.)
2020-12-29 14:33:41 -05:00
comex b36896b90e Add missing include of "core/hle/kernel/kernel.h"
This is needed as the header invokes methods on KernelCore.
2020-12-29 14:22:35 -05:00
LC aa87278bf0
Merge pull request #5245 from ameerj/sleepthread-log
svc: demote SleepThread log to LOG_TRACE
2020-12-29 14:03:24 -05:00
ameerj 0383363a8f svc: demote SleepThread log to LOG_TRACE
This log is called often, and introduces a lot of noise when debug logging is enabled, making it difficult to see other debug logs.
2020-12-29 14:01:56 -05:00
bunnei 22ba437aa4
Merge pull request #5236 from gal20/udp_client_patch
input_common: process udp packets only for the correct pad
2020-12-29 02:51:40 -08:00
bunnei dfdac7d38a hle: kernel: Move ServiceThread ownership to KernelCore.
- Fixes a circular dependency which prevented threads from being released on shutdown.
2020-12-29 01:12:39 -08:00
bunnei f57be2e626 hle: kernel: service_thread: Add thread name and take weak_ptr of ServerSession. 2020-12-29 01:06:39 -08:00
bunnei 7d77a3f88f hle: service: Acquire and release a lock on requests.
- This makes it such that we can safely access service members from CoreTiming thread.
2020-12-28 21:33:34 -08:00
bunnei c7a06908ae audio_core: stream: Ensure buffer is valid before release. 2020-12-28 21:33:34 -08:00
bunnei 06f8c3dc01 core: Do not reset device_memory on shutdown.
- This will be reset on initialization.
2020-12-28 21:33:34 -08:00
bunnei d0649d0971 core: hle: kernel: Clear process list on boot. 2020-12-28 21:33:34 -08:00
bunnei 954341763a gpu: gpu_thread: Ensure MicroProfile is shutdown on exit. 2020-12-28 21:33:34 -08:00
bunnei 994a9fec4e hle: service: vi: Refactor to grab buffer only once. 2020-12-28 21:33:34 -08:00
bunnei 6433b1dfd6 service: nvflinger: Improve synchronization for BufferQueue.
- Use proper mechanisms for blocking on DequeueBuffer.
- Ensure service thread terminates on emulation Shutdown.
2020-12-28 21:33:34 -08:00
bunnei bea51d948d hle: service: Ensure system is powered on before writing IPC result. 2020-12-28 16:33:48 -08:00
bunnei 6d2f9428c5 core: kernel: Clear process list earlier. 2020-12-28 16:33:48 -08:00
bunnei 4991620f89 video_core: gpu_thread: Do not wait when system is powered down. 2020-12-28 16:33:48 -08:00
bunnei 916438a9de core: settings: Untangle multicore from asynchronous GPU.
- Now that GPU is always threaded, we can support multicore with synchronous GPU.
2020-12-28 16:33:48 -08:00
bunnei 40571c073f video_core: gpu: Implement synchronous mode using threaded GPU. 2020-12-28 16:33:48 -08:00
bunnei 14c825bd1c video_core: gpu: Refactor out synchronous/asynchronous GPU implementations.
- We must always use a GPU thread now, even with synchronous GPU.
2020-12-28 16:33:48 -08:00
bunnei 5d4715cc6a hle: kernel: hle_ipc: Remove SleepClientThread.
- This was kind of hacky, and no longer is necessary with service threads.
2020-12-28 16:33:48 -08:00
bunnei 87d6588cb5 hle: service: bsd: Update to work with service threads, removing SleepClientThread. 2020-12-28 16:33:48 -08:00
bunnei 0c81b83ca9 hle: service: nvdrv: Revert #4981 to remove usage of SleepClientThread.
- Note, this always processes the ioctl right away, which fixes BotW 1.0.0 issues.
2020-12-28 16:33:48 -08:00
bunnei 8bc3d66354 hle: kernel: service_thread: Add parameter for thread pool size. 2020-12-28 16:33:47 -08:00
bunnei 19a8f03ad5 hle: service: nvflinger: Refactor locking and interfaces. 2020-12-28 16:33:47 -08:00
bunnei b377da042b hle: service: vi: Remove usage of SleepClientThread. 2020-12-28 16:33:47 -08:00
bunnei 28281ae250 core: hle: server_session: Use separate threads for each service connection. 2020-12-28 16:33:47 -08:00
gal20 1defd0847a udp client: process packets only for the correct pad 2020-12-27 22:22:48 +02:00
german 80fece4e08 Allow to invert analog axis with right click 2020-12-26 17:46:14 -06:00
ReinUsesLisp 661483f313 renderer_vulkan/fixed_pipeline_state: Move enabled bindings to static state
Without using VK_EXT_robustness2, we can't consider the 'enabled' (not
null) vertex buffers as dynamic state, as this leads to invalid Vulkan
state. Move this to static state that is always hashed and compared in
the pipeline key.

The bits for enabled vertex buffers are moved into the attribute state
bitfield. This is not 'correct' as it's not an attribute state, but that
struct has bits to spare, and it's used in an array of 32 elements (the
exact same number of vertex buffer bindings).
2020-12-25 23:34:38 -03:00
Morph ff3aa5d380 yuzu/main: Add basic command line arguments
The following command line arguments are supported:

yuzu.exe "path_to_game" - Launches a game at "path_to_game"
yuzu.exe -f - Launches the next game in fullscreen
yuzu.exe -g "path_to_game" - Launches a game at "path_to_game"
yuzu.exe -f -g "path_to_game" - Launches a game at "path_to_game" in fullscreen
2020-12-25 15:41:00 -05:00
Rodrigo Locatti 0dc4ab42cc
Merge pull request #5226 from ReinUsesLisp/c4715-vc
video_core: Enforce C4715 (not all control paths return a value)
2020-12-25 03:11:47 -03:00
Rodrigo Locatti 453560fb3a
Merge pull request #5225 from ReinUsesLisp/always-vulkan
cmake: Always enable Vulkan
2020-12-25 02:52:29 -03:00
bunnei c8a4967c9d
core: memory: Ensure thread safe access when pages are rasterizer cached (#5206)
* core: memory: Ensure thread safe access when pages are rasterizer cached.
2020-12-24 21:51:49 -08:00
ReinUsesLisp 1b9e08ab78 cmake: Always enable Vulkan
Removes the unnecesary burden of maintaining separate #ifdef paths and
allows us sharing generic Vulkan code across APIs.
2020-12-24 21:07:24 -03:00
ReinUsesLisp 1e191cc837 video_core: Enforce C4715 (not all control paths return a value)
Most of the time people write code that always returns a value,
terminates execution, throws an exception, or uses an unconventional
jump primitive.

This is not always true when we build without asserts on mainline builds.
To avoid introducing undefined behavior on our most used builds, enforce
this warning signalling an error and stopping the build from shipping.
2020-12-24 21:01:23 -03:00
ReinUsesLisp 5dbda22659 vk_shader_decompiler: Silence warning when compiling without asserts 2020-12-24 21:01:09 -03:00
bunnei 5836530a87
Merge pull request #5217 from lat9nq/save-on-boot
yuzu/main: Save settings when starting guest
2020-12-23 01:45:24 -08:00
lat9nq 17badbc442 yuzu/main: Improve menubar access keys
Adds a unique access key to each action within each menu. A few actions
already had their own access key, so those were untouched.
2020-12-22 19:32:58 -05:00
german 64fad8cfe9 Add option to reset window size to 1080p 2020-12-22 17:06:48 -06:00
bunnei 29ccc7673f
Merge pull request #5042 from Morph1984/project-aether
Project Aether: Reimplementation of the Web Browser Applet
2020-12-21 23:47:10 -08:00
lat9nq c243932b41 yuzu/main: Save settings when starting guest
Saves UISettings and Settings when booting a guest. Moves updating
UISettings::values from GMainWindow::closeEvent into its own function,
then reuses it in GMainWindow::BootGame.
2020-12-22 02:29:30 -05:00
bunnei 1279c7ce7a
Merge pull request #5131 from bunnei/scheduler-rewrite
Rewrite Kernel scheduler based on Atmosphere
2020-12-20 20:57:54 -08:00
bunnei c3e201a829
Merge pull request #5201 from ameerj/bufferq-refactor
vi/buffer_queue: Buffer queue management refactor
2020-12-20 15:48:39 -08:00
FearlessTobi 10b0ab7926 yuzu: Remove gdbstub configuration
The gdbstub itself was removed with https://github.com/yuzu-emu/yuzu/pull/5028.
This PR just removes the remaining gdb configuration code from the emulator and the UI.
2020-12-19 19:19:42 +01:00
Morph 82fa9f8d56 applets/web: Implement the online web browser applet 2020-12-18 10:33:28 -05:00
Morph 51cddcb8b8 applets/web: Fix keyboard to emulated controller input 2020-12-18 10:33:28 -05:00
Morph 2ddd83cdfe main: Add the ability to disable the web applet
This should only be used for Super Mario 3D All-Stars. This is a temporary solution until it can be implemented properly.
2020-12-18 10:33:28 -05:00
Morph 8b95bf041d main, applets/web: Re-add progress dialog for RomFS extraction 2020-12-18 10:33:28 -05:00
Morph 93cb783853 applets/web: Implement the Qt web browser applet frontend 2020-12-18 10:33:28 -05:00
Morph d5e0923e3d web_browser_scripts: Add injection scripts for the web browser 2020-12-18 10:33:28 -05:00
Morph d46ca5a015 pl_u, applets/web: Decrypt shared fonts to TTF files 2020-12-18 10:33:28 -05:00
Morph 46183294b2 ns_vm: Stub NeedsUpdateVulnerability
This is used to force system updates on launching the web browser. We do not care about system updates so this can be set to false.
2020-12-18 10:33:28 -05:00
Morph f9653a4417 frontend/input_interpreter: Add InputInterpreter API
The InputInterpreter class interfaces with HID to retrieve button press states. Input is intended to be polled every 50ms so that a button is considered to be held down after 400ms has elapsed since the initial button press and subsequent repeated presses occur every 50ms.

Co-authored-by: Chloe <25727384+ogniK5377@users.noreply.github.com>
2020-12-18 10:33:28 -05:00
Morph 54ea3c47c8 controllers/npad: Make press_state atomic 2020-12-18 10:33:28 -05:00
Morph 5836786246 util: Add URL Request Interceptor for QWebEngine 2020-12-18 10:33:28 -05:00
Morph 51a7681957 bootmanager: Add a check whether loading is complete 2020-12-18 10:33:28 -05:00
Morph d6d1a8e02c applets/web: Implement the default web browser applet frontend 2020-12-18 10:33:28 -05:00
Morph 89df483567 applets/web: Implement the offline browser applet backend 2020-12-18 10:33:27 -05:00
Morph a5750f437d applets/web: Initial implementation of the web browser applet 2020-12-18 10:33:27 -05:00
Morph ccb439efb0 applets: Remove the previous web browser applet implementation 2020-12-18 10:33:27 -05:00
Morph 79316be18c system_archive: Add + and - buttons to the Nintendo Extended OSS font 2020-12-18 02:55:48 -05:00
ameerj 873ad1272e buffer_queue: better use of std::array 2020-12-18 00:12:14 -05:00
ameerj 8cb683f3b9 Overwrite slots instead of queuing them, add disconnect signal
Fix for Katana Zero and Yoshi's Crafted World
2020-12-17 14:22:46 -05:00
Morph 5d29d2111c system_archive: Update Nintendo Extended OSS font
Co-authored-by: Its-Rei <kupfel@gmail.com>
2020-12-17 08:58:13 -05:00
bunnei f3db273753
Merge pull request #5190 from Morph1984/validate_device_handle
controllers/npad: Validate device handles before use
2020-12-15 16:40:11 -08:00
bunnei 2e1b998d5e
Merge pull request #5119 from Morph1984/fs-opendatastoragewithprogramindex
fsp_srv: Implement OpenDataStorageWithProgramIndex
2020-12-15 11:07:03 -08:00
bunnei 37bec068c2
Merge pull request #5157 from lioncash/array-dirty
maxwell_3d: Remove unused dirty_pointer array
2020-12-15 00:35:47 -08:00
bunnei df6427d30b
Merge pull request #5168 from Morph1984/aoc-PurchaseEventManager
aoc_u: Stub IPurchaseEventManager and its service commands
2020-12-14 16:08:38 -08:00
lat9nq 292dd642ce cmake: Fix generating CMake configs and linking with Boost
Fixes regression by 761206cf81, causing
yuzu to not build on Linux with any version of Boost except a cached
1.73 Conan version from before about a day ago.

Moves the Boost requirement out of the `REQUIRED_LIBS` psuedo-2D-array
for Conan to instead be manually configured, using Conan as a fallback
solution if the system does not meet our requirements.

Requires any update from the linux-fresh container in order to build.

**DO NOT MERGE** until someone with the MSVC toolchain can verify this
works there, too.
2020-12-13 01:28:51 -05:00
bunnei 761206cf81
common: Update CMakeList to fix build issue with Boost. 2020-12-12 11:50:07 -08:00
Morph 1c773c0869 controllers/npad: Validate device handles before use
Some games such as NEKOPARA Vol. 3 send invalid device handles when calling InitializeVibrationDevice. Introduce a check to validate the device handle before use.
2020-12-12 07:05:38 -05:00
bunnei 69b46dd607
Merge pull request #5183 from lioncash/alias2
vfs: Use existing type aliases consistently
2020-12-12 01:54:28 -08:00
bunnei c918c6480f
Merge pull request #5187 from Morph1984/revert-stdfs
fs: Revert all std::filesystem changes
2020-12-11 20:07:37 -08:00
bunnei 37194dd4e9
Merge pull request #5172 from lioncash/svc-wide
svc: Remove unnecessary casts
2020-12-11 17:39:30 -08:00
Morph 4de079b256 Revert "Merge pull request #5173 from lioncash/common-fs"
This reverts commit ce5fcb6bb2, reversing
changes made to 6f41763061.
2020-12-11 20:24:22 -05:00
Morph 8941cdb7d2 Revert "Merge pull request #5174 from ReinUsesLisp/fs-fix"
This reverts commit 5fe55b16a1, reversing
changes made to e94dd7e2c4.
2020-12-11 20:24:22 -05:00
Morph dfee6321cd Revert "Merge pull request #5176 from Morph1984/fix-createfile"
This reverts commit 6d6115475b, reversing
changes made to 5fe55b16a1.
2020-12-11 20:24:22 -05:00
Morph 0195038c07 Revert "Merge pull request #5179 from ReinUsesLisp/fs-path"
This reverts commit 4e94d0d53a, reversing
changes made to 6d6115475b.
2020-12-11 20:21:46 -05:00
Morph ac3ec5ed13 Revert "Merge pull request #5181 from Morph1984/5174-review"
This reverts commit cdb36aef9e, reversing
changes made to 5e9b77129f.
2020-12-11 20:21:21 -05:00
bunnei cdb36aef9e
Merge pull request #5181 from Morph1984/5174-review
common/file_util: Address review comments of #5174
2020-12-10 15:52:11 -08:00
bunnei 2d47a5fd41
Merge pull request #5123 from Morph1984/nim-IsLargeResourceAvailable
nim: Stub IsLargeResourceAvailable
2020-12-10 11:34:18 -08:00
bunnei d1a2b3fb18
Merge pull request #5162 from lioncash/copy-shader
gl_shader_decompiler: Elide unnecessary copies within DeclareConstantBuffers()
2020-12-10 00:11:11 -08:00
Lioncash b1657b8c6b vfs: Use existing type aliases consistently
Makes use of the VirtualDir and VirtualFile aliases across the board
instead of having a few isolated places that don't use it.
2020-12-10 01:44:43 -05:00
Morph ec8548b414 common/file_util: Simplify the behavior of CreateFullPath 2020-12-09 19:28:11 -05:00
ReinUsesLisp bab9cae71f common/file_util: Let std::filesystem cast from UTF16 to std::string
Fix invalid encoding paths when iterating over a directory on Windows.
2020-12-09 18:52:36 -03:00
Morph b06d6e3646 vfs_real: Fix CreateFile for files without a file extension 2020-12-09 06:34:49 -05:00
ReinUsesLisp 5329834376 common/file_util: Fix and deprecate CreateFullPath, add CreateDirs
Fix CreateFullPath to have its intended previous behavior (whatever
that was), and deprecate it in favor of the new CreateDirs function.

Unlike CreateDir, CreateDirs is marked as [[nodiscard]] to avoid new
code ignoring its result value.
2020-12-09 05:42:03 -03:00
ReinUsesLisp 52f13f2339 common/file_util: Succeed on CreateDir when the directory exists 2020-12-09 05:21:08 -03:00
Rodrigo Locatti e94dd7e2c4
Merge pull request #5142 from comex/xx-poll-events
network, sockets: Replace `POLL_IN`, `POLL_OUT`, etc. constants with an `enum class PollEvents`
2020-12-09 03:52:20 -03:00
Rodrigo Locatti ce5fcb6bb2
Merge pull request #5173 from lioncash/common-fs
common/file_util: Make use of std::filesystem
2020-12-09 03:47:21 -03:00
Lioncash 20aad9e01a file_util: Migrate remaining file handling functions over to std::filesystem
Converts creation and deletion functions over to std::filesystem,
simplifying our file-handling code.

Notably with this, CopyDir will now function on Windows.
2020-12-09 01:24:05 -05:00
bunnei 6f41763061
Merge pull request #5166 from lioncash/log-cast
core: Remove unnecessary enum casts in log calls
2020-12-08 21:58:13 -08:00
bunnei 05a703e15d
Merge pull request #5135 from Morph1984/applets-shadow
applets: Resolve variable shadowing
2020-12-08 17:43:59 -08:00
Lioncash 0e54aa17e6 file_util: Migrate Exists() and IsDirectory() over to std::filesystem
Greatly simplifies our file-handling code for these functions.
2020-12-08 18:36:53 -05:00
Lioncash 2de124e223 svc: Remove unnecessary casts
Simplifies and removes some casts. In all cases, these were generally
widening from a 32-bit unsigned type to a 64-bit unsigned type, so no
information would be lost from the conversion.
2020-12-08 15:42:10 -05:00
bunnei 6057dc46e5
Merge pull request #5167 from lioncash/doc-memory
memory: Resolve -Wdocumentation warning for Write()
2020-12-08 11:47:04 -08:00
Morph deff708cbe IPurchaseEventManager: Implement GetPurchasedEventReadableHandle
- Used by Pokémon Café Mix
- Used by DOOM: Eternal
2020-12-08 13:39:19 -05:00
Morph a9cfe06aaf IPurchaseEventManager: Stub Set(Default)DeliveryTarget
- Used by Pokémon Café Mix
- Used by DOOM: Eternal
2020-12-08 13:39:13 -05:00
Morph 009bdb3558 aoc_u: Stub Create(Permanent)EcPurchasedEventManager
- Used by Pokémon Café Mix
- Used by DOOM: Eternal
2020-12-08 13:39:07 -05:00
Lioncash a44ff5ed31 memory: Resolve -Wdocumentation warning for Write()
Write() doesn't return anything, so the @returns tag shouldn't be
present.
2020-12-08 12:44:58 -05:00
bunnei 00c6254129
Merge pull request #5156 from comex/xx-raws
configure_motion_touch: Fix unescaped backslash in regex
2020-12-08 09:39:47 -08:00
Morph e15039372e fsp_srv: Implement OpenDataStorageWithProgramIndex
- Used by RollerCoaster Tycoon 3: Complete Edition
2020-12-08 08:19:05 -05:00
Morph 0eb6c6cd83 file_sys: Consolidate common Title ID operations 2020-12-08 08:19:05 -05:00
Morph 51e6f8271a
Merge pull request #5165 from lioncash/copy-controller
controller: Avoid unnecessary copies in ConfigurationComplete()
2020-12-08 20:48:45 +08:00
Lioncash 6b7320add4 core: Remove unnecessary enum casts in log calls
Follows the video core PR. fmt doesn't require casts for enum classes
anymore, so we can remove quite a few casts.
2020-12-07 23:02:23 -05:00
Lioncash 215cfbb757 controller: Use std::move within ConvertToFrontendParameters()
Avoids unnecessary copies.
2020-12-07 22:04:16 -05:00
Lioncash 97dd67ad1c controller: Avoid unnecessary copies in ConfigurationComplete()
Avoids unnecessary 1072 byte copies when querying info about
controllers.
2020-12-07 22:02:58 -05:00
Morph 607bb8d14b
Merge pull request #5020 from german77/AnalogfromButtonFix
Disable analog joystick from buttons by default
2020-12-08 10:30:21 +08:00
german b57ba7bfb6 Disable analog joystick from buttons by default 2020-12-07 19:34:52 -06:00
Rodrigo Locatti 3415890dd5
Merge pull request #5164 from lioncash/contains
video_core: Make use of ordered container contains() where applicable
2020-12-07 21:55:51 -03:00
Rodrigo Locatti 4bd74ed4c7
Merge pull request #5163 from lioncash/concat
ast: Improve string concat readability in operator()
2020-12-07 21:55:21 -03:00
bunnei f782aecf4d
Merge pull request #5153 from comex/xx-unix
CMakeLists,network: Create YUZU_UNIX macro to replace __unix__
2020-12-07 15:32:06 -08:00
Lioncash 09fa1d6a73 video_core: Make use of ordered container contains() where applicable
With C++20, we can use the more concise contains() member function
instead of comparing the result of the find() call with the end
iterator.
2020-12-07 16:30:39 -05:00
Lioncash 45c5b084fd ast: Improve string concat readability in operator()
Provides an in-place format string to make it more pleasant to read.
2020-12-07 16:15:28 -05:00
Lioncash edcbd47800 gl_shader_decompiler: Elide unnecessary copies within DeclareConstantBuffers()
Resolves a -Wrange-loop-analysis warning.
2020-12-07 14:01:52 -05:00
bunnei 5cd051eced
Merge pull request #5149 from comex/xx-map-interval
map_interval: Change field order to address uninitialized field warning
2020-12-07 10:14:02 -08:00
Rodrigo Locatti 12f3b13995
Merge pull request #5159 from lioncash/move-amend
shader_ir: std::move node within DeclareAmend()
2020-12-07 04:58:01 -03:00
Lioncash 5d2f18fbcd buffer_block: Mark interface as nodiscard where applicable
Prevents logic errors from occurring from unused values.
2020-12-07 01:53:40 -05:00
Lioncash 3954f14c6d buffer_block: Remove unnecessary includes
Reduces the amount of dependencies the header pulls in.
2020-12-07 01:52:16 -05:00
Rodrigo Locatti 9ae6224f12
Merge pull request #5158 from lioncash/video-fmt
video_core: Remove unnecessary enum class casting in logging messages
2020-12-07 03:35:25 -03:00
bunnei a58d57a60d
Merge pull request #5148 from comex/xx-unused-fields
core: Mark unused fields as [[maybe_unused]]
2020-12-06 22:33:00 -08:00
bunnei 24cabf5e2f
Merge pull request #5154 from comex/xx-ipc
hle: Type check ResponseBuilder::Push arguments, and fix use in vi.cpp
2020-12-06 22:32:04 -08:00
Lioncash 7234f436aa shader_ir: std::move node within DeclareAmend()
Same behavior, but elides an unnecessary atomic reference count
increment and decrement.
2020-12-07 00:51:03 -05:00
Lioncash 4c5f5c9bf3 video_core: Remove unnecessary enum class casting in logging messages
fmt now automatically prints the numeric value of an enum class member
by default, so we don't need to use casts any more.

Reduces the line noise a bit.
2020-12-07 00:41:50 -05:00
LC 8a00a0ade6
Merge pull request #5147 from comex/xx-purevirt
nvdrv: Remove useless re-declaration of pure virtual methods that were already declared in the superclass
2020-12-07 00:08:46 -05:00
LC 43f0b42088
Merge pull request #5150 from comex/xx-boxcat
boxcat: Avoid unnecessary object copy
2020-12-07 00:07:39 -05:00
LC 23aabe85e6
Merge pull request #5152 from comex/xx-override
renderer_vulkan: Add missing `override` specifier
2020-12-07 00:07:17 -05:00
LC 69af6ada2f
Merge pull request #5136 from lioncash/video-shadow3
video_core: Resolve more variable shadowing scenarios pt.3
2020-12-07 00:06:53 -05:00
Lioncash 9e7a1f1351 maxwell_3d: Move member variables to end of class
Follows our established coding style.
2020-12-06 20:56:00 -05:00
Lioncash ce0712bf95 maxwell_3d: Resolve -Wdocumentation warning
Removes a documentation comment for a non-existent member.
2020-12-06 20:48:12 -05:00
Lioncash bcc5c4403a maxwell_3d: Remove unused dirty_pointer array
This is unused and removing it shrinks the structure by 3584 bytes.
2020-12-06 20:46:57 -05:00
comex 2dce2be138 configure_motion_touch: Fix unescaped backslash in regex
Since this is inside a string literal, backslashes that are part of
regex syntax have to be escaped.  But that's ugly, so convert to a raw
string instead.
2020-12-06 19:25:48 -05:00
comex 0791082b43 network, sockets: Replace POLL_IN, POLL_OUT, etc. constants with an enum class PollEvents
Actually, two enum classes, since for some reason there are two separate
yet identical `PollFD` types used in the codebase.  I get that one is
ABI-compatible with the Switch while the other is an abstract type used
for the host, but why not use `WSAPOLLFD` directly for the latter?

Anyway, why make this change?  Because on Apple platforms, `POLL_IN`,
`POLL_OUT`, etc. (with an underscore) are defined as macros in
<sys/signal.h>.  (This is inherited from FreeBSD.)  So defining
a variable with the same name causes a compile error.

I could just rename the variables, but while I was at it I thought I
might as well switch to an enum for stronger typing.

Also, change the type used for values copied directly to/from the
`events` and `revents` fields of the host *native*
`pollfd`/`WSASPOLLFD`, from `u32` to `short`, as `short` is the correct
canonical type on both Unix and Windows.
2020-12-06 19:14:42 -05:00
comex e31cb50405 Fix "explicitly defaulted but implicitly deleted" warning
`PhysicalCore`'s move assignment operator was declared as `= default`,
but was implicitly deleted because `PhysicalCore` has fields
of reference type.  Switch to explicitly deleting it to avoid a Clang
warning.

The move *constructor* is still defaulted, and is required to exist due
to the use of `std::vector<PhysicalCore>`.
2020-12-06 19:02:04 -05:00
comex 3373149fdc hle: Type check ResponseBuilder::Push arguments, and fix use in vi.cpp
- Add a type check so that calling Push with an invalid type produces a
  compile error rather than a linker error.

- vi.cpp was calling Push with a variable of type `std::size_t`.
  There's no explicit overload for `size_t`, but there is one for `u64`,
  which on most platforms is the same type as `size_t`.  On macOS,
  however, it isn't: both types are 64 bits, but `size_t` is `unsigned
  long` and `u64` is `unsigned long long`.  Regardless, it makes more
  sense to explicitly use `u64` here instead of `size_t`.
2020-12-06 18:59:22 -05:00
comex 0e122c13ad CMakeLists,network: Create YUZU_UNIX macro to replace __unix__
__unix__ is not predefined on Apple platforms even though they are Unix.
2020-12-06 18:56:40 -05:00
comex eea5122d1b renderer_vulkan: Add missing override specifier 2020-12-06 18:38:52 -05:00
comex b8fbf6969c map_interval: Change field order to address uninitialized field warning
Clang complains about `new_chunk`'s constructor using the
then-uninitialized `first_chunk` (even though it's just to get a pointer
into it).
2020-12-06 18:37:23 -05:00
comex feac654ba0 core: Mark unused fields as [[maybe_unused]] 2020-12-06 18:36:10 -05:00
comex 5cb1a343d1 boxcat: Avoid unnecessary object copy 2020-12-06 18:31:13 -05:00
comex 716ae72aac nvdrv: Remove useless re-declaration of pure virtual methods that were already declared in the superclass 2020-12-06 18:24:33 -05:00
comex d637114c17 video_core: Adjust NUM macro to avoid Clang warning
The previous definition was:

    #define NUM(field_name) (sizeof(Maxwell3D::Regs::field_name) / sizeof(u32))

In cases where `field_name` happens to refer to an array, Clang thinks
`sizeof(an array value) / sizeof(a type)` is an instance of the idiom
where `sizeof` is used to compute an array length.  So it thinks the
type in the denominator ought to be the array element type, and warns if
it isn't, assuming this is a mistake.

In reality, `NUM` is not used to get array lengths at all, so there is no
mistake.  Silence the warning by applying Clang's suggested workaround
of parenthesizing the denominator.
2020-12-06 18:24:16 -05:00
Rodrigo Locatti 7e5f595b31
Merge pull request #5143 from comex/xx-users-size
yuzu_cmd: Remove 'users_size'
2020-12-06 19:34:53 -03:00
Rodrigo Locatti 88959b0047
Merge pull request #5141 from comex/xx-true-false
maxwell_dma: Rename RenderEnable::Mode::FALSE and TRUE to avoid name conflict
2020-12-06 19:34:24 -03:00
bunnei dd05c7ec79
Merge pull request #5140 from FearlessTobi/port-5577
Port citra-emu/citra#5577: "Update cubeb and request a persistent stream session"
2020-12-06 01:53:02 -08:00
bunnei 53a04d6b5d
Merge pull request #5132 from lioncash/xbyak-abi
xbyak_abi: Avoid implicit sign conversions
2020-12-06 01:22:43 -08:00
bunnei 1bdb756d28 hle: kernel: Process: Various style fixes based on code review feedback. 2020-12-06 00:27:13 -08:00
bunnei d4ae0ae0e9 core: cpu_manager: Fix a typo in PreemptSingleCore, which broke many games.
- We were reload'ing the old current scheduler, which may have changed.
2020-12-06 00:27:13 -08:00
bunnei 9b492430bb hle: kernel: Thread: Various style fixes based on code review feedback. 2020-12-06 00:27:13 -08:00
bunnei ed4d1e2ade hle: kernel: KScopedSchedulerLockAndSleep: Various style fixes based on code review feedback. 2020-12-06 00:27:13 -08:00
bunnei b1b4f2337e hle: kernel: KScopedLock: Various style fixes based on code review feedback. 2020-12-06 00:27:13 -08:00
bunnei 165d8485f0 hle: kernel: KAbstractSchedulerLock: Various style fixes based on code review feedback. 2020-12-06 00:27:13 -08:00
bunnei 960500cfd2 hle: kernel: KScheduler: Various style fixes based on code review feedback. 2020-12-06 00:27:13 -08:00
bunnei 8fd921557f hle: kernel: KPriorityQueue: Various style fixes based on code review feedback. 2020-12-06 00:27:13 -08:00
bunnei 4d3be1816c hle: kernel: KAffinityMask: Various style fixes based on code review feedback. 2020-12-06 00:27:13 -08:00
bunnei 357d79fb6e hle: kernel: GlobalSchedulerContext: Various style fixes based on code review feedback. 2020-12-06 00:27:13 -08:00
bunnei d2c0c94f0b common: BitSet: Various style fixes based on code review feedback. 2020-12-06 00:27:13 -08:00
bunnei b1326d9230 hle: kernel: Use C++ style comments in KScheduler, etc. 2020-12-06 00:03:24 -08:00
bunnei bc59ca92b6 kernel: KScopedSchedulerLockAndSleep: Remove unused ctor. 2020-12-06 00:03:24 -08:00
bunnei b9b7e4f915 kernel: time_manager: Add missing lock guards. 2020-12-06 00:03:24 -08:00
bunnei ccce6cb3be hle: kernel: Migrate to KScopedSchedulerLock. 2020-12-06 00:03:24 -08:00
bunnei 4756cb203e hle: kernel: Separate KScopedSchedulerLockAndSleep from k_scheduler. 2020-12-06 00:03:24 -08:00
bunnei 8d3e06349e hle: kernel: Separate KScheduler from GlobalSchedulerContext class. 2020-12-06 00:03:24 -08:00
bunnei 9e29e36a78 hle: kernel: Rewrite scheduler implementation based on Mesopshere. 2020-12-06 00:03:24 -08:00
bunnei c10a37e5b6 hle: kernel: physical_core: Clear exclusive state after each run.
- This is closer to pre-multicore behavior, and works a bit better.
2020-12-06 00:03:24 -08:00
bunnei 7e5d0f1fe3 hle: kernel: Port KAbstractSchedulerLock from Mesosphere. 2020-12-06 00:03:24 -08:00
bunnei 39d356782e hle: kernel: svc: Remove reschedule on svcBreak.
- This breaks things, and is unnecessary, since emulation will be done at this point.
2020-12-06 00:03:24 -08:00
bunnei d58a609ae4 hle: kernel: process: Add schedule count tracking, to be used for yield impl. 2020-12-06 00:03:24 -08:00
bunnei 493263f415 hle: kernel: svc: Remove unnecessary hack in svcSleep. 2020-12-06 00:03:24 -08:00
bunnei a3ccac3eb7 common: Port KPriorityQueue from Mesosphere. 2020-12-06 00:03:24 -08:00
bunnei 8dbfa4e1a4 common: Port BitSet from Mesosphere. 2020-12-06 00:03:24 -08:00
bunnei e18ee8d681 hle: kernel: Port KAffinityMask from Mesosphere. 2020-12-06 00:03:24 -08:00
comex a6e6cd5788 maxwell_dma: Rename RenderEnable::Mode::FALSE and TRUE to avoid name conflict
On Apple platforms, FALSE and TRUE are defined as macros by
<mach/boolean.h>, which is included by various system headers.

Note that there appear to be no actual users of the names to fix up.
2020-12-05 17:59:02 -05:00
comex 9dc69fa07c yuzu_cmd: Remove 'users_size'
Specifically:

    const auto size = sdl2_config->GetInteger("System", "users_size", 0);

The variable is never used, producing a warning.  I wondered if this
ought to be assigning something to in `Settings`, but nothing else in
the codebase ever mentions a setting called "users_size", so I guess
it's safe to remove...
2020-12-05 17:50:39 -05:00
Vitor Kiguchi a1e7360273 Update cubeb and request a persistent stream session 2020-12-05 22:26:41 +01:00
Lioncash f95602f152 video_core: Resolve more variable shadowing scenarios pt.3
Cleans out the rest of the occurrences of variable shadowing and makes
any further occurrences of shadowing compiler errors.
2020-12-05 16:02:23 -05:00
Lioncash c277d7d171 game_list_p: Resolve deprecated usage of QVariant operator<
This is designated as obsolete in Qt's docs (see:
https://doc.qt.io/qt-5/qvariant-obsolete.html#operator-lt)
2020-12-05 15:38:58 -05:00
Morph f6d4a289d5 applets: Resolve variable shadowing 2020-12-05 08:37:13 -05:00
Lioncash 414a87a4f4 video_core: Resolve more variable shadowing scenarios pt.2
Migrates the video core code closer to enabling variable shadowing
warnings as errors.

This primarily sorts out shadowing occurrences within the Vulkan code.
2020-12-05 06:39:35 -05:00
bunnei e6a896c4bd
Merge pull request #5124 from lioncash/video-shadow
video_core: Resolve more variable shadowing scenarios
2020-12-05 00:48:08 -08:00
bunnei 63419e144f
Merge pull request #5127 from FearlessTobi/port-5617
Port citra-emu/citra#5617: "Fix telemetry-related exit crash from use-after-free"
2020-12-04 21:57:40 -08:00
Lioncash 2c375013dd xbyak_abi: Shorten std::size_t to size_t
Makes for less reading.
2020-12-05 00:43:55 -05:00
Lioncash b126267442 xbyak_abi: Avoid implicit sign conversions 2020-12-05 00:43:41 -05:00
Chloe Marcec 7fbeb489d3 system_version: Update to 11.0.0 2020-12-05 16:08:03 +11:00
FearlessTobi 37d672bf08 Fix telemetry-related exit crash from use-after-free
Co-Authored-By: xperia64 <xperia64@users.noreply.github.com>
2020-12-05 02:42:50 +01:00
Lioncash 94af77aa7c codec: Remove deprecated usage of AVCodecContext::refcounted_frames
This was only necessary for use with the
avcodec_decode_video2/avcoded_decode_audio4 APIs which are also
deprecated.

Given we use avcodec_send_packet/avcodec_receive_frame, this isn't
necessary, this is even indicated directly within the FFmpeg API changes
document here on 2017-09-26:

https://github.com/FFmpeg/FFmpeg/blob/master/doc/APIchanges#L410

This prevents our code from breaking whenever we update to a newer
version of FFmpeg in the future if they ever decide to fully remove this
API member.
2020-12-04 16:23:13 -05:00
Lioncash 677a8b208d video_core: Resolve more variable shadowing scenarios
Resolves variable shadowing scenarios up to the end of the OpenGL code
to make it nicer to review. The rest will be resolved in a following
commit.
2020-12-04 16:19:09 -05:00
Morph c2f83c04cb nim: Stub IsLargeResourceAvailable
- Used by Immortals Fenyx Rising
2020-12-04 09:53:21 -05:00
bunnei fad38ec6e8
Merge pull request #5064 from lioncash/node-shadow
node: Eliminate variable shadowing
2020-12-04 00:45:33 -08:00
bunnei defa826c53
Merge pull request #5061 from lioncash/pessimizing
vp9/vic: Resolve pessimizing moves
2020-12-03 23:21:12 -08:00
bunnei 69aaad9b96
Merge pull request #4996 from bunnei/use-4jits
Kernel: Refactor to use 4-instances of Dynarmic & various cleanups and improvements
2020-12-03 15:32:45 -08:00
Lioncash edd8208779 node: Mark member functions as [[nodiscard]] where applicable
Prevents logic bugs from accidentally ignoring the return value.
2020-12-03 16:03:34 -05:00
Lioncash 7cf34c3637 node: Eliminate variable shadowing 2020-12-03 15:59:38 -05:00
Lioncash cf9767c608 vp9/vic: Resolve pessimizing moves
Removes the usage of moves that don't result in behavior different from
a copy, or otherwise would prevent copy elision from occurring.
2020-12-03 12:33:07 -05:00
Lioncash 424bffcd3f mouse_poller: Remove unused includes 2020-12-03 10:41:13 -05:00
Lioncash 16aadcc354 mouse_input: Invert conditional in UpdateYuzuSettings()
Allows the struct to be constructed in place.
2020-12-03 10:41:13 -05:00
Lioncash 395997178b mouse_input: Remove two casts and amend some formatting
Removes the use of two static casts and improves the readability of some
vectors slightly.
2020-12-03 10:41:09 -05:00
Lioncash 5842a767a9 mouse_input: Resolve a -Wdocumentation warning 2020-12-03 10:26:50 -05:00
Lioncash 774d7eab64 mouse_input: Remove unused includes 2020-12-03 10:26:30 -05:00
bunnei 88089c8754
Merge pull request #5000 from lioncash/audio-error
audio_core: Make shadowing and unused parameters errors
2020-12-02 23:08:43 -08:00
Lioncash 1ea6bdef05 audio_core: Make shadowing and unused parameters errors
Moves the audio code closer to enabling warnings as errors in general.
2020-12-03 00:54:31 -05:00
bunnei 9abb23cd27
Merge pull request #5002 from ameerj/nvdec-frameskip
nvdec: Queue and display all decoded frames, cleanup decoders
2020-12-02 15:55:15 -08:00
bunnei 25f650e075
Merge pull request #4937 from german77/multiUDP
InputCommon: Add multiple udp server support
2020-12-01 11:47:37 -08:00
LC d39dfdf45c
Merge pull request #5047 from german77/MouseInput
InputCommon: Fix implicit conversion in mouse input
2020-12-01 09:40:46 -05:00
german ece0ae2bfb Fix implicit conversion in mouse input 2020-11-30 21:48:18 -06:00
bunnei 7b4a213603
Merge pull request #5013 from ReinUsesLisp/vk-early-z
vk_shader_decompiler: Implement force early fragment tests
2020-11-30 11:11:07 -08:00
lat9nq 756225c8ff Disable web applet and warning when compiling for Linux on CI
yuzu's web applet does not or barely reacts to user input while open in
Linux. It can be closed via 'Exit Web Applet' on the menubar, however if
yuzu is in fullscreen, this is effectively a softlock as the menubar
cannot be accessed.

This disables building yuzu with the web applet on the Linux CI target.
In addition, this disables the QMessageBox warning about not having
compiled yuzu with the web applet.
2020-11-30 13:25:46 -05:00
bunnei 7bc3e80399
Merge pull request #4939 from german77/MouseInput
InputCommon: Implement full mouse support
2020-11-29 22:59:50 -08:00
bunnei 63b3b25715
Merge pull request #5005 from ReinUsesLisp/div-ceil
common: Add Common::DivCeil and Common::DivCeilLog2
2020-11-29 01:41:06 -08:00
bunnei 4b9e1b6586 kernel: scheduler: Minor cleanup to remove duplicated code. 2020-11-29 01:31:52 -08:00
bunnei b7ef581c6e kernel: time_manager: Protect access with a mutex. 2020-11-29 01:31:52 -08:00
bunnei 24cae76d16 common: fiber: Use VirtualBuffer for stack memory.
- This will be aligned by default, and helps memory usage.
2020-11-29 01:31:52 -08:00
bunnei c2ad1243ba hle: kernel: thread: Remove unused "Running" state. 2020-11-29 01:31:52 -08:00
bunnei 63fd1bb503 core: arm: Implement InvalidateCacheRange for CPU cache invalidation. 2020-11-29 01:31:52 -08:00
bunnei c0870315fd hle: kernel: time_manager: Avoid a crash on process exit. 2020-11-29 01:31:51 -08:00
bunnei 9705f651b2 hle: kernel: AddressArbiter: Remove unused code. 2020-11-29 01:31:51 -08:00
bunnei 9423347c1b hle: kernel: SynchronizationObject: Use atomic_bool for is_signaled. 2020-11-29 01:31:51 -08:00
bunnei c042a89113 common: fiber: Use boost::context instead of native fibers on Windows. 2020-11-29 01:31:51 -08:00
bunnei 7b642c7781 hle: kernel: multicore: Replace n-JITs impl. with 4 JITs. 2020-11-29 01:31:51 -08:00
bunnei 6750b4d3af
Merge pull request #4998 from Morph1984/bioshock-patch
hid: Check if applet_resource exists in InitializeVibrationDevice
2020-11-28 23:20:23 -08:00
german 4eb7327559 Add missing types to NpadCommunicationMode 2020-11-28 21:56:02 -06:00
bunnei 312a8bd4b4
Merge pull request #5021 from german77/StubCommunicationMode
HID: Stub set and get NpadCommunicationMode
2020-11-28 15:22:46 -08:00
Chloe Marcec d7019d8307 audio_core: Remove temp_mix_buffer
It's unused and doesn't need to be initialized
2020-11-28 23:25:28 +11:00
bunnei d9b729bbfd
Merge pull request #5015 from comex/xx-sign-compare
tests: Fix warning about comparison between signed and unsigned
2020-11-27 19:54:26 -08:00
bunnei 1fde40b2c7
Merge pull request #5011 from lioncash/file-str2
core: Reduce string copies in GetGameFileFromPath()
2020-11-27 17:23:00 -08:00
LC fca87cfa3e
Merge pull request #5014 from comex/xx-invalid-offsetof
CMakeLists: disable -Winvalid-offsetof
2020-11-27 17:44:07 -05:00
comex 32f3b6b865 CMakeLists: disable -Winvalid-offsetof
This Clang warning complains when offsetof is used on a
non-standard-layout type (i.e. any class using various C++ features),
even though it works fine (and is not undefined behavior as of C++17).
2020-11-27 17:42:02 -05:00
comex 3dc310bd52 tests: Fix warning about comparison between signed and unsigned 2020-11-27 17:41:20 -05:00
Lioncash 5bc4eabe36 core: Eliminate remaining usages of the global system instance
Removes all remaining usages of the global system instance. After this,
migration can begin to migrate to being constructed and managed entirely
by the various frontends.
2020-11-27 11:40:45 -05:00
Lioncash 073e07ae2d savedata_factory: Eliminate usage of the global system instance
Now there's only two meaningful instances left in core.
2020-11-27 09:45:08 -05:00
Rodrigo Locatti ee5e77fbf9
Merge pull request #5018 from lioncash/service-global
service: Eliminate usages of the global system instance
2020-11-27 02:41:56 -03:00
german 3898d8f0d7 Stub set and get NpadCommunicationMode 2020-11-26 21:35:11 -06:00
Lioncash 1a954b2a59 service: Eliminate usages of the global system instance
Completely removes all usages of the global system instance within the
services code by passing in the using system instance to the services.
2020-11-26 20:03:11 -05:00
comex 4681e1ea9e codec: Fix pragma GCC diagnostic pop missing corresponding push 2020-11-26 16:35:42 -05:00
ReinUsesLisp 2ccf85a910 vk_shader_decompiler: Implement force early fragment tests
Force early fragment tests when the 3D method is enabled.
The established pipeline cache takes care of recompiling if needed.

This is implemented only on Vulkan to avoid invalidating the shader
cache on OpenGL.
2020-11-26 17:52:26 -03:00
Lioncash 9d3d0ae999 core: Reduce string copies in GetGameFileFromPath()
Eliminates some minor string churn where applicable. Also eliminates an
unnecessary vector copy.
2020-11-26 14:05:13 -05:00
ameerj 979b602738 Limit queue size to 10 frames
Workaround for ZLA, which seems to decode and queue twice as many frames as it displays.
2020-11-26 14:04:06 -05:00
bunnei 322349e8cc
Merge pull request #4975 from comex/invalid-syncpoint-id
nvdrv, video_core: Don't index out of bounds when given invalid syncpoint ID
2020-11-26 01:27:24 -08:00
german e46f0e084c Implement full mouse support 2020-11-25 23:59:30 -06:00
bunnei ebcee03b0c
Merge pull request #4981 from ogniK5377/ioctl-ctrl
nvservices: Reintroducee IoctlCtrl
2020-11-25 21:48:57 -08:00
german 2c2b586d86 Add multiple udp server support 2020-11-25 23:44:41 -06:00
ameerj c9e3abe206 Address PR feedback
remove some redundant moves, make deleter match naming guidelines.

Co-Authored-By: LC <712067+lioncash@users.noreply.github.com>
2020-11-26 00:18:26 -05:00
ReinUsesLisp 630823e363 common: Add Common::DivCeil and Common::DivCeilLog2
Add an equivalent to 'Common::AlignUp(n, d) / d' and a log2 alternative.
2020-11-25 23:37:56 -03:00
Jan Beich e48e9a406c input_common: ignore some Clang warnings after 5c4774e8ce
error: unknown warning option '-Werror=unused-but-set-parameter'; did you mean '-Werror=unused-parameter'? [-Werror,-Wunknown-warning-option]
error: unknown warning option '-Werror=unused-but-set-variable'; did you mean '-Werror=unused-const-variable'? [-Werror,-Wunknown-warning-option]
2020-11-25 23:57:11 +00:00
Rodrigo Locatti 0e15c68f54
Merge pull request #4976 from comex/poll-events
Overhaul EmuWindow::PollEvents to fix yuzu-cmd calling SDL_PollEvents off main thread
2020-11-25 20:44:53 -03:00
ameerj eab041866b Queue decoded frames, cleanup decoders 2020-11-25 17:10:44 -05:00
Rodrigo Locatti b834c21894
Merge pull request #4946 from ameerj/alpha-test
renderer_vulkan: Implement alpha testing
2020-11-25 18:48:34 -03:00
ameerj d52ee6d0a7 cleanup unneeded comments and newlines 2020-11-25 14:46:08 -05:00
bunnei dcfa1992ea
Merge pull request #4959 from Morph1984/emulated-controller-styleset
configure_input_player: Use the NpadStyleSet to limit the available controllers shown
2020-11-25 11:20:46 -08:00
bunnei b7f1095980
Merge pull request #4932 from ogniK5377/misc-audio
audren: Make use of nodiscard, rework downmixing, release all buffers
2020-11-25 10:50:52 -08:00
Morph 6f70e1b1ff hid: Check if applet_resource exists in InitializeVibrationDevice 2020-11-25 13:33:30 -05:00
bunnei 9aeada734d
Merge pull request #4978 from bunnei/shutdown-crash
core: cpu_manager: Fix shutdown crash when closing before emulation starts.
2020-11-25 01:20:01 -08:00
ameerj e87670ee48 Refactor MaxwellToSpirvComparison. Use Common::BitCast
Co-Authored-By: Rodrigo Locatti <reinuseslisp@airmail.cc>
2020-11-25 00:33:20 -05:00
ameerj 1dbf71ceb3 Address PR feedback from Rein 2020-11-24 22:46:45 -05:00
ameerj 9014861858 vulkan_renderer: Alpha Test Culling Implementation
Used by various textures in many titles, e.g.  SSBU menu.
2020-11-24 22:46:45 -05:00
bunnei d1da7eb119
Merge pull request #4905 from german77/AnalogFromButton
Allow to dial any angle with digital joystick
2020-11-24 16:04:55 -08:00
bunnei 3359e5ab70 core: cpu_manager: Fix shutdown crash when closing before emulation starts. 2020-11-24 15:25:39 -08:00
bunnei 4fbe4da911 frontend: yuzu (qt): Register a callback for ExecuteProgram. 2020-11-24 15:18:29 -08:00
bunnei 4fb5ca80c0 service: am: Implement ExecuteProgram and required stubs.
- This is used by Super Mario 3D All-Stars.
2020-11-24 15:17:43 -08:00
bunnei 5f75d97125 core: loader: Implement support for loading indexed programs. 2020-11-24 15:16:24 -08:00
bunnei 7791cc8c2e
hle: services: Fix a crash with improper NVFlinger lifetime management. (#4977)
* hle: services: Fix a crash with improper NVFlinger lifetime management.

- This crash would happen when attempting to shutdown yuzu early on in boot.
2020-11-24 14:31:58 -08:00
comex e8b2fd21d8 nvdrv, video_core: Don't index out of bounds when given invalid syncpoint ID
- Use .at() instead of raw indexing when dealing with untrusted indices.

- For the special case of WaitFence with syncpoint id UINT32_MAX,
  instead of crashing, log an error and ignore.  This is what I get when
  running Super Mario Maker 2.
2020-11-24 12:59:41 -05:00
Rodrigo Locatti fbda5e9ec9
Merge pull request #3681 from lioncash/component
decoder/image: Fix incorrect G24R8 component sizes in GetComponentSize()
2020-11-24 04:38:03 -03:00
Rodrigo Locatti 410ed82922
Merge pull request #4942 from lioncash/system
core: Make use of [[nodiscard]] with the System class
2020-11-24 04:26:59 -03:00
Rodrigo Locatti 7afb7a9494
Merge pull request #4972 from lioncash/unused4
svc: Remove unnecessary [[maybe_unused]] tag
2020-11-24 04:25:59 -03:00
bunnei 6694e11303
input_common: Fix typo in gc_poller.cpp with [[maybe_unused]]. 2020-11-23 21:42:06 -08:00
Chloe Marcec ab25d1fe9a nvservices: Reintroducee IoctlCtrl
Fixes regression caused by #4907 which caused games like Breath of the Wild 1.0.0 not to boot.
2020-11-24 16:40:23 +11:00
bunnei 7fb7540d69 input_common: Add more missing [[maybe_unused]] from #4927. 2020-11-23 20:50:35 -08:00
bunnei d04abd39eb
Fix warnings in core/frontend/input.h with [[maybe_unused]]
Fixes build break due to #4927
2020-11-23 18:11:21 -08:00
bunnei e371d12af6
Merge pull request #4927 from lioncash/input-error
input_common: Treat warnings as errors
2020-11-23 17:25:53 -08:00
comex 994f497781 Overhaul EmuWindow::PollEvents to fix yuzu-cmd calling SDL_PollEvents off main thread
EmuWindow::PollEvents was called from the GPU thread (or the CPU thread
in sync-GPU mode) when swapping buffers.  It had three implementations:

- In GRenderWindow, it didn't actually poll events, just set a flag and
  emit a signal to indicate that a frame was displayed.

- In EmuWindow_SDL2_Hide, it did nothing.

- In EmuWindow_SDL2, it did call SDL_PollEvents, but this is wrong
  because SDL_PollEvents is supposed to be called on the thread that set
  up video - in this case, the main thread, which was sleeping in a
  busyloop (regardless of whether sync-GPU was enabled).  On macOS this
  causes a crash.

To fix this:

- Rename EmuWindow::PollEvents to OnFrameDisplayed, and give it a
  default implementation that does nothing.

- In EmuWindow_SDL2, do not override OnFrameDisplayed, but instead have
  the main thread call SDL_WaitEvent in a loop.
2020-11-23 17:58:49 -05:00
bunnei 5d1447897a
Merge pull request #4451 from slashiee/extended-logging
logging/settings: Increase maximum log size to 100 MB and add extended logging option
2020-11-23 13:34:15 -08:00
Lioncash 874be0e3e1 svc: Remove unnecessary [[maybe_unused]] tag
The parameter is used in this function, so this suppression isn't
necessary.
2020-11-23 10:17:20 -05:00
Lioncash 5c4774e8ce input_common: Treat warnings as errors
Migrates over warnings as errors for input common to match how the
common library treats warnings as errors.
2020-11-22 04:50:03 -05:00
bunnei 3a85bc1e77
Merge pull request #4944 from lioncash/system-rem
patch_manager: Remove usages of the global system instance
2020-11-21 22:12:34 -08:00
Morph e13a91fa9b
Merge pull request #4954 from lioncash/compare
gl_rasterizer: Make floating-point literal a float
2020-11-22 09:55:23 +08:00
bunnei 5502f39125
Merge pull request #4955 from lioncash/move3
async_shaders: std::move data within QueueVulkanShader()
2020-11-21 01:21:08 -08:00
bunnei afd0e2ee87
Merge pull request #4907 from ogniK5377/nvdrv-cleanup
core: Make nvservices more standardized
2020-11-20 22:15:44 -08:00
Morph 8758378dc4 applets/controller: Use a pair of emulated controller index to controller type 2020-11-20 22:22:22 -05:00
Morph 102630f2b2 configure_input_player: Use the npad style set to show the available controllers
This will reduce the likelihood of an invalid controller type to be set within a game
2020-11-20 22:22:22 -05:00
LC d88baa746b
Merge pull request #4957 from ReinUsesLisp/alpha-test-rt
gl_rasterizer: Remove warning of untested alpha test
2020-11-20 21:19:06 -05:00
ReinUsesLisp acc14d233f gl_rasterizer: Remove warning of untested alpha test
Alpha test has been proven to only affect the first render target.
2020-11-20 23:17:40 -03:00
bunnei b00f4abe36
Merge pull request #4953 from lioncash/shader-shadow
shader_bytecode: Eliminate variable shadowing
2020-11-20 16:58:14 -08:00
bunnei c47c3d723f
Merge pull request #4951 from bunnei/olsc-stub
hle: service: Stub OLSC Initialize and SetSaveDataBackupSettingEnabled functions.
2020-11-20 14:06:37 -08:00
bunnei 3794c91145 olsc: Move member initialization to after member functions. 2020-11-20 10:50:50 -08:00
Lioncash 01db5cf203 async_shaders: emplace threads into the worker thread vector
Same behavior, but constructs the threads in place instead of moving
them.
2020-11-20 04:46:56 -05:00
Lioncash ba3916fc67 async_shaders: Simplify implementation of GetCompletedWork()
This is equivalent to moving all the contents and then clearing the
vector. This avoids a redundant allocation.
2020-11-20 04:44:44 -05:00
Lioncash 3fcc98e11a async_shaders: Simplify moving data into the pending queue 2020-11-20 04:41:29 -05:00
Lioncash 5b441fa25d async_shaders: std::move data within QueueVulkanShader()
Same behavior, but avoids redundant copies.

While we're at it, we can simplify the pushing of the parameters into
the pending queue.
2020-11-20 04:38:18 -05:00
Lioncash 8469b76630 gl_rasterizer: Make floating-point literal a float
Gets rid of an unnecessary expansion from float to double.
2020-11-20 04:24:33 -05:00
Lioncash b7cd5d742e shader_bytecode: Make use of [[nodiscard]] where applicable
Ensures that all queried values are made use of.
2020-11-20 02:20:37 -05:00
Lioncash 56ecafc204 shader_bytecode: Eliminate variable shadowing 2020-11-20 02:13:45 -05:00
Morph 715f0c3b0c
Merge pull request #4941 from lioncash/config
configure_input_player: Use static qualifier for IsProfileNameValid()
2020-11-20 14:16:01 +08:00
LC bba7e8ea4b
Merge pull request #4950 from german77/RumbleStrenght
Modify rumble amplification
2020-11-20 00:40:09 -05:00
LC e883101999
Merge pull request #4952 from ReinUsesLisp/bit-cast
common/bit_cast: Add function matching std::bit_cast without constexpr
2020-11-20 00:39:30 -05:00
Rodrigo Locatti 1889b641d9
Merge pull request #4308 from ReinUsesLisp/maxwell-3d-funcs
maxwell_3d: Move code to separate functions and insert instead of push_back
2020-11-20 01:57:22 -03:00
ReinUsesLisp 3f2e605dd1 common/bit_cast: Add function matching std::bit_cast without constexpr
Add a std::bit_cast-like function archiving the same runtime results as
the standard function, without compile time support.

This allows us to use bit_cast while we wait for compiler support, it
can be trivially replaced in the future.
2020-11-20 01:52:37 -03:00
bunnei 6e37676482 hle: service: Stub OLSC Initialize and SetSaveDataBackupSettingEnabled functions.
- Used by Animal Cross: New Horizons v1.6.0 update, minimal stub gets this update working.
2020-11-19 12:36:09 -08:00
german77 5b6545b141 Modify rumble amplification 2020-11-19 11:30:52 -06:00
Lioncash 412044960a virtual_buffer: Do nothing on resize() calls with same sizes
Prevents us from churning memory by freeing and reallocating a memory
block that would have already been adequate as is.
2020-11-19 07:54:03 -05:00
bunnei 92344da20c
Merge pull request #4936 from lioncash/page
page_table: Allow page tables to be moved
2020-11-18 20:40:10 -08:00
Lioncash 6f8a06bac5 patch_manager: Remove usages of the global system instance
With this, only 19 usages of the global system instance remain within
the core library.

We're almost there.
2020-11-18 09:36:48 -05:00
Lioncash aaf262bfed core: Remove unused private Init function for the System class
This isn't used, so it can be removed.
2020-11-18 02:09:08 -05:00
Lioncash bcaadac22c core: Make use of [[nodiscard]] with the System class
Given this is a central class, we should flag cases where the return
value of some functions not being used is likely a bug.
2020-11-18 02:06:44 -05:00
Lioncash be4fc777c0 configure_input_player: Use static qualifier for IsProfileNameValid()
This is a static member function, so we don't need use an existing
instance to call this function.
2020-11-17 23:12:44 -05:00
bunnei abda366362
Merge pull request #4866 from Morph1984/mjolnir-p3-prod
Project Mjölnir: Part 3 - Controller Profiles and Vibration Rework
2020-11-17 20:02:27 -08:00
Lioncash 0ca91ced2d virtual_buffer: Add compile-time type-safety guarantees with VirtualBuffer
VirtualBuffer makes use of VirtualAlloc (on Windows) and mmap() (on
other platforms). Neither of these ensure that non-trivial objects are
properly constructed in the allocated memory.

To prevent potential undefined behavior occurring due to that, we can
add a static assert to loudly complain about cases where that is done.
2020-11-17 20:09:58 -05:00
Lioncash b3c8997829 page_table: Allow page tables to be moved
Makes page tables and virtual buffers able to be moved, but not copied,
making the interface more flexible.

Previously, with the destructor specified, but no move assignment or
constructor specified, they wouldn't be implicitly generated.
2020-11-17 20:08:20 -05:00
Lioncash 3cfd962ef4 page_table: Add missing doxygen parameters to Resize()
Resolves two -Wdocumentation warnings.
2020-11-17 19:45:20 -05:00
Lioncash 0890451c55 page_table: Remove unnecessary header inclusions
Prevents indirect inclusions for these headers.
2020-11-17 19:43:27 -05:00
Lioncash 70812ec57b rasterizer_interface: Make use of [[nodiscard]] where applicable 2020-11-17 07:19:13 -05:00
Lioncash a78021580d render_base: Make use of [[nodiscard]] where applicable 2020-11-17 07:19:12 -05:00
Lioncash b928fca114 gpu: Make use of [[nodiscard]] where applicable 2020-11-17 07:19:09 -05:00
bunnei 8ace3959a5
Merge pull request #4929 from lioncash/nodiscard-input
motion_input: Mark member functions as [[nodiscard]] where applicable
2020-11-16 21:40:16 -08:00
Chloe Marcec 908d3c5679 Addressed changes 2020-11-17 15:40:19 +11:00
Chloe Marcec 9a4beac95a audren: Make use of nodiscard, rework downmixing, release all buffers
Preliminary work for upmixing & general cleanup. Fixes basic issues in games such as Shovel Knight and slightly improves the LEGO games. Upmixing stitll needs to be implemented.

Audio levels in a few games will be fixed as we now use the downmix coefficients when possible instead of supplying our own
2020-11-17 14:14:29 +11:00
Morph e7e8a87927 sdl_impl: Pump SDL Events at 1000 Hz 2020-11-15 23:33:21 -05:00
Morph b254d528bc configure_input: Accommodate for the mouse input device engine 2020-11-15 23:33:21 -05:00
Morph ad50209383 hid: Reimplement Begin/EndPermitVibrationSession
Upon further investigation, these commands allow temporary vibrations even when the "Controller Vibration" system setting is disabled. As a result, vibrations are allowed when either the system setting or this flag is set to true. Therefore, we can only block vibrations when both flags are set to false.
2020-11-15 23:33:21 -05:00
Morph d8ad2f3484 controllers/npad: Load input devices on init 2020-11-15 23:33:21 -05:00
Morph 6f5b942897 configure_input: Update the input profiles for other player tabs 2020-11-15 23:33:21 -05:00
Morph 97b2220a82 general: Fix compiler warnings on linux and miscellaneous changes 2020-11-15 23:33:21 -05:00
Morph 117bdc71e0 sdl_impl: Revert to the "old" method of mapping sticks
Not all controllers have a SDL_GameController binding. This caused controllers not present in the SDL GameController database to have buttons mapped instead of axes.

Furthermore, it was not possible to invert the axes when it could be useful such as emulating a horizontal single joycon or other potential cases. This allows us to invert the axes by reversing the order of mapping (vertical, then horizontal).
2020-11-15 23:33:21 -05:00
Morph 760a9e8693 applets/controller: Change the input button to create input profiles
Co-authored-by: Its-Rei <kupfel@gmail.com>
2020-11-15 23:33:21 -05:00
Morph 30e0d1c973 controllers/npad: Remove the old vibration filter
Previously we used a vibration filter that filters out amplitudes close to each other. It turns out there are cases where this results into vibrations that are too inaccurate. Remove this and move the 100Hz vibration filter (Only allowing a maximum of 100 vibrations per second) from sdl_impl to npad when enable_accurate_vibrations is set to false.
2020-11-15 23:33:21 -05:00
Morph 91c06dae1a input: Disconnect a controller prior to connecting a new one
Some games do not respond to a change in controller type if 1) The controller is not disconnected prior to being reconnected and/or 2) The controller is reconnected instantly after being disconnected.

Since it is not possible to change controllers instantly on hardware and requiring a disconnect prior to connecting a new one, we should emulate this as well with a small delay, fixing the aforementioned issue.
2020-11-15 23:33:21 -05:00
Morph 978ca65f59 hid: Implement InitializeVibrationDevice and IsVibrationDeviceMounted 2020-11-15 23:33:20 -05:00
Morph e9e1876e82 input_common: Add VibrationDevice and VibrationDeviceFactory
A vibration device is an input device that returns an unsigned byte as status.
It represents whether the vibration device supports vibration or not.
If the status returns 1, it supports vibration. Otherwise, it does not support vibration.
2020-11-15 23:33:20 -05:00
Morph 38110dd485 configure_input: Add per-player vibration
Allows for enabling and modifying vibration and vibration strength per player.
Also adds a toggle for enabling/disabling accurate vibrations.

Co-authored-by: Its-Rei <kupfel@gmail.com>
2020-11-15 23:33:20 -05:00
Morph d6a41cfc21 settings: Remove global vibration strength modifier
This will be replaced in favor of per-player vibration strength modifiers.
2020-11-15 23:33:20 -05:00
Morph 92fa5257c7 hid: Mark Begin/EndPermitVibrationSession as stubs
The implementation of these commands seem incomplete and causes rumble in Super Mario Party to stop working since only EndPermitVibrationSession is called. Thus, these are better off being marked as a stub until this can be investigated more thoroughly.
2020-11-15 23:33:20 -05:00
Morph 373408ae8c controllers/npad: Send an empty vibration on destruction/deactivation
This stops all controllers from continuously vibrating when emulation is stopped.
2020-11-15 23:33:20 -05:00
Morph 70f16f1722 hid: Stub IsVibrationDeviceMounted
- Used in Super Mario Odyssey
2020-11-15 23:33:20 -05:00
Morph 9b501af8e3 controllers/npad: Add heuristics to reduce rumble state changes
Sending too many state changes in a short period of time can cause massive performance issues.
As a result, we have to use several heuristics to reduce the number of state changes to minimize/eliminate this performance impact while maintaining the quality of these vibrations as much as possible.
2020-11-15 23:33:20 -05:00
Morph 652d6766d5 configure_input: Hook up the vibration percentage spinbox
This allows setting the vibration strength percentage anywhere from 1% to 100%.
Also hooks up the remaining motion button and checkbox in the Controller Applet.
2020-11-15 23:33:20 -05:00
Morph e02ef3c3be controllers/npad: Stop games from vibrating incorrect controllers
Fixes vibration in 1-2 Switch and potentially other games where they would vibrate both players' joycons at the same time.
2020-11-15 23:33:20 -05:00
Morph 07b81f57ba hid: Fix controller rumble based on new research
This fixes the issue where rumble is only sent to the first controller.
Now, individual controllers can receive their own rumble commands.
2020-11-15 23:33:20 -05:00
Morph 31de52513e hid: Pop a struct of parameters instead of popping individual parameters
Some parameters need to be doubleword aligned due to the presence of the applet_resource_user_id.
Previously, this value was invalid in many commands where it was not doubleword aligned when popped.
2020-11-15 23:33:20 -05:00
Morph e3c2749986 hid: Reorder all HID commands
Reorders all HID commands in command id order.
2020-11-15 23:33:20 -05:00
Morph b92bf51ae1 hid: Implement GetVibrationDeviceInfo
The first u32 describes the vibration device type which is a Linear Resonant Actuator used in Nintendo Switch controller hardware.

The second u32 describes the vibration device position, in this case distinguishing between left and right vibration actuators.

Pro Controllers have 2 LRAs each that can vibrate independently of each other, which means they have 2 distinct vibration device handles to distinguish between the two actuators.

Similarly for joycons, the left joycon can be distinguished from the right joycon through the vibration device handle since each joycon has 1 LRA.
2020-11-15 23:33:20 -05:00
Morph 16e2e1c45f hid: Stub InitializeVibrationDevice 2020-11-15 23:33:20 -05:00
Morph 428ce8ec29 controllers/npad: Rename NPadType to NpadStyleSet
This more accurately represents the underlying type and avoids confusion with NpadType
2020-11-15 23:33:20 -05:00
Morph 0a966e2cac controllers/npad: Add DeviceHandle struct
A DeviceHandle describes a vibration device or six-axis sensor based on the npad type, npad id, and device index/position
2020-11-15 23:33:20 -05:00
Morph ceb7b11f16 configure_input_player: Change "Defaults" button behavior
RestoreDefaults() now restores the selected devices' mappings using UpdateMappingWithDefaults().
This allows us to move the keyboard mapping from RestoreDefaults() to UpdateMappingWithDefaults().
2020-11-15 23:33:20 -05:00
Morph 8f2959f680 settings: Preparation for per-game input settings 2020-11-15 23:33:20 -05:00
Morph 8ead176639 udp/client: Reduce testing period to 5 seconds 2020-11-15 23:33:19 -05:00
Morph 64e174237e config: Migrate config files into config/custom
Co-authored-by: lat9nq <lat9nq@virginia.edu>
2020-11-15 23:33:19 -05:00
Morph c0c4ed0d3b controllers/npad: Connect a controller on init if none are connected 2020-11-15 23:33:19 -05:00
Morph 5cafa70d3b applets/controller: Auto accept a valid single player configuration 2020-11-15 23:33:19 -05:00
Morph 484623cd61 bootmanager: Allow mouse clicks only if touch is disabled
Previously mouse clicks will not register when touch is disabled.
This rectifies that and allows mouse clicks to be mapped to other buttons if the touchscreen is disabled.
2020-11-15 23:33:19 -05:00
Morph 57d89e291d input_profiles: Implement input profiles 2020-11-15 23:33:19 -05:00
Morph 75eaab2e0f configure_input_player: Implement input exclusivity and persistence
With this, the "Input Devices" combobox should accurately reflect the input device being used and disallows inputs from other input devices unless the input device is set to "Any".
2020-11-15 23:33:19 -05:00
Morph 9d4edd4e88 ui/themes: Cleanup UI 2020-11-15 23:33:19 -05:00
Lioncash 0a50ba3bd1 motion_input: Mark constructor as explicit 2020-11-15 14:20:41 -05:00
Lioncash cb826bcee7 motion_input: Mark member functions as [[nodiscard]] where applicable 2020-11-15 14:18:09 -05:00
LC ce718522bc
Merge pull request #4914 from lat9nq/gl-warnings
bootmanager: Log and show GL_RENDERER string when GPU is insufficient
2020-11-15 06:33:48 -05:00
bunnei 87f220efff
Merge pull request #4895 from Morph1984/cave-story-plus-applet-fix
applets/controller: Introduce additional checks for mode and caller
2020-11-12 21:55:06 -08:00
ReinUsesLisp 622830f4e1 maxwell_3d: Use insert instead of loop push_back
This reduces the overhead of bounds checking on each element.
It won't reduce the cost of allocation because usually this vector's
capacity is usually large enough to hold whatever we push to it.
2020-11-11 19:52:19 -03:00
ReinUsesLisp 9ea8cffe35 maxwell_3d: Move code to separate functions
Deduplicate some code and put it in separate functions so it's easier to
understand and profile.
2020-11-11 19:52:19 -03:00
german f5110340e6 fix minor clang error 2020-11-10 10:38:15 -06:00
bunnei c22d0d9945
Merge pull request #4901 from bunnei/caps-stub
hle: service: caps_u: Stub GetAlbumFileList3AaeAruid.
2020-11-09 21:20:08 -08:00
Chloe Marcec fc4d692c50 Addressed issues 2020-11-10 15:57:36 +11:00
Chloe Marcec 31c12de0fe core: Make nvservices more standardized 2020-11-10 15:57:35 +11:00
lat9nq c433c0a746 bootmanager: Address review comments
Changes QMessageBox usages to warnings, as the problems they bring to
light are being safely handled by the application and do not warrant
something of the "critical" level.

Changes LOG_CRITICAL to LOG_ERROR for the same reason. Preferring ERROR
to WARNING as yuzu is denying loading of any guest applications after
checking for these conditions.

Moved logging the GL_RENDERER string into GetUnsupportedGLExtensions()
to make more clear that unsupported extensions were already being
logged. Makes placement of the logs easier to understand later, as well.
2020-11-09 22:55:05 -05:00
lat9nq 945cfe234b bootmanager: Log and show GL_RENDERER string when GPU is insufficient
Changes the first message to not include the OpenGL version, as the
error is caused by OpenGL failing to load.

Adds a new check for OpenGL version 4.3. This will display a message
with a similar error as well as the GL_RENDERER string. Adds a CRITICAL
log message when triggered. This prevents a crash with yuzu trying to
use older OpenGL versions.

Modifies the unsupported extension message to output the GL_RENDERER
string in the message, as well as logging the string.
2020-11-09 22:12:41 -05:00
Rodrigo Locatti 9b24197ca0
Merge pull request #4909 from lioncash/interrupt
cpu_interrupt_handler: Mark move contructor/assignment as deleted
2020-11-08 22:09:40 -03:00
Lioncash da7be67daf ipc_helpers: Remove usage of the global system instance
Resolves numerous deprecation warnings throughout the codebase due to
inclusion of this header. Now building core should be significantly less
noisy (and also relying on less global state).

This also uncovered quite a few modules that were relying on indirect
includes, which have also been fixed.
2020-11-08 15:58:11 -05:00
Lioncash 0aad914527 cpu_interrupt_handler: Mark move contructor/assignment as deleted
The interrupt handler contains a std::atomic_bool, which isn't copyable
or movable, so the special move member functions will always be deleted,
despite being defaulted.

This can resolve warnings on clang and GCC.
2020-11-08 15:37:04 -05:00
german 70df449d0a Allow to dial any angle with digital joystick 2020-11-08 09:15:33 -06:00
Morph a6ecdf42bc applets: Rename LibraryAppletVersion to ControllerAppletVersion 2020-11-08 10:04:12 -05:00
Morph 9efbf5309f applets/controller: Pop normal data for StrapGuide and FirmwareUpdate 2020-11-08 09:35:25 -05:00
Morph af1183a993 applets/controller: Introduce additional checks for mode and caller
Some games like Cave Story+ set invalid values in the ControllerPrivateArg's mode and caller fields.
Use other fields to determine the appropriate mode and caller should either or both fields be invalid.
2020-11-08 09:35:25 -05:00
Morph 88192af8ac applets/controller: Add ControllerUpdateFirmwareArg struct 2020-11-08 09:35:25 -05:00
bunnei 7bf9f9ae49
Merge pull request #4903 from bunnei/remove-gpu-integrity
video_core: dma_pusher: Remove integrity check on command lists.
2020-11-08 02:48:22 -08:00
LC e829973742
Merge pull request #4906 from lat9nq/log-cpu-accuracy
settings: log value of CPU_Accuracy
2020-11-07 17:01:33 -05:00
lat9nq 1e149dc18b settings: log value of CPU_Accuracy 2020-11-07 16:14:10 -05:00
bunnei dc5396a466 video_core: dma_pusher: Remove integrity check on command lists.
- This seems to cause softlocks in Breath of the Wild.
2020-11-07 00:08:19 -08:00
bunnei af477fb8c5
Merge pull request #4888 from lioncash/unicorn-remove
core: Remove usage of unicorn
2020-11-06 22:39:05 -08:00
bunnei a0d7a2732d hle: service: caps_u: Stub GetAlbumFileList3AaeAruid.
- This works similiar to GetAlbumContentsFileListForApplication.
- Since we do not implement the album, this should be safe to stub for now.
- Used by Super Smash Bros. Ultimate (newer updates) in World of Light.
2020-11-06 22:23:15 -08:00
Lioncash 00fb79b2f3 common/fiber: Move all member variables into impl class
Hides all of the implementation details for users of the class. This has
the benefit of reducing includes and also making the fiber classes
movable again.
2020-11-06 20:36:32 -05:00
bunnei 91a45834fd
Merge pull request #4891 from lioncash/clang2
General: Fix clang build
2020-11-06 10:33:13 -08:00
bunnei 0b75ec5316
Merge pull request #4894 from lioncash/fn
settings: Simplify initializer of resolution factor
2020-11-06 09:54:02 -08:00
Lioncash c0ab5b79dc settings: Simplify initializer of resolution factor
This can use a braced initializer to accomplish the same thing with less
code.
2020-11-05 22:07:10 -05:00
bunnei a111a9ae2c
Merge pull request #4854 from ReinUsesLisp/cube-array-shadow
shader: Partially implement texture cube array shadow
2020-11-05 16:25:00 -08:00
Lioncash 6f006d051e General: Fix clang build
Allows building on clang to work again
2020-11-05 10:07:16 -05:00
bunnei d62d28522b
Merge pull request #4889 from lioncash/setting-global
core/settings: Move configuring_global behind an API
2020-11-04 17:09:19 -08:00
bunnei 087f52e872
Merge pull request #4858 from lioncash/initializer
General: Resolve a few missing initializer warnings
2020-11-04 12:10:10 -08:00
Lioncash 7aae6d6d2b core/settings: Move configuring_global behind an API
Rather than have directly modified global state here, we can make it an
implementation detail and have an interface that changes are queried
through.
2020-11-04 04:16:37 -05:00
Chloe 6bbbbe8f85
Merge pull request #4869 from bunnei/improve-gpu-sync
Improvements to GPU synchronization & various refactoring
2020-11-04 18:36:55 +11:00
Lioncash fc6db97a09 core: Remove usage of unicorn
Unicorn long-since lost most of its use, due to dynarmic gaining support
for handling most instructions. At this point any further issues
encountered should be used to make dynarmic better.

This also allows us to remove our dependency on Python.
2020-11-03 20:22:05 -05:00
bunnei 4bfa411ddc
Merge pull request #4874 from lioncash/nodiscard2
nvdec: Make use of [[nodiscard]] where applicable
2020-11-03 16:34:07 -08:00
bunnei 222fe75401
Merge pull request #4873 from lioncash/common-error
common: Enable warnings as errors
2020-11-03 11:00:23 -08:00
bunnei 448e4d5c2a
Merge pull request #4878 from bunnei/unload-nrr
hle: service: ldr: Implement UnloadNrr.
2020-11-03 08:52:40 -08:00
Lioncash 4a4b685a04 common: Enable warnings as errors
Cleans up common so that we can enable warnings as errors.
2020-11-02 15:50:58 -05:00
Lioncash 4f0f481f63 nvdec: Make use of [[nodiscard]] where applicable
Prevents bugs from occurring where the results of a function are
accidentally discarded
2020-11-02 02:45:15 -05:00
bunnei 1089d76736
Merge pull request #4865 from ameerj/async-threadcount
async_shaders: Increase Async worker thread count for >8 thread cpus
2020-11-01 01:54:01 -07:00
bunnei 848bdf8a40 fixup! hle service: nvdrv: nvhost_gpu: Update to use SyncpointManager and other improvements. 2020-11-01 01:52:38 -07:00
bunnei 7d2839d7a3 core: Initialize GPU before services. 2020-11-01 01:52:38 -07:00
bunnei e67b8678f8 hle service: nvdrv: nvhost_gpu: Update to use SyncpointManager and other improvements.
- Refactor so that SubmitGPFIFO and KickoffPB use shared functionality.
- Implement add_wait and add_increment flags.
2020-11-01 01:52:38 -07:00
bunnei c6e1c46ac7 video_core: dma_pusher: Add support for integrity checks.
- Log corrupted command lists, rather than crash.
2020-11-01 01:52:38 -07:00
bunnei c64545d07a video_core: dma_pusher: Add support for prefetched command lists. 2020-11-01 01:52:38 -07:00
bunnei 1d4cbb92f2 service: hle: nvflinger: Fix potential shutdown crash when GPU is destroyed. 2020-11-01 01:52:38 -07:00
bunnei 6053b95552 video_core: gpu: Implement WaitFence and IncrementSyncPoint. 2020-11-01 01:52:37 -07:00
bunnei 66edfd61c6 hle service: nvdrv: nvhost_ctrl: Update to use SyncpointManager. 2020-11-01 01:52:37 -07:00
bunnei 4a3fd97e48 hle service: nvdrv: Update to instantiate SyncpointManager. 2020-11-01 01:52:34 -07:00
bunnei d567b7e841 hle: service: nvdrv: Implement SyncpointManager, to manage syncpoints. 2020-11-01 01:51:54 -07:00
Levi Behunin bca9591660
Rename to align with switchbrew and remove gpu function (#4714)
* Rename to align with switchbrew

* Rename to align with switchbrew and remove gpu function that checks if clearing should be done.
2020-11-01 01:24:17 -07:00
bunnei 98f68d06f1
Merge pull request #4853 from ReinUsesLisp/fcmp-imm
shader/arithmetic: Implement FCMP immediate + register variant
2020-10-31 01:25:02 -07:00
bunnei a0e5cccb92 hle: service: ldr: Implement UnloadNrr.
- Used by Final Fantasy X/X-2 HD Remaster.
2020-10-31 01:22:53 -07:00
LC 6db0c0d8d9
Merge pull request #4872 from jbeich/clang
video_core: unbreak -Werror in NVDEC with Clang
2020-10-30 15:11:40 -04:00
Lioncash 14a97d082e CMakeLists: Resolve MSVC build failures
Prevents the compiler tripping up about Windows headers.
2020-10-30 14:57:58 -04:00
Jan Beich 50e52ade85 video_core: unbreak -Werror in NVDEC with Clang
src/core/hle/service/nvdrv/devices/nvhost_nvdec_common.cpp:41:15: error: unused variable 'OutOfMemory' [-Werror,-Wunused-const-variable]
constexpr u32 OutOfMemory{static_cast<u32>(-12)};
              ^
2020-10-30 16:43:10 +00:00
bunnei 8aa9ae5ba5
Merge pull request #4868 from lioncash/discard-error
General: Make ignoring a discarded return value an error
2020-10-30 00:35:40 -07:00
Lioncash 11d0a6e7b8 General: Catch more expressions with no effect on MSVC
MSVC lets us fine-tune catching expressions with no side-effects a
little more.
2020-10-30 00:13:26 -04:00
Lioncash 26547d3e3b General: Make ignoring a discarded return value an error
Allows our CI to catch more potential bugs. This also removes the
[[nodiscard]] attribute of IOFile's Open member function. There are
cases where a file may want to be opened, but have the status of it
checked at a later time.
2020-10-30 00:13:21 -04:00
Lioncash 8049b8beb6 common/stream: Be explicit with copy and move operators 2020-10-29 22:57:35 -04:00
Lioncash 12eeffcb7c vp9: Be explicit with copy and move operators
It's deprecated in the language to autogenerate these if the destructor
for a type is specified, so we can explicitly specify how we want these
to be generated.
2020-10-29 22:57:35 -04:00
Lioncash 0d713cf8eb vp9: Mark functions with [[nodiscard]] where applicable
Prevents values from mistakenly being discarded in cases where it's a
bug to do so.
2020-10-29 22:57:32 -04:00
Lioncash badea3b301 vp9: Provide a default initializer for "hidden" member
The API of VP9 exposes a WasFrameHidden() function which accesses this
member. Given the constructor previously didn't initialize this member,
it's a potential vector for an uninitialized read.

Instead, we can initialize this to a deterministic value to prevent that
from occurring.
2020-10-29 22:35:55 -04:00
Lioncash f8543249f0 vp9: Make some member functions internally linked
These helper functions don't directly modify any member state and can be
hidden from view.
2020-10-29 22:34:46 -04:00
Lioncash 5553bd3ba2 General: Resolve a few missing initializer warnings
Resolves a few -Wmissing-initializer warnings.
2020-10-29 19:37:07 -04:00
bunnei ef29bf4515
Merge pull request #4837 from lioncash/nvdec-2
nvdec: Minor tidying up
2020-10-29 12:28:07 -07:00
ameerj 3620206136 async_shaders: Increase Async worker thread count for 8+ thread cpus
Adds 1 async worker thread for every 2 available threads above 8
2020-10-29 14:16:45 -04:00
bunnei 2dbb144fc6
Merge pull request #4781 from german77/GChotplug
Add hotplug, rumble and fix 3rd party adapters for the GC adapter
2020-10-29 10:28:19 -07:00
Morph 9cfc5fee2f kernel/process: Add missing <ctime> include
Fixes compilation on MSVC
2020-10-29 03:17:20 -04:00
LC 1a6b1bf1d7
Merge pull request #4857 from liushuyu/master
web_service: follow-up fix to #4842
2020-10-29 01:54:45 -04:00
bunnei c5134cbf3a
Merge pull request #4835 from lat9nq/rng-default-time
kernel: Use the current time as the default RNG seed
2020-10-28 22:51:29 -07:00
bunnei c6d001c94f
Merge pull request #4838 from lioncash/syncmgr
sync_manager: Amend parameter order of calls to SyncptIncr constructor
2020-10-28 22:49:22 -07:00
liushuyu cf63eacc1a
web_service: follow-up fix to #4842 ...
* The web_service http request is now fixed on Windows (R) platform.
* The issue is due to a complicated race-condition in `httplib`, a detailed
  explanation is available at https://github.com/yhirose/cpp-httplib/pull/701
* A pending Pull Request on `httplib` has been applied to remedy the
  said race-condition.
* The socket availability check is removed due to a behavioral chice of
  `httplib` that a socket will not be created before any actual request
  is sent.
2020-10-28 23:16:06 -06:00
german 5333db91c1 Add hotplug, rumble and fix 3rd party adapters for the GC adapter 2020-10-28 21:12:34 -05:00
bunnei 156556ddd2 web_service: web_backend: Handle socket errors with GenericRequest.
- Fixes a shutdown crash when we try to submit telemetry if there is a service issue.
2020-10-28 17:19:12 -07:00
bunnei 94eca09cf6 video_core: cdma_pusher: Add missing LOG_DEBUG field in ExecuteCommand. 2020-10-28 16:47:08 -07:00
bunnei 7af2cb4318
Merge pull request #4846 from lioncash/service-fn
service: Update function tables
2020-10-28 13:47:56 -07:00
ReinUsesLisp 657771bdcb shader: Partially implement texture cube array shadow
This implements texture cube arrays with shadow comparisons but doesn't
fix the asserts related to it.

Fixes out of bounds reads on swizzle constructors and makes them use
bounds checked ::at instead of the unsafe operator[].
2020-10-28 17:12:40 -03:00
ReinUsesLisp 44b552be71 shader/arithmetic: Implement FCMP immediate + register variant
Trivially add the encoding for this.
2020-10-28 17:05:41 -03:00
LC 725fcbb368
Merge pull request #4851 from ReinUsesLisp/core-threads-race
hle/kernel: Remove unused registered_core_threads to fix data races
2020-10-28 04:54:35 -04:00
LC a1f176ce52
Merge pull request #4850 from ReinUsesLisp/fiber-ptr-ref
common/fiber: Take shared_ptr<Fiber> by copy in YieldTo
2020-10-28 04:54:19 -04:00
LC 1fd22823bc
Merge pull request #4849 from ReinUsesLisp/fix-fiber-test
tests: Fix data race in fibers test
2020-10-28 04:26:10 -04:00
LC 978e7897a3
Merge pull request #4848 from ReinUsesLisp/type-limits
video_core: Enforce -Werror=type-limits
2020-10-28 03:16:10 -04:00
ReinUsesLisp 79da90cea8 video_core: Enforce -Wredundant-move and -Wpessimizing-move
Silence three warnings and make them errors to avoid introducing more in the future.
2020-10-28 02:44:50 -03:00
ReinUsesLisp 4a451e5849 video_core: Enforce -Werror=type-limits
Silences one warning and avoids introducing more in the future.
2020-10-28 02:37:47 -03:00
ReinUsesLisp cdb2480d39 common/fiber: Take shared_ptr<Fiber> by copy in YieldTo
YieldTo does not intend to modify the passed shared_ptrs.
Pass it by copy to keep a reference count while this function executes.
2020-10-28 02:02:44 -03:00
ReinUsesLisp 3fdb42e0b4 tests: Fix data race in fibers test
Previous to this commit, the tests were using operator[] from
unordered_map to query elements but this silently inserts empty elements
when they don't exist. If all threads were executed without concurrency,
this wouldn't be an issue, but the same unordered_map could be written
from two threads at the same time. This is a data race and makes some
previously inserted elements invisible for a short period of time,
causing them to insert and return an empty element. This default
constructed element (a zero) was used to index an array of fibers that
asserted when one of them was nullptr, shutting the test session off.

To address this issue, lock on thread id reads and writes. This could be
a shared mutex to allow concurrent reads, but the definition of
std::this_thread::get_id is fuzzy when using non-standard techniques
like fibers. I opted to use a standard mutex.

While we are at it, fix the included headers.
2020-10-28 01:41:24 -03:00
Lioncash 020519def8 service: Update function tables
Updates function tables according to info on SwitchBrew.
2020-10-27 21:19:46 -04:00
liushuyu 8e673cbb08
web_backend: fix a regression introduced in 39c8d18
* A regression was in 39c8d18 and token verification function was
  broken.
* The reason being `httplib` now requires OpenSSL 1.1+ API while
  LibreSSL 2.x provided OpenSSL 1.0 compatible API.
* The bundled LibreSSL has been updated to 3.2.2 so it now provides
  OpenSSL 1.1 compatible API now.
* Also the path hint has been added so that it will find the correct
  path to the CA certs on *nix systems.
* An option is provided so that *nix system distributions/providers can
  use their own SSL implementations when compiling Yuzu/Citra to
  (hopefully) complies with their maintenance guidelines.
* LURLParse is also removed since `httplib` can handle
  `scheme:host:port` string itself now.
2020-10-27 02:57:19 -06:00
Lioncash 047e77e2f0 sync_manager: Amend parameter order of calls to SyncptIncr constructor
Corrects some cases where the arguments would be incorrectly swapped.
2020-10-27 03:22:57 -04:00
Lioncash cce14b4cd7 h264: Make WriteUe take a u32
Enforces the type of the desired value in calling code.
2020-10-27 03:21:53 -04:00
Lioncash 6291975731 vp9: std::move buffer within ComposeFrameHeader()
We can move the buffer here to avoid a heap reallocation
2020-10-27 02:27:31 -04:00
Lioncash 00decfbb07 vp9: Remove dead code 2020-10-27 02:26:17 -04:00
Lioncash 111802bbbb vp9: Join declarations with assignments 2020-10-27 02:26:03 -04:00
Lioncash 3b5d5fa86f vp9: Remove pessimizing moves
The move will already occur without std::move.
2020-10-27 02:21:40 -04:00
Lioncash dcc26c54a5 vp9: Resolve variable shadowing 2020-10-27 02:20:17 -04:00
Lioncash c04203b786 nvdec: Tidy up header includes
Prevents a few unnecessary inclusions.
2020-10-27 02:16:42 -04:00
bunnei 941563f981 yuzu: settings: Enable multicore, asynch GPU, and assembly shaders by default.
- In general, this is now the preferred settings for most games.

# Conflicts:
#	src/yuzu/configuration/config.cpp
2020-10-26 23:13:05 -07:00
bunnei d33399e1f4
Merge pull request #4729 from ameerj/nvdec-prod
video_core: NVDEC Implementation
2020-10-26 23:02:42 -07:00
ReinUsesLisp ce69ff2890 hle/kernel: Remove unused registered_core_threads to fix data races
This member was only used on asserts and it triggered data races.
Remove it to fix them.
2020-10-27 01:55:39 -03:00
bunnei c7f32931ee
Merge pull request #4832 from bunnei/cpu-manager-microprofile-fix
core: cpu_manager: Add missing call to MicroProfileOnThreadExit().
2020-10-26 21:29:09 -07:00
bunnei 1828f82000
Merge pull request #4833 from bunnei/timezonemanager-explicit
hle: services: TimeZoneContentManager: This can be made explicit.
2020-10-26 21:28:45 -07:00
ameerj eb67a45ca8 video_core: NVDEC Implementation
This commit aims to implement the NVDEC (Nvidia Decoder) functionality, with video frame decoding being handled by the FFmpeg library.

The process begins with Ioctl commands being sent to the NVDEC and VIC (Video Image Composer) emulated devices. These allocate the necessary GPU buffers for the frame data, along with providing information on the incoming video data. A Submit command then signals the GPU to process and decode the frame data.

To decode the frame, the respective codec's header must be manually composed from the information provided by NVDEC, then sent with the raw frame data to the ffmpeg library.

Currently, H264 and VP9 are supported, with VP9 having some minor artifacting issues related mainly to the reference frame composition in its uncompressed header.

Async GPU is not properly implemented at the moment.

Co-Authored-By: David <25727384+ogniK5377@users.noreply.github.com>
2020-10-26 23:07:36 -04:00
bunnei 9f08cea2c4
Merge pull request #4834 from lioncash/copy-fn
controller: Pass ControllerParameters by reference in ReconfigureControllers()
2020-10-26 18:49:26 -07:00
lat9nq 8bd246032a kernel: Use the current time as the default RNG seed
Use the current time, not zero, as the default RNG seed.
2020-10-26 21:42:11 -04:00
Lioncash 6b5f565324 controller: Pass ControllerParameters by reference in ReconfigureControllers()
Prevents unnecessary copies and heap reallocations from occurring.
2020-10-26 21:06:15 -04:00
bunnei 3984bb6def hle: services: TimeZoneContentManager: This can be made explicit. 2020-10-26 16:11:45 -07:00
bunnei 54aabb00b0 core: cpu_manager: Add missing call to MicroProfileOnThreadExit().
- Fixes an occasional crash when trying to launch subsequent games.
2020-10-26 16:09:15 -07:00
Rodrigo Locatti 2f6ba54483
Merge pull request #4827 from lioncash/trunc
controller: Convert led_patterns integer literals to bool literals
2020-10-25 16:56:30 -03:00
Rodrigo Locatti ae3a755d13
Merge pull request #4828 from lioncash/lockguard
general: Use template deduction guides for lock_guard
2020-10-25 16:55:54 -03:00
Lioncash 98f4c5e7b8 general: Use template deduction guides for lock_guard
Same behavior, less code.
2020-10-25 13:53:22 -04:00
Lioncash 061a63547f controller: Convert led_patterns integer literals to bool literals
'bool' isn't always guaranteed to be the same size as an int, so this
can technically cause truncation warnings if we support other platforms.
2020-10-25 13:44:12 -04:00
Morph 9afbcd9e8a applets/profile_select: Resolve a warning in exec()
Resolves a warning where not all control paths return a value.
2020-10-25 09:16:43 -04:00
bunnei ab052cf684
Merge pull request #4817 from Kewlan/open-single-save-location
main/profile_select: Don't ask for profile when there's only one.
2020-10-24 03:02:19 -07:00
LC 6f6d83befa
Merge pull request #4816 from Morph1984/controller-disconnect-fix
sdl_impl: Fix controller reconnection issues
2020-10-23 13:53:51 -04:00
bunnei 3e46934442
Merge pull request #4706 from ReinUsesLisp/cmake-host-shaders
video_core: Fix instances where msbuild always regenerated host shaders
2020-10-23 10:01:16 -07:00
bunnei e7042163c8
Merge pull request #4792 from bunnei/rtc-fix
service: time: Update current time with changes to RTC setting.
2020-10-22 20:46:54 -07:00
Kewlan 85b5b816cf Don't ask for profile when there's only one. 2020-10-22 11:16:56 +02:00
Lioncash ea20b5c970 core: Fix clang build pt.3
Should finally resolve building with clang.
2020-10-21 22:14:23 -04:00
Morph 2f852f182a sdl_impl: Fix controller reconnection issues
It turns out that after a controller is disconnected, there is a chance that events from the previous controller are sent/processed after it has been disconnected.
This causes the previously disconnected controller to reappear as connected due to GetSDLJoystickBySDLID() emplacing this controller back to the map.

Fix this by only returning an SDLJoystick if and only if it exists in the map.
2020-10-21 09:41:30 -04:00
bunnei 1fc61d09d3
Merge pull request #4811 from lioncash/warn-video
video_core: Conditially activate relevant compiler warnings
2020-10-20 20:59:37 -07:00
Lioncash e408bd3b7c core: Fix clang build pt.2
Resolves the clang build issue in a more unintrusive way.
2020-10-20 22:16:03 -04:00
bunnei 3d592972dc
Revert "core: Fix clang build" 2020-10-20 19:07:39 -07:00
Lioncash 678d012c2c video_core: Conditially activate relevant compiler warnings
These compiler flags aren't shared with clang, so specifying these flags
unconditionally can lead to a bit of warning spam.

While we're in the area, we can also enable -Wunused-but-set-parameter
given this is almost always a bug.
2020-10-20 20:28:25 -04:00
Lioncash fdd9154069 kernel: Fix build with recent compiler flag changes
This slipped through the cracks due to another change being merged
before the compiler flag changes.
2020-10-20 20:23:18 -04:00
LC 536c51912d
Merge pull request #4807 from ReinUsesLisp/glasm-robust-ssbo
gl_arb_decompiler: Implement robust buffer operations
2020-10-20 19:19:38 -04:00
LC 88d5140cf2
Merge pull request #4796 from lioncash/clang
core: Fix clang build
2020-10-20 19:19:12 -04:00
bunnei 940c3bf68d
Merge pull request #4390 from ogniK5377/get-applet-inf-stub
nifm: GetAppletInfo stub
2020-10-20 15:59:19 -07:00