Commit graph

2549 commits

Author SHA1 Message Date
Alex Barney
67dd28898f Update to LibHac v0.14.3 (#2925)
* Update to LibHac v0.14.3

* Fix loading NCAs that don't have a data partition
2024-02-22 19:16:09 -05:00
sharmander
829f293e58 UI - Add Volume Controls + Mute Toggle (F2) (#2871)
* Add the ability to toggle mute in the status bar.

* Add the ability to toggle mute in the status bar.

* Formatting fixes

* Add hotkey (F2) to mute

* Add default hotkey to config.json

* Add ability to change volume via slider.

* Fix Headless

* Fix SDL2 Problem : Credits to d3xMachina

* Remove unnecessary work

* Address gdk comments

* Toggling with Hotkey now properly restores volume to original level.

* Toggling with Hotkey now properly restores volume to original level.

* Update UI to show Volume % instead of Muted/Unmuted

* Clean up the volume ui a bit.

* Undo unintentionally committed code.

* Implement AudRen Support

* Restore intiial volume level in function definition.

* Finalize UI

* Finalize UI

* Use clamp for bounds check

* Use Math.Clamp for volume in soundio

* Address comments by gdkchan

* Address remaining comments

* Fix missing semicolon

* Address remaining gdkchan comment

* Fix comment

* Change /* to //

* Allow volume slider to change volume immediately.
Also force label text to cast to int to prevent decimals from showing in status bar

* Remove blank line

* Undo setting of volume level when "Cancel" is pressed.

* Fix allignment for settings window code
2024-02-22 19:16:08 -05:00
gdkchan
9f345be945 Fix for texture pool not being updated when it should + buffer texture related fixes (#2911) 2024-02-22 19:16:08 -05:00
riperiperi
67d4f741e1 Add support for releasing a semaphore to DmaClass (#2926)
* Add support for releasing a semaphore to DmaClass

Fixes freezes in OpenGL games, primarily GameMaker ones such as Undertale.

* Address Feedback
2024-02-22 19:16:08 -05:00
gdkchan
d898fa76a5 Implement CSDB instruction (#2927) 2024-02-22 19:16:08 -05:00
VocalFan
d36d7b61dc Using more intense lossless compression. (#2811) 2024-02-22 19:16:08 -05:00
Mary
42ed672040 Remove debug configuration and schema (#2920)
The debug configuration can be created by the emulator and is an
artefact of the past.

I also took the liberty of removing the _schema.json file as most of the
time it is left unused/outdated.
2024-02-22 19:16:08 -05:00
Mary
ce979c1f53 Remove unused empty Ryujinx.Audio.Backends project (#2919) 2024-02-22 19:16:08 -05:00
Mary
a9d2c496a2 misc: Sync Config.json default debug config (#2904) 2024-02-22 19:16:08 -05:00
gdkchan
c24afa5f85 Fix SUATOM and other texture shader instructions with RZ dest (#2885)
* Fix SUATOM and other texture shader instructions with RZ dest

* Shader cache version bump
2024-02-22 19:16:08 -05:00
Mary
42e6af15aa Remove usage of Mono.Posix.NETStandard accross all projects (#2906)
* Remove usage of Mono.Posix.NETStandard in Ryujinx project

* Remove usage of Mono.Posix.NETStandard in ARMeilleure project

* Remove usage of Mono.Posix.NETStandard in Ryujinx.Memory project

* Address gdkchan's comments
2024-02-22 19:16:08 -05:00
riperiperi
935627f2ea Move texture anisotropy check to SetInfo (#2843)
Rather than calculating this for every sampler, this PR calculates if a texture can force anisotropy when its info is set, and exposes the value via a public boolean.

This should help texture/sampler heavy games when anisotropic filtering is not Auto, like UE4 ones (or so i hear?). There is another cost where samplers are created twice when anisotropic filtering is enabled, but I'm not sure how relevant this one is.
2024-02-22 19:16:08 -05:00
gdkchan
84871019c1 Implement remaining shader double-precision instructions (#2845)
* Implement remaining shader double-precision instructions

* Shader cache version bump
2024-02-22 19:16:08 -05:00
Mary
dcb72d0a4c misc: Fix alsoft.ini being present on Linux releases (#2902) 2024-02-22 19:16:08 -05:00
Piyachet Kanda
abeb840cf7 Implement UHADD8 instruction (#2908)
* Implement UHADD8 instruction along with a test unit

* Update PTC revision number
2024-02-22 19:16:08 -05:00
gdkchan
5e9fdaf310 Fix FLO.SH shader instruction with a input of 0 (#2876)
* Fix FLO.SH shader instruction with a input of 0

* Shader cache version bump
2024-02-22 19:16:07 -05:00
Mary
81c536b53f kernel: Improve GetInfo readability and update to 13.0.0 (#2900)
* kernel: Define InfoTYpe and make it less obscure when reading GetInfo

Also map ThreadTickCount to 25 instead of 0xF0000002 like 13.x kernel.

* kernel: Implement GetInfo IsApplication

* kernel: Implement GetInfo FreeThreadCount
2024-02-22 19:16:07 -05:00
Mary
ab322daffc misc: Migrate usage of RuntimeInformation to OperatingSystem (#2901)
Very basic migration across the codebase.
2024-02-22 19:16:07 -05:00
Mary
114bb849ad Fix Amiibo hanging since .NET 6 changes (#2890)
The .NET 6 changes ended up causing a difference in the way we deserialise and would end up deserializing wrongly.

This commit fixes it by resoring previous behaviour while still fixing the illink warning that caused that change in the first place
2024-02-22 19:16:07 -05:00
Logan Stromberg
9b788f5de8 Don't blow up everything if a DLC file is moved or renamed. (#2867)
* Don't blow up everything if a DLC file is missing

* change comment

* More correctly setting the "enabled" check box on dlc dialog for the add-on NSP based on the enabled state of all NCAs in the package.

* Update Ryujinx.HLE/HOS/ApplicationLoader.cs

Co-authored-by: Ac_K <Acoustik666@gmail.com>

Co-authored-by: Logan Stromberg <lostromb@microsoft.com>
Co-authored-by: Ac_K <Acoustik666@gmail.com>
2024-02-22 19:16:07 -05:00
Mary
7d74c9edec infra: Migrate to .NET 6 (#2829)
* infra: Migrate to .NET 6

* Rollback version naming change

* Workaround .NET 6 ZipArchive API issues

* ci: Switch to VS 2022 for AppVeyor

CI is now ready for .NET 6

* Suppress WebClient warning in DoUpdateWithMultipleThreads

* Attempt to workaround System.Drawing.Common changes on 6.0.0

* Change keyboard rendering from System.Drawing to ImageSharp

* Make the software keyboard renderer multithreaded

* Bump ImageSharp version to 1.0.4 to fix a bug in Image.Load

* Add fallback fonts to the keyboard renderer

* Fix warnings

* Address caian's comment

* Clean up linux workaround as it's uneeded now

* Update readme

Co-authored-by: Caian Benedicto <caianbene@gmail.com>
2024-02-22 19:16:07 -05:00
Mary
482c4fc6ac kernel: Fix sleep timing accuracy (#2828)
* kernel: Fix sleep timing accuracy

This commit corrects some mistake while comparing reversing of kernel
13.x with our own.

WaitAndCheckScheduledObjects timing accuracy was also improved.

* Make KTimeManager.WaitAndCheckScheduledObjects spin wait for sub milliseconds

Fix performance regression on Pokemon Let's Go games and possibly
others.

* Address rip's comment

* kernel: Fix issues with timeout of -1 (0xFFFFFFFF)

Fixes possible hang on Pokemon DP and possibly others
2024-02-22 19:16:07 -05:00
Mary
3043f53925 kernel: Add support for CFI (#2839)
Add basic support for the CFI value being passed in X18 since 11.0.0 by the official kernel.
We do not implement any random generator atm in the kernel and as such the KSystemControl.GenerateRandom function is stubbed
2024-02-22 19:16:07 -05:00
Ac_K
2eb615c5b5 account/ns: Implement 13.0.0+ service calls (#2820)
This PR implements/stubs some missing calls introduced in recent firmware (13.0.0).

- `acc:u0 InitializeApplicationInfoV2` needed by ACNH.
- `aoc:u NotifyMountAddOnContent/NotifyUnmountAddOnContent/CheckAddOnContentMountStatus` checked by RE. Needed by ACNH.
- `IPurchaseEventManager PopPurchasedProductInfo` needed by Dying Light.

Now ACNH 2.0 update is fully playable, and Dying Light can boot further:
2024-02-22 19:16:06 -05:00
gdkchan
8e4fb71966 Better depth range detection (#2754)
* Better depth range detection

* PR feedback

* Move depth mode set out of the loop and to a separate method
2024-02-22 19:16:06 -05:00
VocalFan
3efd9429f1 Nickname! - Init Amiibos with Profile's name! (#2804)
* Remove comment from code.

* Added needed RegisterInfo for TODO.

* Forgot to add two words...

* Stop being tired and fixed the one issue.

* Removing suggested line from GDKchan.

* GDK seems to have been incorrect?

* Update Ryujinx.HLE/HOS/Services/Nfc/Nfp/VirtualAmiibo.cs

Co-authored-by: gdkchan <gab.dark.100@gmail.com>

Co-authored-by: gdkchan <gab.dark.100@gmail.com>
2024-02-22 19:16:06 -05:00
gdkchan
f358f941d1 Fix shader integer from/to double conversion (#2831) 2024-02-22 19:16:06 -05:00
riperiperi
506ab78acc Limit Custom Anisotropic Filtering to mipmapped textures with many levels (#2832)
* Limit Custom Anisotropic Filtering to only fully mipmapped textures

There's a major flaw with the anisotropic filtering setting that causes @GamerzHell9137 to report graphical bugs that otherwise wouldn't be there, because he just won't set it to Auto. This should fix those issues, hopefully.

These bugs are generally because anisotropic filtering is enabled on something that it shouldn't be, such as a post process filter or some data texture. This PR maintains two host samplers when custom AF is enabled, and only uses the forced AF one when the texture is 2d and fully mipmapped (goes down to 1x1). This is because game textures are the ideal target for this filtering, and they are typically fully mipmapped, unlike things like screen render targets which usually have 1 or just a few levels.

This also only enables AF on mipmapped samplers where the filtering is bilinear or trilinear. This should be self explanatory.

This PR also allows the changing of Anisotropic Filtering at runtime, and you can immediately see the changes. All samplers are flushed from the cache if the setting changes, causing them to be recreated with the new custom AF value. This brings it in line with our resolution scale. 😌

* Expected minimum mip count for large textures rather than all, address feedback

* Use Target rather than Info.Target

* Retrigger build?

* Fix rebase
2024-02-22 19:16:06 -05:00
gdkchan
0cce3573d3 Implement DrawTexture functionality (#2747)
* Implement DrawTexture functionality

* Non-NVIDIA support

* Disable some features that should not affect draw texture (slow path)

* Remove space from shader source

* Match 2D engine names

* Fix resolution scale and add missing XML docs

* Disable transform feedback for draw texture fallback
2024-02-22 19:16:06 -05:00
Adryzz (OLED Edition)
e1806ec874 Fix direct mouse access checkbox label (#2827)
* Fix direct mouse access checkbox label

* Change UI label so that the mouse is a pointing device
2024-02-22 19:16:06 -05:00
gdkchan
b14d2c49c0 Support shader gl_Color, gl_SecondaryColor and gl_TexCoord built-ins (#2817)
* Support shader gl_Color, gl_SecondaryColor and gl_TexCoord built-ins

* Shader cache version bump

* Fix back color value on fragment shader

* Disable IPA multiplication for fixed function attributes and back color selection
2024-02-22 19:16:06 -05:00
gdkchan
b5ea3e70b2 Fix bindless/global memory elimination with inverted predicates (#2826)
* Fix bindless/global memory elimination with inverted predicates

* Shader cache version bump
2024-02-22 19:16:06 -05:00
gdkchan
9c22f6f721 Fix InvocationInfo on geometry shader and bindless default integer const (#2822)
* Fix InvocationInfo on geometry shader and bindless default integer const

* Shader cache version bump

* Consistency for the default value
2024-02-22 19:16:06 -05:00
gdkchan
5f6d7af047 Ensure syncpoints are released and event handles closed on channel close (#2812) 2024-02-22 19:16:06 -05:00
gdkchan
8db7828af9 Clamp number of mipmap levels to avoid API errors due to invalid textures (#2808) 2024-02-22 19:16:06 -05:00
Mary
ef9fa16f06 hle: Make Ryujinx.HLE project entirely safe (#2789)
* Remove a bit of unsafety around

* Regenerate StructArrayHelpers with a max element value of 256

* hle: remove unsafe marker from all struct that had it

* hle: make SoftwareKeyboardRenderer.TryCopyTo safe

* hle: remove unsafety in NpadDevice and remove AllowUnsafeBlocks from csproj

* Revert "Regenerate StructArrayHelpers with a max element value of 256"

This reverts commit f32a6e5be0.

* Introduce ByteArray of various size and use that instead of ArrayXXX to avoid stackoverflow in .NET runtime type resolution

* Use ByteArray more

* Add some missing spaces on Pack = 1 for various structs

* Fix broken logic for TryCopyTo

* Address gdkchan's comment

* Address gdkchan's comment
2024-02-22 19:16:06 -05:00
gdkchan
4d21a8cba6 When waiting on CPU, do not return a time out error from EventWait (#2780)
* When waiting on CPU, do not return a time out error from EventWait

* And while I'm at it...
2024-02-22 19:16:06 -05:00
Mary
ad087b7897 ci: Disable macOS x64 build on AppVeyor (#2795)
This commit disable Appveyor build of macOS x64.

Reason behind is that it's currently entirely out of scope of supported
platform, increases build time by a fair amount and doesn't need a
release on website as it got disabled 6 months ago.
2024-02-22 19:16:06 -05:00
gdkchan
542fb5de14 Add support for fragment shader interlock (#2768)
* Support coherent images

* Add support for fragment shader interlock

* Change to tree based match approach

* Refactor + check for branch targets and external registers

* Make detection more robust

* Use Intel fragment shader ordering if interlock is not available, use nothing if both are not available

* Remove unused field
2024-02-22 19:16:06 -05:00
gdkchan
e21dd71189 Add support for the brazilian portuguese language code (#2792)
* Add support for the brazilian portuguese language code

* Fix error applet message
2024-02-22 19:16:05 -05:00
Mary
5887f442df kernel: Fix inverted condition on permission check of SetMemoryPermission syscall (#2777)
* kernel: Fix inverted condition on permission check of SetMemoryPermission syscall

* Fix condition for real..
2024-02-22 19:16:05 -05:00
gdkchan
e24e73533d Preserve image types for shader bindless surface instructions (.D variants) (#2779)
* Preserve image types for SULD/SUST .D variants

* Make format unknown for surface atomic if bindless and not sized
2024-02-22 19:16:05 -05:00
Mary
3d3b7ce33a hle: Improve safety (#2778)
* timezone: Make timezone implementation safe

* hle: Do not use TrimEnd to parse ASCII strings

This adds an util that handle reading an ASCII string in a safe way.
Previously it was possible to read malformed data that could cause
various undefined behaviours in multiple services.

* hid: Remove an useless unsafe modifier on keyboard update

* Address gdkchan's comment

* Address gdkchan's comment
2024-02-22 19:16:05 -05:00
Mary
5706b7e703 kernel: Clear pages allocated with SetHeapSize (#2776)
* kernel: Clear pages allocated with SetHeapSize

Before this commit, all new pages allocated by SetHeapSize were not
cleared by the kernel.

This would cause undefined data to be pass to the userland and possibly
resulting in weird memory corruption.

This commit also add support for custom fill heap and ipc value (that is also
supported by the official kernel)

* Remove dots at the end of KPageTableBase.MapPages new documentation

* Remove unused _stackFillValue
2024-02-22 19:16:05 -05:00
Billy Laws
2e5b22b379 Fixup channel submit IOCTL syncpoint parameters (#2774)
* Fixup channel submit IOCTL syncpoint parameters

The current arguments worked by happenstance as games only ever submit
one syncpoint and request one fence back, if a game were to do something
other than this then the arguments would've been parsed entirely wrong.

* Address feedback
2024-02-22 19:16:05 -05:00
Mary
22af7b1ec2 misc: Fix IVirtualMemoryManager.Fill ignoring value (#2775)
This fix IVirtualMemoryManager.Fill to actually use the provided fill
value instead of 0.

This have no implication at the moment as everything that use it pass 0
but it is needed for some upcoming kernel fixes.
2024-02-22 19:16:05 -05:00
Mary
996ec9836f kernel: Add resource limit related syscalls (#2773)
* kernel: Add resource limit related syscalls

This commit implements all resource limit related syscalls.

* Fix register mapping being wrong for SetResourceLimitLimitValue

* Address gdkchan's comment
2024-02-22 19:16:05 -05:00
Mary
26ec4faade kernel: Implement SetMemoryPermission syscall (#2772)
* kernel: Implement SetMemoryPermission syscall

This commit implement the SetMemoryPermission syscall accurately.
This also fix KMemoryPermission not being an unsigned 32 bits type and
add the "DontCare" bit (used by shared memory, currently unused in
Ryujinx)

* Update MemoryPermission mask

* Address gdkchan's comments

* Fix a nit

* Address gdkchan's comment
2024-02-22 19:16:05 -05:00
Mary
1fbff43e77 kernel: Add missing address space check in SetMemoryAttribute syscall (#2771) 2024-02-22 19:16:05 -05:00
gdkchan
3aa5abf7cf EventWait should not signal the event when it returns Success (#2739)
* Fix race when EventWait is called and a wait is done on the CPU

* This is useless now

* Fix EventSignal

* Ensure the signal belongs to the current fence, to avoid stale signals
2024-02-22 19:16:04 -05:00