Commit graph

4787 commits

Author SHA1 Message Date
Morph
1c773c0869 controllers/npad: Validate device handles before use
Some games such as NEKOPARA Vol. 3 send invalid device handles when calling InitializeVibrationDevice. Introduce a check to validate the device handle before use.
2020-12-12 07:05:38 -05:00
bunnei
37194dd4e9
Merge pull request #5172 from lioncash/svc-wide
svc: Remove unnecessary casts
2020-12-11 17:39:30 -08:00
bunnei
2d47a5fd41
Merge pull request #5123 from Morph1984/nim-IsLargeResourceAvailable
nim: Stub IsLargeResourceAvailable
2020-12-10 11:34:18 -08:00
Rodrigo Locatti
e94dd7e2c4
Merge pull request #5142 from comex/xx-poll-events
network, sockets: Replace `POLL_IN`, `POLL_OUT`, etc. constants with an `enum class PollEvents`
2020-12-09 03:52:20 -03:00
bunnei
6f41763061
Merge pull request #5166 from lioncash/log-cast
core: Remove unnecessary enum casts in log calls
2020-12-08 21:58:13 -08:00
bunnei
05a703e15d
Merge pull request #5135 from Morph1984/applets-shadow
applets: Resolve variable shadowing
2020-12-08 17:43:59 -08:00
Lioncash
2de124e223 svc: Remove unnecessary casts
Simplifies and removes some casts. In all cases, these were generally
widening from a 32-bit unsigned type to a 64-bit unsigned type, so no
information would be lost from the conversion.
2020-12-08 15:42:10 -05:00
Morph
deff708cbe IPurchaseEventManager: Implement GetPurchasedEventReadableHandle
- Used by Pokémon Café Mix
- Used by DOOM: Eternal
2020-12-08 13:39:19 -05:00
Morph
a9cfe06aaf IPurchaseEventManager: Stub Set(Default)DeliveryTarget
- Used by Pokémon Café Mix
- Used by DOOM: Eternal
2020-12-08 13:39:13 -05:00
Morph
009bdb3558 aoc_u: Stub Create(Permanent)EcPurchasedEventManager
- Used by Pokémon Café Mix
- Used by DOOM: Eternal
2020-12-08 13:39:07 -05:00
Morph
e15039372e fsp_srv: Implement OpenDataStorageWithProgramIndex
- Used by RollerCoaster Tycoon 3: Complete Edition
2020-12-08 08:19:05 -05:00
Morph
0eb6c6cd83 file_sys: Consolidate common Title ID operations 2020-12-08 08:19:05 -05:00
Lioncash
6b7320add4 core: Remove unnecessary enum casts in log calls
Follows the video core PR. fmt doesn't require casts for enum classes
anymore, so we can remove quite a few casts.
2020-12-07 23:02:23 -05:00
Lioncash
215cfbb757 controller: Use std::move within ConvertToFrontendParameters()
Avoids unnecessary copies.
2020-12-07 22:04:16 -05:00
Lioncash
97dd67ad1c controller: Avoid unnecessary copies in ConfigurationComplete()
Avoids unnecessary 1072 byte copies when querying info about
controllers.
2020-12-07 22:02:58 -05:00
bunnei
a58d57a60d
Merge pull request #5148 from comex/xx-unused-fields
core: Mark unused fields as [[maybe_unused]]
2020-12-06 22:33:00 -08:00
bunnei
24cabf5e2f
Merge pull request #5154 from comex/xx-ipc
hle: Type check ResponseBuilder::Push arguments, and fix use in vi.cpp
2020-12-06 22:32:04 -08:00
LC
8a00a0ade6
Merge pull request #5147 from comex/xx-purevirt
nvdrv: Remove useless re-declaration of pure virtual methods that were already declared in the superclass
2020-12-07 00:08:46 -05:00
LC
43f0b42088
Merge pull request #5150 from comex/xx-boxcat
boxcat: Avoid unnecessary object copy
2020-12-07 00:07:39 -05:00
LC
69af6ada2f
Merge pull request #5136 from lioncash/video-shadow3
video_core: Resolve more variable shadowing scenarios pt.3
2020-12-07 00:06:53 -05:00
comex
0791082b43 network, sockets: Replace POLL_IN, POLL_OUT, etc. constants with an enum class PollEvents
Actually, two enum classes, since for some reason there are two separate
yet identical `PollFD` types used in the codebase.  I get that one is
ABI-compatible with the Switch while the other is an abstract type used
for the host, but why not use `WSAPOLLFD` directly for the latter?

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

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

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

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

- vi.cpp was calling Push with a variable of type `std::size_t`.
  There's no explicit overload for `size_t`, but there is one for `u64`,
  which on most platforms is the same type as `size_t`.  On macOS,
  however, it isn't: both types are 64 bits, but `size_t` is `unsigned
  long` and `u64` is `unsigned long long`.  Regardless, it makes more
  sense to explicitly use `u64` here instead of `size_t`.
2020-12-06 18:59:22 -05:00
comex
feac654ba0 core: Mark unused fields as [[maybe_unused]] 2020-12-06 18:36:10 -05:00
comex
5cb1a343d1 boxcat: Avoid unnecessary object copy 2020-12-06 18:31:13 -05:00
comex
716ae72aac nvdrv: Remove useless re-declaration of pure virtual methods that were already declared in the superclass 2020-12-06 18:24:33 -05:00
bunnei
1bdb756d28 hle: kernel: Process: Various style fixes based on code review feedback. 2020-12-06 00:27:13 -08:00
bunnei
9b492430bb hle: kernel: Thread: Various style fixes based on code review feedback. 2020-12-06 00:27:13 -08:00
bunnei
ed4d1e2ade hle: kernel: KScopedSchedulerLockAndSleep: Various style fixes based on code review feedback. 2020-12-06 00:27:13 -08:00
bunnei
b1b4f2337e hle: kernel: KScopedLock: Various style fixes based on code review feedback. 2020-12-06 00:27:13 -08:00
bunnei
165d8485f0 hle: kernel: KAbstractSchedulerLock: Various style fixes based on code review feedback. 2020-12-06 00:27:13 -08:00
bunnei
960500cfd2 hle: kernel: KScheduler: Various style fixes based on code review feedback. 2020-12-06 00:27:13 -08:00
bunnei
8fd921557f hle: kernel: KPriorityQueue: Various style fixes based on code review feedback. 2020-12-06 00:27:13 -08:00
bunnei
4d3be1816c hle: kernel: KAffinityMask: Various style fixes based on code review feedback. 2020-12-06 00:27:13 -08:00
bunnei
357d79fb6e hle: kernel: GlobalSchedulerContext: Various style fixes based on code review feedback. 2020-12-06 00:27:13 -08:00
bunnei
b1326d9230 hle: kernel: Use C++ style comments in KScheduler, etc. 2020-12-06 00:03:24 -08:00
bunnei
bc59ca92b6 kernel: KScopedSchedulerLockAndSleep: Remove unused ctor. 2020-12-06 00:03:24 -08:00
bunnei
b9b7e4f915 kernel: time_manager: Add missing lock guards. 2020-12-06 00:03:24 -08:00
bunnei
ccce6cb3be hle: kernel: Migrate to KScopedSchedulerLock. 2020-12-06 00:03:24 -08:00
bunnei
4756cb203e hle: kernel: Separate KScopedSchedulerLockAndSleep from k_scheduler. 2020-12-06 00:03:24 -08:00
bunnei
8d3e06349e hle: kernel: Separate KScheduler from GlobalSchedulerContext class. 2020-12-06 00:03:24 -08:00
bunnei
9e29e36a78 hle: kernel: Rewrite scheduler implementation based on Mesopshere. 2020-12-06 00:03:24 -08:00
bunnei
c10a37e5b6 hle: kernel: physical_core: Clear exclusive state after each run.
- This is closer to pre-multicore behavior, and works a bit better.
2020-12-06 00:03:24 -08:00
bunnei
7e5d0f1fe3 hle: kernel: Port KAbstractSchedulerLock from Mesosphere. 2020-12-06 00:03:24 -08:00
bunnei
39d356782e hle: kernel: svc: Remove reschedule on svcBreak.
- This breaks things, and is unnecessary, since emulation will be done at this point.
2020-12-06 00:03:24 -08:00
bunnei
d58a609ae4 hle: kernel: process: Add schedule count tracking, to be used for yield impl. 2020-12-06 00:03:24 -08:00
bunnei
493263f415 hle: kernel: svc: Remove unnecessary hack in svcSleep. 2020-12-06 00:03:24 -08:00
bunnei
a3ccac3eb7 common: Port KPriorityQueue from Mesosphere. 2020-12-06 00:03:24 -08:00
bunnei
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
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
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
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
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
bunnei
ebcee03b0c
Merge pull request #4981 from ogniK5377/ioctl-ctrl
nvservices: Reintroducee IoctlCtrl
2020-11-25 21:48:57 -08:00
Morph
6f70e1b1ff hid: Check if applet_resource exists in InitializeVibrationDevice 2020-11-25 13:33:30 -05: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
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
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
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
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
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
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
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
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
bunnei
087f52e872
Merge pull request #4858 from lioncash/initializer
General: Resolve a few missing initializer warnings
2020-11-04 12:10:10 -08: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
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
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
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
bunnei
3984bb6def hle: services: TimeZoneContentManager: This can be made explicit. 2020-10-26 16:11:45 -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
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
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
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
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
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
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
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
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
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
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
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