Commit graph

7593 commits

Author SHA1 Message Date
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
e18ee8d681 hle: kernel: Port KAffinityMask from Mesosphere. 2020-12-06 00:03:24 -08: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
Morph
f6d4a289d5 applets: Resolve variable shadowing 2020-12-05 08:37:13 -05:00
Chloe Marcec
7fbeb489d3 system_version: Update to 11.0.0 2020-12-05 16:08:03 +11:00
Morph
c2f83c04cb nim: Stub IsLargeResourceAvailable
- Used by Immortals Fenyx Rising
2020-12-04 09:53:21 -05: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
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
25f650e075
Merge pull request #4937 from german77/multiUDP
InputCommon: Add multiple udp server support
2020-12-01 11:47:37 -08:00
bunnei
7bc3e80399
Merge pull request #4939 from german77/MouseInput
InputCommon: Implement full mouse support
2020-11-29 22:59:50 -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
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
bunnei
1fde40b2c7
Merge pull request #5011 from lioncash/file-str2
core: Reduce string copies in GetGameFileFromPath()
2020-11-27 17:23:00 -08: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
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
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
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
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
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
bunnei
3359e5ab70 core: cpu_manager: Fix shutdown crash when closing before emulation starts. 2020-11-24 15:25:39 -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
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
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
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
bunnei
afd0e2ee87
Merge pull request #4907 from ogniK5377/nvdrv-cleanup
core: Make nvservices more standardized
2020-11-20 22:15:44 -08:00
bunnei
3794c91145 olsc: Move member initialization to after member functions. 2020-11-20 10:50:50 -08: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
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
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
97b2220a82 general: Fix compiler warnings on linux and miscellaneous changes 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
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
8f2959f680 settings: Preparation for per-game input settings 2020-11-15 23:33:20 -05:00
Morph
c0c4ed0d3b controllers/npad: Connect a controller on init if none are connected 2020-11-15 23:33:19 -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
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
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
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
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
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
448e4d5c2a
Merge pull request #4878 from bunnei/unload-nrr
hle: service: ldr: Implement UnloadNrr.
2020-11-03 08:52:40 -08: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
1d4cbb92f2 service: hle: nvflinger: Fix potential shutdown crash when GPU is destroyed. 2020-11-01 01:52:38 -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
a0e5cccb92 hle: service: ldr: Implement UnloadNrr.
- Used by Final Fantasy X/X-2 HD Remaster.
2020-10-31 01:22:53 -07: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
Lioncash
5553bd3ba2 General: Resolve a few missing initializer warnings
Resolves a few -Wmissing-initializer warnings.
2020-10-29 19:37:07 -04:00
Morph
9cfc5fee2f kernel/process: Add missing <ctime> include
Fixes compilation on MSVC
2020-10-29 03:17:20 -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
7af2cb4318
Merge pull request #4846 from lioncash/service-fn
service: Update function tables
2020-10-28 13:47:56 -07:00
Lioncash
020519def8 service: Update function tables
Updates function tables according to info on SwitchBrew.
2020-10-27 21:19:46 -04: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
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
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
Lioncash
ea20b5c970 core: Fix clang build pt.3
Should finally resolve building with clang.
2020-10-21 22:14:23 -04: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
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
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
David Marcec
298b50e220 Added remaining params 2020-10-20 16:45:01 +11:00
David Marcec
acd35e1b60 nifm: GetAppletInfo stub
Fixes crash for Catherine Full Body
2020-10-20 16:42:40 +11:00
bunnei
60bd54776a
Merge pull request #4788 from ReinUsesLisp/lockfree-host-thread
kernel: Implement host thread register methods without locking
2020-10-19 22:31:52 -07:00
bunnei
e7a26ecec5
Merge pull request #4785 from Morph1984/fs-hades
filesystem: Fix CreateDirectory and DeleteFile
2020-10-19 16:04:01 -07:00
bunnei
598ef6b0b3
Merge pull request #4802 from lioncash/bcat
core: Add boxcat sources with target_sources
2020-10-19 12:40:49 -07:00
bunnei
54b977acaa
Merge pull request #4783 from bunnei/nvdrv-freespace
hle: service: nvdrv: Implement nvhost_as_gpu::FreeSpace.
2020-10-18 12:41:18 -07:00
Lioncash
0ab7bfdfce core: Add boxcat sources with target_sources
Same behavior, minus a script variable.
2020-10-18 08:09:06 -04:00
bunnei
2190f1a2b7
Merge pull request #4801 from lioncash/missing-bound
mii/manager: Make use of unused lower bound in GetRandomValue()
2020-10-17 23:32:40 -07:00
Lioncash
be1954e04c core: Fix clang build
Recent changes to the build system that made more warnings be flagged as
errors caused building via clang to break.

Fixes #4795
2020-10-17 19:50:39 -04:00
Lioncash
c1577f3448 mii/manager: Make use of unused lower bound in GetRandomValue()
Previously, the lower bound wasn't being used and zero was being used as
the lower bound every time this function was called.

This affects the outcome of some of the randomized entries a little bit,
for example, the lower-bound for beard and mustache flags was supposed
to be 1, not 0.

Aside from these cases, the bug didn't affect anything else.
2020-10-17 09:50:04 -04:00
bunnei
363c644730 service: bcat: Check client connection before interacting with socket.
- Fixes a crash when BCAT service is offline.
2020-10-16 21:16:56 -07:00
bunnei
dbd1662ae2
Merge pull request #4784 from bunnei/cancelbuffer
hle: service: vi: Implement BufferQueue::CancelBuffer.
2020-10-15 19:57:27 -07:00
bunnei
1d714c8c7f service: acc: Stub IManagerForApplication::StoreOpenContext.
- Used by Super Mario 3D All-Stars.
2020-10-14 20:06:33 -07:00
bunnei
1f186f34a2 hle: service: vi: Implement BufferQueue::CancelBuffer.
- This is used by Super Mario 3D All-Stars.
2020-10-13 22:11:52 -07:00
ReinUsesLisp
b9a9b83bee kernel: Implement host thread register methods without locking
Locks on GetCurrentHostThreadID were causing performance issues
according to Visual Studio's profiler. It was consuming twice the time
as arm_interface.Run(). The cost was not in the function itself but in
the lockinig it required.

Reimplement these functions using atomics and static storage instead of
an unordered_map. This is a side effect to avoid locking and using linked
lists for reads.

Replace unordered_map with a linear search.
2020-10-13 18:00:25 -03:00
Lioncash
39c8d18feb core/CMakeLists: Make some warnings errors
Makes our error coverage a little more consistent across the board by
applying it to Linux side of things as well. This also makes it more
consistent with the warning settings in other libraries in the project.

This also updates httplib to 0.7.9, as there are several warning
cleanups made that allow us to enable several warnings as errors.
2020-10-13 13:16:49 -04:00
Morph
8db3feae19 filesystem: Fix CreateDirectory and DeleteFile
Add a check if dir is nullptr (does not exist)

Fixes save game creation in Hades
2020-10-13 00:57:04 -04:00
bunnei
62c6c9f6a6 service: time: Update current time with changes to RTC setting.
- This can be used to advance time, e.g. for Pokemon Sword/Shield pokejobs.
2020-10-12 18:09:15 -07:00
bunnei
d291fc1a51
Merge pull request #3929 from FearlessTobi/ticket-keys
file_sys/nsp: Make SetTicketKeys actually do something
2020-10-12 17:58:36 -07:00
bunnei
b260847218 hle: service: nvdrv: Implement nvhost_as_gpu::FreeSpace.
- This is used by Super Mario 3D All-Stars.
2020-10-12 17:39:14 -07:00
bunnei
92adb69fa7
Merge pull request #4736 from Morph1984/home-button-input-protection-stub
hid: Stub HomeButtonInputProtection service commands
2020-10-07 14:54:05 -07:00
bunnei
cc0dc3280d
Merge pull request #4710 from Morph1984/fix-integrated-updates
submission_package: Fix updates integrated into cartridge images.
2020-10-06 22:27:52 -07:00
bunnei
32b4627a9c
Merge pull request #4737 from Morph1984/setshimlibraryversion-stub
capsrv: Stub 3 variants of SetShimLibraryVersion
2020-10-06 21:39:38 -07:00
bunnei
614bd0ee8c
Merge pull request #4742 from german77/InputFilter
HID: Only use inputs corresponding to controller type
2020-10-05 21:40:09 -07:00
bunnei
182cf7d631
Merge pull request #4734 from german77/motionfusion
HID: Add Stub for EnableSixAxisSensorFusion
2020-10-01 22:39:39 -07:00
german
2f47b27654 Only use inputs corresponding to controller type 2020-10-01 19:39:53 -05:00
german
283616dbd8 Stubbed EnableSixAxisSensorFusion 2020-09-30 10:00:24 -05:00
David
4d0ae1a17a
Merge pull request #4291 from german77/ImplementControllerRumble
input_common: First implementation of controller rumble
2020-09-30 21:24:11 +10:00
David
f7808f5658
Merge pull request #4726 from lioncash/applet
frontend/controller: Eliminate dependency on the global system instance
2020-09-30 21:22:45 +10:00
Morph
91bd2281bf caps_c: Stub SetShimLibraryVersion
- Used by caps_su SetShimLibraryVersion
2020-09-30 07:19:46 -04:00
Morph
7d287a6fb0 caps_u: Stub SetShimLibraryVersion
- Used in Super Smash Bros. Ultimate
2020-09-30 07:19:46 -04:00
Morph
9a251339dc caps_su: Properly stub SetShimLibraryVersion 2020-09-30 07:19:46 -04:00
Morph
6380731486 hid: Stub HomeButtonInputProtection service commands
- Used in 1-2 Switch. Given that we do not emulate the functionality of the home button yet, we can stub this for now.
2020-09-30 06:38:24 -04:00
bunnei
392c1b96bc
Merge pull request #4705 from german77/SplitMotionPoller
HID: Use different timing for motion
2020-09-30 01:04:22 -07:00
bunnei
02ea62568f
Merge pull request #1703 from DarkLordZach/nvdec-ioctl
nvdrv: Stub nvdec/vic ioctls to bypass nvdec movies
2020-09-29 15:00:48 -07:00
german
ab88c2f611 First implementation of controller rumble 2020-09-29 10:38:25 -04:00
Lioncash
5c4e237902 core: Mark GetInstance() as deprecated
This way it's obvious that this function shouldn't be used in any future
code.
2020-09-25 19:23:23 -04:00
Lioncash
3e4a0a13cb frontend/controller: Eliminate dependency on the global system instance 2020-09-25 19:23:20 -04:00
LC
4d4afc1502
Merge pull request #4717 from lioncash/debug
service: Restore "unused" function
2020-09-25 00:07:19 -04:00
Lioncash
f3a1bf53f9 service: Restore "unused" function
Turns out this function is actually used, but within a trace log.
2020-09-25 00:06:40 -04:00
Morph
3602df7f1f submission_package: Fix updates integrated into cartridge images. 2020-09-24 17:23:14 -04:00
bunnei
fa4294cc6f
Merge pull request #4678 from Morph1984/LoadOpenContext-partial-impl
acc: Partially implement LoadOpenContext
2020-09-24 11:21:25 -07:00
german
ddff03cff5 Use different timing for motion 2020-09-23 19:09:33 -05:00
Lioncash
b14d344dfc memory: Resolve a -Wdocumentation warning
memory doesn't exist as a parameter any more.
2020-09-23 13:39:27 -04:00
Lioncash
ff45c39578 General: Make use of std::nullopt where applicable
Allows some implementations to avoid completely zeroing out the internal
buffer of the optional, and instead only set the validity byte within
the structure.

This also makes it consistent how we return empty optionals.
2020-09-22 17:32:33 -04:00
Lioncash
a881efbf26 ips_layer: Eliminate a redundant copy in Parse()
Prevents unnecessary copying of the line being parsed.
2020-09-22 16:38:45 -04:00
bunnei
53829d4cbd
Merge pull request #4675 from Morph1984/fix-boot-multicontent
submission_package: Account for multi-content NSPs
2020-09-21 16:36:46 -07:00
Morph
7a504a9365 acc: Stub LoadOpenContext
This is used in multiple games such as:
- Clubhouse Games: 51 Worldwide Classics
- Grandia HD Collection
- XCOM 2 Collection
- Baldur's Gate 1/2
- Dr Kawashima's Brain Training
- Super Mario 3D All-Stars
2020-09-21 01:01:02 -04:00
bunnei
754109fd54
Merge pull request #4683 from Morph1984/NpadHandheldActivationMode-impl
hid: Implement Get/SetNpadHandheldActivationMode
2020-09-20 12:39:20 -07:00
bunnei
8a85a562ed
Merge pull request #4643 from FearlessTobi/decrease-pad-update-interval
Test: Decrease pad_update_ns
2020-09-19 00:39:50 -07:00
Morph
ab961e0701 hid: Implement Get/SetNpadHandheldActivationMode
- Used in Clubhouse Games: 51 Worldwide Classics
2020-09-18 10:10:30 -04:00
Morph
40a72e9cd5 am: Stub GetPreviousProgramIndex
- Used in Super Mario 3D All-Stars
2020-09-17 22:03:02 -04:00
Morph
41c2f5200c submission_package: Account for multi-content NSPs
Previously we assumed a submission package can only contain one Program NCA with a single TitleID.
However, Super Mario 3D All-Stars contains four Program NCAs, each with their unique TitleIDs.
This accounts for the existence of multi-content games such as this one.
- Fixes booting Super Mario 3D All-Stars from the games list.
2020-09-17 20:44:51 -04:00
Rodrigo Locatti
53fc5d0190
Merge pull request #4670 from lioncash/initializer
arm_dynarmic_cp15: Initialize member variables
2020-09-17 21:20:53 +00:00
Rodrigo Locatti
9bdca01c27
Merge pull request #4665 from lioncash/sm-kernel
service/sm: Eliminate dependency on the global system instance
2020-09-17 21:20:39 +00:00
Rodrigo Locatti
8100275309
Merge pull request #4666 from lioncash/unused-func
service: Remove unused funcation
2020-09-17 21:19:48 +00:00
Rodrigo Locatti
131532b570
Merge pull request #4671 from lioncash/nfp-copy
command_generator/nfp: Eliminate unnecessary copies
2020-09-17 21:19:12 +00:00
bunnei
3f6d83b27c
Merge pull request #4594 from german77/MotionHID
hid/configuration: Implement motion controls to HID
2020-09-17 12:39:01 -07:00
Lioncash
aca3621146 nfp: Eliminate two unnecessary copies
GetAmiiboBuffer() returns by const reference, so we can use a reference
instead of taking the returned buffer by value.
2020-09-17 13:35:55 -04:00
Lioncash
1ee9ceb5af arm_dynarmic_cp15: Initialize member variables
Ensures that the member variables are always initialized to a
deterministic value on creation.
2020-09-17 13:03:49 -04:00
Lioncash
02b8b6677a control_metadata: Resolve typo in Portuguese language name
This isn't used anywhere, so this is a trivial fix.
2020-09-17 11:45:30 -04:00
Lioncash
8bbd82863d service: Remove unused funcation
This is now completely unused, so it can be removed.
2020-09-17 11:03:26 -04:00
Lioncash
057aa6275d service/sm: Slightly more efficient string name validation
We can check the end of the string first for null-termination, rather
than the beginning of the string.
2020-09-17 10:54:12 -04:00
Lioncash
78b1bc3b61 service/sm: Eliminate dependency on the global system instance 2020-09-17 10:43:54 -04:00
Lioncash
a62c1999c5 file_sys/romfs_factory: Eliminate usage of the global system accessor 2020-09-16 19:15:19 -04:00
Lioncash
0e80567bef file_sys/bis_factory: Eliminate usage of the global system accessor 2020-09-16 18:16:04 -04:00
Lioncash
aa8d6fc041 loader/nso: Remove unnecessary [[maybe_unused]] 2020-09-16 18:09:01 -04:00
Lioncash
113a3972a6 core/loader: Remove dependencies on the global system instance
Now all that remains is:

18 instances in file_sys code
14 instances in GDB stub code (this can be tossed wholesale)
4 instances in HLE code
2 instances in settings code.
2020-09-16 08:46:59 -04:00
Rodrigo Locatti
004bfefeb5
Merge pull request #4658 from lioncash/copy3
nca_patch: Reduce stack usage size within SearchBucketEntry()
2020-09-16 00:25:11 +00:00
Lioncash
66fc037ef2 nca_patch: Significantly reduce the stack usage size within SearchBucketEntry()
Previously this function was using ~16KB of stack (16528 bytes), which
was caused by the function arguments being taken by value rather than by
reference.

We can make this significantly lighter on the stack by taking them by
reference.
2020-09-15 09:10:58 -04:00
Lioncash
99b372a6c5 nca_patch: Make SearchBucketEntry() internally linked
This is only used internally and doesn't depend on any class state, so
we can make it fully internal.
2020-09-15 09:06:46 -04:00
Lioncash
3a8464cde2 cheat_engine: Convert ExtractName into a non-template function
We don't need to create two separate instantiations of the same code, we
can simply make the character template argument a regular function
parameter.
2020-09-15 03:24:44 -04:00
Lioncash
ba7eb5abf4 cheat_engine: Remove unnecessary system argument to CheatParser's Parse function
This isn't used within the function at all in any implementations, so we
can remove it entirely.
2020-09-15 03:20:40 -04:00
Lioncash
33e4a0b6c1 patch_manager: Resolve implicit truncations in FormatTitleVersion()
We make it explicit that we're truncating arithmetic here to resolve
compiler warnings (even if the sizes weren't u32/u64 arithmetic
generally promotes to int :<)
2020-09-14 19:19:59 -04:00
Lioncash
a4392c24cf patch_manager: Make use of type aliases
We can use these to avoid typing the same type redundantly. This way, if
these ever change, only a single location needs to be modified.
2020-09-14 19:17:50 -04:00
Lioncash
637ab14ae6 patch_manager: Make a few functions internally linked
These functions are only used within this translation unit, so we can
make them internally linked.
2020-09-14 19:04:51 -04:00
Lioncash
e0dd440b1f crypto/key_manager: Remove dependency on the global system accessor
We can supply the content provider as an argument instead of hardcoding
a global accessor in the implementation.
2020-09-14 16:49:59 -04:00
Lioncash
ec2a6e5ba8 kernel: Remove all dependencies on the global system instance
With this, the kernel finally doesn't depend directly on the global
system instance anymore.
2020-09-14 14:03:13 -04:00
bunnei
042567e4b2
Merge pull request #4636 from lioncash/kernel-hle
service: Remove two usages of the global system accessor
2020-09-14 09:17:10 -07:00
bunnei
5fc6bf96d8
Merge pull request #4323 from ReinUsesLisp/no-spin
kernel/scheduler: Use std::mutex instead of spin lock
2020-09-11 23:23:53 -07:00
bunnei
ec634b6a88
Merge pull request #4634 from lioncash/blocking
bsd: Resolve a few warnings
2020-09-11 15:17:34 -07:00
bunnei
324029d4f9
Merge pull request #4310 from ogniK5377/apollo-1-prod
audio_core: Apollo Part 1, AudioRenderer refactor
2020-09-11 10:57:27 -04:00
bunnei
03179ecafe
Merge pull request #4597 from Morph1984/mjolnir-p2
Project Mjölnir: Part 2 - Controller Applet
2020-09-10 19:28:23 -04:00
FearlessTobi
57162e1df3 Test: Decrease pad_update_ns
There have been reports of quite heavy input lag in the past.
Compared to Citra for example, our pad_update_ns value is very high.
So let's decrease it and see if it helps with this problem.
2020-09-10 16:38:53 +02:00
Rodrigo Locatti
663ea382da
Merge pull request #4633 from ReinUsesLisp/gpu-init
video_core: Remove all Core::System references in renderer
2020-09-10 02:28:54 +00:00
Lioncash
ffdf8c0cb3 service: Remove two usages of the global system accessor
Removes more instances of reliance on global state.
2020-09-07 03:18:45 -04:00
Lioncash
40968e3993 bsd: Resolve unused value within SendToImpl
Previously the address provided to SendToImpl would never be propagated
to SendTo(). This fixes that.
2020-09-07 01:06:30 -04:00
Lioncash
cd643ab5c9 bsd: Resolve sign comparison warnings 2020-09-07 01:06:27 -04:00
Lioncash
180fa6859f sockets_translate: Make use of designated initializers
Same behavior, less typing.
2020-09-07 00:53:10 -04:00
Lioncash
188a3cf74c blocking_worker: Make use of templated lambda
We can simplify this a little by explicitly specifying the typename for
the lambda function.
2020-09-07 00:47:46 -04:00
Lioncash
9652973db2 blocking_worker: Resolve -Wdocumentation warning 2020-09-07 00:45:53 -04:00
ReinUsesLisp
9e87193725 video_core: Remove all Core::System references in renderer
Now that the GPU is initialized when video backends are initialized,
it's no longer needed to query components once the game is running: it
can be done when yuzu is booting.

This allows us to pass components between constructors and in the
process remove all Core::System references in the video backend.
2020-09-06 05:28:48 -03:00
bunnei
e126021ffe
Merge pull request #4397 from ReinUsesLisp/bsd
services: Implement most of bsd:s and GetCurrentIpAddress from nifm
2020-09-05 22:40:59 -04:00
Morph
5b6268d26a configure_input: Hook up the motion button and checkbox
This allows toggling motion on or off, and allows access to the motion configuration.
Also changes the [waiting] text for motion buttons to Shake! as this is how motion is connected to a player.
2020-09-05 09:46:34 -04:00
german
6ee8eab670 Add cemu hook changes related to PR #4609 2020-09-04 21:48:13 -05:00
german
0774b17846 Remove RealMotionDevice 2020-09-04 21:48:13 -05:00
Morph
df3cbd4758 controllers/npad: Simplify motion entry assignment
Simplifies the motion assignment in the Dual Joycon entry and assigns index 1 of the motion entry (Motion 2) for the right joycon.
2020-09-04 21:48:13 -05:00
german
ff679f3d17 Include HID and configuration changes related to motion 2020-09-04 21:48:03 -05:00
Morph
0e33b19ae0 hid: Implement MergeSingleJoyasDualJoy
- Used in multiple games such as Super Mario Odyssey.
2020-09-04 15:38:33 -04:00
Morph
b65456b958 applets/controller: Resolve several compiler warnings
Resolves -Wsign-compare and -Wunused-variable
2020-09-04 12:23:26 -04:00
Morph
076e4d44c3 Address feedback 2020-09-04 12:23:25 -04:00
Morph
f95ea04995 applets/controller: Set min_players to have a minimum value of 1.
- Some games like Shipped have a minimum requirement of 0 connected players and is undesired behavior. We must require a minimum of 1 player connected regardless of what games may ask.
2020-09-04 12:23:25 -04:00
Morph
371226448a applets/controller: Modify heuristic to account for certain games
Now left and right joycons have the same priority (meaning both needs to be supported by the game).

Explanation of the new heuristic:
Assign left joycons to even player indices and right joycons to odd player indices.
We do this since Captain Toad Treasure Tracker expects a left joycon for Player 1 and a right Joycon for Player 2 in 2 Player Assist mode.
2020-09-04 12:23:25 -04:00
Morph
7299356f37 applets/controller: Implement fallback applet for the SDL frontend
Implement the fallback applet for the SDL frontend, connecting only the minimum amount of players required.
2020-09-04 12:23:25 -04:00
Morph
5ce3015945 applets/controller: Implement "Explain Text"
"Explain Text" is additional text that is shown for each player in the controller applet.
2020-09-04 12:23:25 -04:00
Morph
5219615418 Project Mjölnir: Part 2 - Controller Applet
Co-authored-by: Its-Rei <kupfel@gmail.com>
2020-09-04 12:23:25 -04:00
bunnei
ba5419b965
Merge pull request #4590 from ReinUsesLisp/tsan-sched
hle/scheduler: Fix data race in is_context_switch_pending
2020-09-03 14:39:57 -04:00
ReinUsesLisp
827ff077e7 file_sys/patch_manager: Add missing include
Fixes build issues
2020-09-03 04:51:49 -03:00
bunnei
38980b2471
Merge pull request #4568 from lioncash/fsp
fsp_srv: Resolve -Wmaybe_uninitialized warning in OpenSaveDataFileSystem()
2020-09-02 23:07:03 -04:00
bunnei
57e43682ed
Merge pull request #4564 from lioncash/file-include
file_sys: Replace inclusions with forward declarations where applicable
2020-09-02 23:06:38 -04:00
bunnei
3dcccabd1d
Merge pull request #4382 from FearlessTobi/port-udp-config
yuzu: Add motion and touch configuration from Citra
2020-09-01 13:56:37 -04:00
bunnei
a1f13a3662
Merge pull request #4589 from ReinUsesLisp/tsan-host
hle/kernel: Fix data race in GetCurrentHostThreadID
2020-08-31 21:20:49 -04:00
LC
b5ed2d408c
Merge pull request #4461 from comex/thread-names
Fix thread naming on Linux, which limits names to 15 bytes.
2020-08-31 15:31:48 -04:00
FearlessTobi
d1e1ea0fef Address second batch of reviews 2020-08-30 00:43:25 +02:00
FearlessTobi
e6bd1fd1b8 yuzu: Add motion and touch configuration 2020-08-29 18:56:34 +02:00
bunnei
40320a1d84
Merge pull request #4586 from yuzu-emu/tsan-cpu-interrupt
cpu_interrupt_handler: Make is_interrupted an atomic
2020-08-28 09:21:47 -04:00
Morph
eb149ec696 controllers/npad: Fix inconsistencies with controller connection statuses 2020-08-26 02:32:32 -04:00
Morph
334ef2efdd controllers/npad: Fix LibNX controller connection statuses
This allows homebrew applications to be able to properly detect connected controllers.
2020-08-26 02:32:32 -04:00
Morph
e7c174b426 controllers/npad: Fix LedPattern for P1-4 2020-08-26 02:32:32 -04:00
Morph
f0fac0c7fb Project Mjölnir: Part 1
Co-authored-by: James Rowe <jroweboy@gmail.com>
Co-authored-by: Its-Rei <kupfel@gmail.com>
2020-08-26 02:32:32 -04:00
ReinUsesLisp
ccdd84a778 hle/scheduler: Fix data race in is_context_switch_pending
As reported by tsan, SelectThreads could write to
is_context_switch_pending holding a mutex while SwitchToCurrent reads it
without holding any.

It is assumed that the author didn't want an atomic here, so the code is
reordered so that whenever is_context_switch_pending is read inside
SwitchToContext, the mutex is locked.
2020-08-26 02:56:05 +00:00
ReinUsesLisp
36eade7f4c hle/kernel: Fix data race in GetCurrentHostThreadID
As reported by tsan, host_thread_ids could be read while
any of the RegisterHostThread variants were called.

To fix this, lock the register mutex when yuzu is running in multicore
mode and GetCurrentHostThreadID is called.
2020-08-26 02:52:50 +00:00
ReinUsesLisp
56ac22f737 cpu_interrupt_handler: Misc style changes 2020-08-26 02:43:26 +00:00
ReinUsesLisp
ea7bda25ba cpu_interrupt_handler: Make is_interrupted an atomic
Fixes a race condition detected from tsan
2020-08-26 02:43:15 +00:00
bunnei
dd828607e0
Merge pull request #4563 from lioncash/rcache
registered_cache: Make use of designated initializers
2020-08-25 10:07:33 -04:00
M&M
43ce33b6cc logging/settings: Increase maximum log size to 100 MB and add extended logging option
The extended logging option is automatically disabled on boot but can be enabled afterwards, allowing the log file to go up to 1 GB during that session.
This commit also fixes a few errors that are present in the general debug menu.
2020-08-24 21:39:56 -07:00
bunnei
6fd3a1bf85
Merge pull request #4562 from lioncash/loop
cpu_manager: Make use of ranged for where applicable
2020-08-24 17:58:41 -04:00
bunnei
ab350b8975
Merge pull request #4561 from lioncash/key-constexpr
key_manager: Make data arrays constexpr
2020-08-23 20:41:05 -04:00
bunnei
42a00877a2
Merge pull request #4549 from lioncash/files
vfs_real: Avoid redundant map lookups
2020-08-23 19:08:36 -04:00
Lioncash
4c1a95ed61 fsp_srv: Resolve -Wunused-but-set-variable warning
We can just log out the parameters in the meantime.
2020-08-23 17:16:32 -04:00
Lioncash
01d1b5cdaf file_sys: Replace inclusions with forward declarations where applicable
Same behavior, minus unnecessary inclusions where not necessary.
2020-08-23 17:02:55 -04:00
Lioncash
85db5f4091 fsp_srv: Resolve -Wmaybe_uninitialized warning in OpenSaveDataFileSystem()
Initialize id to a deterministic value and also mark the unreachable
cases in the switch with UNREACHABLE().
2020-08-23 16:37:57 -04:00
Lioncash
67a8e73101 registered_cache: Make use of ends_with for string suffix checking
Simplifies code.
2020-08-23 11:25:45 -04:00
Lioncash
f83c6e1e0c registered_cache: Make use of designated initializers
Removes the need for comments to indicate the fields being assigned.
2020-08-23 10:26:20 -04:00
bunnei
cfb7fd395c
Merge pull request #4560 from lioncash/convert
core_timing: Resolve sign conversion warning
2020-08-23 02:11:14 -04:00
Lioncash
b62a8ca43e key_manager: Make data arrays constexpr
We can convert these maps into constexpr arrays to eliminate some
runtime static constructors.
2020-08-22 22:47:24 -04:00
Lioncash
544fbd5c84 cpu_manager: Make use of ranged for where applicable
We can simplify a few loops by making use of ranged for.
2020-08-22 22:43:19 -04:00
Lioncash
79504f1a39 core_timing: Remove unused header 2020-08-22 22:12:37 -04:00
Lioncash
25cd5d9dda core_timing: Move clock initializer into constructor initializer list
Same behavior, minus unnecessary zeroing out of the pointer.
2020-08-22 20:26:48 -04:00
Lioncash
2624b1eae6 core_timing: Resolve sign conversion warning
This constant is only ever assigned to downcount, which is a s64, not a
u64.
2020-08-22 20:26:45 -04:00
bunnei
66ac7cf730
Merge pull request #4541 from MerryMage/yolo
dynarmic: Add unsafe optimizations
2020-08-21 23:06:21 -04:00
Lioncash
f6bb905182 common/telemetry: Migrate namespace into the Common namespace
Migrates the Telemetry namespace into the Common namespace to make the
code consistent with the rest of our common code.
2020-08-18 15:08:32 -04:00
Lioncash
551882e512 vfs_real: Resolve sign conversion warnings 2020-08-18 14:58:33 -04:00
Lioncash
ed9ae5a977 vfs_real: Avoid redundant map lookups
Avoids some trivially avoidable map lookups by keeping the result of
find operations around and querying them.
2020-08-18 14:58:29 -04:00
bunnei
56c6a5def8
Merge pull request #4535 from lioncash/fileutil
common/fileutil: Convert namespace to Common::FS
2020-08-17 22:35:30 -04:00
bunnei
0530dd6ea1
Merge pull request #4494 from lioncash/transcode
aes_util: Make use of non-template variant of Transcode
2020-08-17 03:50:35 -04:00
MerryMage
836ec9176a dynarmic: Add unsafe optimizations 2020-08-16 14:15:39 +01:00
Lioncash
c4ed791164 common/fileutil: Convert namespace to Common::FS
Migrates a remaining common file over to the Common namespace, making it
consistent with the rest of common files.

This also allows for high-traffic FS related code to alias the
filesystem function namespace as

namespace FS = Common::FS;

for more concise typing.
2020-08-16 06:52:40 -04:00
bunnei
2b601e8636
Merge pull request #4526 from lioncash/core-semi
core: Resolve several -Wextra-semi warnings
2020-08-15 02:14:11 -04:00
bunnei
e6f9231ef0
Merge pull request #4527 from lioncash/pessimizing2
software_keyboard: Resolve a pessimizing move warning
2020-08-15 02:13:44 -04:00
bunnei
cb6808b4d0
Merge pull request #4492 from lioncash/linkage
system_control: Make functions internally linked where applicable
2020-08-15 02:11:49 -04:00
bunnei
2aabd1eb05
Merge pull request #4463 from lioncash/lockdiscard
kernel/scheduler: Mark SchedulerLock constructor as nodiscard
2020-08-15 01:31:23 -04:00
Lioncash
b14277ef97 time_zone_content_manager: Collapse auto and default case
Prevents a useless self-assignment from occurring.
2020-08-14 10:58:58 -04:00
Lioncash
03d5a5d9de software_keyboard: Resolve a pessimizing move warning
A std::vector created in place like this is already an rvalue and
doesn't need to be moved.
2020-08-14 09:14:54 -04:00
Lioncash
2296e921d2 core: Resolve several -Wextra-semi warnings
We can amend one of the cascade macros to require semicolons in order to
compile. In other cases, we can just remove the superfluous semicolons.
2020-08-14 09:09:20 -04:00
Lioncash
a93f6e51d3 emu_window: Mark Scoped constructor and Acquire() as nodiscard
Ensures that callers make use of the constructor, preventing bugs from
silently occurring.
2020-08-14 04:43:44 -04:00
Lioncash
f808258ed9 kernel/scheduler: Mark SchedulerLock constructor as nodiscard
Allows the compiler to warn about cases where the constructor is used
but then immediately discarded, which is a potential cause of
locking/unlocking bugs.
2020-08-14 04:43:44 -04:00
Rodrigo Locatti
e050594706
Merge pull request #4495 from lioncash/conv
cheat_engine: Resolve implicit bool->u64 conversion
2020-08-14 03:10:17 -03:00
LC
ff0b14ee62
Merge pull request #4511 from lioncash/build2
General: Tidy up clang-format warnings part 2
2020-08-13 15:13:21 -04:00
Lioncash
b724a4d90c General: Tidy up clang-format warnings part 2 2020-08-13 14:19:08 -04:00
bunnei
a8ffe6eee4
Merge pull request #4497 from lioncash/freezer-alg
freezer: Make use of std::erase_if
2020-08-11 23:07:17 -04:00
bunnei
257b1d2c4b
Merge pull request #4496 from lioncash/ce-desig
cheat_engine: Make use of designated initializers
2020-08-10 13:53:43 -04:00
bunnei
acfd771e79
Merge pull request #4491 from lioncash/unused-vars
kernel: Remove unused variables
2020-08-10 12:04:30 -04:00
bunnei
664019954a
Merge pull request #4488 from lioncash/file
vfs_vector: Make creation of array vfs files less verbose
2020-08-09 17:19:34 -04:00
bunnei
929fc849e9
Merge pull request #4457 from ogniK5377/SetScreenShotPermission
am: Unstub SetScreenShotPermission
2020-08-07 09:34:20 -04:00
Lioncash
8e86fa7e60 common/concepts: Rename IsBaseOf to DerivedFrom
This makes it more inline with its currently unavailable standardized
analogue std::derived_from.

While we're at it, we can also make the template match the requirements
of the standardized variant as well.
2020-08-07 08:09:57 -04:00
bunnei
f5d538f118
Merge pull request #4483 from lioncash/constexpr-hex
partition_data_manager: Make data arrays constexpr
2020-08-06 23:14:14 -04:00
bunnei
5cc2f99fab
Merge pull request #4490 from lioncash/arbiter
address_arbiter/scheduler: Resolve sign conversion warnings
2020-08-06 22:28:11 -04:00
Lioncash
61cd7eb47d freezer: Move entry finding to its own function
Cleans up the callsites in other functions.
2020-08-06 03:11:21 -04:00
Lioncash
06ab28263b freezer: Take address values by value
VAddr will always be 64-bit, so there's no need to take a trivial
primitive alias by reference.
2020-08-06 03:04:54 -04:00
Lioncash
253a17451b freezer: Make use of std::erase_if
With C++20 we can simplify the erasing idiom.
2020-08-06 03:03:05 -04:00
Lioncash
5b89291308 cheat_engine: Resolve implicit bool->u64 conversion
We can just return zero here.
2020-08-06 02:55:47 -04:00
Lioncash
df96a214ae cheat_engine: Make use of designated initializers
Same behavior, but makes the member being assigned obvious.
2020-08-06 02:48:13 -04:00
Lioncash
4f2acc54f5 partition_data_manager: Update master key hashes
Fills in some hashes that were previously unhandled.
2020-08-06 02:42:01 -04:00
Lioncash
7f0f37fca7 partition_data_manager: Make data arrays constexpr
Previously the constructor for all of these would run at program
startup, consuming time before the application can enter main().

This is also particularly dangerous, given the logging system wouldn't
have been initialized properly yet, yet the program would use the logs
to signify an error.

To rectify this, we can replace the literals with constexpr functions
that perform the conversion at compile-time, completely eliminating the
runtime cost of initializing these arrays.
2020-08-06 02:41:58 -04:00
Lioncash
04bb47f57f partition_data_manager: Eliminate magic value
We can use sizeof to make it obvious at the call site where the value is
coming from.
2020-08-06 02:34:10 -04:00
Lioncash
09f884b7bd aes_util: Make use of non-template variant of Transcode
Same behavior, less template instantiations.
2020-08-06 02:31:19 -04:00
comex
d37f0b29e2 Fix thread naming on Linux, which limits names to 15 bytes.
- In `SetCurrentThreadName`, when on Linux, truncate to 15 bytes, as (at
  least on glibc) `pthread_set_name_np` will otherwise return `ERANGE` and
  do nothing.
- Also, add logging in case `pthread_set_name_np` returns an error
  anyway.  This is Linux-specific, as the Apple and BSD versions of
  `pthread_set_name_np return `void`.
- Change the name for CPU threads in multi-core mode from
  "yuzu:CoreCPUThread_N" (19 bytes) to "yuzu:CPUCore_N" (14 bytes) so it
  fits into the Linux limit.  Some other thread names are also cut off,
  but I didn't bother addressing them as you can guess them from the
  truncated versions.  For a CPU thread, truncation means you can't see
  which core it is!
2020-08-05 20:34:49 -07:00
bunnei
1cc0e4b4d8
Merge pull request #4489 from lioncash/typesafe
ipc_helpers: Only allow trivially copyable objects with PushRaw() and PopRaw()
2020-08-05 23:20:23 -04:00
bunnei
35c1607f23
Merge pull request #4484 from lioncash/aesutil
aes_util: Allow SetIV() to be non-allocating
2020-08-05 22:35:41 -04:00
bunnei
61678c4e9f
Merge pull request #4475 from lioncash/bqueue
buffer_queue: Make use of designated initializers/std::nullopt where applicable
2020-08-05 16:56:46 -04:00
Lioncash
87c64c41d2 system_control: Make functions internally linked where applicable
These functions are only ever used internally as implementation details
for GenerateRandomRange(), so these can be given internal linkage.
2020-08-05 15:34:27 -04:00
Lioncash
a10d64ea79 kernel: Remove unused variables
Resolves a few compiler warnings.
2020-08-05 15:19:48 -04:00
Lioncash
9893da8e2c scheduler: Resolve sign conversion warning 2020-08-05 15:12:29 -04:00
Lioncash
1a45b15a8c address_arbiter: Resolve sign conversion warning
Makes our type conversion explicit.
2020-08-05 15:07:19 -04:00
bunnei
4a2d9c6454
Merge pull request #4444 from lioncash/volatile
common/atomic_ops: Don't cast away volatile from pointers
2020-08-05 14:22:36 -04:00
Lioncash
a77ee63f65 ipc_helpers: Only allow trivially copyable objects with PushRaw() and PopRaw()
It's undefined behavior to use non-trivially copyable objects with
std::memcpy, so we can add asserts to catch usages of these at
compile-time.
2020-08-05 14:08:28 -04:00
Lioncash
0a5456feb9 vfs_vector: Make creation of array vfs files less verbose
We can add a helper function to make creation of these files nicer.
While we're at it, we can eliminate an unnecessary std::array copy in
the constructor. This makes the overhead on some of these functions way
less intensive, given some arrays were quite large.

e.g. The timezone location names are 9633 bytes in size.
2020-08-05 12:37:00 -04:00
bunnei
07691f994a
Merge pull request #4466 from ogniK5377/loader-type-safe
loader: Make IdentifyFile typesafe
2020-08-05 12:34:25 -04:00
bunnei
142930e609
Merge pull request #4476 from lioncash/tz
time_zone_binary: Make use of designated initializers
2020-08-04 18:56:28 -04:00
bunnei
ba9ed7b1fe
Merge pull request #4401 from ogniK5377/GetIndirectLayerImageRequiredMemoryInfo
vi: IApplicationDisplayService:GetIndirectLayerImageRequiredMemoryInfo
2020-08-04 18:45:11 -04:00
bunnei
f11628b9b7
Merge pull request #4430 from bunnei/new-gpu-vmm
hle: nvdrv: Rewrite of GPU memory management.
2020-08-04 18:44:26 -04:00
bunnei
ecbee11829
Merge pull request #4472 from lioncash/const-get
perf_stats: Mark GetMeanFrametime() as const
2020-08-04 07:00:23 -07:00
David
741cbbdc0e
Merge pull request #4470 from lioncash/qualifier
patch_manager: Resolve -Wignored-qualifier warnings
2020-08-04 14:09:48 +10:00
David
723314b682
Merge pull request #4481 from lioncash/cpp-dep
yuzu: Resolve C++20 deprecation warnings related to lambda captures
2020-08-04 14:06:07 +10:00
David
25fb7cd16d
Merge pull request #4474 from lioncash/hle-profile
profile_manager: Make use of designated initializers
2020-08-04 13:51:15 +10:00
bunnei
c6e5a36452
Merge pull request #4473 from lioncash/cheat-desig
dmnt_cheat_vm: Make use of designated initializers
2020-08-03 18:07:17 -07:00
bunnei
0dbb95c42d
Merge pull request #4456 from Morph1984/stub-really-long-fs-func
fsp-srv: Stub Read/WriteSaveDataFileSystemExtraDataWithMaskBySaveDataAttribute
2020-08-03 18:06:48 -07:00
Lioncash
15660bd857 aes_util: Allow SetIV to be non-allocating
In a few places, the data to be set as the IV is already within an array.
We shouldn't require this data to be heap-allocated if it doesn't need
to be. This allows certain callers to reduce heap churn.
2020-08-03 14:29:58 -04:00
bunnei
9808f244cc
Merge pull request #4482 from lioncash/ldr-sign
service/ldr: Resolve sign mismatch warnings
2020-08-03 11:27:13 -07:00
bunnei
a971667d1f
Merge pull request #4468 from lioncash/regcache
registered_cache: Resolve -Wmaybe_uninitialized warnings
2020-08-03 11:26:45 -07:00
bunnei
94c1689ef3
Merge pull request #4471 from ogniK5377/sm-getservice-concept
sm: Make use of IsBaseOf for GetService
2020-08-03 11:11:22 -07:00
Lioncash
570150bc86 perf_stats: Make use of designated initializers
Same behavior, but allows us to avoid a now-unnecessary zero
initialization.
2020-08-03 12:33:40 -04:00
Lioncash
d767be65be perf_stats: Mark GetMeanFrametime() as const
The general pattern is to mark mutexes as mutable when it comes to
matters of constness, given the mutex acts as a transient member of a
data structure.
2020-08-03 12:33:35 -04:00
Lioncash
b249e4e0ce yuzu: Resolve C++20 deprecation warnings related to lambda captures
C++20 deprecates capturing the this pointer via the '=' capture.
Instead, we replace it or extend the capture specification.
2020-08-03 11:54:04 -04:00
Lioncash
f525da56e5 service/ldr: Resolve sign mismatch warnings
We were performing an int < size_t comparison. We can just correct the
type of the induction variable.
2020-08-03 11:48:16 -04:00
bunnei
3697fc8d14
Merge pull request #4467 from lioncash/mode
file_sys/mode: Make use of DECLARE_ENUM_FLAG_OPERATORS with Mode
2020-08-03 08:07:56 -07:00
Lioncash
04ca1ed2bd time_zone_binary: Make use of designated initializers 2020-08-03 10:42:38 -04:00
Lioncash
9b837c6069 buffer_queue: Make use of std::nullopt
Allows compilers to eliminate unnecessary zeroing out of the optional's
buffer.
2020-08-03 09:31:51 -04:00
Lioncash
24bd068a08 buffer_queue: Make use of designated initializers 2020-08-03 09:31:51 -04:00
Lioncash
b9831fd80a profile_manager: Make use of std::nullopt
Allows some implementations to completely avoid unnecessarily zeroing
out the internal buffer.
2020-08-03 09:03:42 -04:00
Lioncash
3fcaf937d2 profile_manager: Make use of designated initializers
More compact code.
2020-08-03 09:01:31 -04:00
Lioncash
c883666045 dmnt_cheat_vm: Make use of designated initializers
Allows for more compact code.
2020-08-03 08:50:51 -04:00
Lioncash
2b8ae009a0 file_sys/mode: Make use of DECLARE_ENUM_FLAG_OPERATORS with Mode
Same behavior, minus a hand-rolled operator.
2020-08-03 07:52:36 -04:00
David Marcec
6a0b77996b sm: Make use of IsBaseOf for GetService 2020-08-03 21:46:14 +10:00
Lioncash
1c6d3ba397 patch_manager: Resolve -Wignored-qualifier warnings
Top level const will always be ignored in this case, so it can be
removed.
2020-08-03 07:42:56 -04:00
Lioncash
4ca0014479 registered_cache: Resolve -Wmaybe_uninitialized warnings
While we're at it, we can avoid a redundant map lookup.
2020-08-03 07:34:46 -04:00
David Marcec
a5af1161c9 Place in anonymous namespace 2020-08-03 21:31:28 +10:00
David Marcec
6cfff2c3f6 loader: Make IdentifyFile typesafe
Relies on #4465 for concept.h Common::IsBaseOf
2020-08-03 21:31:27 +10:00
David
9b75481755
ipc: Allow all trivially copyable objects to be passed directly into WriteBuffer (#4465)
* ipc: Allow all trivially copyable objects to be passed directly into WriteBuffer

With the support of C++20, we can use concepts to deduce if a type is an STL container or not.

* More agressive concept for stl containers

* Add -fconcepts

* Move to common namespace

* Add Common::IsBaseOf
2020-08-03 07:28:54 -04:00
David
0ca42c806f
Merge pull request #4439 from lioncash/cpu
cpu_manager: Remove redundant std::function declarations
2020-08-03 20:58:31 +10:00
Morph
fc86cb4ca2 minor nits 2020-07-31 11:02:59 -04:00
David Marcec
e586921c28 am: Unstub SetScreenShotPermission 2020-08-01 00:44:14 +10:00
Morph
1241020093 fsp-srv: Stub Read/WriteSaveDataFileSystemExtraDataWithMaskBySaveDataAttribute
Stub these 2 service commands required for Animal Crossing: New Horizons Update 1.4.0
2020-07-30 15:39:44 -04:00
Morph
45fd67c109 fs: Rename SaveDataDescriptor to SaveDataAttribute 2020-07-30 15:29:39 -04:00
Morph
ed46f3c62a xts_archive: Check if the file is nullptr prior to parsing
Fixes an access violation where the file no longer exists at the specified path while being parsed.
2020-07-29 06:50:30 -04:00
Morph
2ec852dd9f registered_cache: Add support for removing folder ncas 2020-07-29 06:50:30 -04:00
bunnei
b205b12e75
Merge pull request #4442 from lioncash/devicemem
device_memory: Remove unused system member
2020-07-28 13:03:30 -07:00
Morph
8d42456dc2 configure_graphics: Remove Force 30 FPS mode
The introduction of multicore rendered this setting non-functional as timing code was changed.

This removes the setting entirely.
2020-07-28 08:07:26 -04:00
Lioncash
e3f0c93230 common/atomic_ops: Don't cast away volatile from pointers
Preserves the volatility of the pointers being casted.
2020-07-28 04:36:53 -04:00
ReinUsesLisp
bc699ace15 service/bsd: Handle Poll with no entries accurately
Testing shows that Poll called with zero entries returns -1 and signals
an errno of zero.
2020-07-28 01:51:47 -03:00
ReinUsesLisp
f7d59f3e0e services/bsd: Implement most of bsd:s
This implements: Socket, Poll, Accept, Bind, Connect, GetPeerName,
GetSockName, Listen, Fcntl, SetSockOpt, Shutdown, Recv, RecvFrom,
Send, SendTo, Write, and Close

The implementation was done referencing: SwIPC, switchbrew, testing
with libnx and inspecting its code, general information about bsd
sockets online, and analysing official software.

Not everything from these service calls is implemented, but everything
that is not implemented will be logged in some way.
2020-07-28 01:48:42 -03:00
ReinUsesLisp
2c67bbf609 service/sockets: Add worker pool abstraction
Manage worker threads with an easy to use abstraction.
We can expand this to support thread deletion in the future.
2020-07-28 01:47:03 -03:00
ReinUsesLisp
5692c48ab7 service/sockets: Add worker abstraction to execute blocking calls asynchronously
This abstraction allows executing blocking functions (like recvfrom on a
socket configured for blocking) without blocking the service thread.
It is intended to be used with SleepClientThread.
2020-07-28 01:47:03 -03:00
ReinUsesLisp
80b4bd3583 service/sockets: Add translate functions
These functions translate from Network enumerations/structures to guest
enumerations/structures and viceversa.
2020-07-28 01:47:03 -03:00
ReinUsesLisp
22263ccaa4 service/sockets: Add enumerations and structures
Add guest enumerations and structures used in socket services
2020-07-28 01:47:03 -03:00
ReinUsesLisp
ef8acc9c3d services/nifm: Implement GetCurrentIpAddress
This is trivially implemented using the Network abstraction

- Used by ftpd
2020-07-28 01:47:03 -03:00
Lioncash
2258f33ee4 device_memory: Remove unused system member
This isn't used by anything in particular, so it can be removed.
2020-07-27 23:37:49 -04:00
Lioncash
989ad52dc1 cpu_manager: Remove redundant std::function declarations
We can just return the function directly. Making for less reading.
2020-07-27 21:57:05 -04:00
bunnei
db94457205
Update src/core/hle/service/nvdrv/devices/nvmap.cpp
Co-authored-by: LC <mathew1800@gmail.com>
2020-07-27 18:27:20 -07:00
Lioncash
a7af349dae core_timing: Make use of uintptr_t to represent user_data
Makes the interface future-proofed for supporting other platforms in the event we ever support platforms with differing pointer sizes. This way, we have a type in place that is always guaranteed to be able to represent a pointer exactly.
2020-07-27 21:21:01 -04:00
CrazyMax
1ffff4dab2 remove unused variable; 2020-07-27 10:36:26 +03:00
bunnei
05def61398 hle: nvdrv: Rewrite of GPU memory management. 2020-07-26 00:49:43 -04:00
Lioncash
7b070bbf62 nvflinger: Mark interface functions with return values as [[nodiscard]]
Not using the return value of these functions are undeniably the source
of a bug. This way we allow compilers to loudly make any future misuses
evident.
2020-07-25 19:42:45 -04:00
Lioncash
5dab23e017 nvflinger: Use return value of Lock()
comex reported in #4424 that we were incorrectly discarding the return
value of Lock() which is correct.
2020-07-25 19:04:53 -04:00
bunnei
a2e1810287
Merge pull request #4350 from ogniK5377/hid-update-connected
hid: Only update keyboard & debug pad inputs if enabled
2020-07-25 11:57:24 -07:00
bunnei
d046e9b458
Merge pull request #4380 from ogniK5377/swkbd-inline-1
swkbd: Return result for Calc request for inlined swkbd
2020-07-24 22:31:24 -07:00
David Marcec
380658c21d audio_core: Apollo Part 1, AudioRenderer refactor 2020-07-25 12:39:34 +10:00
Jan Beich
f99be1c923 network: add missing include for BSDs
src/core/network/network.cpp:112:28: error: use of undeclared identifier 'SHUT_RD'
constexpr int SD_RECEIVE = SHUT_RD;
                           ^
src/core/network/network.cpp:113:25: error: use of undeclared identifier 'SHUT_WR'
constexpr int SD_SEND = SHUT_WR;
                        ^
src/core/network/network.cpp:114:25: error: use of undeclared identifier 'SHUT_RDWR'
constexpr int SD_BOTH = SHUT_RDWR;
                        ^
src/core/network/network.cpp:120:37: error: unknown type name 'in_addr'; did you mean 'in_addr_t'?
constexpr IPv4Address TranslateIPv4(in_addr addr) {
                                    ^~~~~~~
                                    in_addr_t
/usr/include/netdb.h:66:20: note: 'in_addr_t' declared here
typedef __uint32_t      in_addr_t;
                        ^
src/core/network/network.cpp:121:27: error: member reference base type 'in_addr_t' (aka 'unsigned int') is not a structure or union
    const u32 bytes = addr.s_addr;
                      ~~~~^~~~~~~
src/core/network/network.cpp:121:15: error: variables defined in a constexpr function must be initialized
    const u32 bytes = addr.s_addr;
              ^
src/core/network/network.cpp:126:10: error: incomplete result type 'sockaddr' in function definition
sockaddr TranslateFromSockAddrIn(SockAddrIn input) {
         ^
/usr/include/netdb.h:142:9: note: forward declaration of 'sockaddr'
        struct  sockaddr *ai_addr;      /* binary address */
                ^
src/core/network/network.cpp:127:5: error: unknown type name 'sockaddr_in'; did you mean 'sockaddr'?
    sockaddr_in result;
    ^~~~~~~~~~~
    sockaddr
/usr/include/netdb.h:142:9: note: 'sockaddr' declared here
        struct  sockaddr *ai_addr;      /* binary address */
                ^
src/core/network/network.cpp:127:17: error: variable has incomplete type 'sockaddr'
    sockaddr_in result;
                ^
/usr/include/netdb.h:142:9: note: forward declaration of 'sockaddr'
        struct  sockaddr *ai_addr;      /* binary address */
                ^
src/core/network/network.cpp:131:29: error: use of undeclared identifier 'AF_INET'
        result.sin_family = AF_INET;
                            ^
src/core/network/network.cpp:135:29: error: use of undeclared identifier 'AF_INET'
        result.sin_family = AF_INET;
                            ^
src/core/network/network.cpp:139:23: error: use of undeclared identifier 'htons'
    result.sin_port = htons(input.portno);
                      ^
src/core/network/network.cpp:143:14: error: variable has incomplete type 'sockaddr'
    sockaddr addr;
             ^
/usr/include/netdb.h:142:9: note: forward declaration of 'sockaddr'
        struct  sockaddr *ai_addr;      /* binary address */
                ^
src/core/network/network.cpp:156:1: error: unknown type name 'linger'
linger MakeLinger(bool enable, u32 linger_value) {
^
src/core/network/network.cpp:157:5: error: unknown type name 'linger'
    linger value;
    ^
src/core/network/network.cpp:185:16: error: use of undeclared identifier 'AF_INET'
        return AF_INET;
               ^
src/core/network/network.cpp:195:16: error: use of undeclared identifier 'SOCK_STREAM'
        return SOCK_STREAM;
               ^
src/core/network/network.cpp:197:16: error: use of undeclared identifier 'SOCK_DGRAM'
        return SOCK_DGRAM;
               ^
src/core/network/network.cpp:207:16: error: use of undeclared identifier 'IPPROTO_TCP'
        return IPPROTO_TCP;
               ^
fatal error: too many errors emitted, stopping now [-ferror-limit=]
2020-07-22 22:10:15 +00:00
David Marcec
8abb31a19d vi: IApplicationDisplayService:GetIndirectLayerImageRequiredMemoryInfo
Needed for dark souls and monster hunter
2020-07-21 23:06:18 +10:00
David
e9bfe05e04
Merge pull request #4306 from ReinUsesLisp/bsd-network
core/network: Add network abstraction
2020-07-21 16:05:47 +10:00
David Marcec
8248d76964 Address issues 2020-07-20 11:52:07 +10:00
David Marcec
d7d2c27b48 swkbd: Return result for Calc request for inlined swkbd
Fixes random swkbd popups in monster hunter
2020-07-19 18:56:16 +10:00
ReinUsesLisp
51817f6e59 core/network: Add network abstraction
This commit adds a network abstraction designed to implement bsd:s but
at the same time work as a generic abstraction to implement any
networking code we have to use from core.

This is implemented on top of BSD sockets on Unix systems and winsock on
Windows. The code is designed around winsocks having compatibility
definitions to support both BSD and Windows sockets.
2020-07-19 04:12:40 -03:00
bunnei
4a8cb9a706
Merge pull request #4348 from lioncash/nano
core_timing: Make usage of nanoseconds more consistent in the interface
2020-07-18 01:45:10 -04:00
bunnei
c700079e08
Merge pull request #4345 from Morph1984/fix-createfile
filesystem: Create subdirectories prior to creating a file
2020-07-18 00:59:26 -04:00
bunnei
90cbcaa44a
Merge pull request #4273 from ogniK5377/async-shaders-prod
video_core: Add asynchronous shader decompilation and compilation
2020-07-18 00:48:27 -04:00
bunnei
af1151b1b0
Merge pull request #4365 from lioncash/mii
mii/manager: Make use of designated initializers
2020-07-17 22:20:15 -04:00
bunnei
47b305387a
Merge pull request #4366 from lioncash/mii-sign
mii/manager: Resolve sign mismatch warnings
2020-07-17 20:13:06 -04:00
FearlessTobi
4d4bbe756f file_sys/nsp: Make SetTicketKeys actually do something
Previously, the method wasn't modifying any class state and therefore not having any effects when called.
Since this has been the case for a very long time now, I'm not sure if we couldn't just remove this method altogether.
2020-07-18 02:02:39 +02:00
bunnei
5d95e62443
Merge pull request #4344 from VolcaEM/c3
dmnt_cheat_vm: Implement opcode 0xC3 (ReadWriteStaticRegister)
2020-07-17 17:11:52 -04:00
bunnei
0f0b756775
Merge pull request #4309 from Morph1984/fix-romfs-bug
fs: Fix RomFS building when zero byte files are present
2020-07-17 17:01:20 -04:00
David Marcec
4f473cda64 Drop settings namespace 2020-07-17 17:23:24 +10:00
David Marcec
85d7a8f466 Rebase for per game settings 2020-07-17 14:26:14 +10:00
David
c783cf443e
Merge pull request #4347 from lioncash/logging
settings: Make use of std::string_view over std::string for logging
2020-07-17 13:25:06 +10:00
David
92f37a229e
Merge pull request #4371 from lioncash/cmake2
core/CMakeLists: Add missing physical_memory.h header file
2020-07-17 13:22:19 +10:00
David
adbf5ca50b
Merge pull request #4357 from lioncash/unused4
kernel: Remove unused variables
2020-07-17 13:18:31 +10:00
David
69f8b6a53e
Merge pull request #4358 from lioncash/unused5
kernel/thread: Remove unimplemented function prototype
2020-07-17 13:17:52 +10:00
Lioncash
311f500753 core/CMakeLists: Add missing physical_memory.h header file
Allows this header file to show up in IDE CMake generators.
2020-07-16 22:56:31 -04:00
Lioncash
e07eb5b223 constants: Add missing <array> include
Eliminates reliance on an indirect include.
2020-07-16 21:43:20 -04:00
Lioncash
e54c940abf mii/manager: Resolve sign mismatch warnings
Previously the loop termination condition was testing variables of
different signedness.
2020-07-16 21:07:04 -04:00
Lioncash
7f989378c0 mii/manager: Make use of designated initializers
Allows returning the structure in a more concise manner.
2020-07-16 20:45:33 -04:00
bunnei
3bbf4462db
Merge pull request #4292 from bunnei/mii-rewrite
hle: service: mii: Rewrite service to properly support creation of random and default miis.
2020-07-16 20:05:40 -04:00
Rodrigo Locatti
104c523d3d
Merge pull request #4327 from lioncash/desig2
address_space_info: Make use of designated initializers
2020-07-16 17:41:55 -03:00
Lioncash
8bef49cde5 kernel/thread: Remove unimplemented function prototype
This isn't used, so it can be removed.
2020-07-16 14:32:46 -04:00
Lioncash
2bab07c367 kernel: Remove unused variables
Resolves some compiler warnings in the Linux build.
2020-07-16 14:17:50 -04:00
Lioncash
07d080ecc8 kernel: Add missing include 2020-07-16 13:51:51 -04:00
Lioncash
f0125b2be8 cpu_manager: Mark function getters as static
All these do are return std::function instances of static functions, so
these can be used without an instance of the CPU manager.
2020-07-16 13:30:56 -04:00
Lioncash
51546ce57e cpu_manager: Remove unused preemption_count variable
Shrinks the data structure by 8 bytes.
2020-07-16 13:24:25 -04:00
Lioncash
201514cb50 cpu_manager: Add missing includes
Previously this header was relying on indirect inclusions that are no
longer satisfied.
2020-07-16 13:22:58 -04:00
bunnei
2781201bfb
Merge pull request #4337 from lat9nq/fix-per-game-async
main: Set async gpu properly after loading per-game setting
2020-07-16 11:33:51 -04:00
David
0648e023ea
Merge pull request #4346 from lioncash/thread
kernel/handle_table: Remove usages of the global system instance
2020-07-16 23:02:04 +10:00
David Marcec
0319cc1c37 hid: Only update keyboard & debug pad inputs if enabled
Previously we would ignore this setting and would update the states regardless of the user setting
2020-07-16 22:28:49 +10:00
David
815f30dc10
Merge pull request #4249 from Morph1984/delete-update-aoc-on-overwrite
registered_cache: Remove previous update/dlc if it exists on install
2020-07-16 20:36:22 +10:00
Morph
f66e3181dc Check for empty section0 and CNMT prior to install 2020-07-16 05:22:51 -04:00
Morph
5892fc1555 Add comment to clarify the nullptr check 2020-07-16 00:15:27 -04:00
Morph
2079bb4090 filesystem: Create subdirectories prior to creating a file
If subdirectories exist in the given path parameter and don't exist in the real filesystem create them prior to creating the files within.
This fixes the softlocks upon save creation in The Legend of Zelda: Breath of the Wild
2020-07-16 00:15:27 -04:00
bunnei
f26f53f35b
Merge pull request #4328 from lioncash/unused-var3
memory_layout: Remove unused data member
2020-07-15 22:08:05 -04:00
Lioncash
0435b7d361 core_timing: Remove unused data member
Shrinks the size of the CoreTiming class by 8 bytes.
2020-07-15 19:41:37 -04:00
Lioncash
bef1844a51 core_timing: Make TimedCallback take std::chrono::nanoseconds
Enforces our desired time units directly with a concrete type.
2020-07-15 19:41:22 -04:00
Lioncash
8b50c660df core_timing: Make use of std::chrono with ScheduleEvent 2020-07-15 18:54:15 -04:00
Lioncash
af5a56ddc4 settings: Resolve a sign conversion warning within GetTimeZoneString()
A sign conversion warning was occurring due to an int < size_t
comparison.
2020-07-15 13:45:22 -04:00
Lioncash
73bb87c06b kernel/process: Move name and system context to the bottom of the member list
These aren't directly important or commonly used within the process, so
we can move these to the bottom to allow everything else to be more
likely to be within a cache line.
2020-07-15 13:40:18 -04:00
Lioncash
52e83f0d5c kernel/handle_table: Remove usages of the global system instance
Removes even more usages of the global system instance, trimming away
more dependencies on global variables and making them explicit in the
interface.
2020-07-15 13:40:15 -04:00
Lioncash
5dbf91d739 settings: Make use of std::string_view over std::string for logging
In all usages of LogSetting(), string literals are provided.
std::string_view is better suited here, as we won't churn a bunch of
string allocations every time the settings are logged out.

While we're at it, we can fold LogSetting() into LogSettings(), given
it's only ever used there.
2020-07-15 13:37:33 -04:00
Lioncash
4ad69ca96e kernel/thread: Remove global GetCurrentThread()
This is only used in one place, so we can fold it into the calling code,
eliminating a place for the global system instance to be used.
2020-07-15 13:28:05 -04:00
Morph
0ca7b8269a clang format 2020-07-15 13:27:04 -04:00
Morph
1bbc61f5f1 Use proper install result when overwriting files 2020-07-15 13:27:04 -04:00
Morph
8794e623d9 Remove global system instance and address feedback 2020-07-15 13:27:04 -04:00
Morph
a82fdea1ac registered_cache: Remove previous update/dlc if it exists on install
- This checks for and removes old updates or dlc based on title id. If a content meta nca exists within the registered cache, it will attempt to remove all the ncas associated with the content meta before installing a new update/dlc
2020-07-15 13:27:04 -04:00
VolcaEM
e90802e762
clang-format 2020-07-15 01:22:52 +02:00
VolcaEM
b608acd688
dmnt_cheat_vm: Implement opcode 0xC3 (ReadWriteStaticRegister)
This was based on Atmosphére's DMNT Cheat VM:

- https://github.com/Atmosphere-NX/Atmosphere/blob/master/stratosphere/dmnt/source/cheat/impl/dmnt_cheat_vm.hpp
- https://github.com/Atmosphere-NX/Atmosphere/blob/master/stratosphere/dmnt/source/cheat/impl/dmnt_cheat_vm.cpp

From Atmosphére's documentation: "Code type 0xC3 reads or writes a static register with a given register"

There are now only two remaining opcodes to implement (PauseProcess and BreakProcess)

This is untested because I don't have any experience in testing cheats on yuzu
2020-07-15 01:19:22 +02:00
lat9nq
a683e42516 clang-format 2020-07-14 13:46:42 -04:00
lat9nq
6d1477f214 settings: Move settings sanitization to its own function
Creates a new function that can be expanded later to fix other settings that are known to cause emulation errors across executables.
2020-07-14 13:36:09 -04:00
bunnei
e2730372b8
Merge pull request #4294 from MerryMage/cpu-opt-settings
configuration: Add settings to enable/disable specific CPU optimizations
2020-07-14 12:38:03 -04:00
bunnei
450cbcfee6
Merge pull request #4282 from Morph1984/fs-size
filesystem: Set various NAND partition sizes to their defaults
2020-07-14 12:16:42 -04:00
Lioncash
f2f876e3ff memory_layout: Remove unused data member
This isn't used, so it can be removed entirely, shrinking the structure
size by 8 bytes.
2020-07-13 10:51:23 -04:00
Lioncash
ed0fe04b4f address_space_info: Use type alias to simplify code
We can define an alias for the index arrays and then just reuse it to
make the code nicer to read.
2020-07-13 10:42:52 -04:00
Lioncash
c3eb42de65 address_space_info: Make use of designated initializers
We can alter the structure so that we can use designated initializers in
the array, eliminating the comments that indicate their field names.
2020-07-13 10:42:49 -04:00
ReinUsesLisp
9b38f4fc55 kernel/scheduler: Use std::mutex instead of spin lock
Profiling shows that this is a highly contested mutex, causing dimishing
results compared to a OS lock. std::mutex implementations can spin for a
while before falling back to an OS lock.

This avoids wasting precious CPU cycles in a no-op.
2020-07-12 21:27:24 -03:00
Fernando Sahmkow
739d90ee66
Merge pull request #4265 from Morph1984/file-rename
vfs_real: Fix MoveFile
2020-07-12 13:00:09 -04:00
Morph
fd1c3aa14e fs: Fix RomFS building when zero byte files are present
When zero byte files are present, the key (offset) for that file is identical to the file right after. A std::map isn't able to fit key-value pairs with identical keys (offsets), therefore, the solution is to use std::multimap which permits multiple entries with the same key.

This most prominently fixes Pokemon Sword and Shield weather with any RomFS mod applied.
2020-07-12 04:33:35 -04:00
bunnei
e60733aad3
Merge pull request #4275 from CrazyMax/desired_language
AM: fix GetDesiredLanguage:
2020-07-12 01:45:08 -04:00
bunnei
e706501c8d hle: service: mii: Rewrite service to properly support creation of random and default miis. 2020-07-11 21:34:59 -04:00
MerryMage
505aa3a4c1 configure_cpu: Show/Hide debugging options 2020-07-11 16:38:38 +01:00
MerryMage
0193202964 configuration: Add settings to enable/disable specific CPU optimizations 2020-07-11 14:34:09 +01:00
bunnei
a0ee597b19
Merge pull request #4203 from VolcaEM/services
service: Update function tables
2020-07-11 00:02:36 -04:00
Morph
755506d404 vfs_real: Fix MoveFile
The file wasn't closed prior to being renamed / moved, throwing an error that states "The process cannot access the file because it is being used by another process." Fix this by closing the file prior to a rename / move operation.

Fixes saving in Luigi's Mansion 3 and KATANA KAMI: A Way of the Samurai Story.
2020-07-10 00:39:23 -04:00
Morph
7351ca8c75 KeyManager: Prevent writing of invalid keys
If the keys are zero, don't write them to the autogenerated file.
2020-07-10 00:39:00 -04:00
Morph
b24b463c87 bis_factory: Set User NAND free space to be 1 MiB less than total. 2020-07-10 00:37:39 -04:00
Morph
17242a8865 sdmc_factory: Set the SDMC total size to 1 TiB
We should not be limited by the SDMC's partition size, set this to 1 TiB. Hardware is limited to the max allowed by the MBR partition table which is 2 TiB.
2020-07-10 00:37:39 -04:00
Morph
0373ead96e bis_factory: Use hardware default NAND partition sizes
Sets the total space of user and system partitions to their hardware defaults.
Furthermore, return the total space as free space for the user partition to prevent it from reaching zero.
Some games like Bioshock 2 check for the available free space prior to save creation, and we should not be limited by arbitrary limits.
2020-07-10 00:37:39 -04:00
Morph
47e26d7bc7 settings: Remove storage size options 2020-07-10 00:37:39 -04:00
lat9nq
63d23835ef
configuration: implement per-game configurations (#4098)
* Switch game settings to use a pointer

In order to add full per-game settings, we need to be able to tell yuzu to switch
to using either the global or game configuration. Using a pointer makes it easier
to switch.

* configuration: add new UI without changing existing funcitonality

The new UI also adds General, System, Graphics, Advanced Graphics,
and Audio tabs, but as yet they do nothing. This commit keeps yuzu
to the same functionality as originally branched.

* configuration: Rename files

These weren't included in the last commit. Now they are.

* configuration: setup global configuration checkbox

Global config checkbox now enables/disables the appropriate tabs in the game
properties dialog. The use global configuration setting is now saved to the
config, defaulting to true. This also addresses some changes requested in the PR.

* configuration: swap to per-game config memory for properties dialog

Does not set memory going in-game. Swaps to game values when opening the
properties dialog, then swaps back when closing it. Uses a `memcpy` to swap.
Also implements saving config files, limited to certain groups of configurations
so as to not risk setting unsafe configurations.

* configuration: change config interfaces to use config-specific pointers

When a game is booted, we need to be able to open the configuration dialogs
without changing the settings pointer in the game's emualtion. A new pointer
specific to just the configuration dialogs can be used to separate changes
to just those config dialogs without affecting the emulation.

* configuration: boot a game using per-game settings

Swaps values where needed to boot a game.

* configuration: user correct config during emulation

Creates a new pointer specifically for modifying the configuration while
emulation is in progress. Both the regular configuration dialog and the game
properties dialog now use the pointer Settings::config_values to focus edits to
the correct struct.

* settings: split Settings::values into two different structs

By splitting the settings into two mutually exclusive structs, it becomes easier,
as a developer, to determine how to use the Settings structs after per-game
configurations is merged. Other benefits include only duplicating the required
settings in memory.

* settings: move use_docked_mode to Controls group

`use_docked_mode` is set in the input settings and cannot be accessed from the
system settings. Grouping it with system settings causes it to be saved with
per-game settings, which may make transferring configs more difficult later on,
especially since docked mode cannot be set from within the game properties
dialog.

* configuration: Fix the other yuzu executables and a regression

In main.cpp, we have to get the title ID before the ROM is loaded, else the
renderer will reflect only the global settings and now the user's game specific
settings.

* settings: use a template to duplicate memory for each setting

Replaces the type of each variable in the Settings::Values struct with a new
class that allows basic data reading and writing. The new struct
Settings::Setting duplicates the data in memory and can manage global overrides
per each setting.

* configuration: correct add-ons config and swap settings when apropriate

Any add-ons interaction happens directly through the global values struct.
Swapping bewteen structs now also includes copying the necessary global configs
that cannot be changed nor saved in per-game settings. General and System config
menus now update based on whether it is viewing the global or per-game settings.

* settings: restore old values struct

No longer needed with the Settings::Setting class template.

* configuration: implement hierarchical game properties dialog

This sets the apropriate global or local data in each setting.

* clang format

* clang format take 2

can the docker container save this?

* address comments and style issues

* config: read and write settings with global awareness

Adds new functions to read and write settings while keeping the global state in
focus. Files now generated per-game are much smaller since often they only need
address the global state.

* settings: restore global state when necessary

Upon closing a game or the game properties dialog, we need to restore all global
settings to the original global state so that we can properly open the
configuration dialog or boot a different game.

* configuration: guard setting values incorrectly

This disables setting values while a game is running if the setting is
overwritten by a per game setting.

* config: don't write local settings in the global config

Simple guards to prevent writing the wrong settings in the wrong files.

* configuration: add comments, assume less, and clang format

No longer assumes that a disabled UI element means the global state is turned
off, instead opting to directly answer that question. Still however assumes a
game is running if it is in that state.

* configuration: fix a logic error

Should not be negated

* restore settings' global state regardless of accept/cancel

Fixes loading a properties dialog and causing the global config dialog to show
local settings.

* fix more logic errors

Fixed the frame limit would set the global setting from the game properties
dialog. Also strengthened the Settings::Setting member variables and simplified
the logic in config reading (ReadSettingGlobal).

* fix another logic error

In my efforts to guard RestoreGlobalState, I accidentally negated the IsPowered
condition.

* configure_audio: set toggle_stretched_audio to tristate

* fixed custom rtc and rng seed overwriting the global value

* clang format

* rebased

* clang format take 4

* address my own review

Basically revert unintended changes

* settings: literal instead of casting

"No need to cast, use 1U instead"
Thanks, Morph!

Co-authored-by: Morph <39850852+Morph1984@users.noreply.github.com>

* Revert "settings: literal instead of casting
"

This reverts commit 95e992a87c898f3e882ffdb415bb0ef9f80f613f.

* main: fix status buttons reporting wrong settings after stop emulation

* settings: Log UseDockedMode in the Controls group

This should have happened when use_docked_mode was moved over to the controls group
internally. This just reflects this in the log.

* main: load settings if the file has a title id

In other words, don't exit if the loader has trouble getting a title id.

* use a zero

* settings: initalize resolution factor with constructor instead of casting

* Revert "settings: initalize resolution factor with constructor instead of casting"

This reverts commit 54c35ecb46a29953842614620f9b7de1aa9d5dc8.

* configure_graphics: guard device selector when Vulkan is global

Prevents the user from editing the device selector if Vulkan is the global
renderer backend. Also resets the vulkan_device variable when the users
switches back-and-forth between global and Vulkan.

* address reviewer concerns

Changes function variables to const wherever they don't need to be changed. Sets Settings::Setting to final as it should not be inherited from. Sets ConfigurationShared::use_global_text to static.

Co-Authored-By: VolcaEM <volcaem@users.noreply.github.com>

* main: load per-game settings after LoadROM

This prevents `Restart Emulation` from restoring the global settings *after* the per-game settings were applied. Thanks to BSoDGamingYT for finding this bug.

* Revert "main: load per-game settings after LoadROM"

This reverts commit 9d0d48c52d2dcf3bfb1806cc8fa7d5a271a8a804.

* main: only restore global settings when necessary

Loading the per-game settings cannot happen after the ROM is loaded, so we have to specify when to restore the global state. Again thanks to BSoD for finding the bug.

* configuration_shared: address reviewer concerns except operator overrides

Dropping operator override usage in next commit.

Co-Authored-By: LC <lioncash@users.noreply.github.com>

* settings: Drop operator overrides from Setting template

Requires using GetValue and SetValue explicitly. Also reverts a change that broke title ID formatting in the game properties dialog.

* complete rebase

* configuration_shared: translate "Use global configuration"

Uses ConfigurePerGame to do so, since its usage, at least as of now, corresponds with ConfigurationShared.

* configure_per_game: address reviewer concern

As far as I understand, it prevents the program from unnecessarily copying strings.

Co-Authored-By: LC <lioncash@users.noreply.github.com>

Co-authored-by: Morph <39850852+Morph1984@users.noreply.github.com>
Co-authored-by: VolcaEM <volcaem@users.noreply.github.com>
Co-authored-by: LC <lioncash@users.noreply.github.com>
2020-07-09 22:42:09 -04:00
bunnei
f9e748b721
Merge pull request #4248 from Morph1984/CreateManagedDisplaySeparableLayer
AM/ISelfController: Stub CreateManagedDisplaySeparableLayer
2020-07-09 22:09:42 -04:00
bunnei
83b1b259bd
Merge pull request #4202 from ReinUsesLisp/scoped-lock
core_timing,scheduler: Use std::scoped_lock when possible
2020-07-09 15:33:41 -04:00
CrazyMax
cf76769026 AM: fix GetDesiredLanguage:
try to get a control metadata from application update when is failed to get from the basic version.

Tested on Kirby Star Allies
2020-07-08 19:45:06 +03:00
bunnei
4e2464a713
Merge pull request #4243 from CrazyMax/display_version
AM: fix GetDisplayVersion
2020-07-08 10:46:56 -04:00
bunnei
2a87ddcce2
Merge pull request #4245 from MerryMage/page-table-race
memory: Race-condition in pagetables.
2020-07-08 10:44:33 -04:00
MerryMage
e7c77b90c4 cpu_interrupt_handler: Remove #pragma once from .cpp file 2020-07-07 22:47:00 +01:00
CrazyMax
7bd3558c64 GetDisplayVersion should return a null-terminated version string.
also, in case of failed to get of the basic version, we will try get it from application update.
2020-07-07 02:04:24 +03:00
MerryMage
76bd617b2d memory: Set page-table pointers before setting attribute = Memory 2020-07-05 12:54:19 +01:00
Morph
c0dc8f9d25 AM/ISelfController: Stub CreateManagedDisplaySeparableLayer
Stub this by sending 1 layer id instead of 2 as yuzu does not support multiple layers per display.
No adverse side effects have been observed.
- Used by Animal Crossing: New Horizons Update 1.3.0
2020-07-05 06:26:21 -04:00
Rodrigo Locatti
3096adb347
Merge pull request #4218 from ogniK5377/opus-external
externals: Track opus as submodule instead of using conan
2020-07-04 01:32:54 -03:00
bunnei
8a1cfcc8b7
Merge pull request #3924 from ogniK5377/GetKeyCodeMap
Implement GetKeyCodeMap & GetKeyCodeMap2
2020-07-02 23:03:20 -04:00
bunnei
b13fd9e65a
Merge pull request #4193 from ogniK5377/GetIndirectLayerConsumerHandle-stub
am: Stub GetIndirectLayerConsumerHandle
2020-07-02 21:31:20 -04:00
bunnei
af787e451b
Merge pull request #4192 from ogniK5377/acc-ListOpenContextStoredUsers-stub
acc: ListOpenContextStoredUsers partial stub
2020-07-02 20:36:54 -04:00
VolcaEM
3f910efb40
Rename two functions in NS
- Rename "GetShellEvent" to "GetShellEventHandle"
- Rename "LaunchApplicationFromHost" to "LaunchApplication"
2020-07-02 09:02:55 +02:00
VolcaEM
38b585a309
Rename GetApplicationArea2 to GetApplicationAreaSize 2020-07-02 08:58:51 +02:00
David Marcec
d5dfe34c49 externals: Track opus as submodule instead of using conan
Supersedes #4068 see for details.
2020-07-01 15:09:33 +10:00
Lioncash
fb13f053bb key_manager: Correct casing of instance()
Our codebase uppercases member function names.
2020-07-01 00:28:50 -04:00
Lioncash
c91710a82f key_manager: Delete move operations
Prevents the singleton from being moved from.
2020-07-01 00:24:38 -04:00
Lioncash
00a1d106bd key_manager: Make use of canonical deleted operator=
operator= typically returns a reference, it's not void.

While we're at it, we can correct the parameter formatting to adhere to the
codebase.
2020-07-01 00:21:31 -04:00
David
3bb63bc0b3
Merge pull request #3967 from FearlessTobi/keys-singleton
crypto: Make KeyManager a singleton class
2020-07-01 14:16:26 +10:00
bunnei
c6b0353c4d
Merge pull request #4153 from ogniK5377/prepo-multibuf
prepo: : Don't read extra buffer from report unless passed
2020-06-30 22:37:13 -04:00
VolcaEM
86946ea13c
Remove duplicate functions 2020-06-29 04:22:38 +02:00
VolcaEM
f3630a0713
Use decimal instead of hexadecimal
Co-authored-by: David <25727384+ogniK5377@users.noreply.github.com>
2020-06-29 04:21:10 +02:00
VolcaEM
a0c499aef7
Fix typo 2020-06-29 04:12:36 +02:00
VolcaEM
f2eead3b5b
Clang-format 2020-06-29 04:09:38 +02:00
VolcaEM
6a0010d0c6
service: Update function tables 2020-06-29 04:01:34 +02:00
ReinUsesLisp
8562b516c0 core_timing,scheduler: Use std::scoped_lock when possible
Simplifies the cognitive load of procedures using locks and makes locks
safe against exceptions.
2020-06-28 21:42:57 -03:00
bunnei
b05795d704
Merge pull request #3955 from FernandoS27/prometheus-2b
Remake Kernel Scheduling, CPU Management & Boot Management (Prometheus)
2020-06-28 12:37:50 -04:00
David Marcec
db824b59c8 ldr: Cleanup NRO & NRR structs 2020-06-28 20:54:37 +10:00
David
d67c7d9a82
Merge pull request #4026 from VolcaEM/ldr
ldr: Update NRR/NRO structs
2020-06-28 20:46:42 +10:00
David
4a5f6c03b0
Merge pull request #4184 from VolcaEM/patch-9
grc: Update function table
2020-06-28 18:49:15 +10:00
David
d3a306b7a6
Merge pull request #4185 from VolcaEM/patch-10
lbl: Update function table
2020-06-28 18:48:54 +10:00
David
477979dd43
Merge pull request #4186 from VolcaEM/patch-11
ldn: Update function table
2020-06-28 18:48:28 +10:00
David
b478b61dcf
Merge pull request #4187 from VolcaEM/patch-12
mig: Update function table
2020-06-28 18:48:15 +10:00
David
00aa9f6a53
Merge pull request #4188 from VolcaEM/patch-13
mm: Update function table
2020-06-28 18:47:55 +10:00
David
26e243d2d7
Merge pull request #4189 from VolcaEM/patch-14
ncm: Update function table
2020-06-28 18:47:27 +10:00
David
bd590895cf
Merge pull request #4190 from VolcaEM/patch-15
nfc: Update function table
2020-06-28 18:47:07 +10:00
David
e978f05ed1
Merge pull request #4183 from VolcaEM/patch-8
friend: Update function table
2020-06-28 18:46:40 +10:00
David Marcec
dcf345febe am: Stub GetIndirectLayerConsumerHandle
Needed by Monster Hunter Generations Ultimate
2020-06-28 16:51:28 +10:00
David Marcec
f0baf2abf2 acc: ListOpenContextStoredUsers partial stub
Needed by Baldur's Gate 1/2
2020-06-28 16:44:36 +10:00
Fernando Sahmkow
2f8947583f Core/Common: Address Feedback. 2020-06-27 18:20:06 -04:00
Fernando Sahmkow
e486c66850 NvFlinger: Clang Format. 2020-06-27 11:36:30 -04:00
Fernando Sahmkow
4105f38022 SVC: Implement 32-bits wrappers and update Dynarmic. 2020-06-27 11:36:27 -04:00
Fernando Sahmkow
ce350e7ce0 SVC: Add GetCurrentProcessorNumber32, CreateTransferMemory32, SetMemoryAttribute32 2020-06-27 11:36:27 -04:00
Fernando Sahmkow
b8df61c642 ARM: Update Dynarmic and Setup A32 according to latest interface. 2020-06-27 11:36:26 -04:00
Fernando Sahmkow
22ceaca2f4 SVC: Add GetThreadPriority32 & SetThreadPriority32 2020-06-27 11:36:25 -04:00
Fernando Sahmkow
ec11918323 ArmDynarmic32: Setup CNTPCT correctly 2020-06-27 11:36:24 -04:00
Fernando Sahmkow
e3d561fb84 Audio: Correct buffer release for host timing. 2020-06-27 11:36:23 -04:00
Fernando Sahmkow
7fd7d05838 Common/Kernel: Corrections and small bug fixing. 2020-06-27 11:36:21 -04:00
Fernando Sahmkow
272a87127a Services/NvFlinger: Do vSync in a sepparate thread on Multicore. 2020-06-27 11:36:20 -04:00
Fernando Sahmkow
0a8013d71e ARMDynarmicInterface: Correct GCC Build Errors. 2020-06-27 11:36:17 -04:00
Fernando Sahmkow
d240143588 Kernel: Correct Host Context on Threads and Scheduler. 2020-06-27 11:36:15 -04:00
Fernando Sahmkow
467d43570e Clang Format. 2020-06-27 11:36:14 -04:00
Fernando Sahmkow
3714f2e471 ARMInterface/Externals: Update dynarmic and fit to latest version. 2020-06-27 11:36:13 -04:00
Fernando Sahmkow
dda6147b0d ARMInterface: Correct rebase errors. 2020-06-27 11:36:12 -04:00
Fernando Sahmkow
71f1c0f9f9 CoreTiming: Correct rebase bugs and other miscellaneous things. 2020-06-27 11:36:11 -04:00
Fernando Sahmkow
cdf900f1e3 Core: Split Microprofile Dynarmic timing per Core 2020-06-27 11:36:10 -04:00
Fernando Sahmkow
528b19a842 General: Tune the priority of main emulation threads so they have higher priority than less important helper threads. 2020-06-27 11:36:09 -04:00
Fernando Sahmkow
7b44187fd2 Dynarmic Interface: don't clear cache if JIT has not been created. 2020-06-27 11:36:08 -04:00
Fernando Sahmkow
ad92865497 General: Correct rebase, sync gpu and context management. 2020-06-27 11:36:08 -04:00
Fernando Sahmkow
bfb5244cf8 CoreTiming/CycleTimer: Correct Idling. 2020-06-27 11:36:07 -04:00
Fernando Sahmkow
bece52cd81 SingleCore: Correct ticks reset to be on preemption. 2020-06-27 11:36:06 -04:00
Fernando Sahmkow
48fa3b7a0f General: Cleanup legacy code. 2020-06-27 11:36:05 -04:00
Fernando Sahmkow
c8bf47dcfb Kernel/svcBreak: Implement CacheInvalidation for Singlecore and correct svcBreak. 2020-06-27 11:36:04 -04:00
Fernando Sahmkow
54e304fe2a Bootmanager/CPU_Manager: Correct shader caches and sync GPU on OpenGL. 2020-06-27 11:36:03 -04:00
Fernando Sahmkow
19165cd859 HLE_IPC: Correct HLE Event behavior on timeout. 2020-06-27 11:36:03 -04:00
Fernando Sahmkow
7e2ce2f7f4 SingleCore: Improve Cycle timing Behavior and replace mutex in global scheduler for spinlock. 2020-06-27 11:36:02 -04:00
Fernando Sahmkow
a7ecd9e19c FrameLimiting: Enable frame limiting for single core. 2020-06-27 11:36:01 -04:00
Fernando Sahmkow
f5e32935ca SingleCore: Use Cycle Timing instead of Host Timing. 2020-06-27 11:36:01 -04:00
Fernando Sahmkow
9bde28d7b1 Scheduler: Correct Reload/Unload 2020-06-27 11:35:59 -04:00
Fernando Sahmkow
5974e3ea33 Thread: Release the ARM Interface on exitting. 2020-06-27 11:35:58 -04:00
Fernando Sahmkow
1567824d2d General: Move ARM_Interface into Threads. 2020-06-27 11:35:58 -04:00
Fernando Sahmkow
1b82ccec22 Core: Refactor ARM Interface. 2020-06-27 11:35:56 -04:00
Fernando Sahmkow
534466754f X64 Clock: Reduce accuracy to be less or equal to guest accuracy. 2020-06-27 11:35:55 -04:00
Fernando Sahmkow
7b18174eef ARM/WaitTree: Better track the CallStack for each thread. 2020-06-27 11:35:54 -04:00
Fernando Sahmkow
87c49aa7be SVC/ARM: Correct svcSendSyncRequest and cache ticks on arm interface. 2020-06-27 11:35:53 -04:00
Fernando Sahmkow
f2ade343e2 SingleCore: Move Host Timing from a sepparate thread to main cpu thread. 2020-06-27 11:35:52 -04:00
Fernando Sahmkow
5d3a2be04f GUI: Make multicore only work with Async and add GUI for multicore. 2020-06-27 11:35:52 -04:00
Fernando Sahmkow
25565dffd5 ARM: Addapt to new Exclusive Monitor Interface. 2020-06-27 11:35:50 -04:00
Fernando Sahmkow
1a5f2e290b CPU_Manager: Correct stopping on SingleCore. 2020-06-27 11:35:49 -04:00
Fernando Sahmkow
db68fba4a6 Scheduler: Correct yielding interaction with SetThreadActivity. 2020-06-27 11:35:49 -04:00
Fernando Sahmkow
7020d498c5 General: Fix microprofile on dynarmic/svc, fix wait tree showing which threads were running. 2020-06-27 11:35:48 -04:00
Fernando Sahmkow
e6f8bde74b General: Fix Stop function 2020-06-27 11:35:47 -04:00
Fernando Sahmkow
f370de84b1 Kernel: Rewind on SVC change. 2020-06-27 11:35:46 -04:00