Commit graph

801 commits

Author SHA1 Message Date
gdkchan
95283f78a9 HwOpus service implementation (#201)
* Started to implement the hwopus service

* Write outputs on decode method, some basic error handling

* Fix buffer size read from header and check

* Fix order of values
2024-02-22 19:14:02 -05:00
jduncanator
56d5345c7a Audio: Properly implements audio fallback for SoundIO (#500)
* Audio: Properly implements audio fallback for SoundIO

Given some drivers have issues with SoundIO (for the time being), this attempts to detect if SoundIO can open the default audio device, and then return false in IsSupported if it can't.

* Audio: Handle the backend disconnected event

libsoundio panics by default when a backend disconnects, this catches that event and gracefully handles it.

* Audio: Fix styling nits

* Audio: Fix nits

Because Ac_K. 😫
2024-02-22 19:14:02 -05:00
GalladeGuy
487d6b672c Get rid of the link to Ryujinx-Settings (#501) 2024-02-22 19:14:02 -05:00
jduncanator
dbf719ca52 Implement libsoundio as an alternative audio backend (#406)
* Audio: Implement libsoundio as an alternative audio backend

libsoundio will be preferred over OpenAL if it is available on the machine. If neither are available, it will fallback to a dummy audio renderer that outputs no sound.

* Audio: Fix SoundIoRingBuffer documentation

* Audio: Unroll and optimize the audio write callback

Copying one sample at a time is slow, this unrolls the most common audio channel layouts and manually copies the bytes between source and destination. This is over 2x faster than calling CopyBlockUnaligned every sample.

* Audio: Optimize the write callback further

This dramatically reduces the audio buffer copy time. When the sample size is one of handled sample sizes the buffer copy operation is almost 10x faster than CopyBlockAligned.

This works by copying full samples at a time, rather than the individual bytes that make up the sample. This allows for 2x or 4x faster copy operations depending on sample size.

* Audio: Fix typo in Stereo write callback

* Audio: Fix Surround (5.1) audio write callback

* Audio: Update Documentation

* Audio: Use built-in Unsafe.SizeOf<T>()

Built-in `SizeOf<T>()` is 10x faster than our `TypeSize<T>` helper. This also helps reduce code surface area.

* Audio: Keep fixed buffer style consistent

* Audio: Address styling nits

* Audio: More style nits

* Audio: Add additional documentation

* Audio: Move libsoundio bindings internal

As per discussion, moving the libsoundio native bindings into Ryujinx.Audio

* Audio: Bump Target Framework back up to .NET Core 2.1

* Audio: Remove voice mixing optimizations.

Leaves Saturation optimizations in place.
2024-02-22 19:14:01 -05:00
gdkchan
00ce292d45 Force cache to remove entries when memory usage exceeds a given threshold (#492) 2024-02-22 19:14:01 -05:00
gdkchan
223ccc5a9d Initialize blend registers with default values (#497) 2024-02-22 19:14:01 -05:00
Ac_K
8d9cb15010 Add BGR5A1 Image Format (#495)
* Add `BGR5A1` to ImageUtils.cs

Add `BGR5A1` Image Format.

* Add BGR5A1 to OGLEnumConverter.cs
2024-02-22 19:14:01 -05:00
Ac_K
38db510773 Update ImageUtils.cs (#494)
Fix `GalImageFormat.D32S8` definition.
2024-02-22 19:14:01 -05:00
gdkchan
895ba3c7e0 Fix BLR when the source reg is X30 (#493) 2024-02-22 19:14:01 -05:00
gdkchan
5fd827d451 Implment common and independent blend properly (fixes #458) (#485)
* Implment common and independent blend properly

* Nits
2024-02-22 19:14:01 -05:00
LDj3SNuD
7a98b18080 Add Flush-to-zero mode (input, output) to FP instructions (slow paths); update FP Tests. Update Naming Conventions for Tests project. (#489)
* Update SoftFloat.cs

* Update SoftFallback.cs

* Update InstEmitSimdShift.cs

* Update InstEmitSimdCvt.cs

* Update InstEmitSimdArithmetic.cs

* Update CryptoHelper.cs

* Update CpuTestSimd.cs

* Update CpuTestSimdReg.cs

* Update CpuThreadState.cs

* Update OpCodeTable.cs

* Add files via upload

* Nit.

* Remove unused using. Nit.

* Remove unused using. FZ update.

* Nit.

* Remove unused using.
2024-02-22 19:14:01 -05:00
Alex Barney
c8db892e20 Update libhac. Load tickets from XCI files (#476) 2024-02-22 19:14:01 -05:00
Alex Barney
f23cbc5ffc Adjust naming conventions for Ryujinx and ChocolArm64 projects (#484)
* Change naming convention for Ryujinx project

* Change naming convention for ChocolArm64 project

* Fix NaN

* Remove unneeded this. from Ryujinx project

* Adjust naming from new PRs

* Name changes based on feedback

* How did this get removed?

* Rebasing fix

* Change FP enum case

* Remove prefix from ChocolArm64 classes - Part 1

* Remove prefix from ChocolArm64 classes - Part 2

* Fix alignment from last commit's renaming

* Rename namespaces

* Rename stragglers

* Fix alignment

* Rename OpCode class

* Missed a few

* Adjust alignment
2024-02-22 19:14:00 -05:00
gdkchan
4a4a3671aa Fix regression caused by wrong time delta calculation on cache deletion methods 2024-02-22 19:14:00 -05:00
gdkchan
a6868b62fa Fix the rotate right method on ABitUtils (#486) 2024-02-22 19:14:00 -05:00
jduncanator
df04cd5cf7 Timing: Optimize Timestamp Aquisition (#479)
* Timing: Optimize Timestamp Aquisition

Currently, we make use of Environment.TickCount in a number of places. This has some downsides, mainly being that the TickCount is a signed 32-bit integer, and has an effective limit of ~25 days before overflowing and wrapping around. Due to the signed-ness of the value, this also caused issues with negative numbers. This resolves these issues by using a 64-bit tick count obtained from Performance Counters (via the Stopwatch class). This has a beneficial side effect of being significantly more accurate than the TickCount.

* Timing: Rename ElapsedTicks to ElapsedMilliseconds and expose TicksPerX

* Timing: Some style changes

* Timing: Align static variable initialization
2024-02-22 19:14:00 -05:00
LDj3SNuD
f0229fa05b Add SHA1C, SHA1H, SHA1M, SHA1P, SHA1SU0, SHA1SU1 and Isb instructions; add 6 Tests (closed box). (#483)
* Update AOpCodeTable.cs

* Update AInstEmitSystem.cs

* Update AInstEmitSimdHash.cs

* Update ASoftFallback.cs

* Update CpuTestSimdReg.cs

* Update CpuTestSimd.cs
2024-02-22 19:14:00 -05:00
gdkchan
95f8663d51 Crop instead of resizing on 2d engine texture copies (#482)
* Crop instead of resizing on 2d engine texture copies

* Remove unused local
2024-02-22 19:14:00 -05:00
Thomas Guillemard
4f9e9e6087 hid: Implement KEY_RSTICK_* & KEY_LSTICK_* (#466)
* hid: Implement KEY_RSTICK_* & KEY_LSTICK_*

* Fix KEY_RSTICK_UP
2024-02-22 19:14:00 -05:00
LDj3SNuD
7ad2de98da Add Sse Opt. for S/Uaddl_V, S/Uhadd_V, S/Uhsub_V, S/Umlal_V, S/Umlsl_V, S/Urhadd_V, S/Usubl_V Inst.; and for S/Urshr_V, S/Ursra_V Inst.. (#480)
* Update AILEmitterCtx.cs

* Update AInstEmitSimdArithmetic.cs

* Update AInstEmitSimdShift.cs
2024-02-22 19:14:00 -05:00
gdkchan
73a6f25cfe Fix Color Mask values (#473)
* Fix color mask common, set default value on first color mask register

* Missing check

* Better exception messages

* Address PR feedback

* Add fixme as per review feedback
2024-02-22 19:14:00 -05:00
gdkchan
4e5f51057e Move prio/core locals inside the lock on yield (#478) 2024-02-22 19:13:59 -05:00
gdkchan
d7a1d15a47 Fix for render target and a shader compilation issue (#471)
* Fix render target using possibly deleted or wrong handles

* Fix basic blocks with only a KIL instruction on the shader translator

* Formatting fix
2024-02-22 19:13:59 -05:00
gdkchan
2867041be8 Add depth range support on the GPU (#472)
* Add depth range support on the GPU

* Address PR feedback
2024-02-22 19:13:59 -05:00
LDj3SNuD
4d11dc04ed Fix Fcvtl_V and Fcvtn_V; fix half to float conv. and add float to half conv. (full FP emu.). Add 4 FP Tests. (#468)
* Update CpuTest.cs

* Update CpuTestSimd.cs

* Superseded.

* Update AInstEmitSimdCvt.cs

* Update ASoftFloat.cs

* Nit.

* Update PackageReferences.

* Update AInstEmitSimdArithmetic.cs

* Update AVectorHelper.cs

* Update ASoftFloat.cs

* Update ASoftFallback.cs

* Update AThreadState.cs

* Create FPType.cs

* Create FPExc.cs

* Create FPCR.cs

* Create FPSR.cs

* Update ARoundMode.cs

* Update APState.cs

* Avoid an unwanted implicit cast of the operator >= to long, continuing to check for negative values. Remove a leftover.

* Nits.
2024-02-22 19:13:59 -05:00
Ac_K
d146ca8ce9 Implement basic psm service (#467)
* Implement basic psm service

- Add `IPsmServer`
- Stub `GetBatteryChargePercentage` & `GetChargerType`

* Fix wrong sorting

* Add IPsmSession

- Add `IPsmSession` by Thog
- Implement `OpenSession`
2024-02-22 19:13:59 -05:00
Thomas Guillemard
0c0a60a838 Complete rewrite of bsd IClient (#460)
This should provide accurate behaviours.
This implementation has been tested with ftpd and libtransistor bsd tests.

This implementation lacks OOB support.
2024-02-22 19:13:59 -05:00
gdkchan
5ce6f45783 Print stack trace on invalid memory accesses (#461)
* Print stack trace on invalid memory accesses

* Rebased, change code region base address for 39-bits address space, print stack trace on break and undefined instructions too
2024-02-22 19:13:59 -05:00
gdkchan
295b317add Improve texture tables (#457)
* Improve texture tables

* More renaming and other tweaks

* Minor tweaks
2024-02-22 19:13:59 -05:00
gdkchan
0263b5f93e Remove unnecessary usings (#463)
* Remove unnecessary usings

* Fix CastExpression while I'm at it
2024-02-22 19:13:58 -05:00
ReinUsesLisp
0baa2bf606 Move logging to Ryujinx.Common and make it a static class (#413) 2024-02-22 19:13:58 -05:00
Thomas Guillemard
bd6ad16a24 Remove IFileSystem::OpenDirectory extraneous check (#459)
A directory can be open more than one time. This fix issues with
homebrews opening the same directory multiple time.
2024-02-22 19:13:58 -05:00
HorrorTroll
2a722aa6d1 Add G8R8Unorm, G8R8Snorm, B8G8R8A8, D24_S8 Uint, R8Uint, R32Uint (#426)
* Implement B5G6R5Unorm & BGR5A1Unorm

* Fix R8G8 Unorm to G8R8 Unorm

* Added back R8G8 Unorm

* Fix G8R8Unorm, add R8G8B8A8

* Add D24_S8 Uint

* Add R8Uint & R32Uint

* Another fixed

* Reverting back

* R8G8B8A8 change to B8G8R8A8

* Add G8R8 Snorm
2024-02-22 19:13:58 -05:00
HorrorTroll
8466563942 Add RG16Unorm & R16Uint (#456)
* Implement B5G6R5Unorm & BGR5A1Unorm

* Add RG16Unorm, R16Uint
2024-02-22 19:13:58 -05:00
gdkchan
85ca26b132 Add support for saturation on some shader instructions, fix ReadTexture alignment and add ColorMask support (#451)
* Add support for saturation on some shader instructions, fix ReadTexture alignment

* Add ColorMask support, other tweaks
2024-02-22 19:13:58 -05:00
LDj3SNuD
ace5e23b67 Add Fmls_Se, Fmulx_Se/Ve, Smov_S Inst.; Opt. Clz/Clz_V, Cnt_V, Shl_V, S/Ushr_V, S/Usra_V Inst.; Add 11 Tests. Some fixes. (#449)
* Update AOpCodeTable.cs

* Update AInstEmitSimdMove.cs

* Update AInstEmitSimdArithmetic.cs

* Update AInstEmitSimdShift.cs

* Update ASoftFallback.cs

* Update ASoftFloat.cs

* Update AOpCodeSimdRegElemF.cs

* Update CpuTestSimdIns.cs

* Update CpuTestSimdRegElem.cs

* Create CpuTestSimdRegElemF.cs

* Update CpuTestSimd.cs

* Update CpuTestSimdReg.cs

* Superseded Fmul_Se Test. Nit.

* Address PR feedback.

* Address PR feedback.

* Update AInstEmitSimdArithmetic.cs

* Update ASoftFallback.cs

* Update AInstEmitAlu.cs

* Update AInstEmitSimdShift.cs
2024-02-22 19:13:58 -05:00
Thomas Guillemard
4ded034a20 Fix some issues with UserId (#455) 2024-02-22 19:13:58 -05:00
Ac_K
2901a7eefd Update IAccountService and IManagerForApplication (#454)
* Update IAccountService and IManagerForApplication

`IAccountService`:
- Add symbols.
- Fix some mistake.
- Add `IsUserRegistrationRequestPermitted` and `TrySelectUserWithoutInteraction`.

`IManagerForApplication`:
- Add symbols.
- Add Uuid args.
- Little improvement of `GetAccountId`
2024-02-22 19:13:58 -05:00
Ac_K
d8f294eb30 Update UInt128.cs (#453)
Fix invalid Write implementation.
2024-02-22 19:13:58 -05:00
gdkchan
40a603e8b9 Quads, QuadStrip, const attributes and half-float attributes support (#447)
* Quads, QuadStrip and const attributes support

* Add support for half float attributes and fix texture pitch alignment

* Throw when an unsupported float type is used as const attribute aswell
2024-02-22 19:13:58 -05:00
gdkchan
ad86e9a15c Fix race condition on OpenALAudioOut (#448) 2024-02-22 19:13:58 -05:00
Thomas Guillemard
b13ef8ec2a Implement IResolver (#442)
* Implement IResolver

- GetAddrInfo & GetNameInfo still need to be implemented.

* Address comments

* Use MakeError
2024-02-22 19:13:58 -05:00
Thomas Guillemard
e004383127 Implement IRoInterface (#445)
* Implement IRoInterface

This is required by Super Mario Party.
This commit also adds MapProcessCodeMemory and UnmapProcessCodeMemory functions in KMemoryManager. Those two calls might not reflect what the SVC of the same names do.

* Fix some code style issues

* Use MakeError to clarify error code

* Add NRR and NRO constants

* Fix some codestyle issues

* Fix InvalidMemoryState error code
2024-02-22 19:13:57 -05:00
Thomas Guillemard
d6fab0518e Break: don't crash when bit 31 is set (#444) 2024-02-22 19:13:57 -05:00
gdkchan
2fc7a42bf0 Tweak cpu cache deletion policy values (#433)
* Tweak cpu cache deletion policy values

* Address PR feedback
2024-02-22 19:13:57 -05:00
emmauss
7be45b3c0a Stubs Again (#439)
* stub/implement audren commands

* stub ISelfController get/set IdleTimeDetectonExtension

* stub irs

* add irs logclass, stub mmu:u irequest 1

* style fixes, addressed comments
2024-02-22 19:13:57 -05:00
emmauss
4a81ade76c Save Common implementation (#434)
* save common implementation

* remove zero userid check

* Renamed UserId to UInt128

* fix index in hex conversion
2024-02-22 19:13:57 -05:00
Ac_K
7363cc6961 Implement ISslContext (#440)
This PR implement an empty `ISslContext` and update `CreateContext` and `SetInterfaceVersion` inside `ISslService`
2024-02-22 19:13:57 -05:00
Alex Barney
6f08959283 Misc content loading improvements (#432)
* Misc content loading improvements
2024-02-22 19:13:57 -05:00
LDj3SNuD
1e3b3e9a8a Add 9+7 fast/slow FP inst. impls.; add 14 FP Tests. (#437)
* Update CpuTest.cs

* Delete CpuTestSimdCmp.cs

Obsolete.

* Update CpuTestSimdArithmetic.cs

Superseded.

* Update CpuTestSimd.cs

* Update CpuTestSimdReg.cs

* Update AInstEmitSimdArithmetic.cs

* Update AInstEmitSimdHelper.cs

* Update ASoftFloat.cs

* Nit.

* Update AOpCodeTable.cs

* Update AOptimizations.cs

* Update AInstEmitSimdArithmetic.cs

* Update ASoftFloat.cs

* Update CpuTest.cs

* Update CpuTestSimd.cs

* Update CpuTestSimdReg.cs

* Update AOpCodeTable.cs

* Update AInstEmitSimdArithmetic.cs

* Update ASoftFloat.cs

* Update CpuTestSimdReg.cs

* Update AOpCodeTable.cs

* Update AInstEmitSimdArithmetic.cs

* Update ASoftFloat.cs

* Update CpuTestSimd.cs

* Update CpuTestSimdReg.cs
2024-02-22 19:13:57 -05:00