Commit graph

933 commits

Author SHA1 Message Date
gdkchan
c86aacde76
NVDEC implementation using FFmpeg (#443)
* Initial nvdec implementation using FFmpeg

* Fix swapped channels on the video decoder and the G8R8 texture format

* Fix texture samplers not being set properly (regression)

* Rebased

* Remove unused code introduced on the rebase

* Add support for RGBA8 output format on the video image composer

* Correct spacing

* Some fixes for rebase and other tweaks

* Allow size mismatch on frame copy

* Get rid of GetHostAddress calls on VDec
2018-12-03 00:38:47 -02:00
LDj3SNuD
ad00fd0244 Fix Sshl_V; Add S/Uqrshl_V, S/Uqshl_V, S/Urshl_V; Add Tests. (#516)
* Update OpCodeTable.cs

* Update InstEmitSimdShift.cs

* Update SoftFallback.cs

* Update CpuTestSimdReg.cs

* Nit.

* Update SoftFallback.cs

* Update Optimizations.cs

* Update InstEmitSimdLogical.cs

* Update InstEmitSimdArithmetic.cs
2018-12-01 22:34:43 -02:00
jduncanator
9b22e8af5e Normalize all the line endings (#518) 2018-11-29 00:01:19 -02:00
gdkchan
59964f667c
Add support for bigger UBOs, fix sRGB regression, small improvement t… (#503)
* Add support for bigger UBOs, fix sRGB regression, small improvement to the 2D copy engine

* Break into multiple lines

* Read fractions for source/step values on the 2d copy engine aswell

* Use fixed point math for more speed

* Fix reinterpret when texture sizes are different
2018-11-28 21:09:44 -02:00
gdkchan
00579927e4
Better process implementation (#491)
* Initial implementation of KProcess

* Some improvements to the memory manager, implement back guest stack trace printing

* Better GetInfo implementation, improve checking in some places with information from process capabilities

* Allow the cpu to read/write from the correct memory locations for accesses crossing a page boundary

* Change long -> ulong for address/size on memory related methods to avoid unnecessary casts

* Attempt at implementing ldr:ro with new KProcess

* Allow BSS with size 0 on ldr:ro

* Add checking for memory block slab heap usage, return errors if full, exit gracefully

* Use KMemoryBlockSize const from KMemoryManager

* Allow all methods to read from non-contiguous locations

* Fix for TransactParcelAuto

* Address PR feedback, additionally fix some small issues related to the KIP loader and implement SVCs GetProcessId, GetProcessList, GetSystemInfo, CreatePort and ManageNamedPort

* Fix wrong check for source pages count from page list on MapPhysicalMemory

* Fix some issues with UnloadNro on ldr:ro
2018-11-28 20:18:09 -02:00
HorrorTroll
e7fe7d7247 Add RGBA16 Unorm (#513) 2018-11-23 12:21:45 -02:00
jduncanator
76e2d48eee GPU: Allow depth textures to be loaded (#511)
Allow depth textures to be loaded when their component types do not match.
2018-11-21 04:27:33 -02:00
Ac_K
ea35b3d1b0 Clean LM string (#512)
* Update ILogger.cs

* Update ILogger.cs

remove optionnal args

* Change to interpolated strings
2018-11-21 04:27:18 -02:00
emmauss
dc02ac08ca Support other switch controller types (#487)
* Make controllers modular, support changing controller type

* return readable events

* signal hid events

* fix style
2018-11-20 01:01:36 +01:00
emmauss
0c36835f6d fix typo (#509) 2018-11-19 10:04:33 +01:00
HorrorTroll
0f5efe050f Add BGRA8 Srgb (#505) 2018-11-19 02:07:09 -02:00
jduncanator
df5960023e Audio: Track and Call ReleaseCallbacks in the Dummy Audio Output (#508)
We need to signal the guest process when buffers are released to avoid a softlock.
2018-11-19 02:24:15 +01:00
jduncanator
26e09474a9 ContentServices: Handle null LocationEntry Path in VerifyContentType (#506)
When `LocationEntry.ContentPath` is `null`, we can always return `false` as it can't possibly be a valid `ContentType`
2018-11-19 01:20:17 +01:00
emmauss
fe8fbb6fb9 Implement ContentManager and related services (#438)
* Implement contentmanager and related services

* small changes

* read system firmware version from nand

* add pfs support, write directoryentry info for romfs files

* add file check in fsp-srv:8

* add support for open fs of internal files

* fix filename when accessing pfs

* use switch style paths for contentpath

* close nca after verifying type

* removed publishing profiles, align directory entry

* fix style

* lots of style fixes

* yasf(yet another style fix)

* yasf(yet another style fix) plus symbols

* enforce path check on every fs access

* change enum type to default

* fix typo
2018-11-18 17:37:41 -02:00
LDj3SNuD
e603b7afbc Add Sse Opt. for S/Umax_V, S/Umin_V, S/Uaddw_V, S/Usubw_V, Fabs_S/V, Fneg_S/V Inst.; for Fcvtl_V, Fcvtn_V Inst.; and for Fcmp_S Inst.. Add/Improve other Sse Opt.. Add Tests. (#496)
* Update CpuTest.cs

* Update CpuTestSimd.cs

* Update CpuTestSimdReg.cs

* Update InstEmitSimdCmp.cs

* Update SoftFloat.cs

* Update InstEmitAluHelper.cs

* Update InstEmitSimdArithmetic.cs

* Update InstEmitSimdHelper.cs

* Update VectorHelper.cs

* Update InstEmitSimdCvt.cs

* Update InstEmitSimdArithmetic.cs

* Update CpuTestSimd.cs

* Update InstEmitSimdArithmetic.cs

* Update OpCodeTable.cs

* Update InstEmitSimdArithmetic.cs

* Update InstEmitSimdCmp.cs

* Update InstEmitSimdCvt.cs

* Update CpuTestSimd.cs

* Update CpuTestSimdReg.cs

* Create CpuTestSimdFcond.cs

* Update OpCodeTable.cs

* Update InstEmitSimdMove.cs

* Update CpuTestSimdIns.cs

* Create CpuTestSimdExt.cs

* Nit.

* Update PackageReference.
2018-11-18 00:41:16 -02:00
gdkchan
b7613dd4b8 Enable SRGB framebuffers by default (#502) 2018-11-17 05:10:51 +01:00
gdkchan
d2bb458b51 Improved GPU command lists decoding (#499)
* Better implementation of the DMA pusher, misc fixes

* Remove some debug code

* Correct RGBX8 format

* Add support for linked Texture Sampler Control

* Attempt to fix upside down screen issue
2018-11-17 05:01:31 +01:00
gdkchan
b833183ef6 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
2018-11-17 04:36:49 +01:00
jduncanator
5829e36a5c 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. 😫
2018-11-17 04:35:15 +01:00
GalladeGuy
ad98558295 Get rid of the link to Ryujinx-Settings (#501) 2018-11-17 04:33:38 +01:00
jduncanator
8275bc3c08 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.
2018-11-15 03:22:50 +01:00
gdkchan
85ffd76016 Force cache to remove entries when memory usage exceeds a given threshold (#492) 2018-11-14 23:22:02 +01:00
gdkchan
453543fb88 Initialize blend registers with default values (#497) 2018-11-14 22:50:31 +01:00
Ac_K
437962a65d Add BGR5A1 Image Format (#495)
* Add `BGR5A1` to ImageUtils.cs

Add `BGR5A1` Image Format.

* Add BGR5A1 to OGLEnumConverter.cs
2018-11-11 02:27:06 -02:00
Ac_K
fdd5767887 Update ImageUtils.cs (#494)
Fix `GalImageFormat.D32S8` definition.
2018-11-09 16:41:40 -02:00
gdkchan
a4822b7946
Fix BLR when the source reg is X30 (#493) 2018-11-09 16:41:20 -02:00
gdkchan
44c1cf3fe5
Implment common and independent blend properly (fixes #458) (#485)
* Implment common and independent blend properly

* Nits
2018-11-01 01:22:24 -03:00
LDj3SNuD
1e7ea76f14 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.
2018-11-01 01:22:09 -03:00
Alex Barney
53e6664526 Update libhac. Load tickets from XCI files (#476) 2018-10-30 23:34:27 -03:00
Alex Barney
9cb57fb4bb 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
2018-10-30 22:43:02 -03:00
gdkchan
5a87e58183 Fix regression caused by wrong time delta calculation on cache deletion methods 2018-10-30 11:42:27 -03:00
gdkchan
5b13ee655c
Fix the rotate right method on ABitUtils (#486) 2018-10-28 22:18:58 -03:00
jduncanator
c1b7340023 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
2018-10-28 19:31:13 -03:00
LDj3SNuD
b956bbc32c 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
2018-10-28 19:27:50 -03:00
gdkchan
111d14f74a Crop instead of resizing on 2d engine texture copies (#482)
* Crop instead of resizing on 2d engine texture copies

* Remove unused local
2018-10-27 18:46:17 +00:00
Thomas Guillemard
19152def95 hid: Implement KEY_RSTICK_* & KEY_LSTICK_* (#466)
* hid: Implement KEY_RSTICK_* & KEY_LSTICK_*

* Fix KEY_RSTICK_UP
2018-10-27 18:36:49 +00:00
LDj3SNuD
00d4f44bbb 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
2018-10-25 19:10:41 -03:00
gdkchan
f0a49a1c94
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
2018-10-25 18:30:09 -03:00
gdkchan
2fd23577ce
Move prio/core locals inside the lock on yield (#478) 2018-10-24 09:45:37 -03:00
gdkchan
9ace6b9285
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
2018-10-23 17:59:52 -03:00
gdkchan
044b84b078
Add depth range support on the GPU (#472)
* Add depth range support on the GPU

* Address PR feedback
2018-10-23 16:04:08 -03:00
LDj3SNuD
e674b37710 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.
2018-10-23 11:12:45 -03:00
Ac_K
7920dc1d2f 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`
2018-10-21 03:01:22 -03:00
Thomas Guillemard
b5f7d8106b 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.
2018-10-20 22:08:58 +00:00
gdkchan
2cb8541462 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
2018-10-20 22:07:52 +00:00
gdkchan
0e1e094b7a
Improve texture tables (#457)
* Improve texture tables

* More renaming and other tweaks

* Minor tweaks
2018-10-17 18:02:23 -03:00
gdkchan
02a8e7fc93
Remove unnecessary usings (#463)
* Remove unnecessary usings

* Fix CastExpression while I'm at it
2018-10-17 14:55:10 -03:00
ReinUsesLisp
b3a4662be1 Move logging to Ryujinx.Common and make it a static class (#413) 2018-10-17 14:15:50 -03:00
Thomas Guillemard
9b19ea3c87 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.
2018-10-16 23:55:10 +00:00
HorrorTroll
76330b10b4 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
2018-10-14 18:23:23 -03:00